text:
import Service from '@ember/service';
import { assert } from '@ember/debug';
import { appConfigUrl } from 'wherehows-web/utils/api/configurator/configurator';
import { getJSON } from 'wherehows-web/utils/api/fetcher';
import { IAppConfig, IConfiguratorGetResponse } from 'wherehows-web/typings/api/configurator/configurator';
import { ApiStatus } from 'wherehows-web/utils/api';
import deepClone from 'wherehows-web/utils/deep-clone';

/**
 * Conditional type alias for getConfig return type, if T is assignable to a key of
 * IAppConfig, then return the property value, otherwise returns the  IAppConfig object
 */
type IAppConfigOrProperty<T> = T extends keyof IAppConfig ? IAppConfig[T] : T extends undefined ? IAppConfig : never;

/**
 * Holds the application configuration object
 * @type {IAppConfig}
 */
const appConfig: IAppConfig = <IAppConfig>{};

/**
 * Flag indicating the config object has been successfully loaded from the remote endpoint
 * @type {boolean}
 */
let configLoaded = false;

export default class Configurator extends Service {
  /**
   * Fetches the application configuration object from the provided endpoint and augments the appConfig object
   * @return {Promise<IAppConfig>}
   */
  static async load(): Promise<IAppConfig> {
    try {
      const { status, config } = await getJSON<IConfiguratorGetResponse>({ url: appConfigUrl });

      if (status === ApiStatus.OK) {
        return (configLoaded = true) && Object.assign(appConfig, config);
      }

      return Promise.reject(new Error(`Configuration load failed with status: ${status}`));
    } catch (e) {
      configLoaded = false;

      return Promise.reject(e);
    }
  }

  /**
   * Returns a copy of the last saved configuration object if one was successfully retrieved,
   * or a copy of the property on the IAppConfig object, if specified
   * @static
   * @template K
   * @param {K} [key] if provided, the value is returned with that key on the config hash is returned
   * @param {IAppConfigOrProperty<K>} [defaultValue] if provided, will default if key is not found in config
   * @returns {IAppConfigOrProperty<K>}
   * @memberof Configurator
   */
  static getConfig<K extends keyof IAppConfig | undefined>(
    key?: K,
    options: { useDefault?: boolean; default?: IAppConfigOrProperty<K> } = {}
  ): IAppConfigOrProperty<K> {
    // Ensure that the application configuration has been successfully cached
    assert('Please ensure you have invoked the `load` method successfully prior to calling `getConfig`.', configLoaded);

    return typeof key === 'string' && appConfig.hasOwnProperty(<keyof IAppConfig>key)
      ? <IAppConfigOrProperty<K>>deepClone(appConfig[<keyof IAppConfig>key])
      : options.useDefault
        ? <IAppConfigOrProperty<K>>options.default
        : <IAppConfigOrProperty<K>>deepClone(appConfig);
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ann. Mo. bot. Gdn 42: 139 (1955)

#### Original name
Catillaria rudolphii C.W. Dodge

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
failed=false

# allow list of shells to run tests in to be overriden by environment variable
# if empty or null, use defaults
if [ -z "$TEST_SHELLS" ]; then
  TEST_SHELLS="bash zsh"
fi
echo "== Will run all tests with following shells: ${TEST_SHELLS}"

cd -P -- "${0%/*}"  # Change to directory this script lives in
for test in $(find test/lib -name *_test.sh); do
  for shell in $TEST_SHELLS; do
    echo "== Running tests with [$shell]: $test"
    $shell $test || failed=true
  done
done

if [ "$failed" = "true" ]; then
  echo "Tests failed!"
  false
else
  echo "All tests passed!"
  true
fi


text:
package fortunedog.mail.proxy.exchange.codepage;

/**
 * This class is the specific code page for ItemOperations in the ActiveSync protocol.
 * The code page number is 20.
 *
 * @version 1.0
 * @author  Matthew Brace
 */
public class ItemOperationsCodePage extends CodePage {
    /**
     * Constructor for ItemOperationsCodePage.  Initializes all of the code page values.
     */
    public ItemOperationsCodePage() {
        /* Maps String to Token for the code page */
        codepageTokens.put("ItemOperations", 0x05);
        codepageTokens.put("Fetch", 0x06);
        codepageTokens.put("Store", 0x07);
        codepageTokens.put("Options", 0x08);
        codepageTokens.put("Range", 0x09);
        codepageTokens.put("Total", 0x0a);
        codepageTokens.put("Properties", 0x0b);
        codepageTokens.put("Data", 0x0c);
        codepageTokens.put("Status", 0x0d);
        codepageTokens.put("Response", 0x0e);
        codepageTokens.put("Version", 0x0f);
        codepageTokens.put("Schema", 0x10);
        codepageTokens.put("Part", 0x11);
        codepageTokens.put("EmptyFolderContents", 0x12);
        codepageTokens.put("DeleteSubFolders", 0x13);

        /* Maps token to string for the code page */
        for (String s : codepageTokens.keySet()) {
            codepageStrings.put(codepageTokens.get(s), s);
        }

        codePageIndex = 0x14;
        codePageName = "ItemOperations";
    }
}


text:
{-# LANGUAGE TypeSynonymInstances #-}

module Clock (clockHour, clockMin, fromHourMin, toString) where
import Text.Printf (printf)

newtype Clock = Clock Int deriving (Show, Eq)

instance Num Clock where
  abs = id
  signum _ = Clock 1
  (*) (Clock a) (Clock b) = fromMin $ a * b
  (+) (Clock a) (Clock b) = fromMin $ a + b
  negate (Clock clock) = fromMin $ 24 * 60 - clock
  fromInteger i = fromMin (fromInteger i)

clockHour :: Clock -> Int
clockHour (Clock clock) = (clock `div` 60) `mod` 24

clockMin :: Clock -> Int
clockMin (Clock clock) = clock `mod` 60

fromHourMin :: Int -> Int -> Clock
fromHourMin hour min = fromMin (hour * 60 + min)

fromMin :: Int -> Clock
fromMin min
  | min < 0 = fromMin $ min + 24 * 60
  | otherwise = Clock (min `mod` (24 * 60))

toString :: Clock -> String
toString clock = Text.Printf.printf "%02d:%02d" (clockHour clock) (clockMin clock)


text:
package org.apache.geode.internal.cache.ha;

import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;

import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheException;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.CacheListener;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.EntryEvent;
import org.apache.geode.cache.InterestResultPolicy;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.Scope;
import org.apache.geode.cache.client.internal.PoolImpl;
import org.apache.geode.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
import org.apache.geode.cache.util.CacheListenerAdapter;
import org.apache.geode.cache30.CacheSerializableRunnable;
import org.apache.geode.cache30.ClientServerTestCase;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.AvailablePort;
import org.apache.geode.internal.cache.CacheServerImpl;
import org.apache.geode.internal.cache.EntryEventImpl;
import org.apache.geode.internal.cache.EventID;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.NetworkUtils;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;

/**
 * Test to verify correct propagation of operations eventID's for put all
 *
 * @since GemFire 5.1
 */
@Category({DistributedTest.class, ClientSubscriptionTest.class})
public class PutAllDUnitTest extends JUnit4DistributedTestCase {

  /** server1 VM **/
  VM server1 = null;

  /** server2 VM **/
  VM server2 = null;

  /** client1 VM **/
  VM client1 = null;

  /** client2 VM **/
  VM client2 = null;

  /** port of server1 **/
  public int PORT1;

  /** port of server2 **/
  public int PORT2;

  /** region name **/
  private static final String REGION_NAME = "PutAllDUnitTest_Region";
  /** cache **/
  private static Cache cache = null;
  /** server **/
  static CacheServerImpl server = null;

  /** test constructor **/
  public PutAllDUnitTest() {
    super();
  }

  /** get the hosts and the VMs **/
  @Override
  public final void postSetUp() throws Exception {
    final Host host = Host.getHost(0);
    server1 = host.getVM(0);
    server2 = host.getVM(1);
    client1 = host.getVM(2);
    client2 = host.getVM(3);
  }

  /** close the caches **/
  @Override
  public final void preTearDown() throws Exception {
    client1.invoke(() -> PutAllDUnitTest.closeCache());
    client2.invoke(() -> PutAllDUnitTest.closeCache());
    // close server
    server1.invoke(() -> PutAllDUnitTest.closeCache());
    server2.invoke(() -> PutAllDUnitTest.closeCache());

    // close cache in the controller VM (ezoerner) Not doing this was causing CacheExistsExceptions
    // in other dunit tests
    closeCache();
  }

  /** stops the server **/
  private CacheSerializableRunnable stopServer() {
    CacheSerializableRunnable stopserver = new CacheSerializableRunnable("stopServer") {
      public void run2() throws CacheException {
        server.stop();
      }
    };
    return stopserver;
  }

  /** function to create a 2 servers and 3 client (1 client will be in the unit controller VM) **/
  private void createClientServerConfiguration() {
    PORT1 = ((Integer) server1.invoke(() -> PutAllDUnitTest.createServerCache())).intValue();
    PORT2 = ((Integer) server2.invoke(() -> PutAllDUnitTest.createServerCache())).intValue();
    client1.invoke(() -> PutAllDUnitTest
        .createClientCache1(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1)));
    client2.invoke(() -> PutAllDUnitTest
        .createClientCache2(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2)));
    try {
      createClientCache2(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT2));
    } catch (Exception e) {
      fail(" test failed due to " + e);
    }
  }

  /** create the server **/
  public static Integer createServerCache() throws Exception {
    new PutAllDUnitTest().createCache(new Properties());
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    CacheListener clientListener = new HAEventIdPropagationListenerForClient1();
    factory.setCacheListener(clientListener);
    RegionAttributes attrs = factory.create();
    cache.createRegion(REGION_NAME, attrs);
    server = (CacheServerImpl) cache.addCacheServer();
    assertNotNull(server);
    int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
    server.setPort(port);
    server.setNotifyBySubscription(true);
    server.start();
    return new Integer(server.getPort());
  }

  /** function to create cache **/
  private void createCache(Properties props) throws Exception {
    DistributedSystem ds = getSystem(props);
    assertNotNull(ds);
    ds.disconnect();
    ds = getSystem(props);
    cache = CacheFactory.create(ds);
    assertNotNull(cache);
  }

  private static PoolImpl pool = null;

  /**
   * function to create client cache with HAEventIdPropagationListenerForClient2 as the listener
   **/
  public static void createClientCache2(String host, Integer port1) throws Exception {
    int PORT1 = port1.intValue();
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    new PutAllDUnitTest().createCache(props);
    props.setProperty("retryAttempts", "2");
    props.setProperty("endpoints", "ep1=" + host + ":" + PORT1);
    props.setProperty("redundancyLevel", "-1");
    props.setProperty("establishCallbackConnection", "true");
    props.setProperty("LBPolicy", "Sticky");
    props.setProperty("readTimeout", "2000");
    props.setProperty("socketBufferSize", "1000");
    props.setProperty("retryInterval", "250");
    props.setProperty("connectionsPerServer", "2");
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    PoolImpl p = (PoolImpl) ClientServerTestCase.configureConnectionPool(factory, host, PORT1, -1,
        true, -1, 2, null);
    CacheListener clientListener = new HAEventIdPropagationListenerForClient2();
    factory.setCacheListener(clientListener);
    RegionAttributes attrs = factory.create();
    cache.createRegion(REGION_NAME, attrs);
    Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(region);
    region.registerInterest("ALL_KEYS", InterestResultPolicy.NONE);
    pool = p;
  }

  /** function to create client cache **/
  public static void createClientCache1(String host, Integer port1) throws Exception {
    int PORT1 = port1.intValue();
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    new PutAllDUnitTest().createCache(props);
    props.setProperty("retryAttempts", "2");
    props.setProperty("endpoints", "ep1=" + host + ":" + PORT1);
    props.setProperty("redundancyLevel", "-1");
    props.setProperty("establishCallbackConnection", "true");
    props.setProperty("LBPolicy", "Sticky");
    props.setProperty("readTimeout", "2000");
    props.setProperty("socketBufferSize", "1000");
    props.setProperty("retryInterval", "250");
    props.setProperty("connectionsPerServer", "2");
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    PoolImpl p = (PoolImpl) ClientServerTestCase.configureConnectionPool(factory, host, PORT1, -1,
        true, -1, 2, null);
    CacheListener clientListener = new HAEventIdPropagationListenerForClient1();
    factory.setCacheListener(clientListener);
    RegionAttributes attrs = factory.create();
    cache.createRegion(REGION_NAME, attrs);
    Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(region);
    region.registerInterest("ALL_KEYS", InterestResultPolicy.NONE);
    pool = p;
  }

  /** function to close cache **/
  public static void closeCache() {
    if (cache != null && !cache.isClosed()) {
      try {
        cache.close();
        cache.getDistributedSystem().disconnect();
      } catch (RuntimeException e) {
        // ignore
      }
    }
  }

  /** function to assert that the ThreadIdtoSequence id Map is not Null but is empty **/
  public static void assertThreadIdToSequenceIdMapisNotNullButEmpty() {
    Map map = pool.getThreadIdToSequenceIdMap();
    assertNotNull(map);
    // I didn't change this method name for merge purposes, but because of the
    // marker, the map will contain one entry
    assertTrue(map.size() == 1);

  }

  /** function to assert that the ThreadIdtoSequence id Map is not Null and has only one entry **/
  public static Object assertThreadIdToSequenceIdMapHasEntryId() {
    Map map = pool.getThreadIdToSequenceIdMap();
    assertNotNull(map);
    // The map size can now be 1 or 2 because of the server thread putting
    // the marker in the queue. If it is 2, the first entry is the server
    // thread; the second is the client thread. If it is 1, the entry is the
    // client thread. The size changes because of the map.clear call below.
    assertTrue(map.size() != 0);

    // Set the entry to the last entry
    Map.Entry entry = null;
    for (Iterator threadIdToSequenceIdMapIterator =
        map.entrySet().iterator(); threadIdToSequenceIdMapIterator.hasNext();) {
      entry = (Map.Entry) threadIdToSequenceIdMapIterator.next();
    }

    ThreadIdentifier tid = (ThreadIdentifier) entry.getKey();
    SequenceIdAndExpirationObject seo = (SequenceIdAndExpirationObject) entry.getValue();
    long sequenceId = seo.getSequenceId();
    EventID evId = new EventID(tid.getMembershipID(), tid.getThreadID(), sequenceId);
    synchronized (map) {
      map.clear();
    }
    return evId;
  }

  /** function to assert that the ThreadIdtoSequence id Map is not Null and has only one entry **/
  public static Object[] assertThreadIdToSequenceIdMapHasEntryIds() {
    EventID[] evids = new EventID[5];
    Map map = pool.getThreadIdToSequenceIdMap();
    assertNotNull(map);
    evids[0] = putAlleventId1;
    evids[1] = putAlleventId2;
    evids[2] = putAlleventId3;
    evids[3] = putAlleventId4;
    evids[4] = putAlleventId5;
    assertNotNull(evids[0]);
    assertNotNull(evids[1]);
    assertNotNull(evids[2]);
    assertNotNull(evids[3]);
    assertNotNull(evids[4]);
    return evids;
  }

  /** EventId * */
  protected static EventID eventId = null;
  protected volatile static EventID putAlleventId1 = null;
  protected volatile static EventID putAlleventId2 = null;
  protected volatile static EventID putAlleventId3 = null;
  protected volatile static EventID putAlleventId4 = null;
  protected volatile static EventID putAlleventId5 = null;
  protected volatile static EntryEvent putAllevent1 = null;
  protected volatile static EntryEvent putAllevent2 = null;
  protected volatile static EntryEvent putAllevent3 = null;
  protected volatile static EntryEvent putAllevent4 = null;
  protected volatile static EntryEvent putAllevent5 = null;

  protected final static String PUTALL_KEY1 = "putAllKey1";
  protected final static String PUTALL_KEY2 = "putAllKey2";
  protected final static String PUTALL_KEY3 = "putAllKey3";
  protected final static String PUTALL_KEY4 = "putAllKey4";
  protected final static String PUTALL_KEY5 = "putAllKey5";

  private static String PUTALL_VALUE1 = "putAllValue1";
  private static String PUTALL_VALUE2 = "putAllValue2";
  private static String PUTALL_VALUE3 = "putAllValue3";
  private static String PUTALL_VALUE4 = "putAllValue4";
  private static String PUTALL_VALUE5 = "putAllValue5";

  /**
   * This test: 1) creates a client server configuration 2) asserts that the ThreadIdToSequenceIdMap
   * is not null but is empty (on the client) 3) does a put on the server 4) Wait till put is
   * received by the server (and also records the eventId in a variable) and returns the eventId
   * generated on the server 5) asserts that the ThreadIdToSequenceIdMap is not null and has one
   * entry (on the client side) and returns the eventId stored in the map 6) verifies the equality
   * of the two event ids
   *
   * @throws Exception
   */
  @Test
  public void testPutAll() throws Exception {
    setReceivedOperationToFalse();
    client2.invoke(() -> PutAllDUnitTest.setReceivedOperationToFalse());
    createClientServerConfiguration();

    EventID[] eventIds1 = (EventID[]) client1.invoke(() -> PutAllDUnitTest.putAll());
    assertNotNull(eventIds1);
    // wait for key to propagate till client
    // assert map not null on client
    client2.invoke(() -> PutAllDUnitTest.waitTillOperationReceived());

    waitTillOperationReceived();
    EventID[] eventIds2 = (EventID[]) client2
        .invoke(() -> PutAllDUnitTest.assertThreadIdToSequenceIdMapHasEntryIds());
    assertNotNull(eventIds2);
    server1.invoke(() -> PutAllDUnitTest.assertGotAllValues());
    server2.invoke(() -> PutAllDUnitTest.assertGotAllValues());
    client1.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
    client2.invoke(() -> PutAllDUnitTest.assertGotAllValues());
    client2.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
    server1.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
    server2.invoke(() -> PutAllDUnitTest.assertCallbackArgs());
    assertGotAllValues();
    assertCallbackArgs();
    EventID[] eventIds3 = (EventID[]) assertThreadIdToSequenceIdMapHasEntryIds();
    for (int i = 0; i < 5; i++) {
      assertNotNull(eventIds1[i]);
      assertNotNull(eventIds2[i]);
      assertEquals(eventIds1[i], eventIds2[i]);
    }
    for (int i = 0; i < 5; i++) {
      assertNotNull(eventIds1[i]);
      assertNotNull(eventIds3[i]);
      assertEquals(eventIds1[i], eventIds3[i]);
    }
  }

  public static void setReceivedOperationToFalse() {
    receivedOperation = false;
  }

  public static void assertGotAllValues() {
    Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(region);
    assertTrue(region.get(PUTALL_KEY1).equals(PUTALL_VALUE1));
    assertTrue(region.get(PUTALL_KEY2).equals(PUTALL_VALUE2));
    assertTrue(region.get(PUTALL_KEY3).equals(PUTALL_VALUE3));
    assertTrue(region.get(PUTALL_KEY4).equals(PUTALL_VALUE4));
    assertTrue(region.get(PUTALL_KEY5).equals(PUTALL_VALUE5));
  }

  public static void assertCallbackArgs() {
    assertEquals("putAllCallbackArg", putAllevent1.getCallbackArgument());
    assertEquals("putAllCallbackArg", putAllevent2.getCallbackArgument());
    assertEquals("putAllCallbackArg", putAllevent3.getCallbackArgument());
    assertEquals("putAllCallbackArg", putAllevent4.getCallbackArgument());
    assertEquals("putAllCallbackArg", putAllevent5.getCallbackArgument());
  }

  /**
   * does an update and return the eventid generated. Eventid is caught in the listener and stored
   * in a static variable*
   */
  public static Object[] putAll() {
    Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
    assertNotNull(region);
    try {
      Map map = new LinkedHashMap();
      map.put(PUTALL_KEY1, PUTALL_VALUE1);
      map.put(PUTALL_KEY2, PUTALL_VALUE2);
      map.put(PUTALL_KEY3, PUTALL_VALUE3);
      map.put(PUTALL_KEY4, PUTALL_VALUE4);
      map.put(PUTALL_KEY5, PUTALL_VALUE5);
      region.putAll(map, "putAllCallbackArg");
      EventID[] evids = new EventID[5];
      evids[0] = putAlleventId1;
      evids[1] = putAlleventId2;
      evids[2] = putAlleventId3;
      evids[3] = putAlleventId4;
      evids[4] = putAlleventId5;
      assertNotNull(evids[0]);
      assertNotNull(evids[1]);
      assertNotNull(evids[2]);
      assertNotNull(evids[3]);
      assertNotNull(evids[4]);
      return evids;
    } catch (Exception e) {
      fail("put failed due to " + e);
    }
    return null;
  }

  /** Object to wait on till create is received **/
  protected static Object lockObject = new Object();
  /** boolean to signify receipt of create **/
  protected static volatile boolean receivedOperation = false;

  /** wait till create is received. listener will send a notification if create is received **/
  public static void waitTillOperationReceived() {
    synchronized (lockObject) {
      if (!receivedOperation) {
        try {
          lockObject.wait(10000);
        } catch (InterruptedException e) {
          fail("interrupted");
        }
      }
      if (!receivedOperation) {
        fail(" operation should have been received but it has not been received yet");
      }
    }

  }

  /**
   * Listener which sends a notification after create to waiting threads and also extracts teh event
   * id storing it in a static variable
   *
   */
  static class HAEventIdPropagationListenerForClient2 extends CacheListenerAdapter {

    private int putAllReceivedCount = 0;

    public void afterCreate(EntryEvent event) {
      boolean shouldNotify = false;
      Object key = event.getKey();
      if (key.equals(PUTALL_KEY1)) {
        putAllReceivedCount++;
        putAlleventId1 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
        putAllevent1 = event;
      } else if (key.equals(PUTALL_KEY2)) {
        putAllReceivedCount++;
        putAlleventId2 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
        putAllevent2 = event;
      } else if (key.equals(PUTALL_KEY3)) {
        putAllReceivedCount++;
        putAlleventId3 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
        putAllevent3 = event;
      } else if (key.equals(PUTALL_KEY4)) {
        putAllReceivedCount++;
        putAlleventId4 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
        putAllevent4 = event;
      } else if (key.equals(PUTALL_KEY5)) {
        putAllReceivedCount++;
        putAlleventId5 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
        putAllevent5 = event;
      }
      if (putAllReceivedCount == 5) {
        shouldNotify = true;
      }
      if (shouldNotify) {
        synchronized (lockObject) {
          receivedOperation = true;
          lockObject.notify();
        }
      }
    }
  }

  /**
   * Listener which sends a notification after create to waiting threads and also extracts teh event
   * ids storing them in static variables
   *
   */
  static class HAEventIdPropagationListenerForClient1 extends CacheListenerAdapter {

    private int putAllReceivedCount = 0;

    public void afterCreate(EntryEvent event) {
      LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
      boolean shouldNotify = false;
      Object key = event.getKey();
      if (key.equals(PUTALL_KEY1)) {
        putAllReceivedCount++;
        putAlleventId1 = ((EntryEventImpl) event).getEventId();
        assertNotNull(putAlleventId1);
        putAllevent1 = event;
      } else if (key.equals(PUTALL_KEY2)) {
        putAllReceivedCount++;
        putAlleventId2 = ((EntryEventImpl) event).getEventId();
        assertNotNull(putAlleventId2);
        putAllevent2 = event;
      } else if (key.equals(PUTALL_KEY3)) {
        putAllReceivedCount++;
        putAlleventId3 = ((EntryEventImpl) event).getEventId();
        assertNotNull(putAlleventId3);
        putAllevent3 = event;
      } else if (key.equals(PUTALL_KEY4)) {
        putAllReceivedCount++;
        putAlleventId4 = ((EntryEventImpl) event).getEventId();
        assertNotNull(putAlleventId4);
        putAllevent4 = event;
      } else if (key.equals(PUTALL_KEY5)) {
        putAllReceivedCount++;
        putAlleventId5 = ((EntryEventImpl) event).getEventId();
        assertNotNull(putAlleventId5);
        putAllevent5 = event;
      }
      if (putAllReceivedCount == 5) {
        shouldNotify = true;
      }
      if (shouldNotify) {
        synchronized (lockObject) {
          receivedOperation = true;
          lockObject.notify();
        }
      }
    }

  }

}


text:
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y \
  gcc-mips64el-linux-gnuabi64 \
  curl \
  ca-certificates \
  perl \
  make \
  gcc

ENV CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc


text:
using namespace arangodb::options;

namespace arangodb {

// We essentially stop using a meaningful timeout for this operation.
// This is achieved by setting the default for the minimal timeout to 1h or
// 3600s. The reason behind this is the following: We have to live with RocksDB
// stalls and write stops, which can happen in overload situations. Then, no
// meaningful timeout helps and it is almost certainly better to keep trying to
// not have to drop the follower and make matters worse. In case of an actual
// failure (or indeed a restart), the follower is marked as failed and its
// reboot id is increased. As a consequence, the connection is aborted and we
// run into an error anyway. This is when a follower will be dropped.

ReplicationTimeoutFeature::ReplicationTimeoutFeature(Server& server)
    : ArangodFeature{server, *this},
      _timeoutFactor(1.0),
      _timeoutPer4k(0.1),
      _lowerLimit(900.0),
      _upperLimit(3600.0),
      _shardSynchronizationAttemptTimeout(20.0 * 60.0) {
  setOptional(true);
  startsAfter<application_features::DatabaseFeaturePhase>();
}

void ReplicationTimeoutFeature::collectOptions(
    std::shared_ptr<ProgramOptions> options) {
  options->addOption("--cluster.synchronous-replication-timeout-minimum",
                     "all synchronous replication timeouts will be at least "
                     "this value (in seconds)",
                     new DoubleParameter(&_lowerLimit),
                     arangodb::options::makeDefaultFlags(
                         arangodb::options::Flags::Uncommon,
                         arangodb::options::Flags::OnDBServer));

  options
      ->addOption("--cluster.synchronous-replication-timeout-maximum",
                  "all synchronous replication timeouts will be at most "
                  "this value (in seconds)",
                  new DoubleParameter(&_upperLimit),
                  arangodb::options::makeDefaultFlags(
                      arangodb::options::Flags::Uncommon,
                      arangodb::options::Flags::OnDBServer))
      .setIntroducedIn(30800);

  options->addOption(
      "--cluster.synchronous-replication-timeout-factor",
      "all synchronous replication timeouts are multiplied by this factor",
      new DoubleParameter(&_timeoutFactor),
      arangodb::options::makeDefaultFlags(
          arangodb::options::Flags::Uncommon,
          arangodb::options::Flags::OnDBServer));

  options->addOption(
      "--cluster.synchronous-replication-timeout-per-4k",
      "all synchronous replication timeouts are increased by this amount per "
      "4096 bytes (in seconds)",
      new DoubleParameter(&_timeoutPer4k),
      arangodb::options::makeDefaultFlags(
          arangodb::options::Flags::Uncommon,
          arangodb::options::Flags::OnDBServer));

  options
      ->addOption(
          "--cluster.shard-synchronization-attempt-timeout",
          "timeout (in seconds) for every shard synchronization attempt. "
          "running into the timeout will not lead to a synchronization "
          "failure, but will continue the synchronization shortly after. "
          "setting a timeout can help to split the replication of large "
          "shards into smaller chunks and release snapshots on the "
          "leader earlier",
          new DoubleParameter(&_shardSynchronizationAttemptTimeout),
          arangodb::options::makeDefaultFlags(
              arangodb::options::Flags::Uncommon,
              arangodb::options::Flags::OnDBServer))
      .setIntroducedIn(30902);
}

void ReplicationTimeoutFeature::validateOptions(
    std::shared_ptr<ProgramOptions> options) {
  if (_upperLimit < _lowerLimit) {
    LOG_TOPIC("8a9f3", WARN, Logger::CONFIG)
        << "--cluster.synchronous-replication-timeout-maximum must be at least "
        << "--cluster.synchronous-replication-timeout-minimum, setting max to "
        << "min";
    _upperLimit = _lowerLimit;
  }
}

}  // namespace arangodb


text:
<?xml version="1.0" encoding="ISO-8859-1"?>

<document>
<properties>
    <title>Issues</title>
</properties>

JMeter uses Bugzilla for issue tracking, i.e. for reporting bugs and requesting enhancements.

Before creating a new issue, please check whether the issue has already been reported by searching Bugzilla.
It's also worth checking first on the JMeter user mailing list; others may already have a solution.

Please do not use Bugzilla for asking questions. It is not a support forum.
Instead, please subscribe to the JMeter user mailing list and ask there.
The user mailing list has a bigger audience and you are more likely to get an answer quickly.

Bugzilla - All open bugs and enhancements

Bugzilla - Open bugs (excluding enhancements)

Bugzilla - Enhancements only

In most cases it is worth starting a discussion on the mailing list first.
Bugzilla is good for tracking progress and supplying patches, but is unwieldy for longer discussions.

If you have not already done so, you need to register an account first, using the "New Account" link at the top of the
main Bugzilla page: https://bz.apache.org/bugzilla/.

Make sure you read and understand the information on the account creation page before signing up.

Once logged in, click "File a bug" and select JMeter from the list
Please set the severity to "enhancement".

Please make sure that you describe the enhancement in sufficient detail. If necessary provide an example use-case.

If you are providing a code patch, also provide a test case, and documentation on how to use the new feature (ideally as a documentation patch).

First check that the issue has not already been reported.
If reporting a bug, are you sure it really is a bug in JMeter, not just a misunderstanding of how JMeter works?

If you have not already done so, you need to register an account first, using the "New Account" link at the top of the
main Bugzilla page: https://bz.apache.org/bugzilla/.

Make sure you read and understand the information on the account creation page before signing up.

Once logged in you have 2 options:

At the bottom left of the screen click 'File a new bug in the "JMeter" product' link

At the top left of the screen, click "New" link and select JMeter from the list.

Please make sure you provide sufficient information for others to be able to make use of the report effectively.
Use the checklist below to guide you.

JMeter version

Java version (output from java -version)

OS version

jmeter.log file (unlikely to contain sensitive information, but check before uploading)

JMX file if relevant (redact any sensitive information first), providing a simplified Test Plan (using <complink name="Debug Sampler"/>) will ensure BUG is fixed much more rapidly than without it

Try to reproduce the bug without third-party plug-ins. Minimal JMX files should not contain third-party plug-ins, as it makes it harder to test them on a plain JMeter installation.

JTL file if relevant (may need to redact sensitive information)

For a suspected bug, describe what you did, what happened, and how this differs from what you expected to happen.
Does it happen every time?

If you have error messages, that you wish to report, copy them as text into the issue, as it makes it easier to search for them and re-use the message in our research for the origin of the issue

Add yourself in CC List to be notified when JMeter Team requires more information (in this case bug will be marked as NEEDINFO)

When a bug is market as NEEDINFO, please provide as soon as possible the required information so that bug can be understood and fixed. Be aware that if
no information is provided after team requires more information and bug is not reproducible, then bug will be closed as WORKSFORME. You can always reopen it later once you provide the required information.

Select accurately the IMPORTANCE level, ENHANCEMENT means it's not a BUG while others mean it's a BUG

If you are providing a patch to fix a bug, please ensure it is in unified diff format.
If using Eclipse, please set the patch root to "Project", not the default "Workspace" which is harder to apply.

New source files can be provided as is; please ensure they have the standard Apache License header (as per other JMeter files).
Please do not use @author tags (credit will be given in the changes file).

In the case of patches for new features, please also provide documentation patches if at all possible.
Components are documented in xdocs/usermanual/component_reference.xml.

See also the following Bug writing guidelines,
also the terms and conditions noted on the Bugzilla account creation page.

</document>


text:
<?cs include:"doctype.cs" ?>
<?cs include:"macros.cs" ?>

<?cs include:"head_tag.cs" ?>

<?cs call:custom_masthead() ?>

<?cs call:tag_list(root.descr) ?>

<?cs include:"footer.cs" ?>

<?cs include:"trailer.cs" ?>


text:
import * as Immutable from 'immutable';
import { TypedRecord } from 'typed-immutable-record';
import { registerSprites } from '../../core/api';
import { exhaustiveCheck, makeRecordFactory } from '../util';
import {
  SpriteActions,
  SpritesLoadAction,
  SpritesLoadFailAction,
  SpritesLoadSuccessAction,
  SpritesRegisterAction,
} from './sprites.actions';
import { SpriteData, SpriteState } from './sprites.model';

interface SpritesStateRecord extends TypedRecord<SpritesStateRecord>, SpriteState {}

/**
 * @internal
 */
export const spritesStateFactory = makeRecordFactory<SpriteState, SpritesStateRecord>({
  loaded: false,
  spritesById: Immutable.Map<string, SpriteData>(),
});

/**
 * Convert input Plain JSON object into an Immutable.js representation with the correct records.
 * @param object The input values.
 */
export function spritesFromJSON(object: SpriteState): SpriteState {
  const recordValues = {
    spritesById: Immutable.Map<string, SpriteData>(object.spritesById),
    loaded: object.loaded,
  };
  registerSprites('', object.spritesById);
  return spritesStateFactory(recordValues);
}

export function spritesReducer(
  state: SpritesStateRecord = spritesStateFactory(),
  action: SpriteActions
): SpritesStateRecord {
  switch (action.type) {
    case SpritesRegisterAction.typeId: {
      return state.updateIn(['spritesById'], (s) => s.merge(action.payload));
    }
    case SpritesLoadSuccessAction.typeId: {
      return state.merge({
        loaded: true,
      });
    }
    // These only have side-effects
    case SpritesLoadFailAction.typeId:
    case SpritesLoadAction.typeId:
      return state;
    default:
      exhaustiveCheck(action);
      return state;
  }
}

/** @internal {@see sliceSpritesState} */
export const sliceSpritesLoaded = (state: SpritesStateRecord) => state.loaded;
/** @internal {@see sliceSpritesState} */
export const sliceSpritesById = (state: SpritesStateRecord) => state.spritesById;


text:
package autoscalingiface

import (
	"github.com/aws/aws-sdk-go/service/autoscaling"
)

// AutoScalingAPI is the interface type for autoscaling.AutoScaling.
type AutoScalingAPI interface {
	AttachInstances(*autoscaling.AttachInstancesInput) (*autoscaling.AttachInstancesOutput, error)

	AttachLoadBalancers(*autoscaling.AttachLoadBalancersInput) (*autoscaling.AttachLoadBalancersOutput, error)

	CompleteLifecycleAction(*autoscaling.CompleteLifecycleActionInput) (*autoscaling.CompleteLifecycleActionOutput, error)

	CreateAutoScalingGroup(*autoscaling.CreateAutoScalingGroupInput) (*autoscaling.CreateAutoScalingGroupOutput, error)

	CreateLaunchConfiguration(*autoscaling.CreateLaunchConfigurationInput) (*autoscaling.CreateLaunchConfigurationOutput, error)

	CreateOrUpdateTags(*autoscaling.CreateOrUpdateTagsInput) (*autoscaling.CreateOrUpdateTagsOutput, error)

	DeleteAutoScalingGroup(*autoscaling.DeleteAutoScalingGroupInput) (*autoscaling.DeleteAutoScalingGroupOutput, error)

	DeleteLaunchConfiguration(*autoscaling.DeleteLaunchConfigurationInput) (*autoscaling.DeleteLaunchConfigurationOutput, error)

	DeleteLifecycleHook(*autoscaling.DeleteLifecycleHookInput) (*autoscaling.DeleteLifecycleHookOutput, error)

	DeleteNotificationConfiguration(*autoscaling.DeleteNotificationConfigurationInput) (*autoscaling.DeleteNotificationConfigurationOutput, error)

	DeletePolicy(*autoscaling.DeletePolicyInput) (*autoscaling.DeletePolicyOutput, error)

	DeleteScheduledAction(*autoscaling.DeleteScheduledActionInput) (*autoscaling.DeleteScheduledActionOutput, error)

	DeleteTags(*autoscaling.DeleteTagsInput) (*autoscaling.DeleteTagsOutput, error)

	DescribeAccountLimits(*autoscaling.DescribeAccountLimitsInput) (*autoscaling.DescribeAccountLimitsOutput, error)

	DescribeAdjustmentTypes(*autoscaling.DescribeAdjustmentTypesInput) (*autoscaling.DescribeAdjustmentTypesOutput, error)

	DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error)

	DescribeAutoScalingGroupsPages(*autoscaling.DescribeAutoScalingGroupsInput, func(*autoscaling.DescribeAutoScalingGroupsOutput, bool) bool) error

	DescribeAutoScalingInstances(*autoscaling.DescribeAutoScalingInstancesInput) (*autoscaling.DescribeAutoScalingInstancesOutput, error)

	DescribeAutoScalingInstancesPages(*autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool) error

	DescribeAutoScalingNotificationTypes(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*autoscaling.DescribeAutoScalingNotificationTypesOutput, error)

	DescribeLaunchConfigurations(*autoscaling.DescribeLaunchConfigurationsInput) (*autoscaling.DescribeLaunchConfigurationsOutput, error)

	DescribeLaunchConfigurationsPages(*autoscaling.DescribeLaunchConfigurationsInput, func(*autoscaling.DescribeLaunchConfigurationsOutput, bool) bool) error

	DescribeLifecycleHookTypes(*autoscaling.DescribeLifecycleHookTypesInput) (*autoscaling.DescribeLifecycleHookTypesOutput, error)

	DescribeLifecycleHooks(*autoscaling.DescribeLifecycleHooksInput) (*autoscaling.DescribeLifecycleHooksOutput, error)

	DescribeLoadBalancers(*autoscaling.DescribeLoadBalancersInput) (*autoscaling.DescribeLoadBalancersOutput, error)

	DescribeMetricCollectionTypes(*autoscaling.DescribeMetricCollectionTypesInput) (*autoscaling.DescribeMetricCollectionTypesOutput, error)

	DescribeNotificationConfigurations(*autoscaling.DescribeNotificationConfigurationsInput) (*autoscaling.DescribeNotificationConfigurationsOutput, error)

	DescribeNotificationConfigurationsPages(*autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool) error

	DescribePolicies(*autoscaling.DescribePoliciesInput) (*autoscaling.DescribePoliciesOutput, error)

	DescribePoliciesPages(*autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool) error

	DescribeScalingActivities(*autoscaling.DescribeScalingActivitiesInput) (*autoscaling.DescribeScalingActivitiesOutput, error)

	DescribeScalingActivitiesPages(*autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool) error

	DescribeScalingProcessTypes(*autoscaling.DescribeScalingProcessTypesInput) (*autoscaling.DescribeScalingProcessTypesOutput, error)

	DescribeScheduledActions(*autoscaling.DescribeScheduledActionsInput) (*autoscaling.DescribeScheduledActionsOutput, error)

	DescribeScheduledActionsPages(*autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool) error

	DescribeTags(*autoscaling.DescribeTagsInput) (*autoscaling.DescribeTagsOutput, error)

	DescribeTagsPages(*autoscaling.DescribeTagsInput, func(*autoscaling.DescribeTagsOutput, bool) bool) error

	DescribeTerminationPolicyTypes(*autoscaling.DescribeTerminationPolicyTypesInput) (*autoscaling.DescribeTerminationPolicyTypesOutput, error)

	DetachInstances(*autoscaling.DetachInstancesInput) (*autoscaling.DetachInstancesOutput, error)

	DetachLoadBalancers(*autoscaling.DetachLoadBalancersInput) (*autoscaling.DetachLoadBalancersOutput, error)

	DisableMetricsCollection(*autoscaling.DisableMetricsCollectionInput) (*autoscaling.DisableMetricsCollectionOutput, error)

	EnableMetricsCollection(*autoscaling.EnableMetricsCollectionInput) (*autoscaling.EnableMetricsCollectionOutput, error)

	EnterStandby(*autoscaling.EnterStandbyInput) (*autoscaling.EnterStandbyOutput, error)

	ExecutePolicy(*autoscaling.ExecutePolicyInput) (*autoscaling.ExecutePolicyOutput, error)

	ExitStandby(*autoscaling.ExitStandbyInput) (*autoscaling.ExitStandbyOutput, error)

	PutLifecycleHook(*autoscaling.PutLifecycleHookInput) (*autoscaling.PutLifecycleHookOutput, error)

	PutNotificationConfiguration(*autoscaling.PutNotificationConfigurationInput) (*autoscaling.PutNotificationConfigurationOutput, error)

	PutScalingPolicy(*autoscaling.PutScalingPolicyInput) (*autoscaling.PutScalingPolicyOutput, error)

	PutScheduledUpdateGroupAction(*autoscaling.PutScheduledUpdateGroupActionInput) (*autoscaling.PutScheduledUpdateGroupActionOutput, error)

	RecordLifecycleActionHeartbeat(*autoscaling.RecordLifecycleActionHeartbeatInput) (*autoscaling.RecordLifecycleActionHeartbeatOutput, error)

	ResumeProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.ResumeProcessesOutput, error)

	SetDesiredCapacity(*autoscaling.SetDesiredCapacityInput) (*autoscaling.SetDesiredCapacityOutput, error)

	SetInstanceHealth(*autoscaling.SetInstanceHealthInput) (*autoscaling.SetInstanceHealthOutput, error)

	SuspendProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.SuspendProcessesOutput, error)

	TerminateInstanceInAutoScalingGroup(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error)

	UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error)
}


text:
package joptsimple;

import java.lang.reflect.InvocationTargetException;

import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;

/**
 * @author Paul Holser
 */
public class ExceptionMatchers {
    private ExceptionMatchers() {
        throw new UnsupportedOperationException();
    }

    public static Matcher<OptionException> withOption( final String option ) {
        return new TypeSafeMatcher<OptionException>() {
            @Override
            public boolean matchesSafely( OptionException target ) {
                return target.options().contains( option );
            }

            public void describeTo( Description description ) {
                description.appendText( "an OptionException indicating the option ");
                description.appendValue( option );
            }
        };
    }

    public static Matcher<Throwable> withCauseOfType( final Class<? extends Throwable> type ) {
        return new TypeSafeMatcher<Throwable>() {
            @Override
            public boolean matchesSafely( Throwable target ) {
                return type.isInstance( target.getCause() );
            }

            public void describeTo( Description description ) {
                description.appendText( "an exception with cause of type " );
                description.appendValue( type );
            }
        };
    }

    public static Matcher<InvocationTargetException> withTargetOfType( final Class<? extends Throwable> type ) {
        return new TypeSafeMatcher<InvocationTargetException>() {
            @Override
            public boolean matchesSafely( InvocationTargetException target ) {
                return type.isInstance( target.getTargetException() );
            }

            public void describeTo( Description description ) {
                description.appendText( "an InvocationTargetException with target of type " );
                description.appendValue( type );
            }
        };
    }
}


text:
package viewModel

import com.thetestpeople.trt.model._

case class TestsSummaryView(configuration: Configuration, testCounts: TestCounts) {

  val passCount = testCounts.passed

  val failCount = testCounts.failed

  val warnCount = testCounts.warning

  val ignoredCount = testCounts.ignored

  val totalCount = testCounts.total

  val overallStatus: TestStatus =
    if (failCount > 0)
      TestStatus.Broken
    else if (warnCount > 0)
      TestStatus.Warning
    else
      TestStatus.Healthy

  def ballIcon: String = BallIcons.icon(overallStatus)

  def ballDescription: String = TestStatus.identifier(overallStatus)

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: PayOffDigitalCall Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

My Project

Public Member Functions |
List of all members

PayOffDigitalCall Class Reference

#include <Digital.h>

Inheritance diagram for PayOffDigitalCall:

<map name="PayOffDigitalCall_inherit__map" id="PayOffDigitalCall_inherit__map">
<area shape="rect" id="node2" href="classPayOff.html" title="{PayOff\n||+ PayOff()\l+ PayOff()\l+ operator()()\l+ PayOff()\l+ operator()()\l+ ~PayOff()\l+ PayOff()\l+ operator()()\l+ ~PayOff()\l+ clone()\l+ GetStrike()\l+ SetStrike()\l}" alt="" coords="32,5,129,244"/>
</map>

Collaboration diagram for PayOffDigitalCall:

<map name="PayOffDigitalCall_coll__map" id="PayOffDigitalCall_coll__map">
<area shape="rect" id="node2" href="classPayOff.html" title="{PayOff\n||+ PayOff()\l+ PayOff()\l+ operator()()\l+ PayOff()\l+ operator()()\l+ ~PayOff()\l+ PayOff()\l+ operator()()\l+ ~PayOff()\l+ clone()\l+ GetStrike()\l+ SetStrike()\l}" alt="" coords="32,5,129,244"/>
</map>

Public Member Functions

 	PayOffDigitalCall (double Strike_)

virtual double 	operator() (double Spot) const

virtual 	~PayOffDigitalCall ()

virtual PayOff * 	clone () const

virtual double 	GetStrike () const

virtual void 	SetStrike (double Strike_)

 Public Member Functions inherited from PayOff

 	PayOff (double Strike_, OptionType TheOptionsType_)

 	PayOff (double Strike_, double Strike1_, OptionType TheOptionsType_)

double 	operator() (double Spot) const

 	PayOff ()

virtual 	~PayOff ()

 	PayOff (double Strike_=0.0)

virtual 	~PayOff ()

Additional Inherited Members

 Public Types inherited from PayOff

enum  	OptionType { call,
put,
digitalCall,
doubleDigital
 }

Constructor & Destructor Documentation

§ PayOffDigitalCall()

          PayOffDigitalCall::PayOffDigitalCall
          (
          double
          Strike_	)

§ ~PayOffDigitalCall()

          virtual PayOffDigitalCall::~PayOffDigitalCall
          (
          	)

inlinevirtual

Member Function Documentation

§ clone()

          virtual PayOff* PayOffDigitalCall::clone
          (
          	)
           const

virtual

Implements PayOff.

§ GetStrike()

          virtual double PayOffDigitalCall::GetStrike
          (
          	)
           const

virtual

Reimplemented from PayOff.

§ operator()()

          virtual double PayOffDigitalCall::operator()
          (
          double
          Spot	)
           const

virtual

Implements PayOff.

§ SetStrike()

          virtual void PayOffDigitalCall::SetStrike
          (
          double
          Strike_	)

virtual

Reimplemented from PayOff.

The documentation for this class was generated from the following file:

Digital.h

<address class="footer">
Generated by

 1.8.12
</address>


text:
#region Using Directives

using System;
using System.ComponentModel.Composition;
using System.Threading.Tasks;

using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TaskStatusCenter;

#endregion

namespace Pharmatechnik.Nav.Language.Extension.Utilities;

[Export(typeof(TaskStatusProvider))]
class TaskStatusProvider {

    readonly Lazy<IVsTaskStatusCenterService> _taskCenterService;

    [ImportingConstructor]
    public TaskStatusProvider(SVsServiceProvider serviceProvider) {
        _taskCenterService = new Lazy<IVsTaskStatusCenterService>(
            () => (IVsTaskStatusCenterService) serviceProvider.GetService(typeof(SVsTaskStatusCenterService)));
    }

    public TaskStatus CreateTaskStatus(string title) {

        var options = new TaskHandlerOptions {
            Title                  = title,
            ActionsAfterCompletion = CompletionActions.None
        };

        var taskCompletionSource = new TaskCompletionSource<bool>();

        var handler = _taskCenterService.Value?.PreRegister(options, data: default);
        handler?.RegisterTask(taskCompletionSource.Task);

        return new TaskStatus(taskCompletionSource, handler);
    }

}


text:
HI WORLD! WE ARE: The Scheming Polymorphisists

Consising of three talented, handsome DBC dudes: Bison Hubert, Max McGee, and Brian Park.

MVP User stories for our product:
1. As a user, I want to be able to view all questions on the page.
2. As a user, I want to be able to create a question.
3. As a user, I want to be able to view a single question.
4. As a user, I want to be able to edit and delete my question.
5. As a user, I want to be able to answer questions.
6. As a user, I want to be able to edit and delete my answers.
7. As a user, I want to be able to respond to answeres.
8. As a user, I want to be able to edit and delete my responses.
9. As a user, I want to be able to vote on questions and answers.
10. As a user, I want to be able to view all questions, answers, and responses on one question page.

MVP2 User stories:
1. As a user I want to be able to create a new account.
2. As a user I want to be able to login and logout.
3. As a user I want to be able to view all my questions, reponsoses, and answers in my profile.


text:
<im.ene.lab.observablescrollers.lib.widget.ObsScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToPadding="false">

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/activity_vertical_margin"
        android:orientation="vertical">

        <LinearLayout
            style="@style/Widget.CardContent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/lipsum" />

        </LinearLayout>

    </android.support.v7.widget.CardView>

</im.ene.lab.observablescrollers.lib.widget.ObsScrollView>


text:
package com.github.nmorel.gwtjackson.client;

import com.github.nmorel.gwtjackson.client.exception.JsonSerializationException;
import com.github.nmorel.gwtjackson.client.stream.JsonWriter;

/**
 * Base class for all the serializer. It handles null values and exceptions. The rest is delegated to implementations.
 *
 * @author Nicolas Morel
 */
public abstract class JsonSerializer<T> {

    /**
     * Serializes an object into JSON output.
     *
     * @param writer {@link JsonWriter} used to write the serialized JSON
     * @param value Object to serialize
     * @param ctx Context for the full serialization process
     *
     * @throws JsonSerializationException if an error occurs during the serialization
     */
    public void serialize( JsonWriter writer, T value, JsonSerializationContext ctx ) throws JsonSerializationException {
        serialize( writer, value, ctx, JsonSerializerParameters.DEFAULT );
    }

    /**
     * Serializes an object into JSON output.
     *
     * @param writer {@link JsonWriter} used to write the serialized JSON
     * @param value Object to serialize
     * @param ctx Context for the full serialization process
     * @param params Parameters for this serialization
     *
     * @throws JsonSerializationException if an error occurs during the serialization
     */
    public void serialize( JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters params ) throws
            JsonSerializationException {
        serialize( writer, value, ctx, params, false );
    }

    /**
     * Serializes an object into JSON output.
     *
     * @param writer {@link JsonWriter} used to write the serialized JSON
     * @param value Object to serialize
     * @param ctx Context for the full serialization process
     * @param params Parameters for this serialization
     * @param isMapValue indicate if you're serializing a Map value
     * @throws JsonSerializationException if an error occurs during the serialization
     */
    public void serialize( JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters params, boolean isMapValue ) throws
            JsonSerializationException {
        if ( null != params.getInclude() ) {
            switch ( params.getInclude() ) {
                case ALWAYS:
                    if ( null == value ) {
                        serializeNullValue( writer, ctx, params );
                    } else {
                        doSerialize( writer, value, ctx, params );
                    }
                    return;
                case NON_DEFAULT:
                    if ( isDefault( value ) && !isMapValue ) {
                        writer.cancelName();
                    } else {
                        doSerialize( writer, value, ctx, params );
                    }
                    return;
                case NON_EMPTY:
                    if ( isEmpty( value ) && !isMapValue ) {
                        writer.cancelName();
                    } else {
                        doSerialize( writer, value, ctx, params );
                    }
                    return;
                case NON_NULL:
                    if ( null == value && !isMapValue) {
                        writer.cancelName();
                    } else {
                        doSerialize( writer, value, ctx, params );
                    }
                    return;
                case NON_ABSENT:
                    if ( isAbsent( value ) && !isMapValue) {
                        writer.cancelName();
                    } else {
                        doSerialize( writer, value, ctx, params );
                    }
                    return;
            }
        }

        if ( null == value ) {
            if ( ctx.isSerializeNulls() || ( isMapValue && ctx.isWriteNullMapValues() ) ) {
                serializeNullValue( writer, ctx, params );
            } else {
                writer.cancelName();
            }
        } else {
            doSerialize( writer, value, ctx, params );
        }
    }

    /**
     * Serialize the null value. This method allows children to override the default behaviour.
     *
     * @param writer {@link JsonWriter} used to write the serialized JSON
     * @param ctx Context for the full serialization process
     * @param params Parameters for this serialization
     */
    protected void serializeNullValue( JsonWriter writer, JsonSerializationContext ctx, JsonSerializerParameters params ) {
        writer.nullValue();
    }

    /**
     * @param value the value
     * @return true if the value corresponds to the default one
     */
    protected boolean isDefault( T value ) {
        return isEmpty( value );
    }

    /**
     * @param value the value
     * @return true if the value is empty
     */
    protected boolean isEmpty( T value ) {
        return null == value;
    }

    /**
     * @param value the value
     * @return true if the value is absent
     */
    protected boolean isAbsent( T value ) {
        return null == value;
    }

    /**
     * Serializes a non-null object into JSON output.
     *
     * @param writer {@link JsonWriter} used to write the serialized JSON
     * @param value Object to serialize
     * @param ctx Context for the full serialization process
     * @param params Parameters for this serialization
     */
    protected abstract void doSerialize( JsonWriter writer, T value, JsonSerializationContext ctx, JsonSerializerParameters
            params );
}


text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

// Import Javascript modules here:
var example = require('./modules/example');

// ...and then do something with them:
example.init();

// This all gets processed by Babel, so feel free
// to use ES2015 syntax if you like - it will be
// transpiled to backwards-compatible ES5:
var b = [1, 2, 3].map(function (x) {
  return x * 2;
});
console.log(b, 'Babel is working');

},{"./modules/example":2}],2:[function(require,module,exports){
'use strict';

/**
 * This is an example module. Feel free to delete or replace it!
 */

function init() {
  console.log('Browserify is working!');
}

module.exports = {
  init: init
};

},{}]},{},[1]);


text:
package com.linecorp.centraldogma.common;

/**
 * An {@link IllegalArgumentException} that is raised when building a {@link Change} or
 * an {@link Entry} failed due to invalid data format.
 */
public class ChangeFormatException extends IllegalArgumentException {

    private static final long serialVersionUID = 337034992785307988L;

    /**
     * Creates a new instance.
     */
    public ChangeFormatException() {}

    /**
     * Creates a new instance.
     */
    public ChangeFormatException(String message) {
        super(message);
    }

    /**
     * Creates a new instance.
     */
    public ChangeFormatException(Throwable cause) {
        super(cause);
    }

    /**
     * Creates a new instance.
     */
    public ChangeFormatException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
Puppet::Type.type(:sysctl).provide(:darwin) do

  confine  :kernel => 'darwin'
  commands :sysctl => 'sysctl'

  def exists?
    @property_hash[:ensure] == :present
  end

  def self.prefetch(host)
    instances.each do |prov|
      if pkg = host[prov.name]
        pkg.provider = prov
      end
    end
  end

  def self.instances
    sysctlconf=lines || []
    instances = []
    sysctloutput = sysctl('-a').split(/\r?\n/)
    sysctloutput.each do |line|
      #next if line =~ /dev.cdrom.info/

      if line =~ /^[\w]+(\.[\w\_]+)+: /

        kernelsetting = line.split(':')
        Puppet.debug kernelsetting

        confval = sysctlconf.grep(/^#{kernelsetting[0].strip}\s?=/)
        if confval.empty?
          value = kernelsetting[1].strip
          permanent = 'no'
        else
          permanent = 'yes'
          unless confval[0].split(/=/)[1].strip == kernelsetting[1].strip
            value = "outofsync(sysctl:#{kernelsetting[1].strip},config:#{confval[0].split(/=/)[1].strip})"
          else
            value = kernelsetting[1].strip
          end
        end
        instances << new(:ensure => :present, :name => kernelsetting[0].strip, :value => value, :permanent => permanent)
      end
    end
    instances
  end

  def destroy
    local_lines = lines
    File.open(@resource[:path],'w') do |fh|
      fh.write(local_lines.reject{|l| l =~ /^#{@resource[:name]}\s?\=\s?[\S+]/ }.join(''))
    end
    @lines = nil
  end

  def permanent
    @property_hash[:permanent]
  end

  def create
    sysctloutput = sysctl('-a').split(/\r?\n/)
    Puppet.debug "#{sysctloutput.grep(/^#{@resource[:name]}\s?=/)}"
    if sysctloutput.grep(/^#{@resource[:name]}\s?=/).empty?
      self.fail "Invalid sysctl parameter"
    end
  end

  def permanent=(ispermanent)
    if ispermanent == "yes"
      b = ( @resource[:value] == nil ? value : @resource[:value] )
      File.open(@resource[:path], 'a') do |fh|
        fh.puts "#{@resource[:name]} = #{b}"
      end
    else
      local_lines = lines
      File.open(@resource[:path],'w') do |fh|
        fh.write(local_lines.reject{|l| l =~ /^#{@resource[:name]}/ }.join(''))
      end
    end
    @lines = nil
    @property_hash[:permanent] = ispermanent
  end

  def value
    @property_hash[:value]
  end

  def value=(thesetting)
    sysctl('-w', "#{@resource[:name]}=#{thesetting}")
    b = ( @resource[:value] == nil ? value : @resource[:value] )
    if lines
      lines.find do |line|
        if line =~ /^#{@resource[:name]}/ && line !~ /^#{@resource[:name]}\s?=\s?#{b}$/
          content = File.read(@resource[:path])
          unless File.exists?(@resource[:path])

          end
          File.open(@resource[:path],'w') do |fh|
            # this regex is not perfect yet
            fh.write(content.gsub(/#{line}/,"#{@resource[:name]}\ =\ #{b}\n"))
          end
        end
      end
    else
      File.open(@resource[:path],'w') do |fh|
        # this regex is not perfect yet
        fh.puts "#{@resource[:name]} = #{b}"
      end
    end
    @lines = nil
    @property_hash[:value] = thesetting
  end

  def self.lines
    begin
      @lines ||= File.readlines('/etc/sysctl.conf')
    rescue Errno::ENOENT
      return nil
    end
  end
  def lines
    begin
      @lines ||= File.readlines(@resource[:path])
    rescue Errno::ENOENT
      return nil
    end
  end
end


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Outercurve Foundation")]
[assembly: AssemblyProduct("NuGet Gallery")]
[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyInformationalVersion("0.3.0-rc")]


text:
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('imaging-manifest-series', 'Unit | Model | ImagingManifest_Series', {
  needs: [
    'model:meta',
    'model:narrative',
    'model:resource',
    'model:extension',
    'model:reference',
    'model:imaging-manifest-instance'
  ]
});

test('it exists', function(assert) {
  const model = this.subject();
  assert.ok(!!model);
});


text:
"use strict";

var _getIterator = require("babel-runtime/core-js/get-iterator")["default"];

var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;

try {
  for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
    var i = _step.value;
  }
} catch (err) {
  _didIteratorError = true;
  _iteratorError = err;
} finally {
  try {
    if (!_iteratorNormalCompletion && _iterator["return"]) {
      _iterator["return"]();
    }
  } finally {
    if (_didIteratorError) {
      throw _iteratorError;
    }
  }
}


text: require 'acts_as_rateable'


text:
  #include "std/unique_ptr.hpp"
#endif

namespace dp
{

class GpuProgram
{
public:
  GpuProgram(int programIndex, ref_ptr<Shader> vertexShader,
             ref_ptr<Shader> fragmentShader);
  ~GpuProgram();

  void Bind();
  void Unbind();

  int8_t GetAttributeLocation(string const & attributeName) const;
  int8_t GetUniformLocation(string const & uniformName) const;

private:
  void LoadUniformLocations();

private:
  uint32_t m_programID;

  ref_ptr<Shader> m_vertexShader;
  ref_ptr<Shader> m_fragmentShader;

  using TUniformLocations = map<string, int8_t>;
  TUniformLocations m_uniforms;

  uint8_t const m_textureSlotsCount;
};

} // namespace dp


text:
var util      = require('util');
var gutil     = require('gulp-util');
var _         = require('underscore');
var Transform = require('stream').Transform;

/**
 * Primitive mechanism for combining multiple streams of data into one object.
 * Note that this is much more constrained than a full join since we enforce
 * uniqueness of the join key in the source data (thus creating the
 * source/target distinction), and only allow joins on the '=' operator.
 */
var Join = function(options) {
  if (!options.joinColumn) {
    this.throwError_('You must specify a srcColumn or a targetColumn (in the case that your data is already indexed)');
  }
  this.joinColumn = options.joinColumn;
  // The first file to pass through will be stored here.
  this.file = null;
  // This will accumulate the joined rows
  this.data = null;

  Transform.call(this, {objectMode: true});
};
util.inherits(Join, Transform);
Join.NAME = 'Join';

Join.prototype._transform = function(file, encoding, done) {
  if (file.isNull() || file.isDirectory()) {
    this.push(file);
    return done();
  }

  else if (file.isBuffer()) {
    if (!this.data) {
      this.file = file;
      this.data = JSON.parse(file.contents);
      return done();
    }

    var header = this.data[0];
    var joinData = JSON.parse(file.contents);
    var joinHeader = joinData[0];
    var joinIndexPosition = joinHeader.indexOf(this.joinColumn);
    if (joinIndexPosition === -1) {
      this.throwError_('Join column ' + this.joinColumn + ' not found in ' + joinHeader.toString());
      return done();
    }

    // Delete the header
    joinData.splice(0, 1);

    // Delete the join column from the header.
    joinHeader.splice(joinIndexPosition, 1);
    var indexedJoinData = {};
    _.each(joinData, function(row) {
      var key = row[joinIndexPosition];
      if (indexedJoinData[key] !== undefined) {
        this.throwError_('Key ' + key + ' is duplicated. Joined data must be unique.');
        return done();
      }

      // Delete the index from the record to avoid duplicate data.
      row.splice(joinIndexPosition, 1);
      indexedJoinData[key] = row;
    }, this);

    var indexPosition = header.indexOf(this.joinColumn);
    if (indexPosition === -1) {
      this.throwError_('Join column ' + this.joinColumn + ' not found in ' + joinHeader.toString());
      return done();
    }
    var joinedData = _.map(this.data, function(row, i) {
      // Combine the headers.
      if (i === 0) {
        console.log(row.concat(joinHeader));
        return row.concat(joinHeader);
      }

      var key = row[indexPosition];
      var valuesToJoin = indexedJoinData[key];
      if (valuesToJoin) {
        return row.concat(valuesToJoin);
      } else {
        console.log("Warning: No join data available for ", row[joinIndexPosition]);
      }
      return row;
    }, this);

    this.data = joinedData;
    return done();
  }
};

Join.prototype._flush = function(done) {
  this.file.contents = new Buffer(JSON.stringify(this.data));
  this.push(this.file);
  return done();
};

Join.prototype.throwError_ = function(message) {
  this.emit('error', new gutil.PluginError({
    plugin: Join.NAME,
    message: Join.NAME + ': ' + message
  }));
};

var factory = function(options) {
  return new Join(options);
};

module.exports = factory;


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="#0ff">
    <TextView
        android:id="@+id/txt_type_pic_txt"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:gravity="center"
        android:layout_weight="1"
        android:textSize="24sp"/>
	<ImageView
	    android:id="@+id/img_type_pic_pic"
	    android:layout_width="wrap_content"
	    android:layout_height="0dp"
	    android:layout_weight="2"
	    android:scaleType="fitCenter"
	    android:layout_marginTop="5dp"
	    android:layout_gravity="center_horizontal"/>
	<View
	    android:layout_marginTop="10dp"
	    android:background="#9400D3"
	    android:layout_width="match_parent"
	    android:layout_height="2dp"/>
</LinearLayout>


text:
<?php

namespace PHPExiftool\Driver\Tag\CanonVRD;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class WBAdjRGGBLevels extends AbstractTag
{

    protected $Id = 'mixed';

    protected $Name = 'WBAdjRGGBLevels';

    protected $FullName = 'mixed';

    protected $GroupName = 'CanonVRD';

    protected $g0 = 'CanonVRD';

    protected $g1 = 'CanonVRD';

    protected $g2 = 'Image';

    protected $Type = 'mixed';

    protected $Writable = true;

    protected $Description = 'WB Adj RGGB Levels';

    protected $MaxLength = 'mixed';
}


text:
export { terminal } from 'terminal-kit';

export { default as renderToJson } from './renderToJson';
export { default as renderToString } from './renderToString';
export { default as renderFullscreen, exit } from './renderFullscreen';
export {
  default as render,
  withRenderStatic,
  useRenderStatic,
  RenderStatic,
} from './render';

export { default as View, Props as ViewProps } from './components/View';
export { default as Text, Props as TextProps } from './components/Text';
export { default as Progress } from './components/Progress';
export { default as Spinner } from './components/Spinner';

export { TextTransform, JsonText, JsonView, JsonParagraph } from './types';


text:
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.common.queries.GetTagUserMapByTagNameParameters;

// NOT IN USE
public class GetTagUserMapByTagNameQuery<P extends GetTagUserMapByTagNameParameters> extends QueriesCommandBase<P> {
    public GetTagUserMapByTagNameQuery(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeQueryCommand() {
        getQueryReturnValue()
                .setReturnValue(getDbFacade().getTagDAO().getTagUserMapByTagName(getParameters().getTagName()));
    }
}


text:
Introduction
============

|Latest Version| |Supported Versions|

PyPy and PyPy3 are also supported (and tested against).

Find MechanicalSoup on `Python Package Index (Pypi)
<https://pypi.python.org/pypi/MechanicalSoup/>`__ and follow the
development on `GitHub <https://github.com/MechanicalSoup/MechanicalSoup>`__.

Installation
------------

Download and install the latest released version from `PyPI <https://pypi.python.org/pypi/MechanicalSoup/>`__::

  pip install MechanicalSoup

Download and install the development version from GitHub::

  pip install git+https://github.com/MechanicalSoup/MechanicalSoup

Installing from source (installs the version in the current working directory)::

  git clone https://github.com/MechanicalSoup/MechanicalSoup.git
  cd MechanicalSoup
  python setup.py install

(In all cases, add ``--user`` to the ``install`` command to
install in the current user's home directory.)

Example code: https://github.com/MechanicalSoup/MechanicalSoup/tree/master/examples/

.. |Latest Version| image:: https://img.shields.io/pypi/v/MechanicalSoup.svg
   :target: https://pypi.python.org/pypi/MechanicalSoup/
.. |Supported Versions| image:: https://img.shields.io/pypi/pyversions/mechanicalsoup.svg
   :target: https://pypi.python.org/pypi/MechanicalSoup/


text:
<TITLE>Review for Mulan (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Mulan (1998)

reviewed by
Matt Williams

MULAN
A film review by Matt Williams

RATING: * * * 1/2* out of * * * *

Disney cements their place in the forefront of feature animation with
the release of their latest animated adventure, Mulan.  While it adheres
a bit too close to the Disney formula to be perfect, it is nonetheless
an entertaining film for both kids and adults.

Fa Mulan (Ming-Na Wen, singing: Lea Salonga) wants nothing more than to
be a dutiful daughter and honor her family...it's just that she doesn't
quite fit in with the chafing customs of her time.  While most girls her
age are trying to quietly and demurely seek the approval of the local
matchmaker (Miriam Margoyles), Mulan would prefer speaking her mind.

But there is trouble on the horizon.  The evil Huns, led by Shan-Yu
(Miguel Ferrer), are invading China.  The Emperor (Pat Morita) has
decreed that each family must donate one man to serve in the army.  The
only male in Mulan's family is her father, Fa Zhou (Soon-Tek Oh), who,
old and with a bad leg, honorably accepts his fate.  Mulan, on the other
hand, decides to save her father's life...by secretly masquerading as a
man and taking his place on the battlefield.

Mulan, under the assumed name of Ping, appears at camp where she, along
with the other bumbling recruits, Yao (Harvey Fierstein), Chien-Po
(Jerry Tondo) and Ling (Gedde Watanabe), are trained in the art of war
by Captain Shang (B.D. Wong, singing: Donny Osmond).  But she's not
alone in her tasks...in typical Disney fashion, she has three animal
companions:  her horse Khan, a lucky cricket Crickey, and a pint-sized
"guardian" dragon called Mushu (Eddie Murphy).

Much like the gargoyles in The Hunchback of Notre Dame, the humor in
Mulan is lukewarm and doesn't flow well with the rest of the more
serious story.  Sure, some occasional comic relief is welcome,
particularly in a film geared for the younger set, but Mulan overdoes
it.  The overdose of humor turns what could have been a powerfully great
film into a good, but schizophrenic experience.

But, that commentary aside, this is a very well made film (which makes
the formulaic additions all the more regrettable). The animation is on
par with some of Disney's best.  The story itself is interesting, and
the action scenes are awe-inspiring.

The musical score to the film is enjoyable, though, as has been the case
with Disney's recent work, the songs are mostly forgettable. At least,
we're only subjected to four of them this time around.

Mulan boasts the highest death toll of any Disney cartoon to date. Most
of the killing is off-screen and it's all highly depersonalized (there's
nothing to compare with the death of Mufasa or Bambi's mom). There's
nothing graphic, and the film resides snugly inside a G rating. Children
will probably have more questions about the restrictive ancient customs
than of the slaughter of armies.

It's ironic that a film concerned with bucking tradition is hampered
because of its strict adherence to Disney tradition.  If the filmmakers
had the guts to lessen the humor, ax the compulsory songs, and remove
the obligatory (and somewhat unrealistic) romance, they could have had a
classic on their hands. Instead, they merely deliver a very good time at
the movies.

Copyright 1998 Matt Williams

- Matt Williams (matt@cinematter.com)
Reviewer for Cinematter: http://www.cinematter.com
Home of over 500 reviews, and information on over 600 upcoming releases

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
        <title>Webseite nicht verfügbar</title>

Webseite nicht verfügbar

Die Webseite unter %s konnte nicht geladen werden als:

%e


text:
const unsigned char* GetCategoryGroupEnabled(const char* category_group) {
  return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
}

void AddTraceEvent(char phase,
                   const unsigned char* category_group_enabled,
                   const char* name,
                   unsigned long long id,
                   int num_args,
                   const char** arg_names,
                   const unsigned char* arg_types,
                   const unsigned long long* arg_values,
                   unsigned char flags) {
  TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name, id,
                                  num_args, arg_names, arg_types, arg_values,
                                  NULL, flags);
}

#if defined(LIBPEERCONNECTION_LIB)

// libpeerconnection is being compiled as a static lib.  In this case
// we don't need to do any initializing but to keep things simple we
// provide an empty intialization routine so that this #ifdef doesn't
// have to be in other places.
bool InitializeWebRtcModule() {
  webrtc::SetupEventTracer(&GetCategoryGroupEnabled, &AddTraceEvent);
  return true;
}

#else  // !LIBPEERCONNECTION_LIB

// When being compiled as a shared library, we need to bridge the gap between
// the current module and the libpeerconnection module, so things get a tad
// more complicated.

// Global function pointers to the factory functions in the shared library.
CreateWebRtcMediaEngineFunction g_create_webrtc_media_engine = NULL;
DestroyWebRtcMediaEngineFunction g_destroy_webrtc_media_engine = NULL;

// Returns the full or relative path to the libpeerconnection module depending
// on what platform we're on.
static base::FilePath GetLibPeerConnectionPath() {
  base::FilePath path;
  CHECK(PathService::Get(base::DIR_MODULE, &path));
#if defined(OS_WIN)
  path = path.Append(FILE_PATH_LITERAL("libpeerconnection.dll"));
#elif defined(OS_MACOSX)
  // Simulate '@loader_path/Libraries'.
  path = path.Append(FILE_PATH_LITERAL("Libraries"))
             .Append(FILE_PATH_LITERAL("libpeerconnection.so"));
#elif defined(OS_ANDROID)
  path = path.Append(FILE_PATH_LITERAL("libpeerconnection.so"));
#else
  path = path.Append(FILE_PATH_LITERAL("lib"))
             .Append(FILE_PATH_LITERAL("libpeerconnection.so"));
#endif
  return path;
}

bool InitializeWebRtcModule() {
  TRACE_EVENT0("webrtc", "InitializeWebRtcModule");

  if (g_create_webrtc_media_engine)
    return true;  // InitializeWebRtcModule has already been called.

  base::FilePath path(GetLibPeerConnectionPath());
  DVLOG(1) << "Loading WebRTC module: " << path.value();

  std::string error;
  static base::NativeLibrary lib =
      base::LoadNativeLibrary(path, &error);
  CHECK(lib) << error;

  InitializeModuleFunction initialize_module =
      reinterpret_cast<InitializeModuleFunction>(
          base::GetFunctionPointerFromNativeLibrary(
              lib, "InitializeModule"));

  // Initialize the proxy by supplying it with a pointer to our
  // allocator/deallocator routines.
  // On mac we use malloc zones, which are global, so we provide NULLs for
  // the alloc/dealloc functions.
  // PS: This function is actually implemented in allocator_proxy.cc with the
  // new/delete overrides.
  return initialize_module(*CommandLine::ForCurrentProcess(),
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
      &Allocate, &Dellocate,
#endif
      logging::GetLogMessageHandler(),
      &GetCategoryGroupEnabled, &AddTraceEvent,
      &g_create_webrtc_media_engine, &g_destroy_webrtc_media_engine);
}

cricket::MediaEngineInterface* CreateWebRtcMediaEngine(
    webrtc::AudioDeviceModule* adm,
    webrtc::AudioDeviceModule* adm_sc,
    cricket::WebRtcVideoEncoderFactory* encoder_factory,
    cricket::WebRtcVideoDecoderFactory* decoder_factory) {
  // For convenience of tests etc, we call InitializeWebRtcModule here.
  // For Chrome however, InitializeWebRtcModule must be called
  // explicitly before the sandbox is initialized.  In that case, this call is
  // effectively a noop.
  InitializeWebRtcModule();
  return g_create_webrtc_media_engine(adm, adm_sc, encoder_factory,
      decoder_factory);
}

void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) {
  g_destroy_webrtc_media_engine(media_engine);
}

#endif  // LIBPEERCONNECTION_LIB


text:
package edu.nyu.cs.omnidroid.app.controller.external.actions;

import java.io.IOException;
import java.io.Writer;

import org.apache.commons.net.smtp.SMTPClient;
import org.apache.commons.net.smtp.SMTPReply;
import org.apache.commons.net.smtp.SimpleSMTPHeader;

import android.app.Service;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.IBinder;
import edu.nyu.cs.omnidroid.app.R;
import edu.nyu.cs.omnidroid.app.controller.ResultProcessor;
import edu.nyu.cs.omnidroid.app.controller.actions.SendGmailAction;
import edu.nyu.cs.omnidroid.app.model.db.DbHelper;
import edu.nyu.cs.omnidroid.app.model.db.RegisteredAppDbAdapter;

/**
 * This service can be used to send a GMail when receiving an intent created by
 * {@link SendGmailAction}. It utilize a SMTP library from Apache Commons project.
 */
public class GMailService extends Service {

  /**
   * attributes field names
   */

  private RegisteredAppDbAdapter.AccountCredentials account;
  private String to;
  private String subject;
  private String body;
  private Intent intent;

  /**
   * @return null because client can't bind to this service
   */
  @Override

  public IBinder onBind(Intent intent) {
    return null;
  }

  /**
   * Get the username and password for the Gmail account
   */
  private void extractUserCredentials() {
    DbHelper omniDbHelper = new DbHelper(this);
    SQLiteDatabase database = omniDbHelper.getWritableDatabase();
    RegisteredAppDbAdapter registeredAppDbAdapter = new RegisteredAppDbAdapter(database);

    account = registeredAppDbAdapter.getAccountCredentials(DbHelper.AppName.GMAIL, "");

    database.close();
    omniDbHelper.close();
  }

  @Override
  public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);
    this.intent = intent;
    extractUserCredentials();
    to = intent.getStringExtra(SendGmailAction.PARAM_TO);
    subject = intent.getStringExtra(SendGmailAction.PARAM_SUBJECT);
    body = intent.getStringExtra(SendGmailAction.PARAM_BODY);
    send();
  }

  /**
   * Send a GMail
   */
  private void send() {
    //Toast.makeText(this, "GMail Service Started", Toast.LENGTH_LONG).show();

    SMTPClient client = new SMTPClient("UTF-8");
    client.setDefaultTimeout(60 * 1000);

    client.setRequireStartTLS(true); // requires STARTTLS
    client.setUseAuth(true); // use SMTP AUTH

    try {
      client.connect("smtp.gmail.com", 587);
      checkReply(client);
    } catch (IOException e) {
      //ResultProcessor.process(this, intent, ResultProcessor.RESULT_FAILURE_INTERNET,
       //   getString(R.string.gmail_failed_no_network));
      return;
    }

    try {
      client.login("localhost", account.accountName, account.credential);
      checkReply(client);
    } catch (IOException e) {
      ResultProcessor.process(this, intent, ResultProcessor.RESULT_FAILURE_IRRECOVERABLE,
          getString(R.string.gmail_failed_authentication_error));
      return;
    }

    try {
      client.setSender(account.accountName);
      checkReply(client);

      client.addRecipient(to);
      checkReply(client);

      Writer writer = client.sendMessageData();

      if (writer != null) {
        SimpleSMTPHeader header = new SimpleSMTPHeader(account.accountName, to, subject);
        writer.write(header.toString());
        writer.write(body);
        writer.close();
        client.completePendingCommand();
        checkReply(client);
      }

      client.logout();
      client.disconnect();

    } catch (IOException e) {
      ResultProcessor.process(this, intent, ResultProcessor.RESULT_FAILURE_UNKNOWN,
          getString(R.string.gmail_failed_server_error));
      return;
    }
    ResultProcessor.process(this, intent, ResultProcessor.RESULT_SUCCESS,
        getString(R.string.gmail_sent));

  }

  /**
   * Check the response from the SMTP connection
   */
  private void checkReply(SMTPClient sc) throws IOException {
    if (SMTPReply.isNegativeTransient(sc.getReplyCode())) {
      sc.disconnect();
      throw new IOException("Transient SMTP error " + sc.getReplyCode());
    } else if (SMTPReply.isNegativePermanent(sc.getReplyCode())) {
      sc.disconnect();
      throw new IOException("Permanent SMTP error " + sc.getReplyCode());
    }
  }
}


text:
package gw.internal.gosu.ir.compiler.bytecode;

import gw.internal.ext.org.objectweb.asm.ClassWriter;
import gw.internal.ext.org.objectweb.asm.ClassReader;
import gw.internal.ext.org.objectweb.asm.ClassVisitor;
import gw.internal.ext.org.objectweb.asm.Opcodes;
import gw.internal.ext.org.objectweb.asm.FieldVisitor;
import gw.internal.ext.org.objectweb.asm.MethodVisitor;
import gw.internal.ext.org.objectweb.asm.Label;
import gw.internal.ext.org.objectweb.asm.AnnotationVisitor;
import gw.internal.ext.org.objectweb.asm.util.TraceClassVisitor;
import gw.internal.ext.org.objectweb.asm.util.CheckClassAdapter;
import gw.internal.gosu.compiler.DebugFlag;
import gw.lang.ir.IRClass;
import gw.lang.ir.IRType;
import gw.lang.ir.IRSymbol;
import gw.lang.ir.IRAnnotation;
import gw.lang.ir.statement.IRFieldDecl;
import gw.lang.ir.statement.IRMethodStatement;
import gw.lang.reflect.Modifier;
import gw.lang.reflect.gs.BytecodeOptions;

import java.io.StringWriter;
import java.io.PrintWriter;
import java.util.List;

public class IRClassCompiler extends AbstractBytecodeCompiler
{
  private static boolean COMPILE_WITH_DEBUG_INFO = true;

  //## todo: this s/b configurable
  public static final int JAVA_VER = Opcodes.V1_6;

  private ClassVisitor _cv;
  private IRClass _irClass;

  public static byte[] compileClass( IRClass irClass, boolean debug )
  {
    boolean alreadyDebugging = DebugFlag.isDebugFlagsOn();
    if( !alreadyDebugging && debug )
    {
      DebugFlag.setDebugFlagsOn();
    }
    try
    {
      return new IRClassCompiler( irClass ).compile( );
    }
    finally
    {
      if( !alreadyDebugging )
      {
        DebugFlag.setDebugFlagsOff();
      }
    }
  }

  public IRClassCompiler(IRClass irClass) {
    _irClass = irClass;
  }

  private byte[] compile( )
  {
    ClassWriter writer = new GosuClassWriter();
    StringWriter trace = configClassVisitor( writer );

    try
    {
      compileClassHeader();

      addSourceFileRef();

      compileInnerClasses();

      compileFields();

      compileMethods();

      addAnnotations();

      _cv.visitEnd();
    }
    finally
    {
      if( BytecodeOptions.shouldDebug( _irClass.getName() ))
      {
        System.out.println( "========================================================================" );
        System.out.println( _irClass.getName() );
        System.out.println( "========================================================================" );
        System.out.println( trace );
      }
    }
    byte[] bytes = writer.toByteArray();
//    verify( bytes );
    return bytes;
  }

  public void addAnnotations() {
    for (IRAnnotation annotation : _irClass.getAnnotations() ) {
      AnnotationVisitor annotationVisitor = _cv.visitAnnotation(annotation.getDescriptor().getDescriptor(), annotation.isInclude());
      new IRAnnotationCompiler( annotationVisitor, annotation ).compile();
    }
  }

  private StringWriter configClassVisitor( ClassWriter writer )
  {
    _cv = writer;
    StringWriter trace = null;
    if( isDebugFlagSet( DebugFlag.TRACE ) || BytecodeOptions.shouldDebug( _irClass.getName() ) )
    {
      trace = new StringWriter();
      _cv = new TraceClassVisitor( _cv, new PrintWriter( trace ) );
      if( isDebugFlagSet( DebugFlag.ASM_CHECKER ) )
      {
        _cv = new CheckClassAdapter( _cv );
      }
    }
    return trace;
  }

  public static void verify( byte[] bytes )
  {
    if( isDebugFlagSet( DebugFlag.VERIFY ) )
    {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter( sw );
      CheckClassAdapter.verify( new ClassReader( bytes ), false, pw );
      String out = sw.toString();
      if( out.length() > 0 )
      {
        System.out.println( out );
      }
    }
  }

  static public boolean isDebugFlagSet( DebugFlag flag )
  {
    return DebugFlag.getDebugFlags().contains( flag );
  }

  private void compileClassHeader()
  {
    int modifiers = _irClass.getModifiers();
    _cv.visit( JAVA_VER,
            modifiers,
               _irClass.getThisType().getSlashName(),
               getClassSignature(),
               _irClass.getSuperType().getSlashName(),
               getInterfaceNames() );
  }

  /**
   * Deals with generics.
   *
   * Since Gosu generics are parameterized explicitly in the bytecode world,
   * we'll probably not ever conform to java generics.
   */
  private String getClassSignature()
  {
    return null;
  }

  private String[] getInterfaceNames()
  {
    List<? extends IRType> interfaces = _irClass.getInterfaces();
    if( interfaces == null || interfaces.isEmpty() )
    {
      return null;
    }

    String[] ifaceNames = new String[interfaces.size()];
    for( int i = 0; i < ifaceNames.length; i++ )
    {
      IRType iface = interfaces.get( i );
      ifaceNames[i] = iface.getSlashName();
    }
    return ifaceNames;
  }

  private void addSourceFileRef() {
    _cv.visitSource( _irClass.getSourceFile(), null );
  }

  private void compileInnerClasses()
  {
    for( IRClass.InnerClassInfo innerClass : _irClass.getInnerClasses() )
    {
      visitInnerClass( innerClass );
    }
  }

  private void visitInnerClass( IRClass.InnerClassInfo innerClass )
  {
    _cv.visitInnerClass( innerClass.getInnerClass().getSlashName(),
                         innerClass.getEnclosingType().getSlashName(),
                         innerClass.getInnerClass().getRelativeName(),
                         innerClass.getModifiers());
  }

  private void compileFields() {
    for( IRFieldDecl field : _irClass.getFields() )
    {
      FieldVisitor fv = _cv.visitField( field.getModifiers(),
                                        field.getName(),
                                        field.getType().getDescriptor(),
                                        null,
                                        field.getValue() );
      for (IRAnnotation annotation : field.getAnnotations() ) {
        AnnotationVisitor annotationVisitor = fv.visitAnnotation(annotation.getDescriptor().getDescriptor(), annotation.isInclude());
        new IRAnnotationCompiler( annotationVisitor, annotation ).compile();
      }
      fv.visitEnd();
    }
  }

  private void compileMethods() {
    for ( IRMethodStatement method : _irClass.getMethods() ) {
      compileMethod( method );
    }
  }

  private void compileMethod( IRMethodStatement method )
  {
    MethodVisitor mv = _cv.visitMethod( method.getModifiers(),
                                         method.getName(),
                                         getMethodDescriptor( method ),
                                         null, null );
    for( IRAnnotation annotation : method.getAnnotations() )
    {
      AnnotationVisitor annotationVisitor = mv.visitAnnotation( annotation.getDescriptor().getDescriptor(), annotation.isInclude() );
      new IRAnnotationCompiler( annotationVisitor, annotation ).compile();
    }
    for( IRSymbol param: method.getParameters() )
    {
      List<IRAnnotation> paramAnnotations = param.getAnnotations();
      if( paramAnnotations != null )
      {
        int i = 0;
        for( IRAnnotation annotation: paramAnnotations )
        {
          AnnotationVisitor annotationVisitor = mv.visitParameterAnnotation( i++, annotation.getDescriptor().getDescriptor(), annotation.isInclude() );
          new IRAnnotationCompiler( annotationVisitor, annotation ).compile();
        }
      }
    }

    if( method.getMethodBody() != null )
    {
      mv.visitCode();

      IRBytecodeContext context = new IRBytecodeContext( mv );
      if( !Modifier.isStatic( method.getModifiers() ) )
      {
        context.indexThis( _irClass.getThisType() );
      }
      context.indexSymbols( method.getParameters() );

      IRBytecodeCompiler.compileIRElement( method.getMethodBody(), context );
      terminateFunction( context );
    }
    mv.visitEnd();
  }

  private void terminateFunction( IRBytecodeContext context )
  {
    context.popScope();
    MethodVisitor mv = context.getMv();
    Label endLabel = new Label();
    context.visitLabel( endLabel );
    if( COMPILE_WITH_DEBUG_INFO )
    {
      context.visitLocalVars();
    }
    //mv.visitMaxs( context.getMaxScopeSize(), context.getLocalCount() );
    mv.visitMaxs( 0, 0 );
  }

  public static String getMethodDescriptor(IRMethodStatement m) {
    StringBuilder sb = new StringBuilder();
    sb.append("(");
    for (IRSymbol param : m.getParameters()) {
      sb.append(param.getType().getDescriptor());
    }
    sb.append(")");
    sb.append(m.getReturnType().getDescriptor());
    return sb.toString();
  }

  @Override
  public String toString()
  {
    return "Compiling: " + _irClass.getName();
  }
}


text:
package com.davenport.themisto.ocaml;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.swing.JFrame;

import com.davenport.themisto.Module;
import com.davenport.themisto.Project;
import com.davenport.themisto.Shell;

public class OCAMLProject extends Project {

	public OCAMLProject(JFrame frame, File projectFile) {
		super(frame, projectFile);
	}

	public void loadModules() {
		File[] files = projectFile.getParentFile().listFiles();
		for (File file : files) {
			if (!file.getName().startsWith(".") && file.getName().endsWith(".ml")) {
				String moduleName = file.getName().replace(".ml", "");
				modules.add(new OCAMLModule(this, moduleName));
			}
		}
	}

	@Override
	public void link() {
		Shell shell = new Shell(getProjectFile().getParentFile(), messageFrame);
		List<String> cmds = new ArrayList<String>();
		cmds.add("/usr/bin/ocamlc");
		cmds.add("-o");
		cmds.add(executable.getName());
		for (Module module : modules) {
			cmds.add(module.getName() + ".ml");
		}
		shell.execute(cmds);
	}

}