text:
package lexico;/* Generated By:JavaCC: Do not edit this line. AnalisadorLexico.java */
import java.io.*;

public class AnalisadorLexico implements AnalisadorLexicoConstants {

  public static String LexicoStart (String address) throws ParseException, FileNotFoundException {
    FileInputStream meu_Arquivo = new FileInputStream(address);
   SimpleCharStream arquivo = new SimpleCharStream(meu_Arquivo);
   Token token_temporario = null;
   AnalisadorLexicoTokenManager TkMgr = new AnalisadorLexicoTokenManager(arquivo);

    String valor = "";

    do {

        token_temporario = TkMgr.getNextToken();

        if (token_temporario.kind == DIGITO)
          valor += "Num\u00e9rico > " + token_temporario + "\n";

        else if (token_temporario.kind == IDENTIFICADOR)
          valor += "Identificador > " + token_temporario + "\n";

        else if (token_temporario.kind == CARACTER)
          valor += "Char > " + token_temporario + "\n";

        else if (token_temporario.kind == NUMEROREAL)
          valor += "Real > " + token_temporario + "\n";

        else if (token_temporario.kind == NUMEROINTEIRO)
          valor += "Inteiro > " + token_temporario + "\n";

        else if (token_temporario.kind == VAZIO)
          valor += "Void > " + token_temporario + "\n";

        else if (token_temporario.kind == EFAZER || token_temporario.kind == EENQUANTO || token_temporario.kind == EPARA || token_temporario.kind == CASO || token_temporario.kind == QUEBRAR || token_temporario.kind == EESCOLHA)
          valor += "La\u00e7o de repeti\u00e7\u00e3o > " + token_temporario + "\n";

        else if (token_temporario.kind == ESE || token_temporario.kind == ESENAO)
          valor += "La\u00e7o de condi\u00e7\u00e3o > " + token_temporario + "\n";

        else if (token_temporario.kind == VERDADEIRO || token_temporario.kind == FALSO)
          valor += "Verifica\u00e7\u00e3o l\u00f3gico > " + token_temporario + "\n";

        else if (token_temporario.kind == ERETORNO || token_temporario.kind == PADRAO)
          valor += "La\u00e7os de defini\u00e7\u00e3o > " + token_temporario + "\n";

        else if (token_temporario.kind == ECHAVE || token_temporario.kind == DCHAVE || token_temporario.kind == MENORMENOR || token_temporario.kind == MAIORMAIOR)
          valor += "S\u00edmbolo > " + token_temporario + "\n";

        else if (token_temporario.kind == EPARENTESE || token_temporario.kind == DPARENTESE)
          valor += "S\u00edmbolo > " + token_temporario + "\n";

        else if (token_temporario.kind == PONTOVIRGULA || token_temporario.kind == DOISPONTOS || token_temporario.kind == VIRGULA)
          valor += "S\u00edmbolo > " + token_temporario + "\n";

        else if (token_temporario.kind == IGUAL)
          valor += "Atribui\u00e7\u00e3o > " + token_temporario + "\n";

        else if (token_temporario.kind == OULOGICO || token_temporario.kind == ELOGICO || token_temporario.kind == IGUALIGUAL || token_temporario.kind == DIFERENTE)
          valor += "Compara\u00e7\u00e3o l\u00f3gico > " + token_temporario + "\n";

        else if (token_temporario.kind == MENOR || token_temporario.kind == MAIOR || token_temporario.kind == MENORIGUAL || token_temporario.kind == MAIORIGUAL)
          valor += "Compara\u00e7\u00e3o matem\u00e1tica > " + token_temporario + "\n";

        else if (token_temporario.kind == MAIS || token_temporario.kind == MENOS || token_temporario.kind == MULTIPLICACAO || token_temporario.kind == DIVISAO)
          valor += "Aritm\u00e9tico > " + token_temporario + "\n";

        else if (token_temporario.kind == INCREMENTA || token_temporario.kind == DECREMENTA)
          valor += "Incrementa\u00e7\u00e3o > " + token_temporario + "\n";

        else if (token_temporario.kind == COMENTARIO_BLOCO)
          valor += "Comet\u00e1rio bloco > " + token_temporario + "\n";

        else if (token_temporario.kind == LEXEMAS_INVALIDOS)
          valor += " Erro l\u00e9xico > " + token_temporario.image + "\n";

    } while (token_temporario.kind != EOF);
    return valor;
  }

  static private boolean jj_initialized_once = false;
  /** Generated Token Manager. */
  static public AnalisadorLexicoTokenManager token_source;
  static SimpleCharStream jj_input_stream;
  /** Current token. */
  static public Token token;
  /** Next token. */
  static public Token jj_nt;
  static private int jj_ntk;
  static private int jj_gen;
  static final private int[] jj_la1 = new int[0];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
      jj_la1_init_0();
      jj_la1_init_1();
   }
   private static void jj_la1_init_0() {
      jj_la1_0 = new int[] {};
   }
   private static void jj_la1_init_1() {
      jj_la1_1 = new int[] {};
   }

  /** Constructor with InputStream. */
  public AnalisadorLexico(java.io.InputStream stream) {
     this(stream, null);
  }
  /** Constructor with InputStream and supplied encoding */
  public AnalisadorLexico(java.io.InputStream stream, String encoding) {
    if (jj_initialized_once) {
      System.out.println("ERROR: Second call to constructor of static parser.  ");
      System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
      System.out.println("       during parser generation.");
      throw new Error();
    }
    jj_initialized_once = true;
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new AnalisadorLexicoTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  static public void ReInit(java.io.InputStream stream) {
     ReInit(stream, null);
  }
  /** Reinitialise. */
  static public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  /** Constructor. */
  public AnalisadorLexico(java.io.Reader stream) {
    if (jj_initialized_once) {
      System.out.println("ERROR: Second call to constructor of static parser. ");
      System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
      System.out.println("       during parser generation.");
      throw new Error();
    }
    jj_initialized_once = true;
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new AnalisadorLexicoTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  static public void ReInit(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  /** Constructor with generated Token Manager. */
  public AnalisadorLexico(AnalisadorLexicoTokenManager tm) {
    if (jj_initialized_once) {
      System.out.println("ERROR: Second call to constructor of static parser. ");
      System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
      System.out.println("       during parser generation.");
      throw new Error();
    }
    jj_initialized_once = true;
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(AnalisadorLexicoTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
  }

  static private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
      jj_gen++;
      trace_token(token, "");
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }

/** Get the next Token. */
  static final public Token getNextToken() {
    if (token.next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    jj_gen++;
      trace_token(token, " (in getNextToken)");
    return token;
  }

/** Get the specific Token. */
  static final public Token getToken(int index) {
    Token t = token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  static private int jj_ntk() {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    else
      return (jj_ntk = jj_nt.kind);
  }

  static private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
  static private int[] jj_expentry;
  static private int jj_kind = -1;

  /** Generate ParseException. */
  static public ParseException generateParseException() {
    jj_expentries.clear();
    boolean[] la1tokens = new boolean[58];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 0; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1<<j)) != 0) {
            la1tokens[j] = true;
          }
          if ((jj_la1_1[i] & (1<<j)) != 0) {
            la1tokens[32+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 58; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.add(jj_expentry);
      }
    }
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = jj_expentries.get(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  static private int trace_indent = 0;
  static private boolean trace_enabled = true;

/** Enable tracing. */
  static final public void enable_tracing() {
    trace_enabled = true;
  }

/** Disable tracing. */
  static final public void disable_tracing() {
    trace_enabled = false;
  }

  static private void trace_call(String s) {
    if (trace_enabled) {
      for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
      System.out.println("Call:   " + s);
    }
    trace_indent = trace_indent + 2;
  }

  static private void trace_return(String s) {
    trace_indent = trace_indent - 2;
    if (trace_enabled) {
      for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
      System.out.println("Return: " + s);
    }
  }

  static private void trace_token(Token t, String where) {
    if (trace_enabled) {
      for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
      System.out.print("Consumed token: <" + tokenImage[t.kind]);
      if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) {
        System.out.print(": \"" + t.image + "\"");
      }
      System.out.println(" at line " + t.beginLine + " column " + t.beginColumn + ">" + where);
    }
  }

  static private void trace_scan(Token t1, int t2) {
    if (trace_enabled) {
      for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
      System.out.print("Visited token: <" + tokenImage[t1.kind]);
      if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) {
        System.out.print(": \"" + t1.image + "\"");
      }
      System.out.println(" at line " + t1.beginLine + " column " + t1.beginColumn + ">; Expected token: <" + tokenImage[t2] + ">");
    }
  }

}


text:
@interface ViewController ()

@property (strong, nonatomic) NSMutableArray *messages;
@property (strong, nonatomic) JSQMessagesBubbleImage *incomingBubble;
@property (strong, nonatomic) JSQMessagesBubbleImage *outgoingBubble;
@property (strong, nonatomic) JSQMessagesAvatarImage *incomingAvatar;
@property (strong, nonatomic) JSQMessagesAvatarImage *outgoingAvatar;

@end

@implementation ViewController

#pragma mark - UIViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 自分の senderId, senderDisplayName を設定
    self.senderId = @"user1";
    self.senderDisplayName = @"classmethod";
    // MessageBubble (背景の吹き出し) を設定
    JSQMessagesBubbleImageFactory *bubbleFactory = [JSQMessagesBubbleImageFactory new];
    self.incomingBubble = [bubbleFactory  incomingMessagesBubbleImageWithColor:[UIColor jsq_messageBubbleLightGrayColor]];
    self.outgoingBubble = [bubbleFactory  outgoingMessagesBubbleImageWithColor:[UIColor jsq_messageBubbleGreenColor]];
    // アバター画像を設定
    self.incomingAvatar = [JSQMessagesAvatarImageFactory avatarImageWithImage:[UIImage imageNamed:@"User2"] diameter:64];
    self.outgoingAvatar = [JSQMessagesAvatarImageFactory avatarImageWithImage:[UIImage imageNamed:@"User1"] diameter:64];
    // メッセージデータの配列を初期化
    self.messages = [NSMutableArray array];
}

#pragma mark - Auto Message

- (void)receiveAutoMessage
{
    // 1秒後にメッセージを受信する
    [NSTimer scheduledTimerWithTimeInterval:1
                                     target:self
                                   selector:@selector(didFinishMessageTimer:)
                                   userInfo:nil
                                    repeats:NO];
}

- (void)didFinishMessageTimer:(NSTimer*)timer
{
    // 効果音を再生する
    [JSQSystemSoundPlayer jsq_playMessageSentSound];
    // 新しいメッセージデータを追加する
    JSQMessage *message = [JSQMessage messageWithSenderId:@"user2"
                                              displayName:@"underscore"
                                                     text:@"Hello"];
    [self.messages addObject:message];
    // メッセージの受信処理を完了する (画面上にメッセージが表示される)
    [self finishReceivingMessageAnimated:YES];
}

#pragma mark - JSQMessagesViewController

// Sendボタンが押下されたときに呼ばれる
- (void)didPressSendButton:(UIButton *)button
           withMessageText:(NSString *)text
                  senderId:(NSString *)senderId
         senderDisplayName:(NSString *)senderDisplayName
                      date:(NSDate *)date
{
    // 効果音を再生する
    [JSQSystemSoundPlayer jsq_playMessageSentSound];
    // 新しいメッセージデータを追加する
    JSQMessage *message = [JSQMessage messageWithSenderId:senderId
                                              displayName:senderDisplayName
                                                     text:text];
    [self.messages addObject:message];
    // メッセージの送信処理を完了する (画面上にメッセージが表示される)
    [self finishSendingMessageAnimated:YES];
    // 擬似的に自動でメッセージを受信
    [self receiveAutoMessage];
}

#pragma mark - JSQMessagesCollectionViewDataSource

// アイテムごとに参照するメッセージデータを返す
- (id<JSQMessageData>)collectionView:(JSQMessagesCollectionView *)collectionView messageDataForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return [self.messages objectAtIndex:indexPath.item];
}

// アイテムごとの MessageBubble (背景) を返す
- (id<JSQMessageBubbleImageDataSource>)collectionView:(JSQMessagesCollectionView *)collectionView messageBubbleImageDataForItemAtIndexPath:(NSIndexPath *)indexPath
{
    JSQMessage *message = [self.messages objectAtIndex:indexPath.item];
    if ([message.senderId isEqualToString:self.senderId]) {
        return self.outgoingBubble;
    }
    return self.incomingBubble;
}

// アイテムごとのアバター画像を返す
- (id<JSQMessageAvatarImageDataSource>)collectionView:(JSQMessagesCollectionView *)collectionView avatarImageDataForItemAtIndexPath:(NSIndexPath *)indexPath
{
    JSQMessage *message = [self.messages objectAtIndex:indexPath.item];
    if ([message.senderId isEqualToString:self.senderId]) {
        return self.outgoingAvatar;
    }
    return self.incomingAvatar;
}

#pragma mark - UICollectionViewDataSource

// アイテムの総数を返す
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return self.messages.count;
}

@end

redpajama_set_name: RedPajamaGithub


text: from rabbitmq_admin.api import AdminAPI


text:
gnss-prn-gen
============

Generates GNSS PRN codes


text:
require 'mongoid'
require 'ostruct'

module MongoidActivityTracker
  module Tracker
    attr_accessor :actor_cache_methods

    module ClassMethods
      def track(actor, action, options = {})
        create({ action: action, actor: actor }.merge(options))
      end

      def track!(actor, action, options = {})
        create!({ action: action, actor: actor }.merge(options))
      end

      def tracks(relation_name, cache_methods: %i[to_s])
        field_name = [relation_name, 'cache'].join('_')
        accessor_name = [relation_name, 'cache_methods'].join('_')
        instance_variable_name = ['@', accessor_name].join

        field field_name, type: Hash, default: {}

        belongs_to relation_name, polymorphic: true, optional: true

        attr_accessor accessor_name

        define_method accessor_name do
          instance_variable_set(instance_variable_name, cache_methods) unless instance_variable_get(instance_variable_name)
          instance_variable_get(instance_variable_name)
        end

        define_method [relation_name, 'cache_object'].join('_') do
          OpenStruct.new(send(field_name))
        end

        before_validation -> { set_cache(relation_name) }
      end
    end

    def self.included(base)
      base.extend ClassMethods
      base.class_eval do
        include Mongoid::Document

        field :action, type: Symbol

        tracks :actor

        validates :actor, presence: true, unless: -> { actor_cache && actor_cache[:to_s].present? }
        validates :action, presence: true
      end
    end

    def created_at
      id.generation_time.in_time_zone(Time.zone)
    end

    private

    def set_cache(relation_name)
      accessor_name = [relation_name, 'cache_methods'].join('_')
      field_name = [relation_name, 'cache'].join('_')

      return unless send(accessor_name).present?
      return unless send(relation_name).present?

      send(accessor_name).each do |m|
        next if send(field_name)[m].present?

        send(field_name)[m] = send(relation_name).send(m) if send(relation_name).respond_to?(m)
      end
    end
  end
end


text:
namespace Xilium.CefGlue
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using Xilium.CefGlue.Interop;

    /// <summary>
    /// Class that asynchronously executes tasks on the associated thread. It is safe
    /// to call the methods of this class on any thread.
    /// CEF maintains multiple internal threads that are used for handling different
    /// types of tasks in different processes. The cef_thread_id_t definitions in
    /// cef_types.h list the common CEF threads. Task runners are also available for
    /// other CEF threads as appropriate (for example, V8 WebWorker threads).
    /// </summary>
    public sealed unsafe partial class CefTaskRunner
    {
        /// <summary>
        /// Returns the task runner for the current thread. Only CEF threads will have
        /// task runners. An empty reference will be returned if this method is called
        /// on an invalid thread.
        /// </summary>
        public static cef_task_runner_t* GetForCurrentThread()
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.GetForCurrentThread
        }

        /// <summary>
        /// Returns the task runner for the specified CEF thread.
        /// </summary>
        public static cef_task_runner_t* GetForThread(CefThreadId threadId)
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.GetForThread
        }

        /// <summary>
        /// Returns true if this object is pointing to the same task runner as |that|
        /// object.
        /// </summary>
        public int IsSame(cef_task_runner_t* that)
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.IsSame
        }

        /// <summary>
        /// Returns true if this task runner belongs to the current thread.
        /// </summary>
        public int BelongsToCurrentThread()
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.BelongsToCurrentThread
        }

        /// <summary>
        /// Returns true if this task runner is for the specified CEF thread.
        /// </summary>
        public int BelongsToThread(CefThreadId threadId)
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.BelongsToThread
        }

        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </summary>
        public int PostTask(cef_task_t* task)
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.PostTask
        }

        /// <summary>
        /// Post a task for delayed execution on the thread associated with this task
        /// runner. Execution will occur asynchronously. Delayed tasks are not
        /// supported on V8 WebWorker threads and will be executed without the
        /// specified delay.
        /// </summary>
        public int PostDelayedTask(cef_task_t* task, long delay_ms)
        {
            throw new NotImplementedException(); // TODO: CefTaskRunner.PostDelayedTask
        }

    }
}


text:
package org.apache.pig.test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Map;
import java.util.Random;

import org.apache.pig.backend.executionengine.ExecException;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.POStatus;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.Result;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.Divide;
import org.apache.pig.data.DataBag;
import org.apache.pig.data.DataByteArray;
import org.apache.pig.data.DataType;
import org.apache.pig.data.Tuple;
import org.apache.pig.impl.plan.OperatorKey;
import org.apache.pig.test.utils.GenRandomData;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;

public class TestDivide {
    Random r = new Random(42L);
    ConstantExpression lt, rt;
    Divide op = new Divide(new OperatorKey("", r.nextLong()));

    @Before
    public void setUp() throws Exception {
        lt = new ConstantExpression(new OperatorKey("", r.nextLong()));
        rt = new ConstantExpression(new OperatorKey("", r.nextLong()));
    }

    @Test
    public void testOperator() throws ExecException {
        // int TRIALS = 10;
        byte[] types = { DataType.BAG, DataType.BOOLEAN, DataType.BYTEARRAY, DataType.CHARARRAY,
                        DataType.DOUBLE, DataType.FLOAT, DataType.INTEGER, DataType.LONG, DataType.BIGDECIMAL,
                        DataType.DATETIME, DataType.MAP, DataType.TUPLE };
        // Map<Byte,String> map = GenRandomData.genTypeToNameMap();
        System.out.println("Testing DIVIDE operator");
        for (byte type : types) {
            lt.setResultType(type);
            rt.setResultType(type);
            op.setLhs(lt);
            op.setRhs(rt);

            switch (type) {
            case DataType.BAG:
                DataBag inpdb1 = GenRandomData.genRandSmallTupDataBag(r, 10, 100);
                DataBag inpdb2 = GenRandomData.genRandSmallTupDataBag(r, 10, 100);
                lt.setValue(inpdb1);
                rt.setValue(inpdb2);
                Result resdb = op.getNextDataBag();
                assertEquals(resdb.returnStatus, POStatus.STATUS_ERR);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpdb2);
                resdb = op.getNextDataBag();
                assertEquals(resdb.returnStatus, POStatus.STATUS_ERR);
                // test with null in rhs
                lt.setValue(inpdb1);
                rt.setValue(null);
                resdb = op.getNextDataBag();
                assertEquals(resdb.returnStatus, POStatus.STATUS_ERR);
                break;
            case DataType.BOOLEAN:
                Boolean inpb1 = r.nextBoolean();
                Boolean inpb2 = r.nextBoolean();
                lt.setValue(inpb1);
                rt.setValue(inpb2);
                Result resb = op.getNextBoolean();
                assertEquals(resb.returnStatus, POStatus.STATUS_ERR);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpb2);
                resb = op.getNextBoolean();
                assertEquals(resb.returnStatus, POStatus.STATUS_ERR);
                // test with null in rhs
                lt.setValue(inpb1);
                rt.setValue(null);
                resb = op.getNextBoolean();
                assertEquals(resb.returnStatus, POStatus.STATUS_ERR);
                break;
            case DataType.BYTEARRAY: {
                DataByteArray inpba1 = GenRandomData.genRandDBA(r);
                DataByteArray inpba2 = GenRandomData.genRandDBA(r);
                lt.setValue(inpba1);
                rt.setValue(inpba2);
                Result resba = op.getNextDataByteArray();
                //DataByteArray expected = new DataByteArray(inpba1.toString() + inpba2.toString());
                //assertEquals(expected, (DataByteArray)resba.result);
                assertEquals(POStatus.STATUS_ERR, resba.returnStatus);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpba2);
                resba = op.getNextDataByteArray();
                assertEquals(resba.returnStatus, POStatus.STATUS_ERR);
                // test with null in rhs
                lt.setValue(inpba1);
                rt.setValue(null);
                resba = op.getNextDataByteArray();
                assertEquals(resba.returnStatus, POStatus.STATUS_ERR);
                break;
            }
            case DataType.CHARARRAY: {
                String inps1 = GenRandomData.genRandString(r);
                String inps2 = GenRandomData.genRandString(r);
                lt.setValue(inps1);
                rt.setValue(inps2);
                Result ress = op.getNextString();
                /*String expected = new String(inps1 + inps2);
                assertEquals(expected, (String)ress.result);*/
                assertEquals(POStatus.STATUS_ERR, ress.returnStatus);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inps2);
                ress = op.getNextString();
                assertEquals(ress.returnStatus, POStatus.STATUS_ERR);
                // test with null in rhs
                lt.setValue(inps1);
                rt.setValue(null);
                ress = op.getNextString();
                assertEquals(ress.returnStatus, POStatus.STATUS_ERR);
                break;
            }
            case DataType.DOUBLE: {
                Double inpd1 = r.nextDouble();
                Double inpd2 = r.nextDouble();
                lt.setValue(inpd1);
                rt.setValue(inpd2);
                Result resd = op.getNextDouble();
                Double expected = new Double(inpd1 / inpd2);
                assertEquals(expected, (Double)resd.result);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpd2);
                resd = op.getNextDouble();
                assertEquals(null, (Double)resd.result);
                // test with null in rhs
                lt.setValue(inpd1);
                rt.setValue(null);
                resd = op.getNextDouble();
                assertEquals(null, (Double)resd.result);
                // test divide by 0
                lt.setValue(inpd1);
                rt.setValue(0.0);
                resd = op.getNextDouble();
                assertEquals(null, (Double)resd.result);
                break;
            }
            case DataType.FLOAT: {
                Float inpf1 = r.nextFloat();
                Float inpf2 = r.nextFloat();
                lt.setValue(inpf1);
                rt.setValue(inpf2);
                Result resf = op.getNextFloat();
                Float expected = new Float(inpf1 / inpf2);
                assertEquals(expected, (Float)resf.result);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpf2);
                resf = op.getNextFloat();
                assertEquals(null, (Float)resf.result);
                // test with null in rhs
                lt.setValue(inpf1);
                rt.setValue(null);
                resf = op.getNextFloat();
                assertEquals(null, (Float)resf.result);
                // test divide by 0
                lt.setValue(inpf1);
                rt.setValue(0.0f);
                resf = op.getNextFloat();
                assertEquals(null, (Float)resf.result);
                break;
            }
            case DataType.INTEGER: {
                Integer inpi1 = r.nextInt();
                Integer inpi2 = r.nextInt();
                lt.setValue(inpi1);
                rt.setValue(inpi2);
                Result resi = op.getNextInteger();
                Integer expected = new Integer(inpi1 / inpi2);
                assertEquals(expected, (Integer) resi.result);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpi2);
                resi = op.getNextInteger();
                assertEquals(null, (Integer)resi.result);
                // test with null in rhs
                lt.setValue(inpi1);
                rt.setValue(null);
                resi = op.getNextInteger();
                assertEquals(null, (Integer)resi.result);
                // test divide by 0
                lt.setValue(inpi1);
                rt.setValue(0);
                resi = op.getNextInteger();
                assertEquals(null, (Integer)resi.result);
                break;
            }
            case DataType.LONG: {
                Long inpl1 = r.nextLong();
                Long inpl2 = r.nextLong();
                lt.setValue(inpl1);
                rt.setValue(inpl2);
                Result resl = op.getNextLong();
                Long expected = new Long(inpl1 / inpl2);
                assertEquals(expected, (Long)resl.result);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpl2);
                resl = op.getNextLong();
                assertEquals(null, (Long)resl.result);
                // test with null in rhs
                lt.setValue(inpl1);
                rt.setValue(null);
                resl = op.getNextLong();
                assertEquals(null, (Long)resl.result);
                // test divide by 0
                lt.setValue(inpl1);
                rt.setValue(0l);
                resl = op.getNextLong();
                assertEquals(null, (Long)resl.result);
                break;
            }
            case DataType.BIGDECIMAL: {
                MathContext mc = new MathContext(Divide.BIGDECIMAL_MINIMAL_SCALE, RoundingMode.HALF_UP);
                BigDecimal inpf1 = new BigDecimal(r.nextDouble(),mc);
                BigDecimal inpf2 = new BigDecimal(r.nextDouble(),mc);
                lt.setValue(inpf1);
                rt.setValue(inpf2);
                Result resf = op.getNextBigDecimal();
                BigDecimal expected = inpf1.divide(inpf2, 2 * Divide.BIGDECIMAL_MINIMAL_SCALE + 1, RoundingMode.HALF_UP);
                assertEquals(expected, (BigDecimal)resf.result);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpf2);
                resf = op.getNextBigDecimal();
                assertEquals(null, (BigDecimal)resf.result);
                // test with null in rhs
                lt.setValue(inpf1);
                rt.setValue(null);
                resf = op.getNextBigDecimal();
                assertEquals(null, (BigDecimal)resf.result);
                // test divide by 0
				String[] zeroStrings = new String[] { "0", "-0", "0.0", "-0.0", "0.000000", "-0.000000" };
				for (String zeroString : zeroStrings) {
					lt.setValue(inpf1);
					rt.setValue(new BigDecimal(zeroString));
					resf = op.getNextBigDecimal();
					assertEquals(null, (BigDecimal)resf.result);
				}
                break;
            }
            case DataType.DATETIME:
                DateTime inpdt1 = new DateTime(r.nextLong());
                DateTime inpdt2 = new DateTime(r.nextLong());
                lt.setValue(inpdt1);
                rt.setValue(inpdt2);
                Result resdt = op.getNextDateTime();
                assertEquals(resdt.returnStatus, POStatus.STATUS_ERR);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpdt2);
                resdt = op.getNextDateTime();
                assertEquals(resdt.returnStatus, POStatus.STATUS_ERR);
                // test with null in rhs
                lt.setValue(inpdt1);
                rt.setValue(null);
                resdt = op.getNextDateTime();
                assertEquals(resdt.returnStatus, POStatus.STATUS_ERR);
                break;
            case DataType.MAP: {
                Map<String,Object> inpm1 = GenRandomData.genRandMap(r, 10);
                Map<String,Object> inpm2 = GenRandomData.genRandMap(r, 10);
                lt.setValue(inpm1);
                rt.setValue(inpm2);
                Result resm = op.getNextMap();
                assertEquals(POStatus.STATUS_ERR, resm.returnStatus);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpm2);
                resm = op.getNextMap();
                assertEquals(POStatus.STATUS_ERR, resm.returnStatus);
                // test with null in rhs
                lt.setValue(inpm1);
                rt.setValue(null);
                resm = op.getNextMap();
                assertEquals(POStatus.STATUS_ERR, resm.returnStatus);
                break;
            }
            case DataType.TUPLE: {
                Tuple inpt1 = GenRandomData.genRandSmallBagTuple(r, 10, 100);
                Tuple inpt2 = GenRandomData.genRandSmallBagTuple(r, 10, 100);
                lt.setValue(inpt1);
                rt.setValue(inpt2);
                Result rest = op.getNextTuple();
                assertEquals(POStatus.STATUS_ERR, rest.returnStatus);

                // test with null in lhs
                lt.setValue(null);
                rt.setValue(inpt2);
                rest = op.getNextTuple();
                assertEquals(POStatus.STATUS_ERR, rest.returnStatus);
                // test with null in rhs
                lt.setValue(inpt1);
                rt.setValue(null);
                rest = op.getNextTuple();
                assertEquals(POStatus.STATUS_ERR, rest.returnStatus);
                break;
            }
            }
        }
    }
}


text:
package cn.com.sparkle.raptor.core.buff;

public interface BuffPool {
	public boolean close(CycleBuff buff);

	public IoBufferArray get(int byteSize);

	public IoBuffer get();

	public int size();
}


text:
define(
	"app/amd", // anonym is also supported
	["./commonjs", "./labeled"],
	function(commonjs1, labeled1) {
		// but you can use CommonJs-style requires:
		var commonjs2 = require("./commonjs");
		var labeled2 = require("./labeled");
		// Do something...
		return 456;
	}
);


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:gravity="bottom"
    android:orientation="vertical"
    android:padding="@dimen/activity_margin"
    android:theme="@style/AppTheme.Alma.Header">

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/profile_image"
        android:layout_width="90dp"
        android:layout_height="100dp"
        android:src="@drawable/sample"
        android:paddingTop="@dimen/activity_margin5"
        app:civ_border_width="2dp"
        app:civ_border_color="@color/white"/>

    <TextView
        android:id="@+id/headerTV1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/name"
        android:textStyle="bold"
        android:textSize="20dp"
        android:paddingLeft="@dimen/activity_margin5"
        android:paddingBottom="@dimen/activity_margin4"
        android:paddingTop="@dimen/activity_margin5"
        android:textAppearance="@style/TextAppearance.AppCompat.Body1"
        android:layout_toEndOf="@+id/profile_image" />

    <TextView
        android:id="@+id/headerTV2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/role"
        android:textSize="17dp"
        android:layout_below="@+id/headerTV1"
        android:layout_toEndOf="@+id/profile_image"
        android:paddingLeft="@dimen/activity_margin5"/>

</RelativeLayout>


text:
layout: post
title:  "Week 3"
date:   2016-03-08 00:00:00
post_author: Nick
comments: false
---
<iframe src="https://player.vimeo.com/video/158291970?portrait=0" width="675"
height="380" frameborder="0" webkitallowfullscreen mozallowfullscreen
allowfullscreen></iframe>


text:
import unittest

from mock import Mock, create_autospec
from arbalest.redshift import S3CopyPipeline

from arbalest.contrib.luigi import PipelineTask

class PipelineTaskShould(unittest.TestCase):
    def test_run_given_pipeline(self):
        pipeline = create_autospec(S3CopyPipeline)
        pipeline.__name__ = 'S3CopyPipeline'
        pipeline.get = Mock()

        pipeline_task = PipelineTask(pipeline)
        pipeline_task.run()

        self.assertEqual(pipeline.get.called, True)


text:
package org.projectfloodlight.openflow.protocol.instruction;

import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.List;
import io.netty.buffer.ByteBuf;

public interface OFInstructionApplyActions extends OFObject, OFInstruction {
    OFInstructionType getType();
    List<OFAction> getActions();
    OFVersion getVersion();

    void writeTo(ByteBuf channelBuffer);

    Builder createBuilder();
    public interface Builder extends OFInstruction.Builder {
        OFInstructionApplyActions build();
        OFInstructionType getType();
        List<OFAction> getActions();
        Builder setActions(List<OFAction> actions);
        OFVersion getVersion();
    }
}


text:
package com.myweather.android.gson;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * 项目名称:MyWeather
 * 类描述:总的JSON数据对应的实体类
 * 创建人:liang
 * 创建时间:2017/5/2 0002 19:18
 * 修改人:liang
 * 修改时间:2017/5/2 0002 19:18
 * 修改备注:
 */
public class Weather {
    public String status;
    public Basic basic;
    public AQI aqi;
    public Suggestion suggestion;
    public Now now;
    public List<HourlyForecast> hourly_forecast;
    @SerializedName("daily_forecast")
    public List<Forecast> forecastList;
}


text:
function(cub_enable_rdc_for_cuda_target target_name)
  if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}")
    set_target_properties(${target_name} PROPERTIES
      COMPILE_FLAGS "-gpu=rdc"
    )
  else()
    set_target_properties(${target_name} PROPERTIES
      CUDA_SEPARABLE_COMPILATION ON
    )
  endif()
endfunction()


text:
XManager updates may introduce updates to the schema of the database
used to store experiment metadata. Therefore, the existing database must adapt
to the new changes. This is achieved by using
[`alembic`](https://alembic.sqlalchemy.org/en/latest/) to perform migrations.

XManager comes with an already configured `alembic` environment in the
`xm_local.storage` package. Migration scripts are provided in the
`alembic/versions` directory present there.

A new revision can be created using the `alembic revision` command:

```
$ cd xmanager/xm_local/storage
$ alembic -m revision "Create Example table."
  Generating ${PATH_TO_XMANAGER}/xm_local/storage/alembic/versions/106c21f078d5_create_example_table.py ...  done
```

A new file `106c21f078d5_create_example_table.py` is generated. This file
contains details about the migration, like the revision ID `106c21f078d5` and
the `upgrade` and `downgrade` functions. One has to populate these functions
with directives that will apply changes to the database.

```py
"""Create Example table.

Revision ID: 106c21f078d5
Revises: 5cbe03fe7ed1
Create Date: 2022-09-20 09:23:48.029756

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '106c21f078d5'
down_revision = '5cbe03fe7ed1'
branch_labels = None
depends_on = None

def upgrade() -> None:
    pass

def downgrade() -> None:
    pass
```

We can add some directives to our script, e.g. adding a new table `Example`:

```py
def upgrade() -> None:
  op.create_table(
      'Example',
      sa.Column('Id', sa.Integer, primary_key=True)
  )

def downgrade() -> None:
  op.drop_table('Example')
```

Launching XManager now using the `--xm_upgrade_db` flag will attempt to update
the database. For example, running

```sh
$ xmanager launch examples/cifar10_tensorflow/launcher.py -- --xm_upgrade_db
```
will perform the update and some information about this will be printed:

```
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 5cbe03fe7ed1-> 106c21f078d5', Create Example table.
```

For more details on how `alembic` works and how it can be used, check out the
[tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html).

If more developers work on migrations, make sure to sync with the latest
version of the code, check if there are multiple heads / any issues with the
`alembic` history and create a merge revision accordingly. Check
[this tutorial](https://alembic.sqlalchemy.org/en/latest/branches.html#working-with-branches)
for more details on branching.

NOTE: Migrations created by the user are not explicitly supported by XManager.
On update, it's the responsibility of the user to adapt to new revisions.

## Automatic Migration on Update

If XManager is updated and a new version of the database is available (a new
migration script is provided), the currently used database
(local SQLite or specified through the YAML config file) must be upgraded
to run XManager.

When using `--xm_upgrade_db`, XManager attempts to update the database
to the latest version. Taking a backup of the database
before using this flag is recommended, since migrations may fail.

This doesn't apply for the case when a new database is used.
The initial tables will be created automatically for a new database without
having to use the flag.

NOTE: Making changes to the database from outside of the XManager client
is not supported and discouraged (SQL queries, `alembic` upgrades/downgrades).
All database operations should be performed
automatically by the client.


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host.Executors;
using Microsoft.Azure.WebJobs.Host.Indexers;
using Microsoft.Azure.WebJobs.Host.Listeners;
using Microsoft.Azure.WebJobs.Host.Loggers;
using Microsoft.Azure.WebJobs.Host.Storage.Queue;
using Microsoft.Azure.WebJobs.Host.Timers;

namespace Microsoft.Azure.WebJobs.Host.Queues.Listeners
{
    internal class HostMessageListenerFactory : IListenerFactory
    {
        private static readonly TimeSpan Minimum = QueuePollingIntervals.Minimum;
        private static readonly TimeSpan DefaultMaximum = QueuePollingIntervals.DefaultMaximum;

        private readonly IStorageQueue _queue;
        private readonly IQueueConfiguration _queueConfiguration;
        private readonly IBackgroundExceptionDispatcher _backgroundExceptionDispatcher;
        private readonly TextWriter _log;
        private readonly IFunctionIndexLookup _functionLookup;
        private readonly IFunctionInstanceLogger _functionInstanceLogger;
        private readonly IFunctionExecutor _executor;

        public HostMessageListenerFactory(IStorageQueue queue,
            IQueueConfiguration queueConfiguration,
            IBackgroundExceptionDispatcher backgroundExceptionDispatcher,
            TextWriter log,
            IFunctionIndexLookup functionLookup,
            IFunctionInstanceLogger functionInstanceLogger,
            IFunctionExecutor executor)
        {
            if (queue == null)
            {
                throw new ArgumentNullException("queue");
            }

            if (queueConfiguration == null)
            {
                throw new ArgumentNullException("queueConfiguration");
            }

            if (backgroundExceptionDispatcher == null)
            {
                throw new ArgumentNullException("backgroundExceptionDispatcher");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            if (functionLookup == null)
            {
                throw new ArgumentNullException("functionLookup");
            }

            if (functionInstanceLogger == null)
            {
                throw new ArgumentNullException("functionInstanceLogger");
            }

            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            _queue = queue;
            _queueConfiguration = queueConfiguration;
            _backgroundExceptionDispatcher = backgroundExceptionDispatcher;
            _log = log;
            _functionLookup = functionLookup;
            _functionInstanceLogger = functionInstanceLogger;
            _executor = executor;
        }

        public Task<IListener> CreateAsync(CancellationToken cancellationToken)
        {
            ITriggerExecutor<IStorageQueueMessage> triggerExecutor = new HostMessageExecutor(_executor, _functionLookup, _functionInstanceLogger);

            TimeSpan configuredMaximum = _queueConfiguration.MaxPollingInterval;
            // Provide an upper bound on the maximum polling interval for run/abort from dashboard.
            // Use the default maximum for host polling (1 minute) unless the configured overall maximum is even faster.
            TimeSpan maximum = configuredMaximum < DefaultMaximum ? configuredMaximum : DefaultMaximum;
            IDelayStrategy delayStrategy = new RandomizedExponentialBackoffStrategy(Minimum, maximum);

            IListener listener = new QueueListener(_queue,
                poisonQueue: null,
                triggerExecutor: triggerExecutor,
                delayStrategy: delayStrategy,
                backgroundExceptionDispatcher: _backgroundExceptionDispatcher,
                log: _log,
                sharedWatcher: null,
                queueConfiguration: _queueConfiguration);

            return Task.FromResult(listener);
        }
    }
}


text:
<?php

namespace RedBeanPHP\Plugins\RedSql\Filters;

class FilterAND extends NonArgumentedFilter
{
    public function apply(&$sql_reference)
    {
        $sql_reference .= " AND ";
    }
}


text:
require 'spec_helper'

describe Chef::Resource::RemoteFile do
  include_context Chef::Resource::File

  let(:file_base) { "remote_file_spec" }
  let(:source) { 'http://opscode-chef-spec-data.s3.amazonaws.com/integration/remote_file/nyan_cat.png' }
  let(:expected_content) { IO.read(File.join(CHEF_SPEC_DATA, 'remote_file', 'nyan_cat.png')) }

  def create_resource
    node = Chef::Node.new
    events = Chef::EventDispatch::Dispatcher.new
    run_context = Chef::RunContext.new(node, {}, events)
    resource = Chef::Resource::RemoteFile.new(path, run_context)
    resource.source(source)
    resource
  end

  let!(:resource) do
    create_resource
  end

  it_behaves_like "a file resource"
end


text:
/**
 * @module server
 */
/** End Typedoc Module Declaration */
import { ReflectiveInjector } from '@angular/core';
import { Logger } from '../../common/services/logger.service';
import {
  EntityType, RegistryEntityStatic,
  EntityMetadata, EntityRegistry
} from '../../common/registry/entityRegistry';

/**
 * Provides abstract class for all bootstrappers to extend with, common interface for the
 * bootstrap function to have a single pattern to invoke the bootstrappers
 */
export abstract class EntityBootstrapper {

  /** Array of all entities retrieved from the [[EntityRegistry]] */
  protected entities: RegistryEntityStatic<EntityMetadata>[];
  /** Reference to the Injector instance. Can be set with [[setInjector]]*/
  protected injector: ReflectiveInjector;
  /** Instance of Logger, initialized with the current implementations class name as source */
  protected logger: Logger;

  /**
   * Interface to get all injectable entities. Note that some bootstrappers should simply return
   * an empty array when their entities are not injectable. See [[ModelBootstrapper.getInjectableEntities]]
   * for an example of this.
   */
  public abstract getInjectableEntities(): RegistryEntityStatic<EntityMetadata>[];

  /**
   * Kick off the bootstrapping function. The logger instance is assigned here as the injector is
   * not available at constructor time.
   * @returns {void|Promise<void>}
   */
  public invokeBootstrap(): void | Promise<void> {
    this.logger = this.injector.get(Logger)
      .source(this.constructor.name);
    return this.bootstrap();
  }

  /**
   * Assign the current Injector to the class
   * @param injector
   * @returns {EntityBootstrapper}
   */
  public setInjector(injector: ReflectiveInjector): this {
    this.injector = injector;
    return this;
  }

  /**
   * Resolve & retrieve an instance of the entity from the injector. Note that depending on the
   * provider definition, this could be a different class to the passed token
   * @param token
   * @returns {T}
   */
  protected getInstance<T extends Object>(token: RegistryEntityStatic<EntityMetadata>): T {
    const instance: T = this.injector.get(token);

    this.logger.info(`Resolved ${instance.constructor.name}`);

    return instance;
  }

  /**
   * Run the bootstrap method. If the implementation returns a promise, bootstrapping is halted
   * until the promise resolves. If promise is rejected, bootstrapping is aborted.
   */
  protected abstract bootstrap(): void | Promise<void>;

  /**
   * Retrieve all entities of the given type, converted from Map to Array
   * @param type
   * @returns {any[]}
   */
  protected getFromRegistry(type: EntityType): RegistryEntityStatic<EntityMetadata>[] {
    return [...EntityRegistry.root.getAllOfType(type).values()];
  }

  /**
   * Retrieve the entities from the registry.
   *
   * @param type
   * @returns {RegistryEntityStatic[]}
   */
  protected getEntitiesFromRegistry(type: EntityType): RegistryEntityStatic<EntityMetadata>[] {

    // Note the apparent redundancy in assigning `this.entities` is intentional as the `entities`
    // property is used in the `getInjectableEntities` method of some implementations
    this.entities = this.getFromRegistry(type);
    return this.entities;
  }

}


text:
use diem_secure_push_metrics::MetricsPusher;
use std::path::PathBuf;
use structopt::StructOpt;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[derive(Debug, StructOpt)]
struct Opt {
    #[structopt(long, default_value = "500")]
    block_size: usize,

    #[structopt(subcommand)]
    cmd: Command,
}

#[derive(Debug, StructOpt)]
enum Command {
    CreateDb {
        #[structopt(long, parse(from_os_str))]
        data_dir: PathBuf,

        #[structopt(long, default_value = "1000000")]
        num_accounts: usize,

        #[structopt(long, default_value = "1000000")]
        init_account_balance: u64,

        #[structopt(long)]
        prune_window: Option<u64>,
    },
    RunExecutor {
        #[structopt(
            long,
            default_value = "1000",
            about = "number of transfer blocks to run"
        )]
        blocks: usize,

        #[structopt(long, parse(from_os_str))]
        data_dir: PathBuf,

        #[structopt(long, parse(from_os_str))]
        checkpoint_dir: PathBuf,

        #[structopt(
            long,
            about = "Verify sequence number of all the accounts after execution finishes"
        )]
        verify: bool,
    },
}

fn main() {
    let _mp = MetricsPusher::start();
    let opt = Opt::from_args();

    rayon::ThreadPoolBuilder::new()
        .thread_name(|index| format!("rayon-global-{}", index))
        .build_global()
        .expect("Failed to build rayon global thread pool.");

    match opt.cmd {
        Command::CreateDb {
            data_dir,
            num_accounts,
            init_account_balance,
            prune_window,
        } => {
            executor_benchmark::db_generator::run(
                num_accounts,
                init_account_balance,
                opt.block_size,
                data_dir,
                prune_window,
            );
        }
        Command::RunExecutor {
            blocks,
            data_dir,
            checkpoint_dir,
            verify,
        } => {
            diem_logger::Logger::new().init();
            executor_benchmark::run_benchmark(
                opt.block_size,
                blocks,
                data_dir,
                checkpoint_dir,
                verify,
            );
        }
    }
}


text:
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.Socket;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.Scanner;

//import javax.swing.JFrame;
//import javax.swing.JLabel;
//import javax.swing.JPanel;
//import javax.swing.JScrollPane;
//import javax.swing.JTextField;
//import javax.swing.ScrollPaneConstants;

public class Client{

//	private final static int WIDTH = 300;
//	private final static int HEIGHT = 200;
	private final static int TCP_Timeout = 3000;
	//private final static int UDP_Timeout = 1000;
	private final static int MAX_PACKET_SIZE = Server.getMaxPacketSize();

	private boolean running = false;
	private static String serverIP;
	private int clientIDNumber;
	private int UDPPort;

	private DatagramSocket UDPSocket;
	private static Socket TCPSocket;
	private static DataInputStream in;
	private static DataOutputStream out;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("Enter a server IP address, localhost, or join to join an open server:");
		serverIP = sc.nextLine();
		sc.close();
		new Client();
	}

	public Client(){
//		JFrame cf = new JFrame();
//		JPanel cp = new JPanel();
//		cp.setPreferredSize(new Dimension(WIDTH, HEIGHT));
//		cp.setBackground(Color.LIGHT_GRAY);
//		JLabel l = new JLabel();
//		l.setText("Type in IP address or select server from list.");
//		cp.add(l, BorderLayout.NORTH);
//		JTextField tf = new JTextField();
//		tf.setEditable(true);
//		tf.setPreferredSize(new Dimension(WIDTH, 20));
//		cp.add(tf, BorderLayout.CENTER);
//		JScrollPane sp = new JScrollPane();
//		sp.setPreferredSize(new Dimension(WIDTH, 155));
//		sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
//		cp.add(sp, BorderLayout.SOUTH);
//		cf.add(cp);
//		cf.pack();
//		cf.setResizable(false);
//		cf.setTitle("Client");
//		cf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//		cf.setLocationRelativeTo(null);
//		cf.setVisible(true);

		if(serverIP.equals("join")){
			serverIP = getServerIP();
			System.out.print(serverIP);
		}

		try {
			System.out.println("Connecting to TCP server...");
			TCPSocket = new Socket(serverIP, Server.getTCPPort());
			TCPSocket.setSoTimeout(TCP_Timeout);
			System.out.println("Connected.");
			in = new DataInputStream(TCPSocket.getInputStream());
			out = new DataOutputStream(TCPSocket.getOutputStream());
			System.out.println("Opening UDP socket...");
			UDPSocket = new DatagramSocket();
			UDPPort = UDPSocket.getLocalPort();
			//UDPSocket.setSoTimeout(UDP_Timeout);
			System.out.println("Socket opened.");
		} catch (IOException e) {
			System.err.println("Error in establishing server connections.");
			e.printStackTrace();
		}
		running = true;
		run();
	}

	public void run(){
		try {
			//receive and store assigned client ID number
			clientIDNumber = in.readInt();
			System.out.println("Assigned ID number: " + clientIDNumber);
			//send UDP port number to TCP server for storage and use by UDP server
			out.writeInt(UDPPort);
		} catch (IOException e) {
			System.err.println("Failure in communication with TCP server.");
			e.printStackTrace();
		}
		//turn server IP address into InetAddress
		InetAddress serverInetAddress = null;
		try {
			serverInetAddress = InetAddress.getByName(serverIP);
		} catch (UnknownHostException e) {
			System.err.println("Inavalid server IP.");
			e.printStackTrace();
		}
		while(running){
			//4 allocated because an integer is 32 bits = 4 bytes
			ByteBuffer b = ByteBuffer.allocate(4);
			b.putInt(clientIDNumber);
			byte[] statePacketBuf = b.array();
			DatagramPacket statePacket = new DatagramPacket(statePacketBuf, statePacketBuf.length, serverInetAddress, Server.getUDPPort());
			byte[] inPacketBuf = new byte[MAX_PACKET_SIZE];
			DatagramPacket inPacket = new DatagramPacket(inPacketBuf, inPacketBuf.length);
			try {
				UDPSocket.send(statePacket);
				UDPSocket.receive(inPacket);
				byte[] bytesReceived = inPacket.getData();
				ByteBuffer inByteBuffer = ByteBuffer.allocate(inPacketBuf.length);
				inByteBuffer.put(bytesReceived);
				inByteBuffer.flip();
				System.out.println("Client ID Number: " + clientIDNumber);
				System.out.println("Packet: " + inByteBuffer.getInt());
			} catch (IOException e) {
				System.err.println("Error in sending packet");
				e.printStackTrace();
			}
		}
	}

	public String getServerIP(){
		String serverIP = null;
		try {
			URL url = new URL("http://webdev.ausdk12.org/students/2015/ben_k/simple%20platform/levelsave.txt");
			Scanner reader = new Scanner(url.openStream());
			while(reader.hasNextLine()){
				serverIP = reader.nextLine();
			}
		    reader.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return serverIP;
	}
}


text:
typedef struct ProviderConfiguration
{
    char* ProviderName;
    unsigned long Keywords;
    unsigned short Level;
} ProviderConfiguration;

// List of provider configurations.
const unsigned int MaxProviders = 10;
ProviderConfiguration s_ProviderConfigurationList[10];

// Print the provider configuration at the specified index.
void PrintProvider(unsigned int index)
{
    ProviderConfiguration *pProv = &s_ProviderConfigurationList[index];
    printf("Name=%s, Keywords=%08lx, Level=%x\n", pProv->ProviderName, pProv->Keywords, pProv->Level);
}

ProviderConfiguration* GetProvider(unsigned int i)
{
    ProviderConfiguration *retVal = NULL;
    if(i < MaxProviders)
    {
        retVal = &s_ProviderConfigurationList[i];
    }

    return retVal;
}

// Set the provider configuration at the specified index.
void SetProvider(unsigned int index, char* provName, unsigned long keywords, unsigned short level)
{
    ProviderConfiguration *pProv = &s_ProviderConfigurationList[index];
    pProv->ProviderName = provName;
    pProv->Keywords = keywords;
    pProv->Level = level;
}

void ParseInput(char * input)
{
    // Parses a string with the following format:
    //
    //      ProviderName:Keywords:Level[,]*
    //
    // For example:
    //
    //      Microsoft-Windows-DotNETRuntime:0xCAFEBABE:2,Microsoft-Windows-DotNETRuntimePrivate:0xDEADBEEF:1
    //
    // Each provider configuration is separated by a ',' and each component within the configuration is
    // separated by a ':'.

    const char ProviderSeparatorChar = ',';
    const char ComponentSeparatorChar = ':';
    unsigned int len = strlen(input);
    unsigned int index = 0;
    unsigned int provConfigIndex = 0;

    while(index < len)
    {
        ProviderConfiguration *pProv = GetProvider(provConfigIndex++);
        if(pProv == NULL)
        {
            printf("NULL provider configuration.\n");
            return;
        }
        char * pCurrentChunk = &input[index];
        unsigned int currentChunkStartIndex = index;
        unsigned int currentChunkEndIndex = 0;

        // Find the next chunk.
        while(index < len && input[index] != ProviderSeparatorChar)
        {
            index++;
        }
        currentChunkEndIndex = index++;

        // Split the chunk into components.
        unsigned int chunkIndex = currentChunkStartIndex;

        // Get the provider name.
        unsigned int provNameStartIndex = chunkIndex;
        unsigned int provNameEndIndex = currentChunkEndIndex;

        while(chunkIndex < currentChunkEndIndex && input[chunkIndex] != ComponentSeparatorChar)
        {
            chunkIndex++;
        }
        provNameEndIndex = chunkIndex++;

        unsigned int provNameLen = provNameEndIndex - provNameStartIndex;
        pProv->ProviderName = malloc(provNameLen+1);
        memcpy(pProv->ProviderName, &input[provNameStartIndex], provNameLen);

        // Get the keywords.
        unsigned int keywordsStartIndex = chunkIndex;
        unsigned int keywordsEndIndex = currentChunkEndIndex;

        while(chunkIndex < currentChunkEndIndex && input[chunkIndex] != ComponentSeparatorChar)
        {
            chunkIndex++;
        }
        keywordsEndIndex = chunkIndex++;

        unsigned int keywordsLen = keywordsEndIndex - keywordsStartIndex;
        char keywords[keywordsLen+1];
        memcpy(keywords, &input[keywordsStartIndex], keywordsLen);
        keywords[keywordsLen] = '\0';
        pProv->Keywords = strtoul(keywords, NULL, 16);

        // Get the level.
        unsigned int levelStartIndex = chunkIndex;
        unsigned int levelEndIndex = currentChunkEndIndex;

        while(chunkIndex < currentChunkEndIndex && input[chunkIndex] != ComponentSeparatorChar)
        {
            chunkIndex++;
        }
        levelEndIndex = chunkIndex++;

        // Debug print the level.
        unsigned int levelLen = levelEndIndex - levelStartIndex;
        char level[levelLen+1];
        memcpy(level, &input[levelStartIndex], levelLen);
        level[levelLen] = '\0';
        pProv->Level = (unsigned short) strtoul(level, NULL, 16);
    }
}

int main(int argc, char* argv[])
{
    if(argc <= 1)
    {
        printf("No input specified.\n");
        return 0;
    }

    ParseInput(argv[1]);

    for(unsigned int i=0; i<MaxProviders; i++)
    {
        PrintProvider(i);
    }

    return 0;
}


text:
package org.jclouds.aws.ec2.features;

import static org.jclouds.aws.reference.FormParameters.ACTION;

import java.util.Map;

import javax.inject.Named;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

import org.jclouds.aws.ec2.domain.MonitoringState;
import org.jclouds.aws.ec2.xml.MonitoringStateHandler;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.binders.BindInstanceIdsToIndexedFormParams;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.FormParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.VirtualHost;
import org.jclouds.rest.annotations.XMLResponseParser;

/**
 * Provides access to EC2 Monitoring Services via their REST API.
 *

 */
@RequestFilters(FormSigner.class)
@VirtualHost
public interface MonitoringApi {

   /**
    * Enables monitoring for a running instance. For more information, refer to the Amazon
    * CloudWatch Developer Guide.
    *
    * @param region
    *           Instances are tied to Availability Zones. However, the instance ID is tied to the
    *           Region.
    * @see InstanceApi#runInstances
    * @see #unmonitorInstances
    *
    * @see
    */
   @Named("MonitorInstances")
   @POST
   @Path("/")
   @FormParams(keys = ACTION, values = "MonitorInstances")
   @XMLResponseParser(MonitoringStateHandler.class)
   Map<String, MonitoringState> monitorInstancesInRegion(
            @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
            @FormParam("InstanceId.0") String instanceId,
            @BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);

   /**
    * Disables monitoring for a running instance. For more information, refer to the Amazon
    * CloudWatch Developer Guide.
    *
    * @param region
    *           Instances are tied to Availability Zones. However, the instance ID is tied to the
    *           Region.
    *
    * @see InstanceApi#runInstances
    * @see #monitorInstances
    *
    * @see
    */
   @Named("UnmonitorInstances")
   @POST
   @Path("/")
   @FormParams(keys = ACTION, values = "UnmonitorInstances")
   @XMLResponseParser(MonitoringStateHandler.class)
   Map<String, MonitoringState> unmonitorInstancesInRegion(
            @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
            @FormParam("InstanceId.0") String instanceId,
            @BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
}


text: google-site-verification: google9589c40102d1e3e8.html


text: {{message}}


text:
.class Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;
.super Ljava/lang/Object;
.source "ISemService.java"

# interfaces
.implements Lcom/samsung/android/service/SemService/ISemService;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/samsung/android/service/SemService/ISemService$Stub;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "Proxy"
.end annotation

# instance fields
.field private mRemote:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0

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

    iput-object p1, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    return-void
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    return-object v0
.end method

.method public deactivate_Cards(I[Ljava/lang/String;[II)I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeInt(I)V

    invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeStringArray([Ljava/lang/String;)V

    invoke-virtual {v0, p3}, Landroid/os/Parcel;->writeIntArray([I)V

    invoke-virtual {v0, p4}, Landroid/os/Parcel;->writeInt(I)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x7

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public getCPLC14mode()Ljava/lang/String;
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x2

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->readString()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v2

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return-object v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public getInterfaceDescriptor()Ljava/lang/String;
    .locals 1

    const-string/jumbo v0, "com.samsung.android.service.SemService.ISemService"

    return-object v0
.end method

.method public getRestrictedCheck05mode()Ljava/lang/String;
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x1

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->readString()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v2

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return-object v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public get_AttackCountCheck([B)I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeByteArray([B)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x5

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v2

    invoke-virtual {v1, p1}, Landroid/os/Parcel;->readByteArray([B)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public get_HWParamData([BI)I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeByteArray([B)V

    invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeInt(I)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x4

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v2

    invoke-virtual {v1, p1}, Landroid/os/Parcel;->readByteArray([B)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public handle_CCM([BI)[Ljava/lang/String;
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v3, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeByteArray([B)V

    invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeInt(I)V

    iget-object v3, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x3

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    invoke-virtual {v1}, Landroid/os/Parcel;->createStringArray()[Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, p1}, Landroid/os/Parcel;->readByteArray([B)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return-object v2

    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public print_SeState()V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    :try_start_0
    const-string/jumbo v2, "com.samsung.android.service.SemService.ISemService"

    invoke-virtual {v0, v2}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/samsung/android/service/SemService/ISemService$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v3, 0x6

    const/4 v4, 0x0

    invoke-interface {v2, v3, v0, v1, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    return-void

    :catchall_0
    move-exception v2

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v2
.end method


text:
class StorySource < ActiveRecord::Base
  belongs_to :story
  belongs_to :source
end


text:
import virtualenv
from mock import patch, Mock

def test_version():
    """Should have a version string"""
    assert virtualenv.virtualenv_version, "Should have version"

@patch('os.path.exists')
def test_resolve_interpreter_with_absolute_path(mock_exists):
    """Should return absolute path if given and exists"""
    mock_exists.return_value = True
    virtualenv.is_executable = Mock(return_value=True)

    exe = virtualenv.resolve_interpreter("/usr/bin/python42")

    assert exe == "/usr/bin/python42", "Absolute path should return as is"
    mock_exists.assert_called_with("/usr/bin/python42")
    virtualenv.is_executable.assert_called_with("/usr/bin/python42")

@patch('os.path.exists')
def test_resolve_intepreter_with_nonexistant_interpreter(mock_exists):
    """Should exit when with absolute path if not exists"""
    mock_exists.return_value = False

    try:
        virtualenv.resolve_interpreter("/usr/bin/python42")
        assert False, "Should raise exception"
    except SystemExit:
        pass

    mock_exists.assert_called_with("/usr/bin/python42")

@patch('os.path.exists')
def test_resolve_intepreter_with_invalid_interpreter(mock_exists):
    """Should exit when with absolute path if not exists"""
    mock_exists.return_value = True
    virtualenv.is_executable = Mock(return_value=False)

    try:
        virtualenv.resolve_interpreter("/usr/bin/python42")
        assert False, "Should raise exception"
    except SystemExit:
        pass

    mock_exists.assert_called_with("/usr/bin/python42")
    virtualenv.is_executable.assert_called_with("/usr/bin/python42")


text:
<?php

namespace Richpolis\UsuariosBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\RoleInterface;

/**
 * Roles
 *
 * @ORM\Table(name="roles")
 * @ORM\Entity
 */
class Roles implements RoleInterface
{
	/**
	 * @var integer
	 *
	 * @ORM\Column(name="id", type="smallint")
	 * @ORM\Id
	 * @ORM\GeneratedValue(strategy="IDENTITY")
	 */
	private $id;

	/**
	 * @var string
	 *
	 * @ORM\Column(name="nombre", type="string", length=255, nullable=false)
	 */
	private $nombre;

	/**
	 * @var \Doctrine\Common\Collections\Collection
	 *
	 * @ORM\ManyToMany(targetEntity="Richpolis\UsuariosBundle\Entity\Usuario", mappedBy="rol")
	 */
	private $usuario;

	/**
	 * Constructor
	 */
	public function __construct()
	{
		$this->usuario = new \Doctrine\Common\Collections\ArrayCollection();
	}

    public function __toString(){
       return substr($this->getNombre(),5,strlen($this->getNombre()));
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Roles
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Add usuario
     *
     * @param \Richpolis\UsuariosBundle\Entity\Usuario $usuario
     * @return Roles
     */
    public function addUsuario(\Richpolis\UsuariosBundle\Entity\Usuario $usuario)
    {
        $this->usuario[] = $usuario;

        return $this;
    }

    /**
     * Remove usuario
     *
     * @param \Richpolis\UsuariosBundle\Entity\Usuario $usuario
     */
    public function removeUsuario(\Richpolis\UsuariosBundle\Entity\Usuario $usuario)
    {
        $this->usuario->removeElement($usuario);
    }

    /**
     * Get usuario
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getUsuario()
    {
        return $this->usuario;
    }

	public function getRole()
	{
		return $this->nombre;
	}
}


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "plan_de_estudio".
 *
 * @property integer $id_plan
 * @property integer $id_asig
 * @property integer $id_facultad
 * @property integer $curso
 * @property integer $semestre
 *
 * @property Asignaturas $idAsig
 * @property Facultades $idFacultad
 */
class PlanDeEstudio extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'plan_de_estudio';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id_asig', 'id_facultad', 'curso', 'semestre'], 'required', 'message'=>'Campo Obligatorio'],
            [['id_asig', 'id_facultad', 'curso', 'semestre'], 'integer'],
            [['id_asig'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            //'id_plan' => 'Id Plan',
            //'id_asig' => 'Id Asig',
            'id_facultad' => 'Facultad',
            'curso' => 'Curso',
            'semestre' => 'Semestre',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getIdAsig()
    {
        return $this->hasOne(Asignaturas::className(), ['id_asig' => 'id_asig']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getIdFacultad()
    {
        return $this->hasOne(Facultades::className(), ['id_facultad' => 'id_facultad']);
    }
}


text:
import os
import collections

import AnnotationLib
import argparse
import csv
import subprocess
from generate_accept_reject import get_hit_name
import AnnoList_pb2

from bash_var_to_py import bash_var_to_py

def parse_boxes(results):
    rest = results.split(',')[2:]
    boxes = []
    for i in range(0, len(rest), 6):
        boxes.append(map(float, rest[i:i+4]))
    return boxes

def get_path_from_s3(s3url, url_prefix):
    if not s3url.startswith(url_prefix):
        print "mismatch in url prefix\n\ts3url: {}\n\turl prefix: {}".format(s3url, url_prefix)
        assert(False);

    #return '/'.join(s3url.split('/')[4:])
    res = s3url[len(url_prefix):]
    return res;

def annotation_from_result(result, columns, url_prefix):
    hit_type = result[columns['Answer.results']].split(',')[0];

    if hit_type == "label_act":
        return annotation_labelact_from_result(result, columns, url_prefix);
    elif hit_type == "label_cars":
        return annotation_labelbox_from_result(result, columns, url_prefix);
    elif hit_type == "":
        #print "empty result, workerid: ", result[columns['workerid']]
        return annotation_empty_from_result(result, columns, url_prefix);
    else:
        print "unknown hit type: {}, result: {}".format(hit_type, result[columns['Answer.results']])
        assert(False);

def merge_labelact_annolist(annolist):
    name_to_idx = {};
    res_annolist = AnnotationLib.AnnoList();

    for a in annolist:
        if a.imageName in name_to_idx:
            aidx = name_to_idx[a.imageName];
            res_annolist[aidx].rects.extend(a.rects);
        else:
            res_annolist.append(a);
            name_to_idx[a.imageName] = len(res_annolist) - 1;

    return res_annolist;

def annotation_empty_from_result(result, columns, url_prefix):
    annotation = AnnotationLib.Annotation()
    image_url = get_path_from_s3(result[columns['annotation']], url_prefix)

    # remove parameters from filename
    param_idx = image_url.index('&');
    annotation.imageName = image_url[:param_idx];

    # MA: assume filenames don't contain ","
    cidx = annotation.imageName.find(',')
    if cidx >= 0:
        annotation.imageName = annotation.imageName[:cidx];

    assert(len(annotation.imageName) > 0);

    return annotation

ATTR_VAL_GENDER_MALE = 0;
ATTR_VAL_GENDER_FEMALE = 1;

ATTR_VAL_PTYPE_SALES = 0;
ATTR_VAL_PTYPE_CUST = 1;

ATTR_VAL_ACT_SALES_INT = 0;
ATTR_VAL_ACT_SALES_CLEAN = 1;
ATTR_VAL_ACT_SALES_OTHER = 2;

ATTR_VAL_ACT_CUST_QUEUE = 3;
ATTR_VAL_ACT_CUST_INT = 4;
ATTR_VAL_ACT_CUST_BROWSE = 5;
ATTR_VAL_ACT_CUST_OTHER = 6;

def annotation_labelact_from_result(result, columns, url_prefix):
    annotation = AnnotationLib.Annotation()
    image_url = get_path_from_s3(result[columns['annotation']], url_prefix)

    # remove parameters from filename
    param_idx = image_url.index('&');

    image_url_split = image_url[:param_idx].split(',');
    assert(len(image_url_split) == 5);

    annotation.imageName = image_url_split[0];

    rect = AnnotationLib.AnnoRect();
    rect.x1 = int(image_url_split[1])
    rect.y1 = int(image_url_split[2])
    rect.x2 = int(image_url_split[3])
    rect.y2 = int(image_url_split[4])

    result_split = result[columns['Answer.results']].split(',');
    assert(len(result_split) == 1 + 1 + 4 + 4);

    # male/female
    gender_idx_to_val = {0: ATTR_VAL_GENDER_MALE, 1: ATTR_VAL_GENDER_FEMALE};
    ptype_idx_to_val = {0: ATTR_VAL_PTYPE_SALES, 1: ATTR_VAL_PTYPE_CUST};

    sales_act_idx_to_val = {0: ATTR_VAL_ACT_SALES_INT, 1: ATTR_VAL_ACT_SALES_CLEAN, 2: ATTR_VAL_ACT_SALES_OTHER};
    cust_act_idx_to_val = {0: ATTR_VAL_ACT_CUST_QUEUE, 1: ATTR_VAL_ACT_CUST_INT, 2: ATTR_VAL_ACT_CUST_BROWSE, 3: ATTR_VAL_ACT_CUST_OTHER};

    gender_idx = int(result_split[-4]);
    rect.at["gender"] = gender_idx_to_val[gender_idx];

    # sales/cust
    ptype_idx = int(result_split[-3]);
    rect.at["ptype"] = ptype_idx_to_val[ptype_idx];

    if ptype_idx == 0:
        # interact/clean/other
        act_idx = int(result_split[-2]);
        rect.at["act"] = sales_act_idx_to_val[act_idx];
    else:
        # queue/interact/browse/other
        act_idx = int(result_split[-1]);
        rect.at["act"] = cust_act_idx_to_val[act_idx];

    annotation.rects.append(rect);
    return annotation

def annotation_labelbox_from_result(result, columns, url_prefix):
    annotation = AnnotationLib.Annotation()
    image_url = get_path_from_s3(result[columns['annotation']], url_prefix)
    boxes = parse_boxes(result[columns['Answer.results']])
    for box in boxes:
        annotation.rects.append(AnnotationLib.AnnoRect(*box))

    # remove parameters from filename
    param_idx = image_url.index('&');
    annotation.imageName = image_url[:param_idx];

    return annotation

def main():
    parser = argparse.ArgumentParser()

    parser.add_argument("hits_dir", help="hit directory")
    parser.add_argument("--print_empty", action="store_true", help="print info on empty hits");
    parser.add_argument("--save_worker_results", action="store_true", help="save results for each individual worker");

    #parser.add_argument("output_ext", default=".al", help="output format .idl/.al/.pal")
    #parser.add_argument("--url_prefix", help="path on S3 that should be removed when converting to annolist")

    args = parser.parse_args()

    #url_prefix = bash_var_to_py("./data_utils_init.sh", "S3_HOST_DIR")
    url_prefix = bash_var_to_py(args.hits_dir + "/hit_params.sh", "S3_HOST_DIR")

    args.output_ext = ".pal"

    if url_prefix[-1] != os.sep:
        url_prefix += os.sep;

    hit_name = get_hit_name(args.hits_dir)
    #pal_name = args.hits_dir + '/' + hit_name + '.pal'
    pal_name = args.hits_dir + '/' + hit_name + args.output_ext

    results_filename = args.hits_dir + '/' + hit_name + '.results'
    results_by_worker_dir = '%s/results_by_worker_%s' % (args.hits_dir, hit_name)
    subprocess.call(['mkdir', '-p', results_by_worker_dir])
    try:
        with open(args.hits_dir + '/bad_workers.txt', 'r') as f:
            bad_workerids = set(x.strip() for x in f.readlines())
    except IOError:
        bad_workerids = set()

    with open(results_filename, 'r') as results_file:
        results_list = list(csv.reader(results_file, delimiter='\t'))
        invert = lambda d: {v:k for k,v in d.iteritems()}
        columns = invert(dict(enumerate(results_list[0])))

        annotation_list = AnnotationLib.AnnoList();
        hit_type = "";

        for each in results_list[1:]:
            if each[columns['hitstatus']] == 'Reviewable' and each[columns['workerid']] not in bad_workerids:
                cur_hit_type = each[columns['Answer.results']].split(',')[0];
                if not hit_type:
                    hit_type = cur_hit_type;
                else:
                    assert(hit_type == cur_hit_type);

                a = annotation_from_result(each, columns, url_prefix);
                annotation_list.append(a);

        # MA: some hit types require special post-processing
        if hit_type == "label_act":
            annotation_list = merge_labelact_annolist(annotation_list);
            annotation_list.add_attribute("gender", int);
            annotation_list.add_attribute("ptype", int);
            annotation_list.add_attribute("act", int);

            annotation_list.add_attribute_val("gender", "male", ATTR_VAL_GENDER_MALE);
            annotation_list.add_attribute_val("gender", "female", ATTR_VAL_GENDER_FEMALE);

            annotation_list.add_attribute_val("ptype", "sales", ATTR_VAL_PTYPE_SALES);
            annotation_list.add_attribute_val("ptype", "customer", ATTR_VAL_PTYPE_CUST);

            annotation_list.add_attribute_val("act", "interact_with_customer", ATTR_VAL_ACT_SALES_INT);
            annotation_list.add_attribute_val("act", "clean", ATTR_VAL_ACT_SALES_CLEAN);
            annotation_list.add_attribute_val("act", "other_sales", ATTR_VAL_ACT_SALES_OTHER);

            annotation_list.add_attribute_val("act", "queue", ATTR_VAL_ACT_CUST_QUEUE);
            annotation_list.add_attribute_val("act", "interact_with_sales", ATTR_VAL_ACT_CUST_INT);
            annotation_list.add_attribute_val("act", "browse", ATTR_VAL_ACT_CUST_BROWSE);
            annotation_list.add_attribute_val("act", "other_customer", ATTR_VAL_ACT_CUST_OTHER);

        AnnotationLib.save(pal_name, annotation_list)

        if args.save_worker_results:
            for workerid in set(x[columns['workerid']] for x in results_list[1:]):
                if workerid == '':
                    print '%s missing entries' % sum(1 for each in results_list[1:]
                                                     if each[columns['workerid']] == '')
                    continue

                annotation_list = AnnotationLib.AnnoList([annotation_from_result(each, columns, url_prefix)
                                                          for each in results_list[1:]
                                                          if each[columns['hitstatus']] == 'Reviewable'
                                                          and each[columns['workerid']] == workerid]);

                output_filename = '%s/%s.pal' % (results_by_worker_dir, workerid);
                #print "saving ", output_filename;

                print "worker: {}, number of annotations: {}".format(workerid, len(annotation_list));
                AnnotationLib.save(output_filename, annotation_list)

        if args.print_empty:
            for res in results_list[1:]:
                if res[columns['Answer.results']] == "":
                    print "empty hit: ", res

        # show statistics on empty results (happens due to unknown bug in javascript tool)
        empty_res_workers = [each[columns['workerid']] for each in results_list[1:] if each[columns['Answer.results']] == ""];

        print "empty output by workerid: "
        for workerid, worker_empty_count in collections.Counter(empty_res_workers).items():
            print workerid, worker_empty_count

        num_empty = sum((1 for each in results_list[1:] if each[columns['Answer.results']] == ""));
        print "number of empty results: ", num_empty

if __name__ == '__main__':
    main()


text:
from simplebus import SimpleBus

def create_simplebus():
    bus = SimpleBus('unittests')
    bus.config.from_object(SimpleBusConfig())
    return bus

class SimpleBusConfig(object):
    pass


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gov.hhs.fha.nhinc.displayalert;

import gov.hhs.fha.nhinc.common.dda.GetMessagesResponseType.GetMessageResponse;
import java.util.Iterator;
import java.util.List;
import gov.hhs.fha.nhinc.common.dda.GetMessageDetailRequestType;
import gov.hhs.fha.nhinc.common.dda.GetMessageDetailResponseType;
import gov.hhs.fha.nhinc.common.dda.GetMessagesRequestType;
import gov.hhs.fha.nhinc.common.dda.GetMessagesResponseType;
import gov.hhs.fha.nhinc.common.dda.SetMessageRequestType;
import gov.hhs.fha.nhinc.common.dda.SetMessageResponseType;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author tnguyen
 */
public class DisplayAlertMessagesTest {

    public DisplayAlertMessagesTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    /**
     * Test of setMessage method, of class DisplayAlertMessages.
     */
    //@Test
    public void testSetMessage() {
        System.out.println("setMessage");

        SetMessageRequestType request = null;
        DisplayAlertMessages instance = new DisplayAlertMessages();
        SetMessageResponseType expResult = null;
        SetMessageResponseType result = instance.setMessage(request);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of getMessages method, of class DisplayAlertMessages.
     *
        DisplayAlertDataUtil util = new DisplayAlertDataUtil();
        GetMessagesRequestType componentRequest = new GetMessagesRequestType();
        componentRequest.setMessageType(request.getMessageType());
        componentRequest.setPatientId(request.getPatientId());
        componentRequest.setUserId(request.getUserId());
        componentRequest.setLocation(request.getLocation());
        // Fix this - do we need to pass MedAlerts?
        return util.getMessages("MedAlerts", componentRequest);
     *
     */
    //@Test
    public void testGetMessages_EMRinbox() {
        System.out.println("getMessages");

        System.out.println("GET EMR INBOX Alerts");
        GetMessagesRequestType request = new GetMessagesRequestType();
        request.setMessageType("Alert");
        request.setPatientId("99990070");
        request.setUserId("1");
        //request.setLocation("Archive");

        DisplayAlertMessages instance = new DisplayAlertMessages();
        GetMessagesResponseType result = instance.getMessages(request);

        List<GetMessageResponse> alist = result.getGetMessageResponse();
        Iterator<GetMessageResponse> iter = alist.iterator();
        while (iter.hasNext()) {
            GetMessageResponse msg = iter.next();
            System.out.println("ID/DESCR: "+msg.getMessageId()+" , "+msg.getDescription());

        }

        //assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }

    @Test
    public void testGetMessages_USERinbox() {
        System.out.println("getMessages");

        System.out.println("GET EMR INBOX Alerts");
        GetMessagesRequestType request = new GetMessagesRequestType();
        request.setMessageType("Alert");
        //request.setPatientId("99990070");
        request.setUserId("1");
        //request.setLocation("Archive");

        DisplayAlertMessages instance = new DisplayAlertMessages();
        GetMessagesResponseType result = instance.getMessages(request);

        List<GetMessageResponse> alist = result.getGetMessageResponse();
        Iterator<GetMessageResponse> iter = alist.iterator();
        while (iter.hasNext()) {
            GetMessageResponse msg = iter.next();
            System.out.println("ID/DESCR: "+msg.getMessageId()+" , "+msg.getDescription());

        }

    }

    /**
     * Test of getMessageDetail method, of class DisplayAlertMessages.
     */
    //@Test
    public void testGetMessageDetail() {
        System.out.println("getMessageDetail");
        GetMessageDetailRequestType request = null;
        DisplayAlertMessages instance = new DisplayAlertMessages();
        GetMessageDetailResponseType expResult = null;
        GetMessageDetailResponseType result = instance.getMessageDetail(request);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }
}