text:
package com.cloudera.flume.master;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.log4j.Logger;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.KeeperException.Code;
import org.apache.zookeeper.KeeperException.SessionExpiredException;
import org.apache.zookeeper.Watcher.Event.KeeperState;
import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;

import com.cloudera.util.BackoffPolicy;
import com.cloudera.util.FixedRetryPolicy;
import com.cloudera.util.ResultRetryable;
import com.cloudera.util.RetryHarness;
import com.cloudera.util.Retryable;
import com.google.common.base.Preconditions;

/**
 * Wrapper for talking to ZooKeeper that provides a set of primitives we use
 * inside Flume. Not general purpose (yet), but useful to hide the complexities
 * of dealing with ZK's various error conditions.
 *
 */
public class ZKClient implements Watcher {
  protected ZooKeeper zk;
  final String hosts;
  final static Logger LOG = Logger.getLogger(ZKClient.class);

  class ZKRetryHarness {
    final protected RetryHarness harness;

    public ZKRetryHarness(Retryable retry, BackoffPolicy policy) {
      harness = new RetryHarness(retry, policy, true);
    }

    /**
     * Run-time casts an exception into one of the three types that we know
     * could get thrown. It's really ugly.
     */
    protected void massageException(Exception e) throws IOException,
        KeeperException, InterruptedException {
      try {
        throw e;
      } catch (IOException i) {
        throw i;
      } catch (KeeperException k) {
        throw k;
      } catch (InterruptedException i) {
        throw i;
      } catch (Exception x) {
        throw new IOException("Unexpected exception type!", x);
      }
    }

    protected boolean attempt() throws InterruptedException, KeeperException,
        IOException {
      try {
        return harness.attempt();
      } catch (SessionExpiredException s) {
        ZKClient.this.zk = null;
        ZKClient.this.init(ZKClient.this.initCallBack);
      } catch (Exception e) {
        massageException(e);
      }
      // Should never fall through here
      return false;
    }
  }

  class ZKRetryable<T> extends ResultRetryable<T> {
    /**
     * Takes default action for ZK exceptions. If CONNECTIONLOSS, try and
     * reconnect followed by abort. Otherwise, abort and signal failure.
     */
    protected void defaultHandleException(KeeperException k)
        throws KeeperException, IOException, InterruptedException {
      if (k.code() == Code.CONNECTIONLOSS) {
        throw k; // Continue
      } else {
        harness.doAbort();
        throw k;
      }
    }
  }

  /**
   * Creates a new client, but does not connect.
   */
  public ZKClient(String hosts) {
    this.hosts = hosts;
  }

  /**
   * Called when client successfully connects.
   */
  abstract public static class InitCallback {
    abstract public void success(ZKClient client) throws IOException;
  }

  /**
   * Establishes a connection with a ZooKeeper service.
   */
  public boolean init() throws IOException {
    return init(null);
  }

  InitCallback initCallBack;

  /**
   * Establishes a connection with a cluster of ZooKeeper servers. Throws an
   * IOException on failure.
   */
  public synchronized boolean init(final InitCallback initCallback)
      throws IOException {
    Preconditions.checkState(this.zk == null, "zk not null in ZKClient.init");
    initCallBack = initCallback;
    final Retryable retry = new Retryable() {
      public boolean doTry() throws Exception {
        // Wait on this latch for a connection to complete
        // It's important that every try gets its own latch
        final CountDownLatch latch = new CountDownLatch(1);
        final Watcher watcher = new Watcher() {
          public void process(WatchedEvent event) {
            // Don't down the latch if we weren't the most recent attempt
            if (event.getState() == KeeperState.SyncConnected) {
              latch.countDown();
            }
          }
        };

        zk = new ZooKeeper(hosts, 5000, watcher);

        if (!latch.await(5, TimeUnit.SECONDS)) {
          throw new IOException("Could not connect to ZooKeeper!");
        }
        if (initCallback != null) {
          initCallback.success(ZKClient.this);
        }
        return true;
      };
    };
    RetryHarness harness = new RetryHarness(retry, new FixedRetryPolicy(3),
        true);

    try {
      return harness.attempt();
    } catch (IOException i) {
      throw i;
    } catch (Exception e) {
      throw new IOException("Unexpected exception connecting to ZK", e);
    }
  }

  /**
   * Closes the connection to the ZooKeeper service
   */
  public synchronized void close() throws InterruptedException {
    if (this.zk != null) {
      this.getZK().close();
      this.zk = null;
    }
  }

  /**
   * Will make sure that a node exists, with a given path and data. If the node
   * already exists, will not try to set the data.
   */
  public boolean ensureExists(final String path, final byte[] data)
      throws KeeperException, IOException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    if (zk.exists(path, false) != null) {
      return true;
    }
    ZKRetryable<Boolean> retry = new ZKRetryable<Boolean>() {
      public boolean doTry() throws Exception {
        result = true;
        try {
          zk.create(path, data, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          return true;
        } catch (KeeperException k) {
          if (k.code() == Code.NODEEXISTS) {
            // Note that we could have this situation: try to create, succeed
            // but get CONNECTIONLOSS, reconnect, try to create, return false.
            // Until ZK-22 goes in there really isn't a much better way of doing
            // this
            result = false;
            return true; // true to denote success of operation
          }
          defaultHandleException(k);
        }
        return false;
      }
    };

    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    harness.attempt();

    return retry.getResult();
  }

  /**
   * Ensure that the given path is deleted, whether or not we did it.
   */
  public void ensureDeleted(final String path, final int version)
      throws KeeperException, IOException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<Void> retry = new ZKRetryable<Void>() {
      public boolean doTry() throws Exception {
        try {
          zk.delete(path, version);
          return true;
        } catch (KeeperException k) {
          if (k.code() == Code.NONODE) {
            return true;
          }
          defaultHandleException(k);
        }
        return false;
      }
    };

    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    harness.attempt();
  }

  /**
   * Returns the underlying ZooKeeper object. Use only for methods that are not
   * captured by this class.
   *
   * Note that the returned ZooKeeper could be closed by another thread. This
   * method is not recommended for common use.
   */
  public synchronized ZooKeeper getZK() {
    Preconditions.checkState(zk != null, "zk is null in getZK");
    return zk;
  }

  /**
   * Returns the long suffix of a sequential znode
   */
  static public long extractSuffix(String prefix, String znode)
      throws NumberFormatException {
    // This pattern will match nodes created in ZK with the NODE_SEQUENTIAL
    // type. These nodes have a ten digit monotonic sequence number appended to
    // them, which we want to sort by.
    final Pattern pattern = Pattern.compile("(" + prefix
        + ")(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)$");
    Matcher matcher = pattern.matcher(znode);
    if (matcher.find()) {
      return Long.parseLong(matcher.group(2));
    } else {
      throw new NumberFormatException("Znode: " + znode
          + " does not have a numeric 10-digit suffix (Prefix was " + prefix
          + ")");
    }
  }

  /**
   * Returns the most recently created sequential child, just the node name. ZK
   * really should do this on the server side to save the O(n) traffic but until
   * it does, this is what you get.
   *
   * Returns null if the node does not exist or it has no children.
   */
  public String getLastSequentialChild(final String path, final String prefix,
      final boolean watch) throws IOException, KeeperException,
      InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);

    ZKRetryable<String> retry = new ZKRetryable<String>() {
      public boolean doTry() throws Exception {
        result = null;
        List<String> children = null;
        try {
          children = zk.getChildren(path, watch);
        } catch (KeeperException k) {
          defaultHandleException(k);
          return false;
        }
        if (children.size() == 0) {
          return true;
        }

        List<Long> suffixes = new ArrayList<Long>();
        for (String s : children) {
          try {
            suffixes.add(extractSuffix(prefix, s));
          } catch (NumberFormatException n) {
            // Don't throw the exception because there might be
            // some nodes that weren't created sequentially - just ignore.
            LOG.warn("Couldn't parse " + s, n);
          }
        }
        if (suffixes.size() == 0) {
          return true;
        }
        // Sorting is overkill, but convenient.
        Collections.sort(suffixes, Collections.reverseOrder());
        result = String.format(prefix + "%010d", suffixes.get(0));
        return true;
      }
    };

    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    if (harness.attempt()) {
      return retry.getResult();
    }
    return null;
  }

  // Implementations of common ZK APIs
  public List<String> getChildren(final String path, final boolean watch)
      throws IOException, KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<List<String>> retry = new ZKRetryable<List<String>>() {
      public boolean doTry() throws Exception {
        try {
          result = zk.getChildren(path, watch);
        } catch (KeeperException k) {
          defaultHandleException(k);
        }
        return true;
      }
    };

    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    if (harness.attempt()) {
      return retry.getResult();
    }
    return Collections.emptyList();
  }

  public byte[] getData(final String path, final boolean watch, final Stat stat)
      throws IOException, KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<byte[]> retry = new ZKRetryable<byte[]>() {
      public boolean doTry() throws Exception {
        try {
          result = zk.getData(path, watch, stat);
        } catch (KeeperException k) {
          defaultHandleException(k);
        }
        return true;
      }
    };
    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    if (harness.attempt()) {
      return retry.getResult();
    }
    return null;
  }

  public Stat setData(final String path, final byte[] data, final int version)
      throws IOException, KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<Stat> retry = new ZKRetryable<Stat>() {
      public boolean doTry() throws Exception {
        try {
          result = zk.setData(path, data, version);
        } catch (KeeperException k) {
          defaultHandleException(k);
        }
        return true;
      }
    };
    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    if (harness.attempt()) {
      return retry.getResult();
    }
    return null;
  }

  public String create(final String path, final byte[] data,
      final List<ACL> acls, final CreateMode mode) throws IOException,
      KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<String> retry = new ZKRetryable<String>() {
      public boolean doTry() throws IOException, KeeperException,
          InterruptedException {
        try {
          result = zk.create(path, data, acls, mode);
        } catch (KeeperException k) {
          defaultHandleException(k);
          return false;
        }
        return true;
      }
    };
    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);

    if (harness.attempt()) {
      return retry.getResult();
    }
    throw new IOException("Failed to execute create");
  }

  public void delete(final String path, final int version) throws IOException,
      KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<Void> retry = new ZKRetryable<Void>() {
      public boolean doTry() throws IOException, KeeperException,
          InterruptedException {
        try {
          zk.delete(path, version);
        } catch (KeeperException k) {
          defaultHandleException(k);
        }
        return true;
      }
    };
    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);
    harness.attempt();
  }

  public Stat exists(final String path, final boolean watch)
      throws IOException, KeeperException, InterruptedException {
    Preconditions.checkArgument(zk != null);
    final FixedRetryPolicy policy = new FixedRetryPolicy(3);
    ZKRetryable<Stat> retry = new ZKRetryable<Stat>() {
      public boolean doTry() throws IOException, KeeperException,
          InterruptedException {
        try {
          result = zk.exists(path, watch);
        } catch (KeeperException k) {
          defaultHandleException(k);
        }
        return true;
      }
    };
    ZKRetryHarness harness = new ZKRetryHarness(retry, policy);

    if (harness.attempt()) {
      return retry.getResult();
    }
    throw new IOException("Failed to execute exists call");
  }

  @Override
  public void process(WatchedEvent event) {
    LOG.info("Got watched event " + event);
  }
}


text:
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';

export default function () {
  Accounts.urls.resetPassword = function (token) {
    return Meteor.absoluteUrl('user/reset-password?token=' + token);
  };

  Accounts.urls.verifyEmail = function (token) {
    return Meteor.absoluteUrl('user/verify-email?token=' + token);
  };

  Accounts.urls.enrollAccount = function (token) {
    return Meteor.absoluteUrl('user/enroll?token=' + token);
  };

  Meteor.startup(() => {
    // TODO Don't forget to set the mailing url
    // process.env.MAIL_URL = Meteor.settings.mailUrl

    /**
     * Accounts e-mail templates
     */
    Accounts.emailTemplates.siteName = 'Socialize-starter';
    Accounts.emailTemplates.from = 'Socialize-starter no-reply <no-reply@socialize.net>';

    // Account enrollment
    Accounts.emailTemplates.enrollAccount = {
      subject(user) {
        return 'Welcome to Socialize-starter, ' + user.username;
      },
      text(user, url) {
        return 'Hello ' + user.username + '\n\n' +
          'You have been selected to participate in building a better future!' +
          ' To activate your account, simply click the link below:\n\n' +
          url;
      },
    };

    // Reset password
    Accounts.emailTemplates.resetPassword = {
      subject() {
        return 'Socialize-starter reset password';
      },
      text(user, url) {
        return 'Hello ' + user.username + '!\n\n' +
        'We have recieved a request to reset your password for your account.' +
        'Please follow the link bellow to reset your password:\n\n' +
        url;
      },
    };

    // Verifying email
    Accounts.emailTemplates.verifyEmail = {
      subject() {
        return 'Socialize-starter e-mail verification';
      },
      text(user, url) {
        return 'Hello ' + user.username + '!\n\n' +
        'Please verify your e-mail address by clicking on the link bellow:\n\n' +
        url;
      },
    };
  });
}

redpajama_set_name: RedPajamaGithub


text:
.class public final Landroid/app/Notification$WearableExtender;
.super Ljava/lang/Object;
.source "Notification.java"

# interfaces
.implements Landroid/app/Notification$Extender;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/app/Notification;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "WearableExtender"
.end annotation

# static fields
.field private static final DEFAULT_CONTENT_ICON_GRAVITY:I = 0x800005

.field private static final DEFAULT_FLAGS:I = 0x1

.field private static final DEFAULT_GRAVITY:I = 0x50

.field private static final EXTRA_WEARABLE_EXTENSIONS:Ljava/lang/String; = "android.wearable.EXTENSIONS"

.field private static final FLAG_CONTENT_INTENT_AVAILABLE_OFFLINE:I = 0x1

.field private static final FLAG_HINT_AVOID_BACKGROUND_CLIPPING:I = 0x10

.field private static final FLAG_HINT_HIDE_ICON:I = 0x2

.field private static final FLAG_HINT_SHOW_BACKGROUND_ONLY:I = 0x4

.field private static final FLAG_START_SCROLL_BOTTOM:I = 0x8

.field private static final KEY_ACTIONS:Ljava/lang/String; = "actions"

.field private static final KEY_BACKGROUND:Ljava/lang/String; = "background"

.field private static final KEY_CONTENT_ACTION_INDEX:Ljava/lang/String; = "contentActionIndex"

.field private static final KEY_CONTENT_ICON:Ljava/lang/String; = "contentIcon"

.field private static final KEY_CONTENT_ICON_GRAVITY:Ljava/lang/String; = "contentIconGravity"

.field private static final KEY_CUSTOM_CONTENT_HEIGHT:Ljava/lang/String; = "customContentHeight"

.field private static final KEY_CUSTOM_SIZE_PRESET:Ljava/lang/String; = "customSizePreset"

.field private static final KEY_DISPLAY_INTENT:Ljava/lang/String; = "displayIntent"

.field private static final KEY_FLAGS:Ljava/lang/String; = "flags"

.field private static final KEY_GRAVITY:Ljava/lang/String; = "gravity"

.field private static final KEY_HINT_SCREEN_TIMEOUT:Ljava/lang/String; = "hintScreenTimeout"

.field private static final KEY_PAGES:Ljava/lang/String; = "pages"

.field public static final SCREEN_TIMEOUT_LONG:I = -0x1

.field public static final SCREEN_TIMEOUT_SHORT:I = 0x0

.field public static final SIZE_DEFAULT:I = 0x0

.field public static final SIZE_FULL_SCREEN:I = 0x5

.field public static final SIZE_LARGE:I = 0x4

.field public static final SIZE_MEDIUM:I = 0x3

.field public static final SIZE_SMALL:I = 0x2

.field public static final SIZE_XSMALL:I = 0x1

.field public static final UNSET_ACTION_INDEX:I = -0x1

# instance fields
.field private mActions:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Landroid/app/Notification$Action;",
            ">;"
        }
    .end annotation
.end field

.field private mBackground:Landroid/graphics/Bitmap;

.field private mContentActionIndex:I

.field private mContentIcon:I

.field private mContentIconGravity:I

.field private mCustomContentHeight:I

.field private mCustomSizePreset:I

.field private mDisplayIntent:Landroid/app/PendingIntent;

.field private mFlags:I

.field private mGravity:I

.field private mHintScreenTimeout:I

.field private mPages:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Landroid/app/Notification;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method public constructor <init>()V
    .registers 2

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

    .line 4698
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    .line 4699
    const/4 v0, 0x1

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    .line 4701
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    .line 4704
    const v0, 0x800005

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    .line 4705
    const/4 v0, -0x1

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 4706
    const/4 v0, 0x0

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    .line 4708
    const/16 v0, 0x50

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    .line 4715
    return-void
.end method

.method public constructor <init>(Landroid/app/Notification;)V
    .registers 11
    .param p1, "notif"    # Landroid/app/Notification;

    .prologue
    const/16 v8, 0x50

    const/4 v7, 0x1

    const/4 v6, 0x0

    const/4 v5, -0x1

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

    .line 4698
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    iput-object v3, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    .line 4699
    iput v7, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    .line 4701
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    iput-object v3, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    .line 4704
    const v3, 0x800005

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    .line 4705
    iput v5, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 4706
    iput v6, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    .line 4708
    iput v8, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    .line 4719
    iget-object v3, p1, Landroid/app/Notification;->extras:Landroid/os/Bundle;

    const-string/jumbo v4, "android.wearable.EXTENSIONS"

    invoke-virtual {v3, v4}, Landroid/os/Bundle;->getBundle(Ljava/lang/String;)Landroid/os/Bundle;

    move-result-object v2

    .line 4720
    .local v2, "wearableBundle":Landroid/os/Bundle;
    if-eqz v2, :cond_ab

    .line 4721
    const-string/jumbo v3, "actions"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getParcelableArrayList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v0

    .line 4722
    .local v0, "actions":Ljava/util/List;, "Ljava/util/List<Landroid/app/Notification$Action;>;"
    if-eqz v0, :cond_3c

    .line 4723
    iget-object v3, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 4726
    :cond_3c
    const-string/jumbo v3, "flags"

    invoke-virtual {v2, v3, v7}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    .line 4727
    const-string/jumbo v3, "displayIntent"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v3

    check-cast v3, Landroid/app/PendingIntent;

    iput-object v3, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    .line 4730
    const-string/jumbo v3, "pages"

    .line 4729
    invoke-static {v2, v3}, Landroid/app/Notification;->-wrap0(Landroid/os/Bundle;Ljava/lang/String;)[Landroid/app/Notification;

    move-result-object v1

    .line 4731
    .local v1, "pages":[Landroid/app/Notification;
    if-eqz v1, :cond_5e

    .line 4732
    iget-object v3, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-static {v3, v1}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z

    .line 4735
    :cond_5e
    const-string/jumbo v3, "background"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v3

    check-cast v3, Landroid/graphics/Bitmap;

    iput-object v3, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    .line 4736
    const-string/jumbo v3, "contentIcon"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    .line 4737
    const-string/jumbo v3, "contentIconGravity"

    .line 4738
    const v4, 0x800005

    .line 4737
    invoke-virtual {v2, v3, v4}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    .line 4739
    const-string/jumbo v3, "contentActionIndex"

    invoke-virtual {v2, v3, v5}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 4741
    const-string/jumbo v3, "customSizePreset"

    invoke-virtual {v2, v3, v6}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    .line 4743
    const-string/jumbo v3, "customContentHeight"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    .line 4744
    const-string/jumbo v3, "gravity"

    invoke-virtual {v2, v3, v8}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    .line 4745
    const-string/jumbo v3, "hintScreenTimeout"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    .line 4718
    .end local v0    # "actions":Ljava/util/List;, "Ljava/util/List<Landroid/app/Notification$Action;>;"
    .end local v1    # "pages":[Landroid/app/Notification;
    :cond_ab
    return-void
.end method

.method private setFlag(IZ)V
    .registers 5
    .param p1, "mask"    # I
    .param p2, "value"    # Z

    .prologue
    .line 5258
    if-eqz p2, :cond_8

    .line 5259
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    or-int/2addr v0, p1

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    .line 5257
    :goto_7
    return-void

    .line 5261
    :cond_8
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    not-int v1, p1

    and-int/2addr v0, v1

    iput v0, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    goto :goto_7
.end method

# virtual methods
.method public addAction(Landroid/app/Notification$Action;)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "action"    # Landroid/app/Notification$Action;

    .prologue
    .line 4832
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 4833
    return-object p0
.end method

.method public addActions(Ljava/util/List;)Landroid/app/Notification$WearableExtender;
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Landroid/app/Notification$Action;",
            ">;)",
            "Landroid/app/Notification$WearableExtender;"
        }
    .end annotation

    .prologue
    .line 4849
    .local p1, "actions":Ljava/util/List;, "Ljava/util/List<Landroid/app/Notification$Action;>;"
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 4850
    return-object p0
.end method

.method public addPage(Landroid/app/Notification;)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "page"    # Landroid/app/Notification;

    .prologue
    .line 4924
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 4925
    return-object p0
.end method

.method public addPages(Ljava/util/List;)Landroid/app/Notification$WearableExtender;
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Landroid/app/Notification;",
            ">;)",
            "Landroid/app/Notification$WearableExtender;"
        }
    .end annotation

    .prologue
    .line 4939
    .local p1, "pages":Ljava/util/List;, "Ljava/util/List<Landroid/app/Notification;>;"
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 4940
    return-object p0
.end method

.method public clearActions()Landroid/app/Notification$WearableExtender;
    .registers 2

    .prologue
    .line 4859
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 4860
    return-object p0
.end method

.method public clearPages()Landroid/app/Notification$WearableExtender;
    .registers 2

    .prologue
    .line 4949
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 4950
    return-object p0
.end method

.method public clone()Landroid/app/Notification$WearableExtender;
    .registers 4

    .prologue
    .line 4803
    new-instance v0, Landroid/app/Notification$WearableExtender;

    invoke-direct {v0}, Landroid/app/Notification$WearableExtender;-><init>()V

    .line 4804
    .local v0, "that":Landroid/app/Notification$WearableExtender;
    new-instance v1, Ljava/util/ArrayList;

    iget-object v2, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v1, v0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    .line 4805
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mFlags:I

    .line 4806
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    iput-object v1, v0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    .line 4807
    new-instance v1, Ljava/util/ArrayList;

    iget-object v2, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v1, v0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    .line 4808
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    iput-object v1, v0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    .line 4809
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    .line 4810
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    .line 4811
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 4812
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    .line 4813
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    .line 4814
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mGravity:I

    .line 4815
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    iput v1, v0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    .line 4816
    return-object v0
.end method

.method public bridge synthetic clone()Ljava/lang/Object;
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/CloneNotSupportedException;
        }
    .end annotation

    .prologue
    .line 4802
    invoke-virtual {p0}, Landroid/app/Notification$WearableExtender;->clone()Landroid/app/Notification$WearableExtender;

    move-result-object v0

    return-object v0
.end method

.method public extend(Landroid/app/Notification$Builder;)Landroid/app/Notification$Builder;
    .registers 6
    .param p1, "builder"    # Landroid/app/Notification$Builder;

    .prologue
    .line 4756
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 4758
    .local v0, "wearableBundle":Landroid/os/Bundle;
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_15

    .line 4759
    const-string/jumbo v1, "actions"

    iget-object v2, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putParcelableArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V

    .line 4761
    :cond_15
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    const/4 v2, 0x1

    if-eq v1, v2, :cond_22

    .line 4762
    const-string/jumbo v1, "flags"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4764
    :cond_22
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    if-eqz v1, :cond_2e

    .line 4765
    const-string/jumbo v1, "displayIntent"

    iget-object v2, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 4767
    :cond_2e
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_4c

    .line 4768
    const-string/jumbo v2, "pages"

    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    .line 4769
    iget-object v3, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    new-array v3, v3, [Landroid/app/Notification;

    .line 4768
    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v1

    check-cast v1, [Landroid/os/Parcelable;

    invoke-virtual {v0, v2, v1}, Landroid/os/Bundle;->putParcelableArray(Ljava/lang/String;[Landroid/os/Parcelable;)V

    .line 4771
    :cond_4c
    iget-object v1, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_58

    .line 4772
    const-string/jumbo v1, "background"

    iget-object v2, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 4774
    :cond_58
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    if-eqz v1, :cond_64

    .line 4775
    const-string/jumbo v1, "contentIcon"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4777
    :cond_64
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    const v2, 0x800005

    if-eq v1, v2, :cond_73

    .line 4778
    const-string/jumbo v1, "contentIconGravity"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4780
    :cond_73
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    const/4 v2, -0x1

    if-eq v1, v2, :cond_80

    .line 4781
    const-string/jumbo v1, "contentActionIndex"

    .line 4782
    iget v2, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 4781
    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4784
    :cond_80
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    if-eqz v1, :cond_8c

    .line 4785
    const-string/jumbo v1, "customSizePreset"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4787
    :cond_8c
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    if-eqz v1, :cond_98

    .line 4788
    const-string/jumbo v1, "customContentHeight"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4790
    :cond_98
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    const/16 v2, 0x50

    if-eq v1, v2, :cond_a6

    .line 4791
    const-string/jumbo v1, "gravity"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4793
    :cond_a6
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    if-eqz v1, :cond_b2

    .line 4794
    const-string/jumbo v1, "hintScreenTimeout"

    iget v2, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 4797
    :cond_b2
    invoke-virtual {p1}, Landroid/app/Notification$Builder;->getExtras()Landroid/os/Bundle;

    move-result-object v1

    const-string/jumbo v2, "android.wearable.EXTENSIONS"

    invoke-virtual {v1, v2, v0}, Landroid/os/Bundle;->putBundle(Ljava/lang/String;Landroid/os/Bundle;)V

    .line 4798
    return-object p1
.end method

.method public getActions()Ljava/util/List;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Landroid/app/Notification$Action;",
            ">;"
        }
    .end annotation

    .prologue
    .line 4867
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mActions:Ljava/util/ArrayList;

    return-object v0
.end method

.method public getBackground()Landroid/graphics/Bitmap;
    .registers 2

    .prologue
    .line 4987
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method public getContentAction()I
    .registers 2

    .prologue
    .line 5060
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    return v0
.end method

.method public getContentIcon()I
    .registers 2

    .prologue
    .line 5002
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    return v0
.end method

.method public getContentIconGravity()I
    .registers 2

    .prologue
    .line 5023
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    return v0
.end method

.method public getContentIntentAvailableOffline()Z
    .registers 3

    .prologue
    const/4 v0, 0x0

    .line 5170
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    and-int/lit8 v1, v1, 0x1

    if-eqz v1, :cond_8

    const/4 v0, 0x1

    :cond_8
    return v0
.end method

.method public getCustomContentHeight()I
    .registers 2

    .prologue
    .line 5129
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    return v0
.end method

.method public getCustomSizePreset()I
    .registers 2

    .prologue
    .line 5107
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    return v0
.end method

.method public getDisplayIntent()Landroid/app/PendingIntent;
    .registers 2

    .prologue
    .line 4910
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    return-object v0
.end method

.method public getGravity()I
    .registers 2

    .prologue
    .line 5081
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    return v0
.end method

.method public getHintAvoidBackgroundClipping()Z
    .registers 3

    .prologue
    const/4 v0, 0x0

    .line 5232
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    and-int/lit8 v1, v1, 0x10

    if-eqz v1, :cond_8

    const/4 v0, 0x1

    :cond_8
    return v0
.end method

.method public getHintHideIcon()Z
    .registers 3

    .prologue
    const/4 v0, 0x0

    .line 5189
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    and-int/lit8 v1, v1, 0x2

    if-eqz v1, :cond_8

    const/4 v0, 0x1

    :cond_8
    return v0
.end method

.method public getHintScreenTimeout()I
    .registers 2

    .prologue
    .line 5254
    iget v0, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    return v0
.end method

.method public getHintShowBackgroundOnly()Z
    .registers 3

    .prologue
    const/4 v0, 0x0

    .line 5208
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    and-int/lit8 v1, v1, 0x4

    if-eqz v1, :cond_8

    const/4 v0, 0x1

    :cond_8
    return v0
.end method

.method public getPages()Ljava/util/List;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Landroid/app/Notification;",
            ">;"
        }
    .end annotation

    .prologue
    .line 4961
    iget-object v0, p0, Landroid/app/Notification$WearableExtender;->mPages:Ljava/util/ArrayList;

    return-object v0
.end method

.method public getStartScrollBottom()Z
    .registers 3

    .prologue
    const/4 v0, 0x0

    .line 5148
    iget v1, p0, Landroid/app/Notification$WearableExtender;->mFlags:I

    and-int/lit8 v1, v1, 0x8

    if-eqz v1, :cond_8

    const/4 v0, 0x1

    :cond_8
    return v0
.end method

.method public setBackground(Landroid/graphics/Bitmap;)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "background"    # Landroid/graphics/Bitmap;

    .prologue
    .line 4974
    iput-object p1, p0, Landroid/app/Notification$WearableExtender;->mBackground:Landroid/graphics/Bitmap;

    .line 4975
    return-object p0
.end method

.method public setContentAction(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "actionIndex"    # I

    .prologue
    .line 5041
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mContentActionIndex:I

    .line 5042
    return-object p0
.end method

.method public setContentIcon(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "icon"    # I

    .prologue
    .line 4994
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mContentIcon:I

    .line 4995
    return-object p0
.end method

.method public setContentIconGravity(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "contentIconGravity"    # I

    .prologue
    .line 5012
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mContentIconGravity:I

    .line 5013
    return-object p0
.end method

.method public setContentIntentAvailableOffline(Z)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "contentIntentAvailableOffline"    # Z

    .prologue
    .line 5159
    const/4 v0, 0x1

    invoke-direct {p0, v0, p1}, Landroid/app/Notification$WearableExtender;->setFlag(IZ)V

    .line 5160
    return-object p0
.end method

.method public setCustomContentHeight(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "height"    # I

    .prologue
    .line 5118
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mCustomContentHeight:I

    .line 5119
    return-object p0
.end method

.method public setCustomSizePreset(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "sizePreset"    # I

    .prologue
    .line 5094
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mCustomSizePreset:I

    .line 5095
    return-object p0
.end method

.method public setDisplayIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "intent"    # Landroid/app/PendingIntent;

    .prologue
    .line 4901
    iput-object p1, p0, Landroid/app/Notification$WearableExtender;->mDisplayIntent:Landroid/app/PendingIntent;

    .line 4902
    return-object p0
.end method

.method public setGravity(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "gravity"    # I

    .prologue
    .line 5070
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mGravity:I

    .line 5071
    return-object p0
.end method

.method public setHintAvoidBackgroundClipping(Z)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "hintAvoidBackgroundClipping"    # Z

    .prologue
    .line 5220
    const/16 v0, 0x10

    invoke-direct {p0, v0, p1}, Landroid/app/Notification$WearableExtender;->setFlag(IZ)V

    .line 5221
    return-object p0
.end method

.method public setHintHideIcon(Z)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "hintHideIcon"    # Z

    .prologue
    .line 5179
    const/4 v0, 0x2

    invoke-direct {p0, v0, p1}, Landroid/app/Notification$WearableExtender;->setFlag(IZ)V

    .line 5180
    return-object p0
.end method

.method public setHintScreenTimeout(I)Landroid/app/Notification$WearableExtender;
    .registers 2
    .param p1, "timeout"    # I

    .prologue
    .line 5243
    iput p1, p0, Landroid/app/Notification$WearableExtender;->mHintScreenTimeout:I

    .line 5244
    return-object p0
.end method

.method public setHintShowBackgroundOnly(Z)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "hintShowBackgroundOnly"    # Z

    .prologue
    .line 5198
    const/4 v0, 0x4

    invoke-direct {p0, v0, p1}, Landroid/app/Notification$WearableExtender;->setFlag(IZ)V

    .line 5199
    return-object p0
.end method

.method public setStartScrollBottom(Z)Landroid/app/Notification$WearableExtender;
    .registers 3
    .param p1, "startScrollBottom"    # Z

    .prologue
    .line 5138
    const/16 v0, 0x8

    invoke-direct {p0, v0, p1}, Landroid/app/Notification$WearableExtender;->setFlag(IZ)V

    .line 5139
    return-object p0
.end method


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="ClearableEditText">
        <attr name="android:inputType"/>
        <attr name="android:hint"/>
        <attr name="android:enabled"/>
    </declare-styleable>
</resources>


text:
<?php

/**
 * Interface for adapters to various HTTP client libraries and classes.
 *
 * @package    Doctrine\OrientDB
 * @subpackage Binding
 * @author     Daniele Alessandri <suppakilla@gmail.com>
 */

namespace Doctrine\OrientDB\Binding\Adapter;

use Doctrine\OrientDB\Binding\HttpBindingResultInterface;

interface HttpClientAdapterInterface
{
    /**
     * Performs an HTTP request on the specified location.
     *
     * @param   string $method
     * @param   string $location
     * @param   array  $headers
     * @param   string $body
     *
     * @return  HttpBindingResultInterface
     */
    public function request($method, $location, array $headers = null, $body = null);

    /**
     * Sets the username and password used to authenticate to the server.
     *
     * @param string $username Username
     * @param string $password Password
     */
    public function setAuthentication($username, $password);

    /**
     * Returns the underlying client instance wrapped by the adapter.
     *
     * @return mixed
     */
    public function getClient();
}


text:
/**
 * Created by Papa on 8/31/2016.
 */
export declare class DDLManager {
    getCreateTableDDL(entityName: string, ifExistsSupported: string): string;
    warn(message: string): void;
}


text:
#include <cmath>
#include <algorithm>
#include "../ModernAPI/RMSExceptions.h"
#include "../Common/tools.h"
#include "../Common/FrameworkSpecificTypes.h"
#include "../Platform/Json/IJsonObject.h"
#include "../Platform/Json/IJsonArray.h"
#include "../Platform/Json/IJsonParser.h"
#include "jsonserializer.h"

using namespace std;
using namespace rmscore::platform::json;
using namespace rmscore::common;
using namespace rmscore::restclients;

namespace rmscore {
namespace json {
ByteArray JsonSerializer::SerializeUsageRestrictionsRequest(
  const UsageRestrictionsRequest& request)
{
  // convert the PL to base64 encoded string
  ByteArray base64PL(ConvertBytesToBase64(request.pbPublishLicense,
                                          request.cbPublishLicense));

  auto pJsonObject = IJsonObject::Create();

  pJsonObject->SetNamedValue("SerializedPublishingLicense", base64PL);

  return pJsonObject->Stringify();
}

common::ByteArray JsonSerializer::SerializePublishUsingTemplateRequest(
  const PublishUsingTemplateRequest& request)
{
  auto pJson = IJsonObject::Create();

  pJson->SetNamedBool("PreferDeprecatedAlgorithms",
                      request.bPreferDeprecatedAlgorithms);
  pJson->SetNamedBool("AllowAuditedExtraction",
                      request.bAllowAuditedExtraction);
  pJson->SetNamedString("TemplateId", request.templateId);

  if (!request.signedApplicationData.empty())
  {
    auto pSignedApplicationDataJson = IJsonObject::Create();

    for_each(
      begin(request.signedApplicationData),
      end(request.signedApplicationData),
      [ = ](const pair<string, string>& appData)
        {
          // pSignedApplicationDataJson->SetNamedString(appData.name,
          // appData.value);
          pSignedApplicationDataJson->SetNamedString(appData.first,
                                                     appData.second);
        });

    pJson->SetNamedObject("SignedApplicationData", *pSignedApplicationDataJson);
  }

  return pJson->Stringify();
}

common::ByteArray JsonSerializer::SerializePublishCustomRequest(
  const PublishCustomRequest& request)
{
  auto pJson = IJsonObject::Create();

  // Request
  // {
  //	"PreferDeprecatedAlgorithms": ...,
  //	"AllowAuditedExtraction": ...,
  //	"ReferralInfo":...,
  //	"SignedApplicationData": {
  //          "SignedAppDataName1": "EncryptedAppDataValue1"
  //          "SignedAppDataName2": "EncryptedAppDataValue2"
  //          ...
  //      },
  //    "Policy" : {
  //          "Descriptors": [{
  //              "Name": "Protected by Microsoft AADRM service",
  //              "Description" : "This email is protected with Microsoft AADRM
  // service. Your actions may be audited",
  //              "Language" : "en-us"
  //            }],
  //	      ...
  //      }
  // }

  pJson->SetNamedBool("PreferDeprecatedAlgorithms",
                      request.bPreferDeprecatedAlgorithms);
  pJson->SetNamedBool("AllowAuditedExtraction",
                      request.bAllowAuditedExtraction);

  // Add ReferralInfo only when referrer is set
  if (request.wsReferralInfo.length() > 0)
  {
    pJson->SetNamedString("ReferralInfo", request.wsReferralInfo);
  }

  if (!request.signedApplicationData.empty())
  {
    auto pSignedApplicationDataJson = IJsonObject::Create();

    for_each(
      begin(request.signedApplicationData),
      end(request.signedApplicationData),
      [ = ](const pair<string, string>& appData)
        {
          pSignedApplicationDataJson->SetNamedString(appData.first,
                                                     appData.second);
        });

    pJson->SetNamedObject("SignedApplicationData", *pSignedApplicationDataJson);
  }

  auto pPolicyJson = IJsonObject::Create();

  // Add Descriptors
  if (!request.name.empty() &&
      !request.description.empty() &&
      !request.language.empty()) {
    auto pDescriptorObjectArray = IJsonArray::Create();
    auto pDescriptorObject      = IJsonObject::Create();
    pDescriptorObject->SetNamedString("Name",        request.name);
    pDescriptorObject->SetNamedString("Description", request.description);
    pDescriptorObject->SetNamedString("Language",    request.language);
    pDescriptorObjectArray->Append(*pDescriptorObject);
    pPolicyJson->SetNamedArray("Descriptors", *pDescriptorObjectArray);
  }

  // the user rights list json in the policy looks something like this:
  // "Policy": {
  //      ...
  //      "UserRights": [
  //          {
  //              "Users": [user11, user12, ...]
  //              "Rights": [right11, right12, ...]
  //          },
  //          {
  //              "Users": [user21, user22, ...]
  //              "Rights": [right21, right22, ...]
  //          },
  //          ...
  //      ],
  //      "UserRoles":[
  //          {
  //              "Users": [user1, user2, ...],
  //              "Roles": [role1, role2, ...]
  //          },
  //          ...
  //      ],
  //      ...
  // }

  AddUserRightsOrRolesInCustomRequest(pPolicyJson.get(), request);

  pPolicyJson->SetNamedBool("allowOfflineAccess", request.bAllowOfflineAccess);

  // old version support
  pPolicyJson->SetNamedNumber("IntervalTimeInDays",
                              request.bAllowOfflineAccess ? 30 : 0);

  if (std::chrono::system_clock::to_time_t(request.ftLicenseValidUntil) > 0)
  {
    common::DateTime dt = common::DateTime::fromTime_t(
      std::chrono::system_clock::to_time_t(request.ftLicenseValidUntil));
        pPolicyJson->SetNamedString("LicenseValidUntil", dt.toUTC().toString(
                                  Qt::ISODate).toStdString());
  }

  // the appdata should look like this:
  // "Policy": {
  //      ...
  //      "EncryptedApplicationData": {
  //          "EncryptedAppDataName1": "EncryptedAppDataValue1"
  //          "EncryptedAppDataName2": "EncryptedAppDataValue2"
  //          ...
  //      },
  //      ...
  // }

  if (!request.encryptedApplicationData.empty())
  {
    auto pEncryptedApplicationDataJson = IJsonObject::Create();

    for_each(
      begin(request.encryptedApplicationData),
      end(request.encryptedApplicationData),
      [ = ](const pair<string, string>appData)
        {
          pEncryptedApplicationDataJson->SetNamedString(appData.first.
                                                        c_str(),
                                                        appData.second.
                                                        c_str());
        });

    pPolicyJson->SetNamedObject("EncryptedApplicationData",
                                *pEncryptedApplicationDataJson);
  }

  pJson->SetNamedObject("Policy", *pPolicyJson);
  return pJson->Stringify();
}

void JsonSerializer::AddUserRightsOrRolesInCustomRequest(
  IJsonObject                *pPolicyJson,
  const PublishCustomRequest& request)
{
  auto userName     = "Users";
  auto UserProperty = request.userRightsList.size() !=
                      0 ? "Rights" : "Roles";
  auto jsonArrayName = request.userRightsList.size() !=
                       0 ? "UserRights" : "UserRoles";
  auto pUserRightsOrRolesListJson = IJsonArray::Create();

  if (request.userRightsList.size() != 0)
  {
    for_each(
      begin(request.userRightsList),
      end(request.userRightsList),
      [ = ](const UserRightsRequest& userRights)
        {
          auto pUsersJson = IJsonArray::Create();

          for_each(
            begin(userRights.users),
            end(userRights.users),
            [ = ](const string& user)
          {
            pUsersJson->Append(user);
          });

          auto pRightsJson = IJsonArray::Create();

          for_each(
            begin(userRights.rights),
            end(userRights.rights),
            [ = ](const string& right)
          {
            pRightsJson->Append(right);
          });

          auto pUserRightsJson = IJsonObject::Create();

          pUserRightsJson->SetNamedArray(userName,     *pUsersJson);
          pUserRightsJson->SetNamedArray(UserProperty, *pRightsJson);

          pUserRightsOrRolesListJson->Append(*pUserRightsJson);
        });
  }
  else
  {
    for_each(
      begin(request.userRolesList),
      end(request.userRolesList),
      [ = ](const UserRolesRequest& useroles)
        {
          auto pUsersJson = IJsonArray::Create();

          for_each(
            begin(useroles.users),
            end(useroles.users),
            [ = ](const string& user)
          {
            pUsersJson->Append(user);
          });

          auto pRolesJson = IJsonArray::Create();

          for_each(
            begin(useroles.roles),
            end(useroles.roles),
            [ = ](const string& role)
          {
            pRolesJson->Append(role);
          });

          auto pUserRolesJson = IJsonObject::Create();

          pUserRolesJson->SetNamedArray(userName,     *pUsersJson);
          pUserRolesJson->SetNamedArray(UserProperty, *pRolesJson);

          pUserRightsOrRolesListJson->Append(*pUserRolesJson);
        });
  }

  pPolicyJson->SetNamedArray(jsonArrayName, *pUserRightsOrRolesListJson);
}

UsageRestrictionsResponse JsonSerializer::DeserializeUsageRestrictionsResponse(
  common::ByteArray& sResponse)
{
  shared_ptr<IJsonParser> pJsonParser = IJsonParser::Create();

  // parse the JSON
  shared_ptr<IJsonObject> pJsonResponse = pJsonParser->Parse(sResponse);

  UsageRestrictionsResponse response;

  if (pJsonResponse == nullptr) return response;

  response.accessStatus = pJsonResponse->GetNamedString("AccessStatus");
  response.id           = pJsonResponse->GetNamedString("Id");
  response.name         = pJsonResponse->GetNamedString("Name");
  response.description  = pJsonResponse->GetNamedString("Description");
  response.referrer     =
    ProcessReferrerResponse(pJsonResponse->GetNamedString("Referrer"));
  response.owner     = pJsonResponse->GetNamedString("Owner");
  response.issuedTo  = pJsonResponse->GetNamedString("IssuedTo");
  response.contentId = pJsonResponse->GetNamedString("ContentId");

  // Key
  if (pJsonResponse->HasName("Key") && !pJsonResponse->IsNull("Key"))
  {
    shared_ptr<IJsonObject> pJsonKey = pJsonResponse->GetNamedObject("Key");
    response.key.algorithm  = pJsonKey->GetNamedString("Algorithm");
    response.key.cipherMode = pJsonKey->GetNamedString("CipherMode");
    response.key.value      = pJsonKey->GetNamedValue("Value");

    // BUG 101481: There is a bug in PROD where the AccessStatus field is
    // missing. When the fix reaches production, the below
    // statement should be removed.
    if (response.accessStatus.empty())
    {
      response.accessStatus = "AccessGranted";
    }
  }
  else
  {
    // BUG 101481: There is a bug in PROD where the AccessStatus field is
    // missing. When the fix reaches production, the below
    // statement should be removed.
    if (response.accessStatus.empty())
    {
      response.accessStatus = "AccessDenied";
    }
  }

  // Rights
  response.rights = pJsonResponse->GetNamedStringArray("Rights");

  if (pJsonResponse->HasName("Roles") && !pJsonResponse->IsNull("Roles"))
  {
    response.roles = pJsonResponse->GetNamedStringArray("Roles");
  }

  // expiry times
  response.contentValidUntil = pJsonResponse->GetNamedString("ContentValidUntil");
  response.licenseValidUntil = pJsonResponse->GetNamedString("LicenseValidUntil");

  response.bFromTemplate = pJsonResponse->GetNamedBool("FromTemplate");

  // parse expiry times
  if (!response.contentValidUntil.empty())
  {
    // add Z at end - because Content Valid in UTC
    if(response.contentValidUntil.end()[-1] != 'Z') {
        response.contentValidUntil += 'Z';
    }
    auto tmp = common::DateTime::fromString(
      QString::fromStdString(response.contentValidUntil), Qt::ISODate);
    response.ftContentValidUntil = std::chrono::system_clock::from_time_t(
      tmp.toLocalTime().toTime_t());
  }
  else
  {
    response.ftContentValidUntil = std::chrono::system_clock::from_time_t(0);
  }

  if (!response.licenseValidUntil.empty())
  {
    auto tmp =
      common::DateTime::fromString(
        QString::fromStdString(response.licenseValidUntil), Qt::ISODate);
    response.ftLicenseValidUntil = std::chrono::system_clock::from_time_t(
      tmp.toLocalTime().toTime_t());
  }
  else
  {
    response.ftLicenseValidUntil = std::chrono::system_clock::from_time_t(0);
  }

  if (pJsonResponse->HasName("allowOfflineAccess")) {
    response.bAllowOfflineAccess = pJsonResponse->GetNamedBool(
      "allowOfflineAccess", true);
  } else {
    // true by default
    response.bAllowOfflineAccess = true;
  }

  // custom policy response
  if (pJsonResponse->HasName("Policy") && !pJsonResponse->IsNull("Policy"))
  {
    auto pJsonPolicy = pJsonResponse->GetNamedObject("Policy");

    auto intervalTime =
      static_cast<int>(round(pJsonPolicy->GetNamedNumber("IntervalTimeInDays",
                                                         -1.0)));

    if (intervalTime <= 0) response.bAllowOfflineAccess = false;

    response.customPolicy.bAllowAuditedExtraction = pJsonPolicy->GetNamedBool(
      "AllowAuditedExtraction",
      false);

    // UserRights looks something like this
    // "UserRights": [
    //      {"Users": ["user11", "user12", ...], "Rights": ["right11",
    // "right12"], ... }
    //      {"Users": ["user21", "user22", ...], "Rights": ["right21",
    // "right22"], ... }
    //      ...
    // ]
    auto pJsonUserRightsList = pJsonPolicy->GetNamedArray("UserRights");

    for (unsigned iUserRights = 0; iUserRights < pJsonUserRightsList->Size();
         ++iUserRights)
    {
      auto pJsonUserRights = pJsonUserRightsList->GetObjectAt(iUserRights);

      UserRightsResponse userRights;
      userRights.users  = pJsonUserRights->GetNamedStringArray("Users");
      userRights.rights = pJsonUserRights->GetNamedStringArray("Rights");

      response.customPolicy.userRightsList.emplace_back(move(userRights));
    }

    // if UserRoles are present add them too
    if (pJsonPolicy->HasName("UserRoles") && !pJsonPolicy->IsNull("UserRoles"))
    {
      auto pJsonUserRolesList = pJsonPolicy->GetNamedArray("UserRoles");

      for (unsigned iUserRoles = 0; iUserRoles < pJsonUserRolesList->Size();
           ++iUserRoles)
      {
        auto pJsonUserRoles = pJsonUserRolesList->GetObjectAt(iUserRoles);

        UserRolesResponse userRoles;
        userRoles.users = pJsonUserRoles->GetNamedStringArray("Users");
        userRoles.roles = pJsonUserRoles->GetNamedStringArray("Roles");

        response.customPolicy.userRolesList.emplace_back(move(userRoles));
      }
    }

    response.customPolicy.bIsNull = false;
  }
  else
  {
    response.customPolicy.bIsNull = true;
  }

  // signed application data
  if (pJsonResponse->HasName("SignedApplicationData") &&
      !pJsonResponse->IsNull("SignedApplicationData"))
  {
    auto pJsonSignedAppData = pJsonResponse->GetNamedObject(
      "SignedApplicationData");
    response.signedApplicationData = pJsonSignedAppData->ToStringDictionary();
  }

  // encrypted application data
  if (pJsonResponse->HasName("EncryptedApplicationData") &&
      !pJsonResponse->IsNull("EncryptedApplicationData"))
  {
    auto pJsonEncryptedAppData = pJsonResponse->GetNamedObject(
      "EncryptedApplicationData");
    response.encryptedApplicationData =
      pJsonEncryptedAppData->ToStringDictionary();
  }

  return response;
}

ServerErrorResponse JsonSerializer::DeserializeErrorResponse(
  ByteArray& sResponse)
{
  shared_ptr<IJsonParser> pJsonParser = IJsonParser::Create();

  // parse the JSON
  shared_ptr<IJsonObject> pJsonResponse = pJsonParser->Parse(sResponse);

  ServerErrorResponse response;

  // code
  if (pJsonResponse->HasName("Code") && !pJsonResponse->IsNull("Code"))
  {
    response.code = pJsonResponse->GetNamedString("Code");
  }

  // messsage
  if (pJsonResponse->HasName("Message") && !pJsonResponse->IsNull("Message"))
  {
    response.message = pJsonResponse->GetNamedString("Message");
  }

  return response;
}

TemplateListResponse JsonSerializer::DeserializeTemplateListResponse(
  ByteArray& sResponse)
{
  auto pJsonParser = IJsonParser::Create();

  // template list should be an array
  auto pJsonArray = pJsonParser->ParseArray(sResponse);

  TemplateListResponse response;

  for (uint32_t index = 0; index < pJsonArray->Size(); ++index)
  {
    auto pTemplateJson = pJsonArray->GetObjectAt(index);

    auto atemplate = TemplateResponse {
      pTemplateJson->GetNamedString("Id"),
      pTemplateJson->GetNamedString("Name"),
      pTemplateJson->GetNamedString("Description")
    };

    if (atemplate.id.empty())
    {
      throw exceptions::RMSInvalidArgumentException("empty atemplate.id");
    }

    if (atemplate.name.empty())
    {
      throw exceptions::RMSInvalidArgumentException("empty atemplate.name");
    }

    if (atemplate.description.empty())
    {
      throw exceptions::RMSInvalidArgumentException("empty atemplate.description");
    }

    response.templates.emplace_back(move(atemplate));
  }

  return response;
}

PublishResponse JsonSerializer::DeserializePublishResponse(ByteArray& sResponse)
{
  auto pJsonParser = IJsonParser::Create();

  // parse the JSON
  auto pJson = pJsonParser->Parse(sResponse);

  PublishResponse response;

  response.serializedLicense =
    ConvertBase64ToBytes(pJson->GetNamedValue("SerializedPublishingLicense"));
  response.id          = pJson->GetNamedString("Id");
  response.name        = pJson->GetNamedString("Name");
  response.description = pJson->GetNamedString("Description");
  response.referrer    = pJson->GetNamedString("Referrer");
  response.owner       = pJson->GetNamedString("Owner");
  response.contentId   = pJson->GetNamedString("ContentId");

  auto pJsonKey = pJson->GetNamedObject("Key");

  response.key.algorithm  = pJsonKey->GetNamedString("Algorithm");
  response.key.cipherMode = pJsonKey->GetNamedString("CipherMode");
  response.key.value      = pJsonKey->GetNamedValue("Value");

  // signed application data
  if (pJson->HasName("SignedApplicationData") &&
      !pJson->IsNull("SignedApplicationData"))
  {
    auto pJsonSignedAppData = pJson->GetNamedObject("SignedApplicationData");
    response.signedApplicationData = pJsonSignedAppData->ToStringDictionary();
  }

  // encrypted application data
  if (pJson->HasName("EncryptedApplicationData") &&
      !pJson->IsNull("EncryptedApplicationData"))
  {
    auto pJsonEncryptedAppData =
      pJson->GetNamedObject("EncryptedApplicationData");
    response.encryptedApplicationData =
      pJsonEncryptedAppData->ToStringDictionary();
  }

  if (response.serializedLicense.empty())
  {
    throw exceptions::RMSInvalidArgumentException(
            "empty response.serializedLicense");
  }

  if (response.owner.empty())
  {
    throw exceptions::RMSInvalidArgumentException("empty response.owner");
  }

  if (response.key.value.empty())
  {
    throw exceptions::RMSInvalidArgumentException("empty response.key.value");
  }

  if (response.key.algorithm.empty())
  {
    throw exceptions::RMSInvalidArgumentException("empty response.key.algorithm");
  }

  if (response.key.cipherMode.empty())
  {
    throw exceptions::RMSInvalidArgumentException("empty response.key.cipherMode");
  }
  return response;
}

ServiceDiscoveryListResponse JsonSerializer::DeserializeServiceDiscoveryResponse(
  ByteArray& sResponse)
{
  auto pJsonParser = IJsonParser::Create();

  // service discovery response should be an array
  auto pJsonArray = pJsonParser->ParseArray(sResponse);

  ServiceDiscoveryListResponse response;

  for (uint32_t index = 0; index < pJsonArray->Size(); ++index)
  {
    auto pTemplateJson = pJsonArray->GetObjectAt(index);

    auto endpoint = ServiceDiscoveryResponse {
      pTemplateJson->GetNamedString("Name"),
      pTemplateJson->GetNamedString("Uri")
    };

    if (endpoint.name.empty())
    {
      throw exceptions::RMSInvalidArgumentException("empty response.endpoint.name");
    }

    if (endpoint.uri.empty())
    {
      throw exceptions::RMSInvalidArgumentException("empty response.endpoint.uri");
    }

    response.serviceEndpoints.emplace_back(move(endpoint));
  }

  return response;
}

string JsonSerializer::ProcessReferrerResponse(const string&& referrerResponse)
{
  if (!referrerResponse.empty())
  {
    try
    {
      common::IUri::Create(referrerResponse);
      return move(referrerResponse);
    }
    catch (exceptions::RMSException)
    {
      string withMailTo = "mailto:" + referrerResponse;
      common::IUri::Create(withMailTo);
      return move(withMailTo);
    }
  }
  else
  {
    return referrerResponse;
  }
}

shared_ptr<IJsonSerializer>IJsonSerializer::Create()
{
  return make_shared<JsonSerializer>();
}
} // namespace json
} // namespace rmscore


text:
(function () {
    'use strict';
    angular.module('twentyfourtyeightapp', []);
})();


text:
namespace OctoFlow
{
    using OctoFlow;
    using Octokit;
    using System;
    using System.IO;
    using Xunit;
    using System.Linq;
    using System.Threading.Tasks;
    using System.Collections.Generic;

    public class ProcessFlowTest
    {
        static readonly Credentials credentials = new Credentials(File.ReadAllText(@"..\..\Token").Trim());

        IGitHubClient github;

        public ProcessFlowTest()
        {
            github = new GitHubClient(new ProductHeaderValue("kzu-client"))
            {
                Credentials = credentials
            };

            var repository = new ProcessRepository(
                github,
                new ProcessSettings("netfx", "LearnGit"));

            repository.Initialize();
            Repository = repository;
        }

        public IProcessRepository Repository { get; set; }

        [Fact]
        public async Task when_generating_flow_then_succeeds()
        {
            var type = ProcessType.QA;
			var flow = Repository.GetFlow(type);

            var generator = new FlowIssueGenerator(type, flow);

            var body = generator.Render();

            var issue = Repository.AllIssues.Values.FirstOrDefault(i => i.Issue.Title == "~" + type);
            if (issue != null)
            {
                var updated = await github.Issue.Update(
                    Repository.Settings.Repository.Owner,
                    Repository.Settings.Repository.Name,
                    issue.Issue.Number,
                    new IssueUpdate
                    {
                        Body = body
                    });

                Console.WriteLine("Updated issue #" + updated.Number);
            }
            else
            {
                var created = await github.Issue.Create(
                    Repository.Settings.Repository.Owner,
                    Repository.Settings.Repository.Name,
                    new NewIssue("~" + type)
                    {
                        Body = body
                    });

                Console.WriteLine("Created issue #" + created.Number);
            }

            Console.WriteLine(body);
        }
    }
}


text:
kitchensink-cordova: Example Mobile Applications Using Hybrid HTML5 + REST with Apache Cordova
===============================================================================================
Author: Kris Borchers
Level: Intermediate
Technologies: HTML5, REST, Apache Cordova
Summary: Based on kitchensink, but uses hybrid HTML5 running as a native application on mobiles
Target Product: WFK
Product Versions: EAP 6.1, EAP 6.2, WFK 2.4
Source: <https://github.com/jboss-developer/jboss-wfk-quickstarts/>

What is it?
-----------

This project serves as an example of the HTML5 [kitchensink](https://github.com/jboss-developer/jboss-wfk-quickstarts/tree/master/kitchensink-html5-mobile) quickstart converted to a hybrid [Apache Cordova](http://cordova.apache.org/) application.

What does this mean? Basically, this takes our [HTML5 + REST](https://community.jboss.org/wiki/HTML5RESTApplications) / [jQuery Mobile](http://jquerymobile.com/) web application and converts it to a native application for both iOS and Android.

Currently, these applications must be built separately, but in the future we hope to provide a single build step for all supported mobile OS types.

These concepts can be applied to the conversion of most HTML5/JS based web apps by just replacing the specific paths described in this article with paths that match your environment. If you have an existing Web Application based on HTML5 + REST, use the following guide to convert it to a hybrid application with Apache Cordova: [Converting a Mobile HTML5 + REST Web App to a Hybrid App with Apache Cordova](http://aerogear.org/docs/guides/HTML5ToHybridWithCordova/)

Available Hybrid Applications
-----------------------------

The following is a list of the currently available hybrid applications.
For more detailed information about a quickstart, click on the quickstart name.

Click on the link below to see instructions to see instructions for each OS type:

1. [Kitchensink Apache Cordova iOS](#kitchensink-apache-cordova-ios-example)
2. [Kitchensink Apache Cordova Android](#kitchensink-apache-cordova-android-example)

Kitchensink Apache Cordova iOS Example
-----------------------------------

### What is it?

This quickstart was built upon the HTML5 kitchensink quickstart, which was converted to a hybrid Apache Cordova application. Basically, this takes our HTML5 + REST / jQuery Mobile based web application and converts it to a native application for iOS.

### System requirements

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform (EAP) 6.1 or later with the Red Hat JBoss Web Framework Kit (WFK) 2.4.

All you need to build this project is Mac OS X Lion (10.7) (or later) and XCode 4.5 or later and the appropriate iOS SDK for your needs. If you need more detailed instruction to setup a iOS Development Environment with Apache Cordova, take a look at [Setting up your development environment to use Apache Cordova](http://aerogear.org/docs/guides/CordovaSetup/)

### Import the Quickstart Code

First you need to import the existing iOS code to XCode.

1. Open Finder and navigate to `QUICKSTART_HOME/kitchensink-cordova/ios/`. Be sure to replace `QUICKSTART_HOME` with the root directory of your quickstarts.
2. Right click on *KitchensinkCordova.xcodeproj* and select *Open With XCode*
3. Change the `Target` in the Scheme menu to KitchensinkCordova and select a device
4. Make sure that your `QUICKSTART_HOME/kitchensink-cordova/ios/www` is a symbolic link to `../shared/www`

### Run and Access the Application

If the toolbar in XCode is visible, click on the `Run` button. This will start the iOS Simulator with this quickstart running in it. If your toolbar is not visible, click `View -> Show Toolbar` to show it.

Kitchensink Apache Cordova Android Example
-----------------------------------

### What is it?

This application is built upon the HTML5 kitchensink quickstart, which was converted to an Apache Cordova based hybrid application. Basically, this takes our HTML5 + REST / jQuery Mobile based web application and converts it to a native application for Android.

### System requirements

All you need to build this project is Java 6.0 (Java SDK 1.6) or later, JBDS 5 or Eclipse with [Android Development Tools (ADT) Plugin for the Eclipse IDE](http://developer.android.com/tools/sdk/eclipse-adt.html). If you need more detailed instruction to setup a Android Development Environment with Apache Cordova, you can take a look at [Setting up your development environment to use Apache Cordova](http://aerogear.org/docs/guides/CordovaSetup/)

### Import the Quickstart Code

First we need to import the existing Android code to JBDS or Eclipse

1. In Eclipse, click on `File`, then `Import`.
2. Select `Existing Android Code Into Workspace` and click `Next`.
3. In `Root Directory`, click on the `Browse...` button, then find and select `QUICKSTART_HOME/kitchensink-cordova/android/`. Be sure to replace `QUICKSTART_HOME` with the root directory of your quickstarts.
4. Click the `Finish` button to start the project import.
5. Make sure that your `QUICKSTART_HOME/kitchensink-cordova/android/assets/www` is a symbolic link to `../shared/www`

### Troubleshooting Tips

#### Troubleshooting Fedora/Red Hat Enterprise Linux

If you receive an error _Unable to resolve target 'android-10'_, it means you don't have the Android API 10 (Android 2.3.3) installed.

To solve this you must:

1. Right-click the project in the left pane.
2. Select `Properties`
3. In Android options, select the appropriate Android API.

_NOTE: This sample was built for the Android 2.1 SDK for maximum compatibility with current devices but should work on any 2.x or 4.0 SDK. The sample was not tested on the 3.x series._

#### Troubleshooting Windows Operating Systems

As Windows doesn't support symbolic links you must copy `shared/www` folder to `QUICKSTART_HOME/kitchensink-cordova/android/assets/www`

### Start the Emulator and Deploy the application

1. To start the emulator in Eclipse, click on `Window` and select `AVD Manager`.
2. In the `Android Virtual Device Manager` window, select the appropriate AVD and click the `Start` button.
3. In the `Launch Options` window. click the `Launch` button.
4. When the Emulator starts, select your project on Eclipse.
5. Click on `Run`, then `Run As` and `Android Application`.

### Access the application

The application will be running on the Emulator.


text:
/* eslint-disable react/sort-comp */
/* @flow */

import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import type { Connector } from 'react-redux';

import * as action from './action';
import type { ArticlesLatestFetch as ArticlesLatestFetchType, Dispatch, Reducer } from '../../types';
import ArticlesLatest from '../../components/ArticlesLatest';
import Loading from '../../containers/Loading';
import styles from './styles.scss';

type Props = {
  articlesLatestFetch: ArticlesLatestFetchType,
  fetchArticlesIfNeeded: (indexLimit: string) => void,
};

// Export this for unit testing more easily
export class ArticlesLatestFetch extends PureComponent {
  props: Props;

  static defaultProps: {
    articlesLatestFetch: {
      readyStatus: 'ARTICLES_LATEST_INVALID',
      list: null,
    },
    fetchArticlesIfNeeded: () => {},
  };

  componentDidMount() {
    this.props.fetchArticlesIfNeeded(this.props.indexLimit);
  }

  renderArticlesLatest = () => {
    const { articlesLatestFetch } = this.props;

    if (!articlesLatestFetch.readyStatus || articlesLatestFetch.readyStatus === action.ARTICLES_LATEST_INVALID ||
      articlesLatestFetch.readyStatus === action.ARTICLES_LATEST_REQUESTING) {
      return <Loading />
    }

    if (articlesLatestFetch.readyStatus === action.ARTICLES_LATEST_FAILURE) {
      return
Oops, Failed to load list!
;
    }

    if (this.props.type === "square-small") {
        return <ArticlesLatest list={articlesLatestFetch.list} />;
    }

    if (this.props.type === "square-featured") {
        return <ArticlesLatest list={articlesLatestFetch.list} />;
    }
  }

  render() {
    return (

        {this.renderArticlesLatest()}

    );
  }
}

const connector: Connector<{}, Props> = connect(
  ({ articlesLatestFetch }: Reducer) => ({ articlesLatestFetch }),
  (dispatch: Dispatch) => ({
    fetchArticlesIfNeeded: (indexLimit: string) => dispatch(action.fetchArticlesIfNeeded(indexLimit)),
  }),
);

export default connector(ArticlesLatestFetch);


text:
<fresco:FrescoDrawee xmlns:fresco="nativescript-fresco"
                    verticalAlignment="center"
                    placeholderImageUri="res://ns_logo"
                    aspectRatio="1.49"
                    imageUri="https://raw.githubusercontent.com/NativeScript/nativescript-fresco/master/examples-data/breakfast1.jpg"
                    actualImageScaleType="centerInside"/>


text:
"""Module implementing RNN Cells that used to be in core.

@@EmbeddingWrapper
@@InputProjectionWrapper
@@OutputProjectionWrapper
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import math

from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import embedding_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn_ops
from tensorflow.python.ops import rnn_cell_impl
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import nest

# pylint: disable=protected-access,invalid-name
RNNCell = rnn_cell_impl.RNNCell
_WEIGHTS_VARIABLE_NAME = rnn_cell_impl._WEIGHTS_VARIABLE_NAME
_BIAS_VARIABLE_NAME = rnn_cell_impl._BIAS_VARIABLE_NAME
# pylint: enable=protected-access,invalid-name

class _Linear(object):
  """Linear map: sum_i(args[i] * W[i]), where W[i] is a variable.

  Args:
    args: a 2D Tensor or a list of 2D, batch, n, Tensors.
    output_size: int, second dimension of weight variable.
    dtype: data type for variables.
    build_bias: boolean, whether to build a bias variable.
    bias_initializer: starting value to initialize the bias
      (default is all zeros).
    kernel_initializer: starting value to initialize the weight.

  Raises:
    ValueError: if inputs_shape is wrong.
  """

  def __init__(self,
               args,
               output_size,
               build_bias,
               bias_initializer=None,
               kernel_initializer=None):
    self._build_bias = build_bias

    if args is None or (nest.is_sequence(args) and not args):
      raise ValueError("`args` must be specified")
    if not nest.is_sequence(args):
      args = [args]
      self._is_sequence = False
    else:
      self._is_sequence = True

    # Calculate the total size of arguments on dimension 1.
    total_arg_size = 0
    shapes = [a.get_shape() for a in args]
    for shape in shapes:
      if shape.ndims != 2:
        raise ValueError("linear is expecting 2D arguments: %s" % shapes)
      if shape[1].value is None:
        raise ValueError("linear expects shape[1] to be provided for shape %s, "
                         "but saw %s" % (shape, shape[1]))
      else:
        total_arg_size += shape[1].value

    dtype = [a.dtype for a in args][0]

    scope = vs.get_variable_scope()
    with vs.variable_scope(scope) as outer_scope:
      self._weights = vs.get_variable(
          _WEIGHTS_VARIABLE_NAME, [total_arg_size, output_size],
          dtype=dtype,
          initializer=kernel_initializer)
      if build_bias:
        with vs.variable_scope(outer_scope) as inner_scope:
          inner_scope.set_partitioner(None)
          if bias_initializer is None:
            bias_initializer = init_ops.constant_initializer(0.0, dtype=dtype)
          self._biases = vs.get_variable(
              _BIAS_VARIABLE_NAME, [output_size],
              dtype=dtype,
              initializer=bias_initializer)

  def __call__(self, args):
    if not self._is_sequence:
      args = [args]

    if len(args) == 1:
      res = math_ops.matmul(args[0], self._weights)
    else:
      # Explicitly creating a one for a minor performance improvement.
      one = constant_op.constant(1, dtype=dtypes.int32)
      res = math_ops.matmul(array_ops.concat(args, one), self._weights)
    if self._build_bias:
      res = nn_ops.bias_add(res, self._biases)
    return res

# TODO(xpan): Remove this function in a follow up.
def _linear(args,
            output_size,
            bias,
            bias_initializer=None,
            kernel_initializer=None):
  """Linear map: sum_i(args[i] * W[i]), where W[i] is a variable.

  Args:
    args: a 2D Tensor or a list of 2D, batch, n, Tensors.
    output_size: int, second dimension of W[i].
    bias: boolean, whether to add a bias term or not.
    bias_initializer: starting value to initialize the bias
      (default is all zeros).
    kernel_initializer: starting value to initialize the weight.

  Returns:
    A 2D Tensor with shape `[batch, output_size]` equal to
    sum_i(args[i] * W[i]), where W[i]s are newly created matrices.

  Raises:
    ValueError: if some of the arguments has unspecified or wrong shape.
  """
  if args is None or (nest.is_sequence(args) and not args):
    raise ValueError("`args` must be specified")
  if not nest.is_sequence(args):
    args = [args]

  # Calculate the total size of arguments on dimension 1.
  total_arg_size = 0
  shapes = [a.get_shape() for a in args]
  for shape in shapes:
    if shape.ndims != 2:
      raise ValueError("linear is expecting 2D arguments: %s" % shapes)
    if shape[1].value is None:
      raise ValueError("linear expects shape[1] to be provided for shape %s, "
                       "but saw %s" % (shape, shape[1]))
    else:
      total_arg_size += shape[1].value

  dtype = [a.dtype for a in args][0]

  # Now the computation.
  scope = vs.get_variable_scope()
  with vs.variable_scope(scope) as outer_scope:
    weights = vs.get_variable(
        _WEIGHTS_VARIABLE_NAME, [total_arg_size, output_size],
        dtype=dtype,
        initializer=kernel_initializer)
    if len(args) == 1:
      res = math_ops.matmul(args[0], weights)
    else:
      res = math_ops.matmul(array_ops.concat(args, 1), weights)
    if not bias:
      return res
    with vs.variable_scope(outer_scope) as inner_scope:
      inner_scope.set_partitioner(None)
      if bias_initializer is None:
        bias_initializer = init_ops.constant_initializer(0.0, dtype=dtype)
      biases = vs.get_variable(
          _BIAS_VARIABLE_NAME, [output_size],
          dtype=dtype,
          initializer=bias_initializer)
    return nn_ops.bias_add(res, biases)

class EmbeddingWrapper(RNNCell):
  """Operator adding input embedding to the given cell.

  Note: in many cases it may be more efficient to not use this wrapper,
  but instead concatenate the whole sequence of your inputs in time,
  do the embedding on this batch-concatenated sequence, then split it and
  feed into your RNN.
  """

  def __init__(self,
               cell,
               embedding_classes,
               embedding_size,
               initializer=None,
               reuse=None):
    """Create a cell with an added input embedding.

    Args:
      cell: an RNNCell, an embedding will be put before its inputs.
      embedding_classes: integer, how many symbols will be embedded.
      embedding_size: integer, the size of the vectors we embed into.
      initializer: an initializer to use when creating the embedding;
        if None, the initializer from variable scope or a default one is used.
      reuse: (optional) Python boolean describing whether to reuse variables
        in an existing scope.  If not `True`, and the existing scope already has
        the given variables, an error is raised.

    Raises:
      TypeError: if cell is not an RNNCell.
      ValueError: if embedding_classes is not positive.
    """
    super(EmbeddingWrapper, self).__init__(_reuse=reuse)
    rnn_cell_impl.assert_like_rnncell("cell", cell)
    if embedding_classes <= 0 or embedding_size <= 0:
      raise ValueError("Both embedding_classes and embedding_size must be > 0: "
                       "%d, %d." % (embedding_classes, embedding_size))
    self._cell = cell
    self._embedding_classes = embedding_classes
    self._embedding_size = embedding_size
    self._initializer = initializer

  @property
  def state_size(self):
    return self._cell.state_size

  @property
  def output_size(self):
    return self._cell.output_size

  def zero_state(self, batch_size, dtype):
    with ops.name_scope(type(self).__name__ + "ZeroState", values=[batch_size]):
      return self._cell.zero_state(batch_size, dtype)

  def call(self, inputs, state):
    """Run the cell on embedded inputs."""
    with ops.device("/cpu:0"):
      if self._initializer:
        initializer = self._initializer
      elif vs.get_variable_scope().initializer:
        initializer = vs.get_variable_scope().initializer
      else:
        # Default initializer for embeddings should have variance=1.
        sqrt3 = math.sqrt(3)  # Uniform(-sqrt(3), sqrt(3)) has variance=1.
        initializer = init_ops.random_uniform_initializer(-sqrt3, sqrt3)

      if isinstance(state, tuple):
        data_type = state[0].dtype
      else:
        data_type = state.dtype

      embedding = vs.get_variable(
          "embedding", [self._embedding_classes, self._embedding_size],
          initializer=initializer,
          dtype=data_type)
      embedded = embedding_ops.embedding_lookup(embedding,
                                                array_ops.reshape(inputs, [-1]))

      return self._cell(embedded, state)

class InputProjectionWrapper(RNNCell):
  """Operator adding an input projection to the given cell.

  Note: in many cases it may be more efficient to not use this wrapper,
  but instead concatenate the whole sequence of your inputs in time,
  do the projection on this batch-concatenated sequence, then split it.
  """

  def __init__(self,
               cell,
               num_proj,
               activation=None,
               input_size=None,
               reuse=None):
    """Create a cell with input projection.

    Args:
      cell: an RNNCell, a projection of inputs is added before it.
      num_proj: Python integer.  The dimension to project to.
      activation: (optional) an optional activation function.
      input_size: Deprecated and unused.
      reuse: (optional) Python boolean describing whether to reuse variables
        in an existing scope.  If not `True`, and the existing scope already has
        the given variables, an error is raised.

    Raises:
      TypeError: if cell is not an RNNCell.
    """
    super(InputProjectionWrapper, self).__init__(_reuse=reuse)
    if input_size is not None:
      logging.warn("%s: The input_size parameter is deprecated.", self)
    rnn_cell_impl.assert_like_rnncell("cell", cell)
    self._cell = cell
    self._num_proj = num_proj
    self._activation = activation
    self._linear = None

  @property
  def state_size(self):
    return self._cell.state_size

  @property
  def output_size(self):
    return self._cell.output_size

  def zero_state(self, batch_size, dtype):
    with ops.name_scope(type(self).__name__ + "ZeroState", values=[batch_size]):
      return self._cell.zero_state(batch_size, dtype)

  def call(self, inputs, state):
    """Run the input projection and then the cell."""
    # Default scope: "InputProjectionWrapper"
    if self._linear is None:
      self._linear = _Linear(inputs, self._num_proj, True)
    projected = self._linear(inputs)
    if self._activation:
      projected = self._activation(projected)
    return self._cell(projected, state)

class OutputProjectionWrapper(RNNCell):
  """Operator adding an output projection to the given cell.

  Note: in many cases it may be more efficient to not use this wrapper,
  but instead concatenate the whole sequence of your outputs in time,
  do the projection on this batch-concatenated sequence, then split it
  if needed or directly feed into a softmax.
  """

  def __init__(self, cell, output_size, activation=None, reuse=None):
    """Create a cell with output projection.

    Args:
      cell: an RNNCell, a projection to output_size is added to it.
      output_size: integer, the size of the output after projection.
      activation: (optional) an optional activation function.
      reuse: (optional) Python boolean describing whether to reuse variables
        in an existing scope.  If not `True`, and the existing scope already has
        the given variables, an error is raised.

    Raises:
      TypeError: if cell is not an RNNCell.
      ValueError: if output_size is not positive.
    """
    super(OutputProjectionWrapper, self).__init__(_reuse=reuse)
    rnn_cell_impl.assert_like_rnncell("cell", cell)
    if output_size < 1:
      raise ValueError("Parameter output_size must be > 0: %d." % output_size)
    self._cell = cell
    self._output_size = output_size
    self._activation = activation
    self._linear = None

  @property
  def state_size(self):
    return self._cell.state_size

  @property
  def output_size(self):
    return self._output_size

  def zero_state(self, batch_size, dtype):
    with ops.name_scope(type(self).__name__ + "ZeroState", values=[batch_size]):
      return self._cell.zero_state(batch_size, dtype)

  def call(self, inputs, state):
    """Run the cell and output projection on inputs, starting from state."""
    output, res_state = self._cell(inputs, state)
    if self._linear is None:
      self._linear = _Linear(output, self._output_size, True)
    projected = self._linear(output)
    if self._activation:
      projected = self._activation(projected)
    return projected, res_state


text:
package net.runelite.api.events;

import lombok.Data;

/**
 * An event where the game has changed from fixed to resizable mode or vice versa.
 */
@Data
public class ResizeableChanged
{
	/**
	 * Whether the game is in resizable mode.
	 */
	private boolean isResized;
}


text:
package org.ovirt.engine.api.resource;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Produces;
import org.jboss.resteasy.annotations.providers.jaxb.Formatted;

import org.ovirt.engine.api.model.BaseResource;

@Produces({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
public interface UpdatableResource<R extends BaseResource> {

    @GET
    @Formatted
    public R get();

    @PUT
    @Formatted
    @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
    public R update(R resource);
}