text:
/// <reference path="../../../../typings/tsd.d.ts" />
angular.module('app').controller('ManagementReportController', function (
    $browser, $window, $timeout, UserDetails, toastr, ReportService) {

    $window.document.title = 'Management Report';
    var vm = this;
    vm.state = {
        userDetails: null,
        showToolPanel: false,
        narrower: false,
        reportRequest: {
            UserId: 0,
            SimId: 0,
            TestSuiteId: 0
        }
    };
    vm.data = {};
    vm.gridOptions = {};
    $window.vm = vm;

    vm.toggleToolPanel = function () {
        var isShowing = vm.gridOptions.api.isToolPanelShowing();
        vm.gridOptions.api.showToolPanel(!isShowing);
    }

    vm.toggleWidth = function () {
        vm.state.narrower = !vm.state.narrower;
    }

    vm.exportCsv = function () {
        var params = {
            fileName: "ManagementReport.csv",
            customHeader: "Management Report generated on 31 Jan 2016\n"
        };
        vm.gridOptions.api.exportDataAsCsv(params);
    }

    // TODO: Add a filter
    // vm.filter = function(){

    // }

    //TODO: OnClick row show flot Pie chart
    // TODO: Host flot chart in draggable panel like http://codepen.io/m-e-conroy/pen/HjpCF

    var colWidth = 70;
    var columnDefs = [
        { headerName: "UserName", field: "UserName", width: 150 },
        { headerName: "SimName", field: "SimName", width: 280 },
        { headerName: "TestSuiteName", field: "TestSuiteName", width: 460 },
        { headerName: "Tests", field: "NumTests", width: colWidth },
        { headerName: "Pass", field: "Pass", width: colWidth },
        { headerName: "Fail", field: "Fail", width: colWidth },
        { headerName: "Untested", field: "Untested", width: colWidth },
        { headerName: "Pass%", field: "PassPercent", width: colWidth },
        { headerName: "Fail%", field: "FailPercent", width: colWidth },
        { headerName: "Untested%", field: "UntestedPercent", width: colWidth + 30 }
        //   { headerName: "UserId", field: "UserId", width: colWidth },
        //   { headerName: "SimId", field: "SimId", width: colWidth },
        //   { headerName: "TestSuiteId", field: "TestSuiteId", width: colWidth }
    ];

    function onModelUpdated() {
        var model = vm.gridOptions.api.getModel();
        var totalRows = vm.gridOptions.rowData.length;
        var processedRows = model.getVirtualRowCount();
        vm.rowCount = processedRows.toLocaleString() + ' / ' + totalRows;
    }

    function onFilterChanged(value) {
        vm.gridOptions.api.setQuickFilter(value);
    }

    vm.gridOptions = {
        showToolPanel: false,
        columnDefs: columnDefs,
        rowData: [],
        enableColResize: true,
        enableSorting: true,
        groupSuppressAutoColumn: false,
        groupColumnDef: null,
        onModelUpdated: onModelUpdated,
        suppressRowClickSelection: true,
        // Filtering
        enableFilter: true,
        onBeforeFilterChanged: function () { console.log('onBeforeFilterChanged'); },
        onAfterFilterChanged: function () { console.log('onAfterFilterChanged'); },
        onFilterModified: function () { console.log('onFilterModified'); }
    };

    vm.getManagementReport = function () {
        ReportService.getManagementReport().then(function (response) {
            vm.data = response.data;
            vm.gridOptions.api.setRowData(vm.data);
        });
    };

    var init = function () {
        UserDetails.get().then(function (data) {
            // Get our user details
            vm.state.userDetails = data; // setup our user detail
            // TODO: Figure out why we get a TypeError: Cannot read property 'setRowData' of undefined
            // When we run getManagementReport() here
            vm.getManagementReport();
        }, function () {
            toastr.error('Please make sure that you are logged in to OTS UTP!');
            $window.location.href = $browser.baseHref() + 'account/login';
            return;
        });
    };
    //init();

});


text:
require 'spec_helper'

describe Keychain::Exception, '#initialize' do
  it 'should take a message prefix and an error code' do
    Keychain::KeychainException.instance_method(:initialize).arity.should be 2
    expect { Keychain::KeychainException.new '', ErrSecSuccess }.to_not raise_error ArgumentError
    expect { Keychain::KeychainException.new '', ErrSecSuccess }.to_not raise_error TypeError
  end
  it 'should add the prefix to beginning of the error message' do
    exception = Keychain::KeychainException.new 'my prefix', 0
    exception.message.should match /^my prefix/
  end
  it 'should look up the error code for the error message' do
    exception = Keychain::KeychainException.new 'test', ErrSecUnimplemented
    exception.message.should match /not implemented/
  end
end

describe Keychain::Exception, '#code' do
  it 'should be the cached error code' do
    exception = Keychain::KeychainException.new 'my prefix', 0
    exception.code.should == 0

    exception = Keychain::KeychainException.new 'my prefix', -25293
    exception.code.should == -25293
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.microsoft.applicationinsights.library;

import android.content.Context;

public class MockExceptionTracking extends ExceptionTracking {

    public int processKillCount;

    public MockExceptionTracking(Context context,
                                 Thread.UncaughtExceptionHandler preexistingExceptionHandler,
                                 boolean ignoreDefaultHandler) {
        super(preexistingExceptionHandler, ignoreDefaultHandler);
        this.processKillCount = 0;
    }

    public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler) {
        super.preexistingExceptionHandler = handler;
    }

    @Override
    public void killProcess() {
        // no-op but count that this was called
        this.processKillCount++;
    }
}


text:
using System;
using System.ComponentModel;

namespace SharpKit.DotNet.Html.mediastream
{

    using SharpKit.JavaScript;
    using SharpKit.DotNet.JavaScript;
    using SharpKit.DotNet.Html.fileapi;
    using SharpKit.DotNet.Html.html.shadow;
    using SharpKit.DotNet.Html.html.track;
    using SharpKit.DotNet.Html.inspector;
    using SharpKit.DotNet.Html.loader.appcache;
    using SharpKit.DotNet.Html.battery;
    using SharpKit.DotNet.Html.gamepad;
    using SharpKit.DotNet.Html.geolocation;
    using SharpKit.DotNet.Html.indexeddb;
    using SharpKit.DotNet.Html.intents;
    using SharpKit.DotNet.Html.mediasource;
    using SharpKit.DotNet.Html.mediastream;
    using SharpKit.DotNet.Html.networkinfo;
    using SharpKit.DotNet.Html.notifications;
    using SharpKit.DotNet.Html.proximity;
    using SharpKit.DotNet.Html.quota;
    using SharpKit.DotNet.Html.speech;
    using SharpKit.DotNet.Html.webaudio;
    using SharpKit.DotNet.Html.webdatabase;
    using SharpKit.DotNet.Html.plugins;
    using SharpKit.DotNet.Html.storage;
    using SharpKit.DotNet.Html.svg;
    using SharpKit.DotNet.Html.workers;

    [JsType(JsMode.Prototype, NativeEnumerator = false, NativeArrayEnumerator = true, Export = false, PropertiesAsFields = true, NativeCasts = true, Name = "MediaStreamList")]
    public partial class MediaStreamList : IJsArrayEnumerable<MediaStream>
    {
        [JsProperty(NativeIndexer = true)]
        public MediaStream this[int index] { get { return default(MediaStream); } set { } }
        public int length { get; set; }

        MediaStream IJsArrayEnumerable<MediaStream>.this[JsNumber index]
        {
            get { throw new NotImplementedException(); }
        }

        JsNumber IJsArrayEnumerable<MediaStream>.length
        {
            get { throw new NotImplementedException(); }
        }

        System.Collections.Generic.IEnumerator<MediaStream> System.Collections.Generic.IEnumerable<MediaStream>.GetEnumerator()
        {
            throw new NotImplementedException();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            throw new NotImplementedException();
        }
    }

}


text:
using HeritageProperties.Pages;
using HeritageProperties.PCL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;

namespace HeritageProperties
{
    public class App
    {
        public static Page GetMainPage()
        {
            return new MainPage();
        }

        private static ViewModelLocator _locator;
        public static ViewModelLocator Locator
        {
            get
            {
                return _locator ?? (_locator = new ViewModelLocator());
            }
        }

    }
}


text:
require 'rails_helper'

RSpec.describe "clinic_histories/index", type: :view do
  before(:each) do
    assign(:clinic_histories, [
      ClinicHistory.create!(
        :first_name => "First Name",
        :second_name => "Second Name",
        :first_surname => "First Surname",
        :second_surname => "Second Surname",
        :email => "Email",
        :type_document => "Type Document",
        :document => "Document",
        :days_age => 1,
        :months_age => 2,
        :years_age => 3,
        :gender => "Gender",
        :profession => "Profession",
        :blood_type => "Blood Type",
        :nacionality => "Nacionality",
        :eps => nil,
        :arl => nil,
        :address => "Address",
        :condition => 4,
        :accompanist_name => "Accompanist Name",
        :relationship => 5,
        :phone => "Phone",
        :city => nil,
        :user => nil,
        :city => "City",
        :department => "Department",
        :user => nil,
        :cove => "Cove",
        :mobiel_service => "Mobiel Service",
        :airport => nil,
        :type_service => 6,
        :patient => nil,
        :origin => "Origin",
        :destination => "Destination",
        :company => "Company",
        :accompanist_name => "Accompanist Name",
        :relationship => 7,
        :phone => "Phone",
        :reason_for_consultation => "MyText",
        :current_illness => "MyText",
        :neunatales => false,
        :neunatales_description => "MyText",
        :patologicos => false,
        :patologicos_description => "MyText",
        :quirurgicos => false,
        :quirurgicos_description => "MyText",
        :farmacologicos => false,
        :farmacologicos_description => "MyText",
        :alergicos => false,
        :alergicos_description => "MyText",
        :toxicos => false,
        :toxicos_description => "MyText",
        :traumaticos => false,
        :traumaticos_description => "MyText",
        :hospitables => false,
        :hospitables_description => "MyText",
        :atep_laboral => false,
        :atep_laboral_description => "MyText",
        :familiar => false,
        :familiar_description => "MyText",
        :inmunologicos => false,
        :inmunologios_description => "MyText",
        :asociado_viajes_de_vuelo => false,
        :asociado_viajes_de_vuelo_description => "MyText",
        :menstrual_cycle => 8,
        :gestational_age => "Gestational Age",
        :eco => "Eco",
        :fum => 9,
        :pregnancy => false,
        :g => "G",
        :p => "P",
        :c => "C",
        :a => "A",
        :m => "M",
        :v => "V",
        :e => "E",
        :cardiovascular => false,
        :cardiovascular_description => "MyText",
        :respiratory => false,
        :respiratory_description => "MyText",
        :abdominal => false,
        :abdominal_description => "MyText",
        :genito_urinario => false,
        :genito_urinario_description => "MyText",
        :neurological => "Neurological",
        :neurological_description => "MyText",
        :mental => false,
        :mental_description => "MyText",
        :sense_organ => false,
        :sense_organ_description => "MyText",
        :skeletal_muscle => false,
        :skeletal_muscle_description => "MyText",
        :skin_and_appendages => "Skin And Appendages",
        :skin_and_appendages_description => "MyText",
        :ta_mmgh => "Ta Mmgh",
        :heart_rate => "Heart Rate",
        :breathing_frequency => "Breathing Frequency",
        :sat_of_o_ambiente => "Sat Of O Ambiente",
        :sat_of_o_supplementary => "Sat Of O Supplementary",
        :temperature => "Temperature",
        :weight_in_kilograms => "Weight In Kilograms",
        :height_in_centimeters => "Height In Centimeters",
        :glucose => "Glucose",
        :measurement => "Measurement",
        :head => false,
        :head_description => "MyText",
        :sense_organ => false,
        :sense_organ_description => "Sense Organ Description",
        :neck => false,
        :neck_description => "MyText",
        :rib_cage => false,
        :rib_cage_description => "MyText",
        :heart => false,
        :heart_description => "MyText",
        :lungs => false,
        :lungs_description => "MyText",
        :abdomen => false,
        :abdomen_description => "MyText",
        :genitourinary => false,
        :genitourinary_description => "MyText",
        :rectum => false,
        :rectum_description => "MyText",
        :extremities => false,
        :extremities_description => "MyText",
        :skin_and_appendages => false,
        :skin_and_appendages_description => "MyText",
        :skeletal_muscle => false,
        :skeletal_muscle_description => "MyText",
        :mental => false,
        :mental_description => "MyText",
        :neurological => false,
        :neurological_description => "MyText",
        :alteration => 10,
        :eye_opening => 11,
        :verbal_answer => 12,
        :motor_response => 13,
        :other_signs => 14,
        :analysis => "MyText",
        :print_diagnosed => "MyText",
        :plan_and_treatment => "MyText",
        :observations_recommendations => "MyText"
      ),
      ClinicHistory.create!(
        :first_name => "First Name",
        :second_name => "Second Name",
        :first_surname => "First Surname",
        :second_surname => "Second Surname",
        :email => "Email",
        :type_document => "Type Document",
        :document => "Document",
        :days_age => 1,
        :months_age => 2,
        :years_age => 3,
        :gender => "Gender",
        :profession => "Profession",
        :blood_type => "Blood Type",
        :nacionality => "Nacionality",
        :eps => nil,
        :arl => nil,
        :address => "Address",
        :condition => 4,
        :accompanist_name => "Accompanist Name",
        :relationship => 5,
        :phone => "Phone",
        :city => nil,
        :user => nil,
        :city => "City",
        :department => "Department",
        :user => nil,
        :cove => "Cove",
        :mobiel_service => "Mobiel Service",
        :airport => nil,
        :type_service => 6,
        :patient => nil,
        :origin => "Origin",
        :destination => "Destination",
        :company => "Company",
        :accompanist_name => "Accompanist Name",
        :relationship => 7,
        :phone => "Phone",
        :reason_for_consultation => "MyText",
        :current_illness => "MyText",
        :neunatales => false,
        :neunatales_description => "MyText",
        :patologicos => false,
        :patologicos_description => "MyText",
        :quirurgicos => false,
        :quirurgicos_description => "MyText",
        :farmacologicos => false,
        :farmacologicos_description => "MyText",
        :alergicos => false,
        :alergicos_description => "MyText",
        :toxicos => false,
        :toxicos_description => "MyText",
        :traumaticos => false,
        :traumaticos_description => "MyText",
        :hospitables => false,
        :hospitables_description => "MyText",
        :atep_laboral => false,
        :atep_laboral_description => "MyText",
        :familiar => false,
        :familiar_description => "MyText",
        :inmunologicos => false,
        :inmunologios_description => "MyText",
        :asociado_viajes_de_vuelo => false,
        :asociado_viajes_de_vuelo_description => "MyText",
        :menstrual_cycle => 8,
        :gestational_age => "Gestational Age",
        :eco => "Eco",
        :fum => 9,
        :pregnancy => false,
        :g => "G",
        :p => "P",
        :c => "C",
        :a => "A",
        :m => "M",
        :v => "V",
        :e => "E",
        :cardiovascular => false,
        :cardiovascular_description => "MyText",
        :respiratory => false,
        :respiratory_description => "MyText",
        :abdominal => false,
        :abdominal_description => "MyText",
        :genito_urinario => false,
        :genito_urinario_description => "MyText",
        :neurological => "Neurological",
        :neurological_description => "MyText",
        :mental => false,
        :mental_description => "MyText",
        :sense_organ => false,
        :sense_organ_description => "MyText",
        :skeletal_muscle => false,
        :skeletal_muscle_description => "MyText",
        :skin_and_appendages => "Skin And Appendages",
        :skin_and_appendages_description => "MyText",
        :ta_mmgh => "Ta Mmgh",
        :heart_rate => "Heart Rate",
        :breathing_frequency => "Breathing Frequency",
        :sat_of_o_ambiente => "Sat Of O Ambiente",
        :sat_of_o_supplementary => "Sat Of O Supplementary",
        :temperature => "Temperature",
        :weight_in_kilograms => "Weight In Kilograms",
        :height_in_centimeters => "Height In Centimeters",
        :glucose => "Glucose",
        :measurement => "Measurement",
        :head => false,
        :head_description => "MyText",
        :sense_organ => false,
        :sense_organ_description => "Sense Organ Description",
        :neck => false,
        :neck_description => "MyText",
        :rib_cage => false,
        :rib_cage_description => "MyText",
        :heart => false,
        :heart_description => "MyText",
        :lungs => false,
        :lungs_description => "MyText",
        :abdomen => false,
        :abdomen_description => "MyText",
        :genitourinary => false,
        :genitourinary_description => "MyText",
        :rectum => false,
        :rectum_description => "MyText",
        :extremities => false,
        :extremities_description => "MyText",
        :skin_and_appendages => false,
        :skin_and_appendages_description => "MyText",
        :skeletal_muscle => false,
        :skeletal_muscle_description => "MyText",
        :mental => false,
        :mental_description => "MyText",
        :neurological => false,
        :neurological_description => "MyText",
        :alteration => 10,
        :eye_opening => 11,
        :verbal_answer => 12,
        :motor_response => 13,
        :other_signs => 14,
        :analysis => "MyText",
        :print_diagnosed => "MyText",
        :plan_and_treatment => "MyText",
        :observations_recommendations => "MyText"
      )
    ])
  end

  it "renders a list of clinic_histories" do
    render
    assert_select "tr>td", :text => "First Name".to_s, :count => 2
    assert_select "tr>td", :text => "Second Name".to_s, :count => 2
    assert_select "tr>td", :text => "First Surname".to_s, :count => 2
    assert_select "tr>td", :text => "Second Surname".to_s, :count => 2
    assert_select "tr>td", :text => "Email".to_s, :count => 2
    assert_select "tr>td", :text => "Type Document".to_s, :count => 2
    assert_select "tr>td", :text => "Document".to_s, :count => 2
    assert_select "tr>td", :text => 1.to_s, :count => 2
    assert_select "tr>td", :text => 2.to_s, :count => 2
    assert_select "tr>td", :text => 3.to_s, :count => 2
    assert_select "tr>td", :text => "Gender".to_s, :count => 2
    assert_select "tr>td", :text => "Profession".to_s, :count => 2
    assert_select "tr>td", :text => "Blood Type".to_s, :count => 2
    assert_select "tr>td", :text => "Nacionality".to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "Address".to_s, :count => 2
    assert_select "tr>td", :text => 4.to_s, :count => 2
    assert_select "tr>td", :text => "Accompanist Name".to_s, :count => 2
    assert_select "tr>td", :text => 5.to_s, :count => 2
    assert_select "tr>td", :text => "Phone".to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "City".to_s, :count => 2
    assert_select "tr>td", :text => "Department".to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "Cove".to_s, :count => 2
    assert_select "tr>td", :text => "Mobiel Service".to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => 6.to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "Origin".to_s, :count => 2
    assert_select "tr>td", :text => "Destination".to_s, :count => 2
    assert_select "tr>td", :text => "Company".to_s, :count => 2
    assert_select "tr>td", :text => "Accompanist Name".to_s, :count => 2
    assert_select "tr>td", :text => 7.to_s, :count => 2
    assert_select "tr>td", :text => "Phone".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => 8.to_s, :count => 2
    assert_select "tr>td", :text => "Gestational Age".to_s, :count => 2
    assert_select "tr>td", :text => "Eco".to_s, :count => 2
    assert_select "tr>td", :text => 9.to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "G".to_s, :count => 2
    assert_select "tr>td", :text => "P".to_s, :count => 2
    assert_select "tr>td", :text => "C".to_s, :count => 2
    assert_select "tr>td", :text => "A".to_s, :count => 2
    assert_select "tr>td", :text => "M".to_s, :count => 2
    assert_select "tr>td", :text => "V".to_s, :count => 2
    assert_select "tr>td", :text => "E".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "Neurological".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "Skin And Appendages".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "Ta Mmgh".to_s, :count => 2
    assert_select "tr>td", :text => "Heart Rate".to_s, :count => 2
    assert_select "tr>td", :text => "Breathing Frequency".to_s, :count => 2
    assert_select "tr>td", :text => "Sat Of O Ambiente".to_s, :count => 2
    assert_select "tr>td", :text => "Sat Of O Supplementary".to_s, :count => 2
    assert_select "tr>td", :text => "Temperature".to_s, :count => 2
    assert_select "tr>td", :text => "Weight In Kilograms".to_s, :count => 2
    assert_select "tr>td", :text => "Height In Centimeters".to_s, :count => 2
    assert_select "tr>td", :text => "Glucose".to_s, :count => 2
    assert_select "tr>td", :text => "Measurement".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "Sense Organ Description".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => 10.to_s, :count => 2
    assert_select "tr>td", :text => 11.to_s, :count => 2
    assert_select "tr>td", :text => 12.to_s, :count => 2
    assert_select "tr>td", :text => 13.to_s, :count => 2
    assert_select "tr>td", :text => 14.to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
  end
end


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.devtools.build.lib.collect;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * An immutable chain of immutable Iterables.
 *
 *
This class is defined for the sole purpose of being able to check for immutability (using
 * instanceof). Otherwise, we could use a plain Iterable (as returned by {@code
 * Iterables.concat()}).
 *
 * @see CollectionUtils#checkImmutable(Iterable)
 */
public final class IterablesChain<T> implements Iterable<T> {
  public static <T> Iterable<T> concat(Iterable<? extends T> a, Iterable<? extends T> b) {
    return IterablesChain.<T>builder().add(a).add(b).build();
  }

  private final Iterable<T> chain;

  IterablesChain(Iterable<T> chain) {
    this.chain = chain;
  }

  @Override
  public Iterator<T> iterator() {
    return chain.iterator();
  }

  public static <T> Builder<T> builder() {
    return new Builder<>();
  }

  @Override
  public String toString() {
    return "[" + Joiner.on(", ").join(this) + "]";
  }

  /** Builder for IterablesChain. */
  public static class Builder<T> {
    private List<Iterable<? extends T>> iterables = new ArrayList<>();

    private Builder() {}

    /**
     * Adds an immutable iterable to the end of the chain.
     *
     *
If the iterable can not be confirmed to be immutable, a runtime error is thrown.
     */
    public Builder<T> add(Iterable<? extends T> iterable) {
      CollectionUtils.checkImmutable(iterable);
      // Avoid unnecessarily expanding a NestedSet.
      boolean isEmpty =
          iterable instanceof NestedSet
              ? ((NestedSet<?>) iterable).isEmpty()
              : Iterables.isEmpty(iterable);
      if (!isEmpty) {
        iterables.add(iterable);
      }
      return this;
    }

    /** Adds a single element to the chain. */
    public Builder<T> addElement(T element) {
      iterables.add(ImmutableList.of(element));
      return this;
    }

    /** Returns true if the chain is empty. */
    public boolean isEmpty() {
      return iterables.isEmpty();
    }

    /** Builds an iterable that iterates through all elements in this chain. */
    @SuppressWarnings("unchecked")
    public Iterable<T> build() {
      int size = iterables.size();
      if (size == 0) {
        return ImmutableList.of();
      } else if (size == 1) {
        // cast is type safe since Iterable<T> doesn't allow mutation
        return (Iterable<T>) iterables.get(0);
      }
      return new IterablesChain<>(Iterables.concat(ImmutableList.copyOf(iterables)));
    }
  }
}


text:
/**
 *
 */
package eu.diachron.qualitymetrics.intrinsic.consistency;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;

import org.mapdb.DB;
import org.mapdb.HTreeMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Sets;
import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.rdf.model.AnonId;
import com.hp.hpl.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.impl.ModelCom;
import com.hp.hpl.jena.sparql.core.Quad;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD;

import de.unibonn.iai.eis.diachron.mapdb.MapDbFactory;
import de.unibonn.iai.eis.diachron.semantics.DQM;
import de.unibonn.iai.eis.diachron.semantics.DQMPROB;
import de.unibonn.iai.eis.diachron.technques.probabilistic.ReservoirSampler;
import de.unibonn.iai.eis.luzzu.datatypes.ProblemList;
import de.unibonn.iai.eis.luzzu.semantics.utilities.Commons;
import eu.diachron.qualitymetrics.utilities.AbstractQualityMetric;
import eu.diachron.qualitymetrics.utilities.VocabularyLoader;

/**
 * @author Jeremy Debattista
 *
 * This metric tests if a property's domain and range
 * are of the same type as declared in the corresponding
 * schema.
 *
 */
public class EstimatedUsageOfIncorrectDomainOrRangeDatatypes extends AbstractQualityMetric {

	private final Resource METRIC_URI = DQM.UsageOfIncorrectDomainOrRangeDatatypesMetric;

	private static Logger logger = LoggerFactory.getLogger(EstimatedUsageOfIncorrectDomainOrRangeDatatypes.class);

	private static DB mapDb = MapDbFactory.getMapDBAsyncTempFile();

	private HTreeMap<String, List<String>> mapResourceType =  MapDbFactory.createHashMap(mapDb, UUID.randomUUID().toString());

//	private Set<SerialisableTriple> unknownTriples =  MapDbFactory.createHashSet(mapDb, UUID.randomUUID().toString());
	private ReservoirSampler<Triple> unknownTriples = new ReservoirSampler<Triple>(500000, false);
//	protected Set<SerialisableModel> problemList =  MapDbFactory.createHashSet(mapDb, UUID.randomUUID().toString());

	//Sampling of Problems
	ReservoirSampler<ProblemReport> problemSampler = new ReservoirSampler<ProblemReport>(50000, false);

	private long incorrectDomain = 0;
	private long incorrectRange = 0;
	private long undereferenceablePredicates = 0;
	private long unknownDomainAndRange = 0;

	private ModelCom mc = new ModelCom(Graph.emptyGraph);

	@Override
	public void compute(Quad quad) {

		logger.debug("Computing : {} ", quad.asTriple().toString());

		if (quad.getPredicate().getURI().equals(RDF.type.getURI())) {
			String s = "";
			if (quad.getSubject().isBlank()) s = quad.getSubject().getBlankNodeLabel();
			else s = quad.getSubject().getURI();
			String o = quad.getObject().getURI();

			List<String> types = new ArrayList<String>();

			if (mapResourceType.containsKey(s)){
				types = mapResourceType.get(s);
			}
			types.add(o);
			mapResourceType.put(s, types);
		}
		else {
			this.unknownTriples.add(quad.asTriple());
			//this.unknownTriples.add(new SerialisableTriple(quad.asTriple()));
		}
	}

//    private void addToProblem(Quad q, char type){
//    	Model m = ModelFactory.createDefaultModel();
//
//    	Resource gen = Commons.generateURI();
//    	if (type == 'd')
//    		m.add(gen, RDF.type, DQM.IncorrectDomain);
//    	if (type == 'r')
//    		m.add(gen, RDF.type, DQM.IncorrectRange);
//    	if (type == 'x')
//    		m.add(gen, RDF.type, DQM.IncorrectDomain);
//    	if (type == 'u')
//    		m.add(gen, RDF.type, DQM.IncorrectRange);
//
//
//    	Resource anon = m.createResource(AnonId.create());
//    	m.add(gen, DQM.problematicTriple, anon);
//    	m.add(anon, RDF.subject, Commons.asRDFNode(q.getSubject()));
//    	m.add(anon, RDF.predicate, Commons.asRDFNode(q.getPredicate()));
//    	m.add(anon, RDF.object, Commons.asRDFNode(q.getObject()));
//
//    	try{
//    		this.problemList.add(new SerialisableModel(m));
//    	} catch (Exception e){
//    		logger.error("Error adding to problem list :" + e.getMessage());
//    	}
//    }

	private void addToProblem(Quad q, char type){
		ProblemReport pr = new ProblemReport(q, type);
		Boolean isAdded = this.problemSampler.add(pr);
		if (!isAdded) pr = null;
	}

	@Override
	public double metricValue() {

		for (Triple t : this.unknownTriples.getItems()){
			if (VocabularyLoader.getInstance().checkTerm(t.getPredicate())){
				checkDomain(t);
				checkRange(t);
			} else {
				undereferenceablePredicates++;
			}
		}

		double value = 1 - ((double) incorrectDomain + (double) incorrectRange + (double) undereferenceablePredicates + (double) unknownDomainAndRange) / ((double) this.unknownTriples.size() * 2);

		statsLogger.info("Dataset: {} - # Incorrect Domains : {}; # Incorrect Ranges : {}; # Items in Reservoir : {}; # Undereferenceable Predicates : {}; # Unknown Domain and Range : {}; Metric Value: {} "
				, this.getDatasetURI(), incorrectDomain, incorrectRange, this.unknownTriples.size(), undereferenceablePredicates, unknownDomainAndRange, value);

		return value;
	}

	private void checkDomain(Triple t){
		String subURI = (t.getSubject().isBlank()) ? t.getSubject().toString() : t.getSubject().getURI();

		if (mapResourceType.containsKey(subURI)){
			List<String> _typeList = mapResourceType.get(subURI);

			Set<RDFNode> types = new LinkedHashSet<RDFNode>();
			types.add(RDFS.Resource); // this is required as everything is a resource, useful for those undereferenceable properties
			for (String type : _typeList){
				types.add(mc.createResource(type));
				types.addAll(VocabularyLoader.getInstance().inferParentClass(mc.createResource(type).asNode()));
			}

			Set<RDFNode> _dom = VocabularyLoader.getInstance().getPropertyDomain(t.getPredicate());
			if (_dom.size() > 0){ // do not consider those properties which have an open domain
				if(Sets.intersection(_dom, types).size() == 0){
					addToProblem(new Quad(null, t),'d');
					incorrectDomain++;
				}
			}
		} else {
			addToProblem(new Quad(null, t),'x');
			unknownDomainAndRange++;
		}
	}

	private void checkRange(Triple t){
		Set<RDFNode> _ran = VocabularyLoader.getInstance().getPropertyRange(t.getPredicate());
		if (_ran.size() > 0){ // do not consider those properties which have an open range
			if (t.getObject().isLiteral()){
				Resource litRes = this.getLiteralType(t.getObject());
				if (!_ran.contains(litRes)){
					addToProblem(new Quad(null, t),'r');
					incorrectRange++;
				}
			} else {
				String objURI = (t.getObject().isBlank()) ? t.getObject().toString() : t.getObject().getURI();

				if (mapResourceType.containsKey(objURI)){
					List<String> _typeList = mapResourceType.get(objURI);

					Set<RDFNode> types = new LinkedHashSet<RDFNode>();

					for (String type : _typeList){
						types.add(mc.createResource(type));
						types.addAll(VocabularyLoader.getInstance().inferParentClass(mc.createResource(type).asNode()));
					}

					if(Sets.intersection(_ran, types).size() == 0){
						addToProblem(new Quad(null, t),'r');
						incorrectRange++;
					}
				} else {
					addToProblem(new Quad(null, t),'u');
					unknownDomainAndRange++;
				}
			}
		}
	}

	@Override
	public Resource getMetricURI() {
		return METRIC_URI;
	}

//	@Override
//	public ProblemList<?> getQualityProblems() {
//		ProblemList<SerialisableModel> tmpProblemList = null;
//		try {
//			if(this.problemList != null && this.problemList.size() > 0) {
//				tmpProblemList = new ProblemList<SerialisableModel>(new ArrayList<SerialisableModel>(this.problemList));
//			} else {
//				tmpProblemList = new ProblemList<SerialisableModel>();
//			}		} catch (ProblemListInitialisationException problemListInitialisationException) {
//			logger.error(problemListInitialisationException.getMessage());
//		}
//		return tmpProblemList;
//	}
	public ProblemList<?> getQualityProblems() {
		ProblemList<Model> tmpProblemList = new ProblemList<Model>();
		if(this.problemSampler != null && this.problemSampler.size() > 0) {
			for(ProblemReport pr : this.problemSampler.getItems()){
				tmpProblemList.getProblemList().add(pr.createProblemModel());
			}
		} else {
			tmpProblemList = new ProblemList<Model>();
		}
		return tmpProblemList;
	}

	@Override
	public boolean isEstimate() {
		return true;
	}

	@Override
	public Resource getAgentURI() {
		return DQM.LuzzuProvenanceAgent;
	}

	private Resource getLiteralType(Node lit_obj){
		RDFNode n = Commons.asRDFNode(lit_obj);
		Literal lt = (Literal) n;

		if (((Literal)n).getDatatype() != null){
			return  ModelFactory.createDefaultModel().createResource(lt.getDatatype().getURI());
		} else {
			if (lt.getValue() instanceof Byte) return XSD.xbyte;
			else if (lt.getValue() instanceof Boolean) return XSD.xboolean;
			else if (lt.getValue() instanceof Short) return XSD.xshort;
			else if (lt.getValue() instanceof Integer) return XSD.xint;
			else if (lt.getValue() instanceof Long) return XSD.xlong;
			else if (lt.getValue() instanceof Float) return XSD.xfloat;
			else if (lt.getValue() instanceof Double) return XSD.xdouble;
			else if (lt.getValue() instanceof String) return XSD.xstring;
			else return RDFS.Literal;
		}
	}

	// problems private class for sampling
	private class ProblemReport{

		private Quad q ;
		private char type;

		ProblemReport(Quad q, char type){
			this.q = q;
			this.type = type;
		}

	   Model createProblemModel(){
	    	Model m = ModelFactory.createDefaultModel();

	    	Resource gen = Commons.generateURI();
	    	if (type == 'd')
	    		m.add(gen, RDF.type, DQMPROB.IncorrectDomain);
	    	if (type == 'r')
	    		m.add(gen, RDF.type, DQMPROB.IncorrectRange);
	    	if (type == 'x')
	    		m.add(gen, RDF.type, DQMPROB.UnknownType);
	    	if (type == 'u')
	    		m.add(gen, RDF.type, DQMPROB.UnknownType);

	    	Resource anon = m.createResource(AnonId.create());
	    	m.add(gen, DQMPROB.problematicTriple, anon);
	    	m.add(anon, RDF.subject, Commons.asRDFNode(q.getSubject()));
	    	m.add(anon, RDF.predicate, Commons.asRDFNode(q.getPredicate()));
	    	m.add(anon, RDF.object, Commons.asRDFNode(q.getObject()));

	    	try{
	    		return m;
	    	} catch (Exception e){
	    		logger.error("Error adding to problem list :" + e.getMessage());
	    		return ModelFactory.createDefaultModel();
	    	}

	    }
	}
}


text:
<?php

namespace Numbers\Users\Users\Controller\System;
class Senders extends \Object\Controller\Permission {
	public function actionEdit() {
		$form = new \Numbers\Users\Users\Form\System\Senders([
			'input' => \Request::input()
		]);
		echo $form->render();
	}
}


text:
/* Body
--------------------------------------- */
body {
    margin: 0;
    font-family: sans-serif;
    line-height: 25px;
}

section h2 {
    border-bottom: 2px solid #80bfff;
    padding-top: 60px;
    padding-bottom: 5px;
}

/*Universal Selectors
--------------------------------------- */
.noBullets ul li {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    list-style-type: none;
    margin: 5px 5px 5px auto;
}

.squareBullets li {
    list-style-type: square;
}

ol{
  line-height: 30px;
}

.update{
  background-color: lightgoldenrodyellow;
}

/*Pseudo Classes*/
.button {
    background-color: #f1f1f1;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 7px;
    color: black;
    text-decoration: none;
    display: block;
    width: 250px;
    line-height: 30px;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.button:hover {
    background-color: #cce6ff;
    border: 1px solid darkgray;
    box-shadow: 3px 3px 5px lightgray;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.button:active {
    border: 1px solid darkgray;
    box-shadow: 0px 0px 0px white;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.masterButton {
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 7px;
    color: black;
    text-decoration: none;
    display: block;
    position: absolute;
    width: 250px;
    line-height: 30px;
    top: 130px;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.masterButton:hover {
    border: 1px solid darkgray;
    background-color: #cce6ff;
    box-shadow: 3px 3px 5px lightgray;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.masterButton:active {
    text-align: center;
    border: 1px solid darkgray;
    box-shadow: 0px 0px 0px white;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

/* Controlling the Width of Content
--------------------------------------- */
nav,
section {
    width: 75%;
    margin: auto;
}

/* Navigation Bar
--------------------------------------- */

#nav-bar {
    margin: 0;
    width: 100%;
    height: 50px;
    box-shadow: 0px 3px 5px lightgray;
    position: fixed;
    background: white;
    z-index: 10;
}

#nav-bar > nav {
    overflow: hidden;
    height: 50px;
}

#nav-bar > section > a > img {
    float: left;
    width: 40px;
    margin: 5px 10px auto auto;
}

#nav-bar h2 {
    float: left;
    margin: 0;
    line-height: 50px;
    vertical-align: middle;
    padding-top: 0;
    padding-bottom: 0;
}

.naviCons {
  float: right;
  margin-right: 210px;
}

.naviCons a img{
  width: 30px;
  margin: 10px 10px auto auto;
  opacity: .5;
  transition-property: opacity;
  transition-duration: .3s;
}

.naviCons a img:hover {
  opacity: 1;
  transition-property: opacity;
  transition-duration: .3s;
}

@keyframes shakeDirectory {
  from {
    -webkit-transform: rotate(5deg);
 }
 to {
   -webkit-transform-origin:center center;
   -webkit-transform: rotate(-5deg);
 }
}

@keyframes shakeTools {
  from {
    -webkit-transform: rotate(0deg);
 }
 to {
   -webkit-transform-origin:center center;
   -webkit-transform: rotate(359deg);
 }
}

.directoryIcon:hover {
  -webkit-animation: shakeDirectory 0.07s ease-in-out 0.1s infinite alternate;
}

.toolsIcon:hover {
  -webkit-animation: shakeTools 3s infinite linear;
}

/*Following is done to keep the header fixed*/
#withoutBottomBorder{
  padding-bottom: 5px;
  border-bottom: 0;
}

.top-less{
  margin-top: 0;
  padding-top: 20px;
}

/* Menu
--------------------------------------- */
#nav-bar ul {
    list-style-type: none;
    float: right;
    padding: 0;
    position: absolute;
    right: 12.5%;
    margin: 0;
    z-index: 10;
    border-left: 1px solid lightgray;
    border-right: 1px solid lightgray;
    border-image:  linear-gradient(to top, lightgray, rgba(0, 0, 0, 0)) 1 100%;
}

#nav-bar ul li {
    float: left;
    position: relative;
    width: 200px;
    line-height: 50px;
    background-color: white;
    vertical-align: middle;
    padding-left: 10px;
}

#nav-bar ul li a {
    display: block;
    text-decoration: none;
    color: black;
}

#nav-bar ul li ul {
    border: 1px solid lightgray;
}

#nav-bar ul li ul li{
    line-height: 6.5vh;
}

#drop-down {
    position: absolute;
    left: 0%;
    padding: 0%;
    width: 100%;
}

#go-to {
    cursor: pointer;
    user-select: none;
}

#go-to > ul {
    display: none;
}

#go-to:hover > ul {
    display: block;
    box-shadow: 2px 2px 5px lightgray;
}

#drop-down > li:active #drop-down{
    display: none;
}

#nav-bar ul li:hover {
    background-color: #f1f1f1;
}

#nav-bar ul li ul li:hover {
    background-color: #cce6ff;
    border-left: 3px solid #80bfff;
}

/* Main Content
--------------------------------------- */
article {
    clear: both;
    position: relative;
}

article #intro {
    width: 100%;
    height: 85%;
}

/* Central
--------------------------------------- */

#central p a {
    text-decoration: none;
    color: royalblue;
}

/* Presentation
--------------------------------------- */

#presentation iframe {
  width: 100%;
  height: 300px;
  border: none;
  overflow-x: hidden;
  overflow-y: scroll;
}

#tableContent a {
  text-decoration: none;
  color: royalblue;
}

/* Policies
--------------------------------------- */

ul.tab {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
    box-shadow: 3px 3px 5px lightgray;
    display: block;
}

/* Float the list items side by side
--------------------------------------- */
ul.tab li {
    float: left;
    border-right: 1px solid lightgray;
    border-image:  linear-gradient(to top, lightgray, rgba(0, 0, 0, 0)) 1 100%;
}

/* Style the links inside the list items
--------------------------------------- */
ul.tab li a {
    display: inline-block;
    color: black;
    text-align: center;
    padding: 14px 9.65px;
    text-decoration: none;
    -webkit-transition: 0.3s;
    transition: 0.3s;
    font-size: 17px;
}

/* Change background color of links on hover
--------------------------------------- */
ul.tab li a:hover {
    background-color: #cce6ff;
}

/* Create an active/current tablink class
--------------------------------------- */
ul.tab li a:focus,
.active {
    background-color: #cce6ff;
}

/* Style the tab content
--------------------------------------- */
.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;
}

/* Tiles
--------------------------------------- */
.tileContainer {
    margin: auto;
}

.tiles {
    margin: 5px 5px 5px auto;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    width: 300px;
    height: 225px;
    background-color: #f1f1f1;
    box-shadow: 3px 3px 3px lightgray;
}

.tiles div {
    position: relative;
    padding-left: 20px;
    padding-right: 20px;
    width: 250px;
    height: 150px;
    margin: auto;
}

.tiles div h4 {
    margin-top: 0;
}

.tiles div p {
    height: 75px;
}

/* Checklist
--------------------------------------- */

/*Checklists - checkbox*/

#checklists input {
    width: 18px;
    height: 18px;
}

/*Checklists- Properties of Labels and Paragraphs with checkboxes*/

#checklists label {
    display: block;
}

#checklists label p {
    display: inline;
}

/*Checklists - Line-through the text when the checkbox is checked*/

#checklists input:checked + p {
    text-decoration: line-through;
    color: gray;
}

/*Checklists - Hover over effects for labels*/

#checklists label:hover {
    background-color: #d9d9d9;
    vertical-align: middle;
}

/* Drafting System
--------------------------------------- */
#CAD-guidelines ul li ul {
    padding: 0;
}

/* Tutorials
--------------------------------------- */
.rows a {
    text-decoration: none;
    display: block;
    padding: 5px;
    color: black;
}

.rows ul {
    list-style-type: none;
    padding-left: 0;
}

.rows ul li {
    background-color: #f1f1f1;
    display: inline-block;
    margin: 10px 10px 5px auto;
    border: 1px solid #ccc;
    border-radius: 7px;
    width: 48%;
    text-align: center;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.rows ul li:hover {
    background-color: #cce6ff;
    border: 1px solid darkgray;
    box-shadow: 3px 3px 5px lightgray;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

.rows ul li:active {
    border: 1px solid darkgray;
    box-shadow: 0px 0px 0px white;
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-duration: .3s;
    transition-duration: .3s;
}

/* Back to Top Image
--------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    z-index: 100;
    opacity: .5;
    transition-property: opacity;
    transition-duration: .3s;
}

.back-to-top:hover {
    opacity: 1;
    transition-property: opacity;
    transition-duration: .3s;
}

/*Contact List
--------------------------------------- */
#fixedHeader {
  position: fixed;
  width: 100%;
}

#tableContent {
  padding-top: 35px;
}

table{
  /*border: 0.5px solid black;*/
  width:100%;
  table-layout: fixed;
}
th{
  background:#cce6ff;
}
tr:nth-child(odd){
  /*background: #e0e2e2;*/
  background: #f1f1f1;
}

@media print{
    body{
        font-size: larger;
    }
}

/* FAQ
--------------------------------------- */
#faq div {
    margin: auto auto 20px auto;
}

#faq div ul {
    width: 100%;
}

#faq .tab li a{
    text-align: left;
    width: 200vh;
}

/*Notes for opening a file directly
--------------------------------------- */

.notes {
  display: none;
  border-left: 2px solid rgb(240, 111, 114);
  padding-left: 10px;
}

.info {
  display: inline-block;
  float: right;
  width: 25px;
  cursor: help;
}

.info:hover ~ .notes {
  display: inline-block;
}

/* Style the Scroll-Bar
--------------------------------------- */

/* width */
::-webkit-scrollbar {
  width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background-color: none;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #80bfff;
  border-radius: 10px;
}

/* Handle on active */
::-webkit-scrollbar-thumb:active {
  background: #41A0F2;
}


text:
package innova.utility;

public class Constant
{
	public static final int INTERVAL_INVALID = -1;
	public static final int INDEX_INVALID = -1;
	public static final int SIZE_OF_INT = 4;
}


text:
package com.didichuxing.doraemondemo;

import org.junit.Test;

public class TestJava {

    @Test
    public void test() throws Exception{

        System.out.println("test");
    }
}


text:
from tempest.api.compute import base
from tempest.test import attr

class HypervisorAdminV3Test(base.BaseV3ComputeAdminTest):

    """
    Tests Hypervisors API that require admin privileges
    """

    _interface = 'json'

    @classmethod
    def setUpClass(cls):
        super(HypervisorAdminV3Test, cls).setUpClass()
        cls.client = cls.hypervisor_admin_client

    def _list_hypervisors(self):
        # List of hypervisors
        resp, hypers = self.client.get_hypervisor_list()
        self.assertEqual(200, resp.status)
        return hypers

    @attr(type='gate')
    def test_get_hypervisor_list(self):
        # List of hypervisor and available hypervisors hostname
        hypers = self._list_hypervisors()
        self.assertTrue(len(hypers) > 0)

    @attr(type='gate')
    def test_get_hypervisor_list_details(self):
        # Display the details of the all hypervisor
        resp, hypers = self.client.get_hypervisor_list_details()
        self.assertEqual(200, resp.status)
        self.assertTrue(len(hypers) > 0)

    @attr(type='gate')
    def test_get_hypervisor_show_details(self):
        # Display the details of the specified hypervisor
        hypers = self._list_hypervisors()
        self.assertTrue(len(hypers) > 0)

        resp, details = (self.client.
                         get_hypervisor_show_details(hypers[0]['id']))
        self.assertEqual(200, resp.status)
        self.assertTrue(len(details) > 0)
        self.assertEqual(details['hypervisor_hostname'],
                         hypers[0]['hypervisor_hostname'])

    @attr(type='gate')
    def test_get_hypervisor_show_servers(self):
        # Show instances about the specific hypervisors
        hypers = self._list_hypervisors()
        self.assertTrue(len(hypers) > 0)

        hypervisor_id = hypers[0]['id']
        resp, hypervisors = self.client.get_hypervisor_servers(hypervisor_id)
        self.assertEqual(200, resp.status)
        self.assertTrue(len(hypervisors) > 0)

    @attr(type='gate')
    def test_get_hypervisor_stats(self):
        # Verify the stats of the all hypervisor
        resp, stats = self.client.get_hypervisor_stats()
        self.assertEqual(200, resp.status)
        self.assertTrue(len(stats) > 0)

    @attr(type='gate')
    def test_get_hypervisor_uptime(self):
        # Verify that GET shows the specified hypervisor uptime
        hypers = self._list_hypervisors()

        resp, uptime = self.client.get_hypervisor_uptime(hypers[0]['id'])
        self.assertEqual(200, resp.status)
        self.assertTrue(len(uptime) > 0)

    @attr(type='gate')
    def test_search_hypervisor(self):
        hypers = self._list_hypervisors()
        self.assertTrue(len(hypers) > 0)
        resp, hypers = self.client.search_hypervisor(
            hypers[0]['hypervisor_hostname'])
        self.assertEqual(200, resp.status)
        self.assertTrue(len(hypers) > 0)


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.dahanne.spring.android.ch3.http.basic.authentication"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <uses-permission android:name="android.permission.INTERNET"/>
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


text:
// Type definitions for SuperAgent v1.4.0
// Project: https://github.com/visionmedia/superagent
// Definitions by: Alex Varju <https://github.com/varju/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path='../node/node.d.ts' />

declare module 'superagent' {
  import stream = require('stream');

  type CallbackHandler = (err: any, res: request.Response) => void;

  var request: request.SuperAgentStatic;

  module request {
    interface SuperAgentStatic extends SuperAgent<SuperAgentRequest> {
      (url: string): SuperAgentRequest;
      (method: string, url: string): SuperAgentRequest;

      agent(): SuperAgent<SuperAgentRequest>;
    }

    interface SuperAgent<Req extends Request<any>> extends stream.Stream {
      get(url: string, callback?: CallbackHandler): Req;
      post(url: string, callback?: CallbackHandler): Req;
      put(url: string, callback?: CallbackHandler): Req;
      head(url: string, callback?: CallbackHandler): Req;
      del(url: string, callback?: CallbackHandler): Req;
      delete(url: string, callback?: CallbackHandler): Req;
      options(url: string, callback?: CallbackHandler): Req;
      trace(url: string, callback?: CallbackHandler): Req;
      copy(url: string, callback?: CallbackHandler): Req;
      lock(url: string, callback?: CallbackHandler): Req;
      mkcol(url: string, callback?: CallbackHandler): Req;
      move(url: string, callback?: CallbackHandler): Req;
      purge(url: string, callback?: CallbackHandler): Req;
      propfind(url: string, callback?: CallbackHandler): Req;
      proppatch(url: string, callback?: CallbackHandler): Req;
      unlock(url: string, callback?: CallbackHandler): Req;
      report(url: string, callback?: CallbackHandler): Req;
      mkactivity(url: string, callback?: CallbackHandler): Req;
      checkout(url: string, callback?: CallbackHandler): Req;
      merge(url: string, callback?: CallbackHandler): Req;
      // m-search(url: string, callback?: CallbackHandler): Req;
      notify(url: string, callback?: CallbackHandler): Req;
      subscribe(url: string, callback?: CallbackHandler): Req;
      unsubscribe(url: string, callback?: CallbackHandler): Req;
      patch(url: string, callback?: CallbackHandler): Req;
      search(url: string, callback?: CallbackHandler): Req;
      connect(url: string, callback?: CallbackHandler): Req;

      parse(fn: Function): Req;
      saveCookies(res: Response): void;
      attachCookies(req: Req): void;
    }

    interface Response extends NodeJS.ReadableStream {
      text: string;
      body: any;
      files: any;
      header: any;
      type: string;
      charset: string;
      status: number;
      statusType: number;
      info: boolean;
      ok: boolean;
      redirect: boolean;
      clientError: boolean;
      serverError: boolean;
      error: Error;
      accepted: boolean;
      noContent: boolean;
      badRequest: boolean;
      unauthorized: boolean;
      notAcceptable: boolean;
      notFound: boolean;
      forbidden: boolean;
      get(header: string): string;
    }

    interface Request<Req extends Request<any>> /* extends NodeJS.WritableStream */ {
      abort(): void;
      accept(type: string): Req;
      attach(field: string, file: string, filename?: string): Req;
      auth(user: string, name: string): Req;
      buffer(val: boolean): Req;
      clearTimeout(): Req;
      end(callback?: CallbackHandler): Req;
      field(name: string, val: string): Req;
      get(field: string): string;
      on(name: string, handler: Function): Req;
      on(name: 'error', handler: (err: any) => void): Req;
      part(): Req;
      pipe(stream: NodeJS.WritableStream, options?: Object): stream.Writable;
      query(val: Object): Req;
      redirects(n: number): Req;
      send(data: string): Req;
      send(data: Object): Req;
      send(): Req;
      set(field: string, val: string): Req;
      set(field: Object): Req;
      timeout(ms: number): Req;
      type(val: string): Req;
      use(fn: Function): Req;
      withCredentials(): Req;
      write(data: string, encoding?: string): Req;
      write(data: Buffer, encoding?: string): Req;
    }
    interface SuperAgentRequest extends Request<Request<Request<Request<any>>>> {}

  }

  export = request;
}


text:
#include <jni.h>

#include <sstream>
#include <string>

#include "java_interop.h"
#include "json/json.h"

namespace jsonparse {

extern "C" JNIEXPORT jstring JNICALL
Java_com_example_prefabdependency_MainActivity_getJsonValue(JNIEnv *env,
                                                     jobject /* this */,
                                                     jstring jsonFromJava,
                                                     jstring keyFromJava) {
  if (jsonFromJava == nullptr) {
    logging::FatalError(env, "jsonFromJava argument cannot be null");
  }
  if (keyFromJava == nullptr) {
    logging::FatalError(env, "keyFromJava argument cannot be null");
  }

  const std::string json =
      jsonparse::jni::Convert<std::string>::from(env, jsonFromJava);
  const std::string key =
      jsonparse::jni::Convert<std::string>::from(env, keyFromJava);

  Json::Value root;
  std::istringstream(json) >> root;

  return jni::Convert<jstring>::from(env, root[key].asString());
}

}  // namespace com.example.prefabdependency


text:
function answer = onMatlabPath(p, loose)
% Return true if the specified path is currently on the Matlab search path.
% If loose is true, (default = false), then answer is true if any
% subdirectory of p is on the path.
%
%% Example:
%
%   onMatlabPath 'C:\pmtkData'
%%

% This file is from pmtk3.googlecode.com

SetDefaultValue(2, 'loose', false);
if loose
    answer = any(cellfun(@(s)isSubstring(p, s), tokenize(path(), ';')));
else
    answer = any(cellfun(@(s)strcmpi(s, p), tokenize(path(), ';')));
end
end


text:
E-HMM -- Hidden Markov Model with Exponential PDF
====

A Matlab package for Hidden Markov Model with Exponential Probability Dense Function for Emissions


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Tofispora repetospora G. Langer & Ryvarden, 1994

### Remarks
null


text:
"use strict";

var fs = require( 'fs' );
var ex = require( 'msexcel-builder' );

var walk = function( dir ) {
    var results = []
    var list = fs.readdirSync( dir )
    list.forEach( function( file ) {
        file = dir + '/' + file
        var stat = fs.statSync( file )
        if ( stat && stat.isDirectory() ) {results = results.concat( walk( file ) )}
        else {results.push( file )}
    } )
    return results
}

var search = function( regexp, files ) {
    var results = [];
    files.forEach( function( file ) {
        var fileContets = fs.readFileSync( file ).toString();

        var matches;

        while ( matches = regexp.exec( fileContets ) ) {
            results = results.concat( matches[1] );
        }
    } );

    return results;
}

var createAndSaveExcel = function( matches, translationFile ) {
    var dir = './output';
    if ( !fs.existsSync( dir ) ) {
        fs.mkdirSync( dir );
    }
    var workbook = ex.createWorkbook( dir, 'extract-' + Date.now() + '.xlsx' );

    var sheet1 = workbook.createSheet( 'Sheet1', 10, matches.length );

    var index = 0;

    matches.forEach( function( item ) {
        index++;
        sheet1.set( 1, index, item );
        sheet1.set( 2, index, translationFile[item]["EN"] );
        sheet1.set( 3, index, translationFile[item]["FR"] );
    } )

    workbook.save( function( ok ) {
        if ( ok != null ) {
            workbook.cancel();
        }
        else {
            console.log( 'congratulations, your workbook created' );
        }
    } );

}

module.exports = function( regexpString, filesPath, translationFilePath ) {
    var files = walk( filesPath );

    var matches = search( regexpString, files );

    var translationFile = require( translationFilePath );

    createAndSaveExcel( matches, translationFile );
};


text:
Rails.application.routes.draw do
  root 'home#index'

  resources :users do
    resources :notifications, param: :notification_id
    resources :bets, param: :bet_id
    resources :significant_others, param: :significant_other_id
  end

  get '/sessions/new', to: 'sessions#new'
  post '/sessions', to: 'sessions#create'
  delete '/sessions/:id', to: 'sessions#destroy', as: 'sessions_destroy'

  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end


text:
package org.vaadin.client;

import com.vaadin.shared.communication.ServerRpc;

public interface SuggestBoxServerRpc extends ServerRpc {
    void suggestFor(String query);

    void selectionChanged(int itemId);
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Quicktips Example</title>

        <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all-neptune.css">

        <link rel="stylesheet" type="text/css" href="extjs/examples/shared/example.css" />
        <link rel="stylesheet" type="text/css" href="qtips.css" />

Tips examples

Note that the js is not minified so it is readable. See qtips.js for the tip creation code.

Easiest Tip

Callout Tip

QuickTip

QuickTip

Fixed width

With title

Aligned top

5 bedrooms

2 bathrooms

Large backyard

Close to transport


text:
<?php

//dataform routing
Burp::post(null, 'process=1', array('as'=>'save', function() {
    BurpEvent::queue('dataform.save');
}));

//datagrid routing
Burp::get(null, 'page/(\d+)', array('as'=>'page', function($page) {
    BurpEvent::queue('dataset.page', array($page));
}));
Burp::get(null, 'ord=(-?)(\w+)', array('as'=>'orderby', function($direction, $field) {
    $direction = ($direction == '-') ? "DESC" : "ASC";
    BurpEvent::queue('dataset.sort', array($direction, $field));
}))->remove('page');

//todo: dataedit

Route::get('rapyd-ajax/{hash}', array('as' => 'rapyd.remote', 'uses' => '\Zofe\Rapyd\Controllers\AjaxController@getRemote'));
//Route::controller('rapyd-demo', '\Zofe\Rapyd\Demo\DemoController');


text:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Jasmine Spec Runner with Benchmarking</title>
  <% css.forEach(function(style){ %>
    <link rel="stylesheet" type="text/css" href="<%= style %>">
  <% }) %>

  <script src="<%= temp %>/benchmark.js"></script>
  <% if (useNanoTime) { %>
    <applet code="nano" archive="<%= temp %>/nano.jar"></applet>
  <% } %>

  <% with (scripts) { %>
    <% [].concat(polyfills, jasmine, vendor, helpers, src, specs,reporters).forEach(function(script){ %>
    <script src="<%= script %>"></script>
    <% }) %>
  <% }; %>
</head>
<body>
</body>
</html>


text:
"""
Get dropped item's ModelIndex in QListView

Tested environment:
    Mac OS X 10.6.8

Docs

 - http://doc.qt.nokia.com/latest/model-view-programming.html#using-drag-and-drop-with-item-views
 - file:///opt/local/share/doc/qt4/html/qabstractitemmodel.html#dropMimeData
"""
import glob
import os
import sys

try:
    from PySide import QtCore
    from PySide import QtGui
except ImportError:
    from PyQt4 import QtCore
    from PyQt4 import QtGui

class ListModel(QtCore.QAbstractListModel):
    def __init__(self, os_list):
        super(ListModel, self).__init__()
        self.os_list = os_list

    def rowCount(self, parent):
        return len(self.os_list)

    def data(self, index, role = QtCore.Qt.DisplayRole):
        if not index.isValid():
            return None

        os_name, os_logo_path = self.os_list[index.row()]
        if role == QtCore.Qt.DisplayRole:
            return os_name
        elif role == QtCore.Qt.DecorationRole:
            return QtGui.QIcon(os_logo_path)

        return None

    def flags(self, idx):
        if idx.isValid():
            return QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsDropEnabled |\
                   QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
        else:
            return QtCore.Qt.ItemIsDropEnabled |\
                   QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled

    def supportedDropActions(self):
        return QtCore.Qt.MoveAction

    def dropMimeData(self, data, action, row, column, parent_idx):
        """
        NOTICE: Although the specified row, column
        and parent indicate the location of an item in the model where the operation ended,
        it is the responsibility of the view to
        provide a suitable location for where the data should be inserted.
        """
#        print data, action, row, column, parent_idx
        return super(ListModel, self).dropMimeData(data, action, row, column, parent_idx)

    def mimeData(self, idxes):
        # NOTE: create mime data from ancestor method for fixed crash bug on PySide
        mime_data = super(ListModel, self).mimeData(idxes)

        encoded_data = ""

        for idx in idxes:
            if idx.isValid():
                encoded_data += '\r\n' + self.data(idx, role = QtCore.Qt.DisplayRole)

        mime_data.setData('text/plain', encoded_data)

        return mime_data

class ListView(QtGui.QListView):
    def __init__(self, parent=None):
        super(ListView, self).__init__(parent)

        self.data_sources = create_data_source()
        list_model = ListModel(self.data_sources)
        self.setModel(list_model)

        # size
        self.setIconSize(QtCore.QSize(50, 50))
        self.setSpacing(5)
        self.setUniformItemSizes(True)

        # view
        self.setDropIndicatorShown(True)

        # interactive in DND mode
        self.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
        self.setDragEnabled(True)
        self.setAcceptDrops(True)

    def dropEvent(self, evt):
        mime_data = evt.mimeData()

        if mime_data.hasFormat('text/plain'):
            buf = mime_data.data('text/plain')
            print "source == self:", evt.source() == self
            print 'mime data:', repr(buf)

            target_idx = self.indexAt(evt.pos())
            print "dropped at row:%d, col:%d:" % (target_idx.row(), target_idx.column())

        return super(ListView, self).dropEvent(evt)

def create_data_source():
    logos = glob.glob('*.png')
    return [(os.path.splitext(i)[0], i) for i in logos]

class Demo(QtGui.QWidget):
    def __init__(self):
        super(Demo, self).__init__()
        x, y, w, h = 500, 200, 300, 400
        self.setGeometry(x, y, w, h)

        self.list_view = ListView(self)
        x, y, w, h = 5, 5, 290, 250
        self.list_view.setGeometry(x, y, w, h)

    def show_and_raise(self):
        self.show()
        self.raise_()

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)

    demo = Demo()
    demo.show_and_raise()

    sys.exit(app.exec_())


text:
// Generated from Linn.g4 by ANTLR 4.5

    package linn.grammar;

import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.TerminalNode;

/**
 * This class provides an empty implementation of {@link LinnListener},
 * which can be extended to create a listener which only needs to handle a subset
 * of the available methods.
 */
public class LinnBaseListener implements LinnListener {
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterLinn(LinnParser.LinnContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitLinn(LinnParser.LinnContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterLinnRule(LinnParser.LinnRuleContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitLinnRule(LinnParser.LinnRuleContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterLinnProduction(LinnParser.LinnProductionContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitLinnProduction(LinnParser.LinnProductionContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterParams(LinnParser.ParamsContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitParams(LinnParser.ParamsContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterKeyValue(LinnParser.KeyValueContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitKeyValue(LinnParser.KeyValueContext ctx) { }

	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void enterEveryRule(ParserRuleContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void exitEveryRule(ParserRuleContext ctx) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void visitTerminal(TerminalNode node) { }
	/**
	 * {@inheritDoc}
	 *
	 *
The default implementation does nothing.

	 */
	@Override public void visitErrorNode(ErrorNode node) { }
}


text:
#include "hclib.h"
int ____num_tasks[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <shmem.h>

#include "uts.h"

/***********************************************************
 *                                                         *
 *  Compiler Type (these flags are set by at compile time) *
 *     (default) ANSI C compiler - sequential execution    *
 *     (_OPENMP) OpenMP enabled C compiler                 *
 *     (__UPC__) UPC compiler                              *
 *     (_SHMEM)  Cray Shmem                                *
 *     (__PTHREADS__) Pthreads multithreaded execution     *
 *                                                         *
 ***********************************************************/

#include <omp.h>
#define MAX_OMP_THREADS       32
#define MAX_SHMEM_THREADS     64
// OpenMP helper function to match UPC lock allocation semantics

/***********************************************************
 *  Parallel execution parameters                          *
 ***********************************************************/

int cbint     = 1;        // Cancellable barrier polling interval
int pollint   = 1;        // BUPC Polling interval

int n_nodes = 0;
int n_leaves = 0;

#ifdef THREAD_METADATA
typedef struct _thread_metadata {
    size_t ntasks;
} thread_metadata;
thread_metadata t_metadata[MAX_OMP_THREADS];
#endif

#define N_BUFFERED_STEALS 16
Node steal_buffer[N_BUFFERED_STEALS];
volatile int n_buffered_steals = 0;
long steal_buffer_locks[MAX_SHMEM_THREADS];

int complete_pes = 0;

static int pe, npes;

static int steal_from(int target_pe, Node *stolen_out) {
    int remote_buffered_steals;

    shmem_set_lock(&steal_buffer_locks[target_pe]);
    shmem_int_get(&remote_buffered_steals, &n_buffered_steals, 1, target_pe);

    int stole_something = 0;
    if (remote_buffered_steals > 0) {
        remote_buffered_steals--;
        shmem_getmem(stolen_out, &steal_buffer[remote_buffered_steals],
                sizeof(Node), target_pe);
        shmem_int_put(&n_buffered_steals, &remote_buffered_steals, 1, target_pe);
        stole_something = 1;
    }

    shmem_clear_lock(&steal_buffer_locks[target_pe]);
    return stole_something;
}

static int remote_steal(Node *stolen_out) {
    int pe_above = (pe + 1) % npes;
    int pe_below = pe - 1;
    if (pe_below < 0) pe_below = npes - 1;

    shmem_int_add(&complete_pes, 1, 0);

    int ndone = shmem_int_fadd(&complete_pes, 0, 0);
    while (ndone != npes) {
        // Try to remote steal

        if (steal_from(pe_above, stolen_out) || steal_from(pe_below, stolen_out)) {
            shmem_int_add(&complete_pes, -1, 0);
            return 1;
        }

        pe_above = (pe_above + 1) % npes;
        pe_below = pe_below - 1;
        if (pe_below < 0) pe_below = npes - 1;

        ndone = shmem_int_fadd(&complete_pes, 0, 0);
    }

    assert(ndone == npes);
    return 0;
}

#ifdef __BERKELEY_UPC__
/* BUPC nonblocking I/O Handles */
bupc_handle_t cb_handle       = BUPC_COMPLETE_HANDLE;
const int     local_cb_cancel = 1;
#endif

/***********************************************************
 * Tree statistics (if selected via UTS_STAT)              *
 *   compute overall size and imbalance metrics            *
 *   and histogram size and imbalance per level            *
 ***********************************************************/
#ifdef UTS_STAT

/* Check that we are not being asked to compile parallel with stats.
 * Parallel stats collection is presently not supported.  */

#define MAXHISTSIZE      2000  // max tree depth in histogram
int    stats     = 1;
int    unbType   = 1;
int    maxHeight = 0;         // maximum depth of tree
double maxImb    = 0;         // maximum imbalance
double minImb    = 1;
double treeImb   =-1;         // Overall imbalance, undefined

int    hist[MAXHISTSIZE+1][2];      // average # nodes per level
double unbhist[MAXHISTSIZE+1][3];   // average imbalance per level

int    *rootSize;             // size of the root's children
double *rootUnb;              // imbalance of root's children

/* Tseng statistics */
int    totalNodes = 0;
double imb_max    = 0;         // % of work in largest child (ranges from 100/n to 100%)
double imb_avg    = 0;
double imb_devmaxavg     = 0;  // ( % of work in largest child ) - ( avg work )
double imb_normdevmaxavg = 0;  // ( % of work in largest child ) - ( avg work ) / ( 100% - avg work )
#else
int stats   = 0;
int unbType = -1;
#endif

/***********************************************************
 *  Execution Tracing                                      *
 ***********************************************************/

#define SS_WORK    0
#define SS_SEARCH  1
#define SS_IDLE    2
#define SS_OVH     3
#define SS_CBOVH   4
#define SS_NSTATES 5

/* session record for session visualization */
struct sessionRecord_t {
  double startTime, endTime;
};
typedef struct sessionRecord_t SessionRecord;

/* steal record for steal visualization */
struct stealRecord_t {
  long int nodeCount;           /* count nodes generated during the session */
  int victimThread;             /* thread from which we stole the work  */
};
typedef struct stealRecord_t StealRecord;

/* Store debugging and trace data */
struct metaData_t {
  SessionRecord sessionRecords[SS_NSTATES][20000];   /* session time records */
  StealRecord stealRecords[20000]; /* steal records */
};
typedef struct metaData_t MetaData;

/* holds text string for debugging info */
char debug_str[1000];

/***********************************************************
 * StealStack types                                        *
 ***********************************************************/

/***********************************************************
 *  Global shared state                                    *
 ***********************************************************/

/***********************************************************
 *  UTS Implementation Hooks                               *
 ***********************************************************/

// Return a string describing this implementation
char * impl_getName() {
    return "HCLIB";
}

// construct string with all parameter settings
int impl_paramsToStr(char *strBuf, int ind) {
//     int n_omp_threads;
// #pragma omp parallel
//     {
// #pragma omp single
//         {
//     n_omp_threads = omp_get_num_threads();
//         }
//     }

  ind += sprintf(strBuf+ind, "Execution strategy:  ");

  return ind;
}

int impl_parseParam(char *param, char *value) {
  int err = 0;  // Return 0 on a match, nonzero on an error

  switch (param[1]) {
    case 'i':
      cbint = atoi(value); break;
    default:
      err = 1;
      break;
  }

  return err;
}

void impl_helpMessage() {
}

void impl_abort(int err) {
  exit(err);
}

/***********************************************************
 *                                                         *
 *  FUNCTIONS                                              *
 *                                                         *
 ***********************************************************/

/*
 * StealStack
 *    Stack of nodes with sharing at the bottom of the stack
 *    and exclusive access at the top for the "owning" thread
 *    which has affinity to the stack's address space.
 *
 *    * All operations on the shared portion of the stack
 *      must be guarded using the stack-specific lock.
 *    * Elements move between the shared and exclusive
 *      portion of the stack solely under control of the
 *      owning thread. (ss_release and ss_acquire)
 *    * workAvail is the count of elements in the shared
 *      portion of the stack.  It may be read without
 *      acquiring the stack lock, but of course its value
 *      may not be acurate.  Idle threads read workAvail in
 *      this speculative fashion to minimize overhead to
 *      working threads.
 *    * Elements can be stolen from the bottom of the shared
 *      portion by non-owning threads.  The values are
 *      reserved under lock by the stealing thread, and then
 *      copied without use of the lock (currently space for
 *      reserved values is never reclaimed).
 *
 */

/* fatal error */
void ss_error(char *str) {
  printf("*** %s\n", str);
  exit(4);
}

#ifdef UTS_STAT
/*
 * Statistics,
 * : number of nodes per level
 * : imbalanceness of nodes per level
 *
 */
void initHist()
{
  int i;
  for (i=0; i<MAXHISTSIZE; i++){
    hist[i][0]=0;
    hist[i][1]=0;
    unbhist[i][1]=1;
    unbhist[i][2]=0;
  }
}

void updateHist(Node* c, double unb)
{
  if (c->height<MAXHISTSIZE){
    hist[c->height][1]++;
    hist[c->height][0]+=c->numChildren;

    unbhist[c->height][0]+=unb;
    if (unbhist[c->height][1]>unb)
      unbhist[c->height][1]=unb;
    if (unbhist[c->height][2]<unb)
      unbhist[c->height][2]=unb;

  }
  else {
    hist[MAXHISTSIZE][1]++;
    hist[MAXHISTSIZE][0]+=c->numChildren;
  }
}

void showHist(FILE *fp)
{
  int i;
  fprintf(fp, "depth\tavgNumChildren\t\tnumChildren\t imb\t maxImb\t minImb\t\n");
  for (i=0; i<MAXHISTSIZE; i++){
    if ((hist[i][0]!=0)&&(hist[i][1]!=0))
      fprintf(fp, "%d\t%f\t%d\t %lf\t%lf\t%lf\n", i, (double)hist[i][0]/hist[i][1],
              hist[i][0], unbhist[i][0]/hist[i][1], unbhist[i][1], unbhist[i][2]);
  }
}

double getImb(Node *c)
{
  int i=0;
  double avg=.0, tmp=.0;
  double unb=0.0;

  avg=(double)c->sizeChildren/c->numChildren;

  for (i=0; i<c->numChildren; i++){
    if ((type==BIN)&&(c->pp==NULL))
      {
        if (unbType<2)
          tmp=min((double)rootSize[i]/avg, avg/(double)rootSize[i]);
        else
          tmp=max((double)rootSize[i]/avg, avg/(double)rootSize[i]);

        if (unbType>0)
          unb+=tmp*rootUnb[i];
        else
          unb+=tmp*rootUnb[i]*rootSize[i];
      }
    else{
      if (unbType<2)
        tmp=min((double)c->size[i]/avg, avg/(double)c->size[i]);
      else
        tmp=max((double)c->size[i]/avg, avg/(double)c->size[i]);

      if (unbType>0)
        unb+=tmp*c->unb[i];
      else
        unb+=tmp*c->unb[i]*c->size[i];
    }
  }

  if (unbType>0){
    if (c->numChildren>0)
      unb=unb/c->numChildren;
    else unb=1.0;
  }
  else {
    if (c->sizeChildren>1)
      unb=unb/c->sizeChildren;
    else unb=1.0;
  }
  if ((debug & 1) && unb>1) printf("unb>1%lf\t%d\n", unb, c->numChildren);

  return unb;
}

void getImb_Tseng(Node *c)
{
  double t_max, t_avg, t_devmaxavg, t_normdevmaxavg;

  if (c->numChildren==0)
    {
      t_avg =0;
      t_max =0;
    }
  else
    {
      t_max = (double)c->maxSizeChildren/(c->sizeChildren-1);
      t_avg = (double)1/c->numChildren;
    }

  t_devmaxavg = t_max-t_avg;

  if (debug & 1)
    printf("max\t%lf, %lf, %d, %d, %d\n", t_max, t_avg,
           c->maxSizeChildren, c->sizeChildren, c->numChildren);

  if (1-t_avg==0)
    t_normdevmaxavg = 1;
  else
    t_normdevmaxavg = (t_max-t_avg)/(1-t_avg);

  imb_max += t_max;
  imb_avg += t_avg;
  imb_devmaxavg += t_devmaxavg;
  imb_normdevmaxavg +=t_normdevmaxavg;
}

void updateParStat(Node *c)
{
  double unb;

  totalNodes++;
  if (maxHeight<c->height)
    maxHeight=c->height;

  unb=getImb(c);
  maxImb=max(unb, maxImb);
  minImb=min(unb, minImb);
  updateHist(c, unb);

  getImb_Tseng(c);

  if (c->pp!=NULL){
    if ((c->type==BIN)&&(c->pp->pp==NULL)){
      rootSize[c->pp->ind]=c->sizeChildren;
      rootUnb[c->pp->ind]=unb;
    }
    else{
      c->pp->size[c->pp->ind]=c->sizeChildren;
      c->pp->unb[c->pp->ind]=unb;
    }
    /* update statistics per node*/
    c->pp->ind++;
    c->pp->sizeChildren+=c->sizeChildren;
    if (c->pp->maxSizeChildren<c->sizeChildren)
      c->pp->maxSizeChildren=c->sizeChildren;
  }
  else
    treeImb = unb;
}
#endif

/*
 *	Tree Implementation
 *
 */
void initNode(Node * child)
{
  child->type = -1;
  child->height = -1;
  child->numChildren = -1;    // not yet determined

#ifdef UTS_STAT
  if (stats){
    int i;
    child->ind = 0;
    child->sizeChildren = 1;
    child->maxSizeChildren = 0;
    child->pp = NULL;
    for (i = 0; i < MAXNUMCHILDREN; i++){
      child->size[i] = 0;
      child->unb[i]  = 0.0;
    }
  }
#endif
}

void initRootNode(Node * root, int type)
{
  uts_initRoot(root, type);

  #ifdef TRACE
    stealStack[0]->md->stealRecords[0].victimThread = 0;  // first session is own "parent session"
  #endif

#ifdef UTS_STAT
  if (stats){
    int i;
    root->ind = 0;
    root->sizeChildren = 1;
    root->maxSizeChildren = 1;
    root->pp = NULL;

    if (type != BIN){
      for (i=0; i<MAXNUMCHILDREN; i++){
        root->size[i] = 0;
        root->unb[i]  =.0;
      }
    }
    else {
      int rbf = (int) ceil(b_0);
      rootSize = malloc(rbf*sizeof(int));
      rootUnb = malloc(rbf*sizeof(double));
      for (i = 0; i < rbf; i++) {
        rootSize[i] = 0;
        rootUnb[i] = 0.0;
      }
    }
  }
#endif
}

/*
 * Generate all children of the parent
 *
 * details depend on tree type, node type and shape function
 *
 */
void genChildren(Node * parent, Node * child) {
  int parentHeight = parent->height;
  int numChildren, childType;

#ifdef THREAD_METADATA
  t_metadata[omp_get_thread_num()].ntasks += 1;
#endif

hclib_pragma_marker("omp", "atomic", "pragma528_omp_atomic");
  n_nodes += 1;

  numChildren = uts_numChildren(parent);
  childType   = uts_childType(parent);

  // record number of children in parent
  parent->numChildren = numChildren;

  // construct children and push onto stack
  if (numChildren > 0) {
    int i, j;
    child->type = childType;
    child->height = parentHeight + 1;

#ifdef UTS_STAT
    if (stats) {
      child->pp = parent;  // pointer to parent
    }
#endif

    unsigned char * parent_state = parent->state.state;
    unsigned char * child_state = child->state.state;

    for (i = 0; i < numChildren; i++) {
      for (j = 0; j < computeGranularity; j++) {
        // TBD:  add parent height to spawn
        // computeGranularity controls number of rng_spawn calls per node
          rng_spawn(parent_state, child_state, i);
      }

      Node parent = *child;

      int made_available_for_stealing = 0;
      // if (omp_get_thread_num() == 0 && n_buffered_steals < N_BUFFERED_STEALS) {
      if (hclib_get_current_worker() == 0 && n_buffered_steals < N_BUFFERED_STEALS) {
          shmem_set_lock(&steal_buffer_locks[pe]);
          if (n_buffered_steals < N_BUFFERED_STEALS) {
              steal_buffer[n_buffered_steals++] = parent;
              made_available_for_stealing = 1;
          }
          shmem_clear_lock(&steal_buffer_locks[pe]);
      }
      if (!made_available_for_stealing) {
hclib_pragma_marker("omp", "task untied firstprivate(parent) if(parent.height < 9)", "pragma572_omp_task");
          {
              Node child;
              initNode(&child);

              if (parent.numChildren < 0) {
                  genChildren(&parent, &child);
              }
          }
      }
    }
  } else {
hclib_pragma_marker("omp", "atomic", "pragma584_omp_atomic");
      n_leaves += 1;
  }
}

// display search statistics
void showStats(double elapsedSecs) {
  int i;
  int tnodes = 0, tleaves = 0, trel = 0, tacq = 0, tsteal = 0, tfail= 0;
  int mdepth = 0, mheight = 0;
  double twork = 0.0, tsearch = 0.0, tidle = 0.0, tovh = 0.0, tcbovh = 0.0;

//   // combine measurements from all threads
//   for (i = 0; i < GET_NUM_THREADS; i++) {
//     tnodes  += stealStack[i]->nNodes;
//     tleaves += stealStack[i]->nLeaves;
//     trel    += stealStack[i]->nRelease;
//     tacq    += stealStack[i]->nAcquire;
//     tsteal  += stealStack[i]->nSteal;
//     tfail   += stealStack[i]->nFail;
//     twork   += stealStack[i]->time[SS_WORK];
//     tsearch += stealStack[i]->time[SS_SEARCH];
//     tidle   += stealStack[i]->time[SS_IDLE];
//     tovh    += stealStack[i]->time[SS_OVH];
//     tcbovh  += stealStack[i]->time[SS_CBOVH];
//     mdepth   = max(mdepth, stealStack[i]->maxStackDepth);
//     mheight  = max(mheight, stealStack[i]->maxTreeDepth);
//   }
//   if (trel != tacq + tsteal) {
//     printf("*** error! total released != total acquired + total stolen\n");
//   }
//
  uts_showStats(hclib_num_workers(), 0, elapsedSecs, n_nodes, n_leaves, mheight);
//
//   if (verbose > 1) {
//     if (doSteal) {
//       printf("Total chunks released = %d, of which %d reacquired and %d stolen\n",
//           trel, tacq, tsteal);
//       printf("Failed steal operations = %d, ", tfail);
//     }
//
//     printf("Max stealStack size = %d\n", mdepth);
//     printf("Avg time per thread: Work = %.6f, Search = %.6f, Idle = %.6f\n", (twork / GET_NUM_THREADS),
//         (tsearch / GET_NUM_THREADS), (tidle / GET_NUM_THREADS));
//     printf("                     Overhead = %6f, CB_Overhead = %6f\n\n", (tovh / GET_NUM_THREADS),
//         (tcbovh/GET_NUM_THREADS));
//   }
//
//   // per thread execution info
//   if (verbose > 2) {
//     for (i = 0; i < GET_NUM_THREADS; i++) {
//       printf("** Thread %d\n", i);
//       printf("  # nodes explored    = %d\n", stealStack[i]->nNodes);
//       printf("  # chunks released   = %d\n", stealStack[i]->nRelease);
//       printf("  # chunks reacquired = %d\n", stealStack[i]->nAcquire);
//       printf("  # chunks stolen     = %d\n", stealStack[i]->nSteal);
//       printf("  # failed steals     = %d\n", stealStack[i]->nFail);
//       printf("  maximum stack depth = %d\n", stealStack[i]->maxStackDepth);
//       printf("  work time           = %.6f secs (%d sessions)\n",
//              stealStack[i]->time[SS_WORK], stealStack[i]->entries[SS_WORK]);
//       printf("  overhead time       = %.6f secs (%d sessions)\n",
//              stealStack[i]->time[SS_OVH], stealStack[i]->entries[SS_OVH]);
//       printf("  search time         = %.6f secs (%d sessions)\n",
//              stealStack[i]->time[SS_SEARCH], stealStack[i]->entries[SS_SEARCH]);
//       printf("  idle time           = %.6f secs (%d sessions)\n",
//              stealStack[i]->time[SS_IDLE], stealStack[i]->entries[SS_IDLE]);
//       printf("  wakeups             = %d, false wakeups = %d (%.2f%%)",
//              stealStack[i]->wakeups, stealStack[i]->falseWakeups,
//              (stealStack[i]->wakeups == 0) ? 0.00 : ((((double)stealStack[i]->falseWakeups)/stealStack[i]->wakeups)*100.0));
//       printf("\n");
//     }
//   }
//
//   #ifdef TRACE
//     printSessionRecords();
//   #endif
//
//   // tree statistics output to stat.txt, if requested
// #ifdef UTS_STAT
//   if (stats) {
//     FILE *fp;
//     char * tmpstr;
//     char strBuf[5000];
//     int  ind = 0;
//
//     fp = fopen("stat.txt", "a+w");
//     fprintf(fp, "\n------------------------------------------------------------------------------------------------------\n");
//     ind = uts_paramsToStr(strBuf, ind);
//     ind = impl_paramsToStr(strBuf, ind);
//     //showParametersStr(strBuf);
//     fprintf(fp, "%s\n", strBuf);
//
//     fprintf(fp, "\nTotal nodes = %d\n", totalNodes);
//     fprintf(fp, "Max depth   = %d\n\n", maxHeight);
//     fprintf(fp, "Tseng ImbMeasure(overall)\n max:\t\t%lf \n avg:\t\t%lf \n devMaxAvg:\t %lf\n normDevMaxAvg: %lf\t\t\n\n",
//             imb_max/totalNodes, imb_avg/totalNodes, imb_devmaxavg/totalNodes,
//             imb_normdevmaxavg/totalNodes);
//
//     switch (unbType){
//     case 0: tmpstr = "(min imb weighted by size)"; break;
//     case 1: tmpstr = "(min imb not weighted by size)"; break;
//     case 2: tmpstr = "(max imb not weighted by size)"; break;
//     default: tmpstr = "(?unknown measure)"; break;
//     }
//     fprintf(fp, "ImbMeasure:\t%s\n Overall:\t %lf\n Max:\t\t%lf\n Min:\t\t%lf\n\n",
//             tmpstr, treeImb, minImb, maxImb);
//     showHist(fp);
//     fprintf(fp, "\n------------------------------------------------------------------------------------------------------\n\n\n");
//     fclose(fp);
//   }
// #endif
}

/*  Main() function for: Sequential, OpenMP, UPC, and Shmem
 *
 *  Notes on execution model:
 *     - under openMP, global vars are all shared
 *     - under UPC, global vars are private unless explicitly shared
 *     - UPC is SPMD starting with main, OpenMP goes SPMD after
 *       parsing parameters
 */
int main(int argc, char *argv[]) {
  Node root;

#ifdef THREAD_METADATA
  memset(t_metadata, 0x00, MAX_OMP_THREADS * sizeof(thread_metadata));
#endif
  memset(steal_buffer_locks, 0x00, MAX_SHMEM_THREADS * sizeof(long));

hclib_pragma_marker("omp_to_hclib", "", "pragma714_omp_to_hclib");
  {

  shmem_init();

  pe = shmem_my_pe();
  npes = shmem_n_pes();

  /* determine benchmark parameters (all PEs) */
  uts_parseParams(argc, argv);

#ifdef UTS_STAT
  if (stats) {
    initHist();
  }
#endif

  double t1, t2, et;

  /* show parameter settings */
  if (pe == 0) {
      uts_printParams();
  }

  initRootNode(&root, type);

  shmem_barrier_all();

  /* time parallel search */
  t1 = uts_wctime();

/********** SPMD Parallel Region **********/
hclib_pragma_marker("omp", "parallel", "pragma746_omp_parallel");
  {
hclib_pragma_marker("omp", "master", "pragma748_omp_master");
      {
          int first = 1;

          Node child;
retry:
          initNode(&child);

          if (first) {
              if (pe == 0) {
                  genChildren(&root, &child);
              }
          } else {
              genChildren(&root, &child);
          }
          first = 0;

hclib_pragma_marker("omp", "taskwait", "pragma765_omp_taskwait");

          if (n_buffered_steals > 0) {
              shmem_set_lock(&steal_buffer_locks[pe]);
              if (n_buffered_steals > 0) {
                  n_buffered_steals--;
                  memcpy(&root, &steal_buffer[n_buffered_steals], sizeof(root));
                  shmem_clear_lock(&steal_buffer_locks[pe]);
                  goto retry;
              } else {
                  shmem_clear_lock(&steal_buffer_locks[pe]);
              }
          }

          const int got_more_work = remote_steal(&root);
          if (got_more_work == 1) {
              goto retry;
          }
      }
  }

  if (pe != 0) {
      shmem_int_add(&n_nodes, n_nodes, 0);
      shmem_int_add(&n_leaves, n_leaves, 0);
  }

  shmem_barrier_all();

  t2 = uts_wctime();
  et = t2 - t1;
  if (pe == 0) {
      showStats(et);
  }
/********** End Parallel Region **********/
#ifdef THREAD_METADATA
  int p;
  for (p = 0; p < npes; p++) {
      if (p == pe) {
          printf("\n");
          int i;
          for (i = 0; i < n_omp_threads; i++) {
              printf("PE %d, thread %d: %lu tasks\n", p, i, t_metadata[i].ntasks);
          }
      }
      shmem_barrier_all();
  }
#endif
  }

  shmem_finalize();
  return 0;
}