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

Mighty Joe Young (1998)

reviewed by
James Brundage

Mighty Joe Young

Directed by Ron Underwood

Written by Mark Rosenthal and Lawrence Konner

Starring Charlize Theron, Bill Paxton, David Paymer

Rating: 7/10

As Reviewed by James Brundage

     I'm beginning to get fed up.  Over my four years as a critic, the thing
which has kept me going is the moderate balance of films.  The good balances
the bad.  I try to see both in equal proportions.  But Disney's Mighty Joe
Young remake marks the fourth week in which I haven't seen a truly terrible
movie.

    It's a backwards machismo, I suppose, the urge to see the things which
you so loathe; but I need to see a bad film every once in a while.  And, you
know what, Mighty Joe Young doesn't qualify.

     Far from being bad, Mighty Joe Young is actually a family fun movie.
It's enjoyable, appropriate, cute, cuddly, and all of those other things
that I've been seeing in every movie since A Bug's Life.

     Mighty Joe Young tracks a 2,000 pound gorilla in the wilds of Africa
that is taken to a reserve in ... California? ... for safe-keeping.  Okay.
A little unrealistic, but who ever said a kid's movie had to have the
slightest hint of realism.  The first half of the movie is a Gorillas in the
Mist-esque hatred of poachers woman-of-the-wild motif.  The second half is a
straight up parody of King Kong, awestruck onlookers and all.

     Mark one down.  I'm feeling relaxed.  It is, as a point of fact, an
extremely un-creative movie.  But, as a vetern, I can say quite honestly
that creativity doesn't count for as much as it should.  So that saves
Mighty Joe from my wrath, although my colleagues and cohorts and surely
bashing this film at this very moment.

     This is not the film to take a girl on a date to.  It's not the film
for you.  It's the film for you and your family.  When you're right
alongside your kid, all of the normal rights and wrongs slip away.  The same
thing happens when you watch a horror movie or an action flick.  It becomes
fun.  All you have to do to enjoy Mighty Joe Young is shut up and watch.

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

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

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

Broken URLs inthe reviews are the responsibility of the author.

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

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


text:
require "spec_helper"

RSpec.feature "Throughout checkout process", type: :feature, js: true do
  let!(:country) do
    create(:country, name: "United States of America", states_required: true)
  end
  let!(:state) { create(:state, name: "Alabama", abbr: "AL", country: country) }

  let!(:shipping_calculator) { create(:calculator) }
  let!(:shipping_method) { create(:shipping_method) }
  let!(:stock_location) { create(:stock_location) }
  let!(:payment_method) { create(:check_payment_method) }

  let(:handling_fee_label) { "Custom handling fee" }
  let(:handling_fee_amount) { 1.23 }
  let(:purchase_quantity) { 2 }

  let!(:tax_category) { create(:tax_category) }
  let!(:variant) do
    create(:variant, handling_fee: handling_fee_amount,
                     tax_category: tax_category)
  end
  let!(:zone) do
    zone = create(:zone, name: "US", default_tax: true)
    zone.members.create(zoneable: country)
    zone
  end
  let!(:handling_fee_tax) do
    create(:handling_fee_tax, name: handling_fee_label,
                              zone: zone,
                              tax_category: tax_category)
  end

  before { visit spree.product_path(variant.product) }

  it "displays handling fee where available", js: true do
    # Product detail page
    fill_in "quantity", with: purchase_quantity

    click_button Spree.t(:add_to_cart)

    # Cart
    click_button Spree.t(:checkout)

    # Login (as a guest)
    fill_in "order_email", with: "me@example.com"

    click_button Spree.t(:continue)

    # Checkout - Address
    fill_in_address

    click_button Spree.t(:save_and_continue)

    # Checkout - Delivery
    expect(page).to have_content handling_fee_label
    expect(page).to have_content calculated_handling_fee

    click_button Spree.t(:save_and_continue)

    # Checkout - Payment
    expect(page).to have_content handling_fee_label
    expect(page).to have_content calculated_handling_fee

    click_button Spree.t(:save_and_continue)

    # Complete / Receipt
    expect(current_path).to include spree.order_path(Spree::Order.last)
    expect(page).to have_content Spree.t(:order_processed_successfully)
    expect(page).not_to have_content("#{Spree.t(:tax)}: #{handling_fee_label}")
    expect(page).to have_content handling_fee_label
    expect(page).to have_content calculated_handling_fee
  end

  def calculated_handling_fee
    fee = handling_fee_amount * purchase_quantity

    "$#{fee}"
  end

  def fill_in_address
    address = "order_bill_address_attributes"
    fill_in "#{address}_firstname", with: "Ryan"
    fill_in "#{address}_lastname", with: "Bigg"
    fill_in "#{address}_address1", with: "143 Swan Street"
    fill_in "#{address}_city", with: "Richmond"
    select "United States of America", from: "#{address}_country_id"
    select "Alabama", from: "#{address}_state_id"
    fill_in "#{address}_zipcode", with: "12345"
    fill_in "#{address}_phone", with: "(555) 555-5555"
  end
end

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by noel on 07/12/2015.
 */
(function(){
    var app = angular.module("Balance");
    app.controller("SettingController",['$http','$location','$window','$timeout','$scope','$localStorage','Worker','Parameter',function($http,$location,$window,$timeout,$scope,$localStorage,Worker,Parameter){
        //$window.localStorage.clear();

        //Variable definition
        /*
            Elements to edit:
                Workers
                    Edit Value and types of values
                Payments
                    Add new payment type, edit payment types, discounts and percents
                Hires
                    Edit text and variables that will be included on hire time
         */

        var self=this; //to access scope within callbacks

        //Control variable
        this.selected = false;
        this.hireShow = false;
        this.name = false;
        this.nominasShow=false;

        /*#################################
        Edit worker section     ~##########
        ################################*/

        this.nameFields = []; // Empty initial fields
        //CRUD Operation

        //CREATE
        this.addWorkerValue = function(value){
            console.log("add param");
            self.selectedInput = null;
            self.addValue = null;
            var newObject = {value:value.value,editing:false,type:value.type};
            self.nameFields.push(newObject);
            Parameter.save(newObject,function(data){
                self.updateParams();
            });
        };

        //RETRIEVE HTTP RETRIEVE TEMPORALLY COMMENTED OUT
        this.getParams = function(){
            console.log("getParamenters");
            Parameter.query(function(data){
                self.nameFields = [];
                console.log(data);
                data.forEach(function(object){
                    self.nameFields.push(object);
                });
                self.nameFields.forEach(function(element){
                    element.editing = false;
                })
            })
        };

        //UPDATE
        this.editName = function(field){
            this.nameFields.forEach(function(element){
                if (element == field){
                    console.log(element.editing);
                    if (element.editing == false){

                        element.editing = true;
                    }
                    else{
                        element.editing = false;
                        Parameter.update(element, function (data) {
                            self.updateParams();
                        });
                    }
                }
            });
        };

        //UPDATE PARAMS TEMPORALLY COMMENTED OUT
        this.updateParams = function(){
            console.log("updating");
            console.log($localStorage.WorkerParams);
            $localStorage.WorkerParams = self.nameFields;
        };
       /* this.updateParams = function(){
            var params=[];
            self.nameFields.forEach(function(field){
                params.push(field.value);
            });
            var parameters={params:params.join("__")};
            $http({
                method:'POST',
                url:'http://128.199.62.16:8080/api/trabajadores/setParams',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
                },
                data: $.param(parameters)
            }).success(function(data){
                self.getParams();
                console.log(data);
            }).error(function(data){
                console.log(data);
            });
        };
        */

        //DELETE HTTP DELETE TEMPORALLY COMMENTED OUT
        this.deleteName = function(name){
            var array = [];
            self.nameFields.forEach(function(element){
                if (element != name){
                    array.push(element);
                }
            });
            self.nameFields = array;
            Parameter.delete({},name,function(data){
                self.updateParams();
            });
        };

        this.inputType = ["text","number","checkbox","date"];

        /*#################################
          END Edit worker section     ~####
         ################################*/

//#########################################################################################
        /*#################################
          Edit Hire section           ~####
         ################################*/

        if ($localStorage.hire == undefined){
            $localStorage.hire = {};
        }
        this.hire= $localStorage.hire;
        this.hire.mode = "Preview";
        this.hire.preview = true;
        this.hire.editing = false;
        this.toggleEdit = function(){
            if (this.hire.mode == "Preview") {
                console.log("changing");
                this.hire.mode = "Editing";
                this.hire.editing = true;
                this.hire.preview = false;
            }
            else{
                this.hire.mode = "Preview";
                this.hire.editing = false;
                this.hire.preview = true;
            }
        };

        this.updateHire = function(){
            self.hire = $localStorage.hire;
            console.log($localStorage.hire);

        };
        this.updateLocalHire = function(){
            $localStorage.hire = self.hire;
            console.log($localStorage.hire);
        };

        this.addHireSection = function(section){

            $localStorage.hire.sections.push(section);
            self.updateHire();
        };

        this.addHireVariable = function(variable){
            if ($localStorage.hire.sections == undefined){
                console.log("section undefined");
                $localStorage.hire.sections == [{variables:[{variable:variable,text:""}]}];
                self.updateHire();
            }
            else{
                console.log("section defined");
                console.log($localStorage.hire);
                var last = $localStorage.hire.sections.length - 1;
                $localStorage.hire.sections[last].variables.push({variable:variable,text:""});
                self.updateHire();
            }

        };

        this.removeHireVariable = function(variable){
            $localStorage.hire.sections.forEach(function(section){
                var sectionArray=[];
               section.variables.forEach(function(element){
                   if (element.variable != variable){
                       sectionArray.push(element);
                   }
               });
                section.variables = sectionArray;
            });
            self.updateHire();
            self.checkEmptySections();
        };

        this.checkEmptySections = function(){
          var array = [];
            $localStorage.hire.sections.forEach(function(element){
                if (element != {variables:[]}){
                    array.push(element);
                }
            });
            $localStorage.hire.sections = array;
            self.updateHire();
        };

        this.checkSection = function(){
          if ($localStorage.hire.sections == undefined){
              $localStorage.hire.sections = [{number:0,name:"Contenedor",variables:[]}];
              self.updateHire();
          }
        };

        this.addVariable = function(value) {
            console.log("adding"  + value.value);
            console.log(self.selectedSession);
            self.hire.sections[self.selectedSession].variables.push({
                variable: value.value,
                text: '',
                centered: false,
                justify: false,
                right: false,
                left: false
            });
            self.sectionSelected = false;
            $localStorage.hire = self.hire;
        };

   //##############################################################################
        /*#################################
         Edit Nomina section           ~####
         ################################*/

        this.nominaExist = false;
        if ($localStorage.nominas == undefined){
            $localStorage.nominas = [];
        }
        this.nominas = $localStorage.nominas;

        //nominas array final result should look like this
        //nominas=[{name:"nombre",payments:[{type:"tipo",price:"precio", editing=false}],discounts:[{type:"tipo",price:"precio",percent:"porciento", editing=false}],editing=false},{},{},{}];
        //get will only get the nominas info without the editing value.

        this.editedNomina = "";

        //CRUD OPERATION

        //CREATE
        this.addNomina=function(nomina){
            self.checkNomina(nomina);
            if (!self.nominaExist){
                var object = {name:nomina,payments:[],discounts:[],editing:false};
                self.nominas.push(object);
                self.newNomina = "";
                self.addingNomina = false;
                self.updateNominas();
            }
        };

        this.checkNomina = function(name){
            if (name==""){
                self.nominaExist=true;
                self.addingNomina = false;
            }
            else {
                self.nominaExist = false;
                self.nominas.forEach(function (element) {
                    if (element.name == name) {
                        self.nominaExist = true;
                        $window.alert("ya existe una nomina con el mismo nombre");
                    }
                });
            }
        };

        //RETURN
        this.getNominas = function(){
            //get nominas from database $http.get operation
        };

        //UPDATE
        this.editNominaToggle = function(nomina){

        };

        this.updateNominas = function(){
            $localStorage.nominas = self.nominas;
          //http post operation with all data to update remotely the content of self.nominas
        };

        this.editNomina = function(nomina){
          self.nominas.forEach(function(element){
              if(element.name===nomina.name){
                  element.editing = !element.editing;
                  if (!element.editing){
                      self.checkNomina(self.editedNomina);
                  }
                  if (!self.nominaExist) {
                      if (self.editedNomina != "") {
                          console.log(self.editedNomina);
                          element.name = self.editedNomina;
                          self.updateNominas();
                      }
                      self.editedNomina = "";
                  }
              }
          })
        };

        //REMOVE
        this.removeNomina = function(nomina){
            if (nomina == self.selectedNomina ){
                self.nominaClicked = false;
                self.selectedNomina = "";
            }
            var newArray=[];
            self.nominas.forEach(function(element){
                if (element!=nomina){
                    newArray.push(element);
                }
            });
            self.nominas=[];
            self.nominas=newArray;
            self.updateNominas();
        };

        //Update payment type
        this.addPayment = function(payment){
            var add = true;
            self.selectedNomina.payments.forEach(function(element){
               if (element.type == payment.type){
                   $window.alert("Ya existe un pago con el mismo nombre");
                   add = false
               }
            });
            if (add) {
                this.selectedNomina.payments.push(payment);
                self.updateNominas();
            }
        };

        this.updatePayment = function(){
            if (!selectedPayment.editing){
                console.log("finish editing");
                //$http post stored payment.
            }
        };

        this.addDiscount = function(discount){
            var add = true;
            self.selectedNomina.discounts.forEach(function(element){
                if (element.type == discount.type){
                    $window.alert("ya existe un descuento con el mismo nombre");
                    add = false;
                }
            });
            if (add){
                this.selectedNomina.discounts.push(discount);
                self.updateNominas();
            }
        };

        //INITIALIZATION
        var init = function () {
            self.getParams();
            // check if there is query in url
            // and fire search in case its value is not empty
        };
        init();
    }]);
    app.directive('editTrabajadoresValues',function(){
        return{
            restrict: 'E',
            templateUrl: "templates/editTrabajadores.html",
            controller: "SettingController",
            controllerAs: "settings"
        }
    });

    app.directive('editHireValues',function(){
        return{
            restrict:'E',
            templateUrl: "templates/editHire.html",
            controller: "SettingController",
            controllerAs: "settings"
        }
    });
    app.directive('editNominaValues',function(){
        return{
            restrict:'E',
            templateUrl: "templates/nominas.html",
            controller: "SettingController",
            controllerAs: "settings"
        }
    });

})();


text:
// Generated by CoffeeScript 1.8.0
var async, createAudit, createAuditTable, createWidget, createWidgetTable, db, widget;

async = require('async');

db = require('pg-db')();

/*
Add an event handler to log all executed SQL:
 */

db.on('execute', function(data) {
  return console.log('SQL: %j', data.sql);
});

createWidgetTable = function(cb) {
  var sql;
  sql = "CREATE TABLE IF NOT EXISTS widget (\n  name      text,\n  price     numeric,\n  quantity  int\n)";
  return db.update(sql, function(err, rowCount) {
    return cb(err);
  });
};

createAuditTable = function(cb) {
  var sql;
  sql = "CREATE TABLE IF NOT EXISTS audit (\n  message     text,\n  created_at  timestamptz DEFAULT now()\n)";
  return db.update(sql, function(err, rowCount) {
    return cb(err);
  });
};

createWidget = function(widget, cb) {
  var sql;
  sql = "INSERT INTO widget\n(name, price, quantity)\nVALUES\n(:name, :price, :quantity)";
  return db.update(sql, widget, function(err, rowCount) {
    console.log('Insert count: %s rows', rowCount);
    return cb(err);
  });
};

createAudit = function(message, cb) {
  var sql;
  sql = "INSERT INTO audit\n(message)\nVALUES\n(:message)";
  return db.update(sql, {
    message: message
  }, function(err, rowCount) {
    console.log('Insert count: %s rows', rowCount);
    return cb(err);
  });
};

widget = {
  name: 'Foobar',
  price: 123.45,
  quantity: 200
};

db.tx.series([
  createWidgetTable, createAuditTable, function(cb) {
    return createWidget(widget, cb);
  }, function(cb) {
    return createAudit('Created widget with name: ' + widget.name, cb);
  }
], function(err) {
  if (err) {
    console.error('Transaction error: %s', err);
  } else {
    console.log('Transaction completed successfully');
  }
  return db.end();
});


text: echo AfterAllowTraffic>> %~dp0/../../../../../executed_proof_file


text:
.class Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;
.super Landroid/support/v4/view/ViewPropertyAnimatorListenerAdapter;
.source "AppCompatDelegateImplV9.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->onDestroyActionMode(Landroid/support/v7/view/ActionMode;)V
.end annotation

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

# instance fields
.field final synthetic this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

# direct methods
.method constructor <init>(Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;)V
    .registers 2
    .param p1, "this$1"    # Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    .prologue
    .line 1818
    iput-object p1, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    invoke-direct {p0}, Landroid/support/v4/view/ViewPropertyAnimatorListenerAdapter;-><init>()V

    return-void
.end method

# virtual methods
.method public onAnimationEnd(Landroid/view/View;)V
    .registers 5
    .param p1, "view"    # Landroid/view/View;

    .prologue
    const/4 v2, 0x0

    .line 1821
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModeView:Landroid/support/v7/widget/ActionBarContextView;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/support/v7/widget/ActionBarContextView;->setVisibility(I)V

    .line 1822
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModePopup:Landroid/widget/PopupWindow;

    if-eqz v0, :cond_36

    .line 1823
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModePopup:Landroid/widget/PopupWindow;

    invoke-virtual {v0}, Landroid/widget/PopupWindow;->dismiss()V

    .line 1827
    :cond_1d
    :goto_1d
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModeView:Landroid/support/v7/widget/ActionBarContextView;

    invoke-virtual {v0}, Landroid/support/v7/widget/ActionBarContextView;->removeAllViews()V

    .line 1828
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mFadeAnim:Landroid/support/v4/view/ViewPropertyAnimatorCompat;

    invoke-virtual {v0, v2}, Landroid/support/v4/view/ViewPropertyAnimatorCompat;->setListener(Landroid/support/v4/view/ViewPropertyAnimatorListener;)Landroid/support/v4/view/ViewPropertyAnimatorCompat;

    .line 1829
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iput-object v2, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mFadeAnim:Landroid/support/v4/view/ViewPropertyAnimatorCompat;

    .line 1830
    return-void

    .line 1824
    :cond_36
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModeView:Landroid/support/v7/widget/ActionBarContextView;

    invoke-virtual {v0}, Landroid/support/v7/widget/ActionBarContextView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    instance-of v0, v0, Landroid/view/View;

    if-eqz v0, :cond_1d

    .line 1825
    iget-object v0, p0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9$1;->this$1:Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9$ActionModeCallbackWrapperV9;->this$0:Landroid/support/v7/app/AppCompatDelegateImplV9;

    iget-object v0, v0, Landroid/support/v7/app/AppCompatDelegateImplV9;->mActionModeView:Landroid/support/v7/widget/ActionBarContextView;

    invoke-virtual {v0}, Landroid/support/v7/widget/ActionBarContextView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Landroid/view/View;

    invoke-static {v0}, Landroid/support/v4/view/ViewCompat;->requestApplyInsets(Landroid/view/View;)V

    goto :goto_1d
.end method


text:
#include "PlatformJsonArrayTest.h"
#include "../../Platform/Logger/Logger.h"
#include "../../Platform/Json/IJsonParser.h"
#include "../../Platform/Json/IJsonObject.h"
#include "../../Platform/Json/IJsonArray.h"

using namespace rmscore::platform::json;
using namespace rmscore::platform::logger;

void PlatformJsonArrayTest::testGetStringAt_data()
{
  QTest::addColumn<QString>("jsonAsString");
  QTest::addColumn<int>(    "index");
  QTest::addColumn<QString>("expectedValue");

  auto jsonAsString1 = "[\"python\",\"c++\",\"ruby\"]";

  QTest::newRow("0")
    << jsonAsString1
    << 0
    << "python";

  QTest::newRow("1")
    << jsonAsString1
    << 1
    << "c++";

  QTest::newRow("2")
    << jsonAsString1
    << 2
    << "ruby";
}

void PlatformJsonArrayTest::testGetStringAt()
{
  QFETCH(QString, jsonAsString);
  QFETCH(int,     index);
  QFETCH(QString, expectedValue);

  auto jsonArr = jsonAsString.toUtf8();

  auto pparser = IJsonParser::Create();
  auto p_arr   =
    pparser->ParseArray(rmscore::common::ByteArray(jsonArr.begin(),
                                                  jsonArr.end()));
  QVERIFY(p_arr != nullptr);

  try
  {
    QVERIFY(p_arr->GetStringAt(index) == expectedValue.toStdString());
  }
  catch (std::invalid_argument& e)
  {
    Logger::Error("Exception: %s", e.what());
  }
}

// void  PlatformJsonArrayTest::testGetObjectAt()
// {
//    QVERIFY2(false, "Not implemented");
// }
// void  PlatformJsonArrayTest::testGetObjectAt_data()
// {
//    QVERIFY2(false, "Not implemented");
// }

void PlatformJsonArrayTest::testAppendObject()
{
  auto pJsonObject1 = IJsonObject::Create();

  pJsonObject1->SetNamedString("myString", "MyStringValue");
  auto pJsonObject2 = IJsonObject::Create();
  pJsonObject2->SetNamedBool("myBool", true);
  pJsonObject2->SetNamedNumber("myNum", 1515);

  auto pJsonArray = IJsonArray::Create();
  pJsonArray->Append(*pJsonObject1);
  pJsonArray->Append(*pJsonObject2);
  rmscore::common::ByteArray stringified = pJsonArray->Stringify();
  QByteArray actualRes((const char *)stringified.data(), (int)stringified.size());
  QString jsonAsString = "[{\"myString\":\"MyStringValue\"},{\"myBool\":true,\"myNum\":1515}]";
  auto expectedRes = QJsonDocument::fromJson(jsonAsString.toUtf8()).toJson(QJsonDocument::Compact);
  QCOMPARE(actualRes, expectedRes);
}

void PlatformJsonArrayTest::testAppendString()
{
  auto pJsonArray = IJsonArray::Create();

  pJsonArray->Append("string1");
  pJsonArray->Append("string2");
  rmscore::common::ByteArray stringified = pJsonArray->Stringify();
  QByteArray actualRes((const char *)stringified.data(), (int)stringified.size());
  QString jsonAsString = "[\"string1\",\"string2\"]";
  auto expectedRes = QJsonDocument::fromJson(jsonAsString.toUtf8()).toJson(QJsonDocument::Compact);
  QCOMPARE(actualRes, expectedRes);
}


text:
<!DOCTYPE html>

<title></title>
#parse("sys/header.html")

			#if($shiro.hasPermission("position:save"))
			 新增
			#end
			#if($shiro.hasPermission("position:update"))
			 修改
			#end
			#if($shiro.hasPermission("position:delete"))
			 删除
			#end

{{title}}

		<form class="form-horizontal">

职位名称

			      <input type="text" class="form-control" v-model="position.position" placeholder="职位名称"/>

				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				  <input type="button" class="btn btn-warning" @click="reload" value="返回"/>

		</form>


text:
<!DOCTYPE html>

	<meta charset="<?php bloginfo('charset'); ?>" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<link rel="dns-prefetch" href="//www.google-analytics.com">

	<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
	<meta name="description" content="<?php bloginfo('description'); ?>" />
	<meta name="author" content="Bill Patrianakos" />
	<link rel="author" href="<?php bloginfo('template_url'); ?>/humans.txt" />

	<meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/style.css?v=2" />
	<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,300italic|Arvo:400,700' rel='stylesheet' type='text/css'>

	<?php wp_head(); ?>

<body <?php body_class(); ?>>

				<a href="<?php echo home_url('/'); ?>" class="logo">UBR The Internet User's Bill of Rights

				<?php html5blank_nav(); ?>


text:
self.addEventListener('fetch', event => {
  if (event.request.url.indexOf('fallthrough') != -1) {
    return;
  }
  if (event.request.url.indexOf('respondWithFetch') != -1) {
    event.respondWith(fetch(event.request));
    return;
  }
});


text:
@interface PodsDummy_SimpleExtensions : NSObject
@end
@implementation PodsDummy_SimpleExtensions
@end


text:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

public class SpellChecker {

  static ArrayList<String> dict;
  static ArrayList<String> document;
  static HashMap<Character, Pointers> pointerReference;
  static String docCurrentLine;
  static char firstChar;

 public static void main(String[] args){
	 readDictionary(args[1]);
	 BufferedReader readDocument;
	try {
		readDocument = new BufferedReader(new FileReader(args[0]));
		document = new ArrayList<>();
		 while ((docCurrentLine = readDocument.readLine()) != null) {
			 firstChar = docCurrentLine.charAt(0);
			 int returnValue =  Arrays.binarySearch(dict.toArray(), pointerReference.get(firstChar).getStartReference(), pointerReference.get(firstChar).getEndReference(), docCurrentLine);
			 if(returnValue < 0){
				 int replaceValue = returnValue * -1;
				 docCurrentLine = dict.get(replaceValue);

			 }
			 document.add(docCurrentLine);
			}
	} catch (FileNotFoundException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}

	// writing the file from the array

	File fileOutput = new File("document-corrected.txt");
    try {
			fileOutput.createNewFile();
			FileWriter fw = new FileWriter(fileOutput.getAbsoluteFile());
			BufferedWriter bw = new BufferedWriter(fw);
			for (int i = 0;i<=document.size()-1; i++)
			{
				bw.write(document.get(i)+"\n");
			}
			bw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
 }

   public static void readDictionary(String file){
	   String sCurrentLine;
	   BufferedReader br;
	   char firstLetter;
	   int startReference = 0, currentReference  = 0;
	   pointerReference = new HashMap<Character, Pointers>();
	   dict = new ArrayList<>();
		try {
			br = new BufferedReader(new FileReader(file));
			firstLetter = br.readLine().charAt(0);
			System.out.println(firstLetter);
			while ((sCurrentLine = br.readLine()) != null) {
				currentReference++;
				dict.add(sCurrentLine);
				char first = sCurrentLine.charAt(0);
				if(firstLetter != first){
					Pointers pointer = new Pointers(startReference, currentReference-1, firstLetter);
					pointerReference.put(firstLetter, pointer );
					// this is the beginning of another first character
					firstLetter = first;
					startReference = currentReference;
				}

			}
		}
		catch (FileNotFoundException  e) {
			e.printStackTrace();
		}
		catch (IOException e) {
			e.printStackTrace();
		}
 }

}


text: PatternFinder


text:
package org.apache.ignite.internal.processors.cache.query.continuous;

import java.io.Serializable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import javax.cache.configuration.FactoryBuilder;
import javax.cache.configuration.MutableCacheEntryListenerConfiguration;
import javax.cache.event.CacheEntryCreatedListener;
import javax.cache.event.CacheEntryEvent;
import javax.cache.event.CacheEntryListenerException;
import javax.cache.event.CacheEntryUpdatedListener;
import javax.cache.processor.EntryProcessorException;
import javax.cache.processor.MutableEntry;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
import org.apache.ignite.cache.CacheEntryProcessor;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cache.query.ContinuousQuery;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteAsyncCallback;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionSerializationException;
import org.junit.Test;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;

/**
 *
 */
public class CacheContinuousQueryAsyncFilterListenerTest extends GridCommonAbstractTest {
    /** */
    private static final int NODES = 5;

    /** */
    public static final int ITERATION_CNT = 100;

    /** */
    private boolean client;

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

        cfg.setClientMode(client);

        MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
        storeSpi.setExpireCount(1000);

        cfg.setEventStorageSpi(storeSpi);

        return cfg;
    }

    /** {@inheritDoc} */
    @Override protected void beforeTestsStarted() throws Exception {
        super.beforeTestsStarted();

        startGridsMultiThreaded(NODES - 1);

        client = true;

        startGrid(NODES - 1);
    }

    ///
    /// ASYNC FILTER AND LISTENER. TEST LISTENER.
    ///

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerTx() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerTxJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerMvccTx() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerMvccTxJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerAtomic() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerAtomicJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, ATOMIC), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedAtomic() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedAtomicJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, ATOMIC), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedAtomicOffHeapValues() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerAtomicWithoutBackup() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 0, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerAtomicWithoutBackupJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 0, ATOMIC), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListener() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicated() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedJCacheApi() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerMvcc() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedMvcc() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInListenerReplicatedJCacheApiMvcc() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL_SNAPSHOT), true, true, true);
    }

    ///
    /// ASYNC FILTER AND LISTENER. TEST FILTER.
    ///

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterTx() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterTxJCacheApi() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterMvccTx() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterMvccTxJCacheApi() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterAtomic() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterAtomicJCacheApi() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, ATOMIC), true, true, true);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedAtomic() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(REPLICATED, 2, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterAtomicWithoutBackup() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 0, ATOMIC), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilter() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicated() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedJCacheApi() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterMvcc() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedMvcc() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedJCacheApiMvcc() throws Exception {
        testNonDeadLockInFilter(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL_SNAPSHOT), true, true, false);
    }

    ///
    /// ASYNC LISTENER. TEST LISTENER.
    ///

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterTxSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterMvccTxSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterAtomicSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, ATOMIC), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedAtomicSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, ATOMIC), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterAtomicWithoutBackupSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 0, ATOMIC), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedSyncFilter() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterSyncFilterMvcc() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(PARTITIONED, 2, TRANSACTIONAL_SNAPSHOT), false, true, false);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testNonDeadLockInFilterReplicatedSyncFilterMvcc() throws Exception {
        testNonDeadLockInListener(cacheConfiguration(REPLICATED, 2, TRANSACTIONAL_SNAPSHOT), false, true, false);
    }

    /**
     * @param ccfg Cache configuration.
     * @param asyncFltr Async filter.
     * @param asyncLsnr Async listener.
     * @param jcacheApi Use JCache api for registration entry update listener.
     * @throws Exception If failed.
     */
    private void testNonDeadLockInListener(CacheConfiguration ccfg,
        final boolean asyncFltr,
        boolean asyncLsnr,
        boolean jcacheApi) throws Exception {
        ignite(0).createCache(ccfg);

        ThreadLocalRandom rnd = ThreadLocalRandom.current();

        try {
            for (int i = 0; i < ITERATION_CNT; i++) {
                log.info("Start iteration: " + i);

                int nodeIdx = i % NODES;

                final String cacheName = ccfg.getName();
                final IgniteCache cache = grid(nodeIdx).cache(cacheName);

                final QueryTestKey key = NODES - 1 != nodeIdx ? affinityKey(cache) : new QueryTestKey(1);

                final QueryTestValue val0 = new QueryTestValue(1);
                final QueryTestValue newVal = new QueryTestValue(2);

                final CountDownLatch latch = new CountDownLatch(1);
                final CountDownLatch evtFromLsnrLatch = new CountDownLatch(1);

                IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> fltrClsr =
                    new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {
                        @Override public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey,
                            ? extends QueryTestValue> e) {
                            if (asyncFltr) {
                                assertFalse("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("sys-"));

                                assertTrue("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("callback-"));
                            }
                        }
                    };

                IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> lsnrClsr =
                    new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {
                        @Override public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey,
                            ? extends QueryTestValue> e) {
                            IgniteCache<Object, Object> cache0 = ignite.cache(cacheName);

                            QueryTestValue val = e.getValue();

                            if (val == null)
                                return;
                            else if (val.equals(newVal)) {
                                evtFromLsnrLatch.countDown();

                                return;
                            }
                            else if (!val.equals(val0))
                                return;

                            // For MVCC mode we need to wait until updated value becomes visible. Usually this is
                            // several ms to wait - mvcc coordinator need some time to register tx as finished.
                            if (ccfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT) {
                                Object v = null;

                                while (v == null && !Thread.currentThread().isInterrupted()) {
                                    v = cache0.get(key);

                                    if (v == null)
                                        doSleep(50);
                                }
                            }

                            try {
                                assertEquals(val, val0);

                                if (atomicityMode(cache0) != ATOMIC) {
                                    boolean committed = false;

                                    while (!committed && !Thread.currentThread().isInterrupted()) {
                                        try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
                                            cache0.put(key, newVal);

                                            tx.commit();

                                            committed =true;
                                        }
                                        catch (Exception ex) {
                                            assertTrue(ex.getCause() instanceof TransactionSerializationException);
                                            assertEquals(atomicityMode(cache0), TRANSACTIONAL_SNAPSHOT);
                                        }
                                    }
                                }
                                else
                                    cache0.put(key, newVal);

                                latch.countDown();
                            }
                            catch (Exception exp) {
                                log.error("Failed: ", exp);

                                throw new IgniteException(exp);
                            }
                        }
                    };

                QueryCursor qry = null;
                MutableCacheEntryListenerConfiguration<QueryTestKey, QueryTestValue> lsnrCfg = null;

                CacheInvokeListener locLsnr = asyncLsnr ? new CacheInvokeListenerAsync(lsnrClsr)
                    : new CacheInvokeListener(lsnrClsr);

                CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue> rmtFltr = asyncFltr ?
                    new CacheTestRemoteFilterAsync(fltrClsr) : new CacheTestRemoteFilter(fltrClsr);

                if (jcacheApi) {
                    lsnrCfg = new MutableCacheEntryListenerConfiguration<>(
                        FactoryBuilder.factoryOf(locLsnr),
                        FactoryBuilder.factoryOf(rmtFltr),
                        true,
                        false
                    );

                    cache.registerCacheEntryListener(lsnrCfg);
                }
                else {
                    ContinuousQuery<QueryTestKey, QueryTestValue> conQry = new ContinuousQuery<>();

                    conQry.setLocalListener(locLsnr);

                    conQry.setRemoteFilterFactory(FactoryBuilder.factoryOf(rmtFltr));

                    qry = cache.query(conQry);
                }

                try {
                    if (rnd.nextBoolean())
                        cache.put(key, val0);
                    else {
                        cache.invoke(key, new CacheEntryProcessor() {
                            @Override public Object process(MutableEntry entry, Object... arguments)
                                throws EntryProcessorException {
                                entry.setValue(val0);

                                return null;
                            }
                        });
                    }

                    assertTrue("Failed to waiting event.", U.await(latch, 3, SECONDS));

                    assertEquals(cache.get(key), new QueryTestValue(2));

                    assertTrue("Failed to waiting event from listener.", U.await(latch, 3, SECONDS));
                }
                finally {
                    if (qry != null)
                        qry.close();

                    if (lsnrCfg != null)
                        cache.deregisterCacheEntryListener(lsnrCfg);
                }

                log.info("Iteration finished: " + i);
            }
        }
        finally {
            ignite(0).destroyCache(ccfg.getName());
        }
    }

    /**
     * @param ccfg Cache configuration.
     * @param asyncFilter Async filter.
     * @param asyncLsnr Async listener.
     * @param jcacheApi Use JCache api for start update listener.
     * @throws Exception If failed.
     */
    private void testNonDeadLockInFilter(CacheConfiguration ccfg,
        final boolean asyncFilter,
        final boolean asyncLsnr,
        boolean jcacheApi) throws Exception {
        ignite(0).createCache(ccfg);

        ThreadLocalRandom rnd = ThreadLocalRandom.current();

        try {
            for (int i = 0; i < ITERATION_CNT; i++) {
                log.info("Start iteration: " + i);

                int nodeIdx = i % NODES;

                final String cacheName = ccfg.getName();
                final IgniteCache cache = grid(nodeIdx).cache(cacheName);

                final QueryTestKey key = NODES - 1 != nodeIdx ? affinityKey(cache) : new QueryTestKey(1);

                final QueryTestValue val0 = new QueryTestValue(1);
                final QueryTestValue newVal = new QueryTestValue(2);

                final CountDownLatch latch = new CountDownLatch(1);
                final CountDownLatch evtFromLsnrLatch = new CountDownLatch(1);

                IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> fltrClsr =
                    new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {
                        @Override public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey,
                            ? extends QueryTestValue> e) {
                            if (asyncFilter) {
                                assertFalse("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("sys-"));

                                assertTrue("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("callback-"));
                            }

                            IgniteCache<Object, Object> cache0 = ignite.cache(cacheName);

                            QueryTestValue val = e.getValue();

                            if (val == null)
                                return;
                            else if (val.equals(newVal)) {
                                evtFromLsnrLatch.countDown();

                                return;
                            }
                            else if (!val.equals(val0))
                                return;

                            try {
                                assertEquals(val, val0);

                                if (atomicityMode(cache0) != ATOMIC) {
                                    boolean committed = false;

                                    while (!committed && !Thread.currentThread().isInterrupted()) {
                                        try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {

                                            cache0.put(key, newVal);

                                            tx.commit();

                                            committed =true;
                                        }
                                        catch (Exception ex) {
                                            assertTrue(ex.toString(), X.hasCause(ex, TransactionSerializationException.class));
                                            assertEquals(atomicityMode(cache0), TRANSACTIONAL_SNAPSHOT);
                                        }
                                    }
                                }
                                else
                                    cache0.put(key, newVal);

                                latch.countDown();
                            }
                            catch (Exception exp) {
                                log.error("Failed: ", exp);

                                throw new IgniteException(exp);
                            }
                        }
                    };

                IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> lsnrClsr =
                    new IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>>() {
                        @Override public void apply(Ignite ignite, CacheEntryEvent<? extends QueryTestKey,
                            ? extends QueryTestValue> e) {
                            if (asyncLsnr) {
                                assertFalse("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("sys-"));

                                assertTrue("Failed: " + Thread.currentThread().getName(),
                                    Thread.currentThread().getName().contains("callback-"));
                            }

                            QueryTestValue val = e.getValue();

                            if (val == null || !val.equals(new QueryTestValue(1)))
                                return;

                            assertEquals(val, val0);

                            latch.countDown();
                        }
                    };

                QueryCursor qry = null;
                MutableCacheEntryListenerConfiguration<QueryTestKey, QueryTestValue> lsnrCfg = null;

                CacheInvokeListener locLsnr = asyncLsnr ? new CacheInvokeListenerAsync(lsnrClsr)
                    : new CacheInvokeListener(lsnrClsr);

                CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue> rmtFltr = asyncFilter ?
                    new CacheTestRemoteFilterAsync(fltrClsr) : new CacheTestRemoteFilter(fltrClsr);

                if (jcacheApi) {
                    lsnrCfg = new MutableCacheEntryListenerConfiguration<>(
                        FactoryBuilder.factoryOf(locLsnr),
                        FactoryBuilder.factoryOf(rmtFltr),
                        true,
                        false
                    );

                    cache.registerCacheEntryListener(lsnrCfg);
                }
                else {
                    ContinuousQuery<QueryTestKey, QueryTestValue> conQry = new ContinuousQuery<>();

                    conQry.setLocalListener(locLsnr);

                    conQry.setRemoteFilterFactory(FactoryBuilder.factoryOf(rmtFltr));

                    qry = cache.query(conQry);
                }

                try {
                    if (rnd.nextBoolean())
                        cache.put(key, val0);
                    else
                        cache.invoke(key, new CacheEntryProcessor() {
                            @Override public Object process(MutableEntry entry, Object... arguments)
                                throws EntryProcessorException {
                                entry.setValue(val0);

                                return null;
                            }
                        });

                    assert U.await(latch, 3, SECONDS) : "Failed to waiting event.";

                    assertEquals(cache.get(key), new QueryTestValue(2));

                    assertTrue("Failed to waiting event from filter.", U.await(latch, 3, SECONDS));
                }
                finally {
                    if (qry != null)
                        qry.close();

                    if (lsnrCfg != null)
                        cache.deregisterCacheEntryListener(lsnrCfg);
                }

                log.info("Iteration finished: " + i);
            }
        }
        finally {
            ignite(0).destroyCache(ccfg.getName());
        }
    }

    /**
     * @param cache Ignite cache.
     * @return Key.
     */
    private QueryTestKey affinityKey(IgniteCache cache) {
        Affinity aff = affinity(cache);

        for (int i = 0; i < 10_000; i++) {
            QueryTestKey key = new QueryTestKey(i);

            if (aff.isPrimary(localNode(cache), key))
                return key;
        }

        throw new IgniteException("Failed to found primary key.");
    }

    /** {@inheritDoc} */
    @Override protected long getTestTimeout() {
        return TimeUnit.SECONDS.toMillis(2 * 60);
    }

    /**
     *
     */
    @IgniteAsyncCallback
    private static class CacheTestRemoteFilterAsync extends CacheTestRemoteFilter {
        /**
         * @param clsr Closure.
         */
        public CacheTestRemoteFilterAsync(
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> clsr) {
            super(clsr);
        }
    }

    /**
     *
     */
    private static class CacheTestRemoteFilter implements
        CacheEntryEventSerializableFilter<QueryTestKey, QueryTestValue> {
        /** */
        @IgniteInstanceResource
        private Ignite ignite;

        /** */
        private IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> clsr;

        /**
         * @param clsr Closure.
         */
        public CacheTestRemoteFilter(IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey,
            ? extends QueryTestValue>> clsr) {
            this.clsr = clsr;
        }

        /** {@inheritDoc} */
        @Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e)
            throws CacheEntryListenerException {
            clsr.apply(ignite, e);

            return true;
        }
    }

    /**
     *
     */
    @IgniteAsyncCallback
    private static class CacheInvokeListenerAsync extends CacheInvokeListener {
        /**
         * @param clsr Closure.
         */
        public CacheInvokeListenerAsync(
            IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> clsr) {
            super(clsr);
        }
    }

    /**
     *
     */
    private static class CacheInvokeListener implements CacheEntryUpdatedListener<QueryTestKey, QueryTestValue>,
        CacheEntryCreatedListener<QueryTestKey, QueryTestValue>, Serializable {
        @IgniteInstanceResource
        private Ignite ignite;

        /** */
        private IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue>> clsr;

        /**
         * @param clsr Closure.
         */
        public CacheInvokeListener(IgniteBiInClosure<Ignite, CacheEntryEvent<? extends QueryTestKey,
            ? extends QueryTestValue>> clsr) {
            this.clsr = clsr;
        }

        /** {@inheritDoc} */
        @Override public void onUpdated(Iterable<CacheEntryEvent<? extends QueryTestKey,
            ? extends QueryTestValue>> events)
            throws CacheEntryListenerException {
            for (CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e : events)
                clsr.apply(ignite, e);
        }

        /** {@inheritDoc} */
        @Override public void onCreated(Iterable<CacheEntryEvent<? extends QueryTestKey,
            ? extends QueryTestValue>> events) throws CacheEntryListenerException {
            for (CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e : events)
                clsr.apply(ignite, e);
        }
    }

    /**
     * @param cacheMode Cache mode.
     * @param backups Number of backups.
     * @param atomicityMode Cache atomicity mode.
     * @return Cache configuration.
     */
    protected CacheConfiguration<Object, Object> cacheConfiguration(
        CacheMode cacheMode,
        int backups,
        CacheAtomicityMode atomicityMode) {
        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

        ccfg.setName("test-cache-" + atomicityMode + "-" + cacheMode + "-" + backups);
        ccfg.setAtomicityMode(atomicityMode);
        ccfg.setCacheMode(cacheMode);
        ccfg.setWriteSynchronizationMode(FULL_SYNC);

        if (cacheMode == PARTITIONED)
            ccfg.setBackups(backups);

        return ccfg;
    }

    /**
     *
     */
    public static class QueryTestKey implements Serializable, Comparable {
        /** */
        private final Integer key;

        /**
         * @param key Key.
         */
        public QueryTestKey(Integer key) {
            this.key = key;
        }

        /** {@inheritDoc} */
        @Override public boolean equals(Object o) {
            if (this == o)
                return true;

            if (o == null || getClass() != o.getClass())
                return false;

            QueryTestKey that = (QueryTestKey)o;

            return key.equals(that.key);
        }

        /** {@inheritDoc} */
        @Override public int hashCode() {
            return key.hashCode();
        }

        /** {@inheritDoc} */
        @Override public String toString() {
            return S.toString(QueryTestKey.class, this);
        }

        /** {@inheritDoc} */
        @Override public int compareTo(Object o) {
            return key - ((QueryTestKey)o).key;
        }
    }

    /**
     *
     */
    public static class QueryTestValue implements Serializable {
        /** */
        @GridToStringInclude
        protected final Integer val1;

        /** */
        @GridToStringInclude
        protected final String val2;

        /**
         * @param val Value.
         */
        public QueryTestValue(Integer val) {
            this.val1 = val;
            this.val2 = String.valueOf(val);
        }

        /** {@inheritDoc} */
        @Override public boolean equals(Object o) {
            if (this == o)
                return true;

            if (o == null || getClass() != o.getClass())
                return false;

            QueryTestValue that = (QueryTestValue)o;

            return val1.equals(that.val1) && val2.equals(that.val2);
        }

        /** {@inheritDoc} */
        @Override public int hashCode() {
            int res = val1.hashCode();

            res = 31 * res + val2.hashCode();

            return res;
        }

        /** {@inheritDoc} */
        @Override public String toString() {
            return S.toString(QueryTestValue.class, this);
        }
    }
}


text:
<?php

namespace Nokaut\ApiKit\Ext\Data\Converter\Filters;

use Nokaut\ApiKit\Collection\Products;
use Nokaut\ApiKit\Entity\Metadata\Facet\PropertyFacet\Range;
use Nokaut\ApiKit\Ext\Data\Collection\Filters\PropertyRanges;
use Nokaut\ApiKit\Ext\Data\Collection\Filters\PropertyValues;
use Nokaut\ApiKit\Ext\Data\Converter\ConverterInterface;
use Nokaut\ApiKit\Ext\Data\Collection\Filters\PropertyAbstract;
use Nokaut\ApiKit\Ext\Data\Converter\Filters\Callback\Property\CallbackInterface;
use Nokaut\ApiKit\Ext\Data\Entity\Filter\PropertyRange;
use Nokaut\ApiKit\Ext\Data\Entity\Filter\PropertyValue;

class PropertiesConverter implements ConverterInterface
{
    /**
     * @param Products $products
     * @param CallbackInterface[] $callbacks
     * @return PropertyAbstract[]
     */
    public function convert(Products $products, $callbacks = array())
    {
        $propertiesInitialConverted = $this->initialConvert($products);
        $properties = array();

        foreach ($propertiesInitialConverted as $property) {
            foreach ($callbacks as $callback) {
                $callback($property, $products);
            }
            $properties[] = $property;
        }

        return $properties;
    }

    /**
     * @param Products $products
     * @return PropertyAbstract[]
     */
    protected function initialConvert(Products $products)
    {
        $facetProperties = $products->getProperties();

        $properties = array();

        foreach ($facetProperties as $facetProperty) {
            $entities = array();
            if ($facetProperty->getRanges()) {
                foreach ($facetProperty->getRanges() as $range) {
                    $entity = new PropertyRange();
                    $entity->setName($this->getPropertyRangeName($range));
                    $entity->setUrl($range->getUrl());
                    $entity->setIsFilter($range->getIsFilter());
                    $entity->setTotal((int)$range->getTotal());
                    $entity->setMin($range->getMin());
                    $entity->setMax($range->getMax());
                    $entities[] = $entity;
                }

                $property = new PropertyRanges($entities);
            } else {
                foreach ($facetProperty->getValues() as $value) {
                    $entity = new PropertyValue();
                    $entity->setName($value->getName());
                    $entity->setUrl($value->getUrl());
                    $entity->setIsFilter($value->getIsFilter());
                    $entity->setTotal($value->getTotal());
                    $entities[] = $entity;
                }

                $property = new PropertyValues($entities);
            }

            $property->setUnit($facetProperty->getUnit());
            $property->setName($facetProperty->getName());
            $property->setId($facetProperty->getId());

            $properties[] = $property;
        }

        return $properties;
    }

    /**
     * @param Range $range
     * @return string
     */
    protected function getPropertyRangeName(Range $range)
    {
        if ($range->getMin() == $range->getMax()) {
            return (string)$range->getMin();
        } else {
            return sprintf("%s - %s", $range->getMin(), $range->getMax());
        }
    }
}


text:
FactoryGirl.define do
  TAGS = %w(foo bar foobar fizz buzz fizzbuzz doo dad doodad wid get widget).freeze

  factory :product_category do
    sequence :name do |n|
      "Product Category Name #{n}"
    end
    sequence :description do |n|
      "Product Category description #{n}"
    end
    img 'product.png'
    tag_list { TAGS.sample rand 0..(TAGS.length / 2) }
  end
end


text:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="X*: Anytime Multi-Agent Path Finding for Sparse Domains using Window-Based Iterative Repairs">
<meta name="author" content="Kyle Vedder">
<link rel="shortcut icon" href="favicon.ico">
<title>X*</title>

# X*: Anytime Multi-Agent Path Finding for Sparse Domains using Window-Based Iterative Repairs

### [Kyle Vedder](http://vedder.io) and [Joydeep Biswas](http://joydeepb.com)

### In Artificial Intelligence, Volume 291, 2021.

### Links: [[pdf]](publications/expanding_astar_aij.pdf) [[code]](https://github.com/kylevedder/libMultiRobotPlanning/tree/xstar)

#### Abstract

We present the Windowed Anytime Multiagent Planning Framework (WAMPF), a framework that can make *any* optimal MAPF solver anytime by exploiting domain sparsity. Real-world domains are often sparse, i.e. agent-agent collisions tend to involve a small subset of agents in a single local region; this allows WAMPF to break down a large MAPF problem into small repair windows that can be efficiently searched to quickly generate a *valid* path. As time permits, WAMPF repair windows are grown and further repaired to improve the global repair quality. WAMPF provides online path suboptimality upperbounds, provably converges to a known optimal path given sufficient runtime, and provides infrastructure for information reuse to speed up window repair searches if supported by the underlying MAPF planner.

We present two A\*-based implementations of WAMPF: 1) Naive Windowing A\* (NWA\*), a naive implementation that does not leverage information reuse, and 2) Expanding A\* (X\*), an efficient implementation that employs a novel A* search tree transformation to perform search reuse.

Experimentally, we demonstrate that in sparse domains: 1) X\* outperforms state-of-the-art anytime or optimal MAPF solvers in time to valid path, 2) X\* is competitive with state-of-the-art anytime or optimal MAPF solvers in time to optimal path, 3) X\* quickly converges to tight suboptimality bounds, and 4) X\* is competitive with state-of-the-art suboptimal  MAPF solvers in time to valid path for small numbers of agents while providing much higher quality paths.

#### Video

Two minute teaser video [[slides]](https://docs.google.com/presentation/d/1qTM8LGMHVllsLpeJT1YsP814FDzw9fcNAnG9jWxrqmE/edit?usp=sharing)

Fifteen minute overview video [[slides]](https://docs.google.com/presentation/d/1Uex6PMoZ_hvDpw03dkZ-61fnHZLgHnGJV5WnrMHRKDc/edit?usp=sharing)