code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
#!hyphen-venv/bin/python import imp from migrate.versioning import api from app import db from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO migration = SQLALCHEMY_MIGRATE_REPO + \ '/versions/%03d_migration.py' % \ (api.db_version( SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) + 1) tmp_module = imp.new_module('old_model') old_model = api.create_model(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) exec old_model in tmp_module.__dict__ script = api.make_update_script_for_model( SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, tmp_module.meta, db.metadata) open(migration, "wt").write(script) api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) print 'New migration saved as ' + migration print 'Current database version: ' + \ str(api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO))
bkfunk/HyphenCMS
db_migrate.py
Python
gpl-2.0
1,012
<?php /** * ChronoCMS version 1.0 * Copyright (c) 2012 ChronoCMS.com, All rights reserved. * Author: (ChronoCMS.com Team) * license: Please read LICENSE.txt * Visit http://www.ChronoCMS.com for regular updates and information. **/ namespace GCore\Admin\Extensions\Chronoforms\Actions\FileDownload; /*** FILE_DIRECT_ACCESS_HEADER ***/ defined("GCORE_SITE") or die; Class FileDownload extends \GCore\Admin\Extensions\Chronoforms\Action{ static $title = 'File Download'; static $group = array('utilities' => 'Utilities'); var $defaults = array( //'path' => '', ); function execute(&$form, $action_id){ $config = !empty($form->actions_config[$action_id]) ? $form->actions_config[$action_id] : array(); $config = new \GCore\Libs\Parameter($config); $file_path = $config->get('path'); if(file_exists($file_path)){ \GCore\Libs\Download::send($file_path); } } public static function config(){ echo \GCore\Helpers\Html::formStart('action_config file_download_action_config', 'file_download_action_config_{N}'); echo \GCore\Helpers\Html::formSecStart(); echo \GCore\Helpers\Html::formLine('Form[extras][actions_config][{N}][path]', array('type' => 'text', 'label' => l_('CF_FILE_DOWNLOAD_PATH'), 'value' => \GCore\C::ext_path('chronoforms', 'front'), 'class' => 'XXL', 'sublabel' => l_('CF_FILE_DOWNLOAD_PATH_DESC'))); echo \GCore\Helpers\Html::formSecEnd(); echo \GCore\Helpers\Html::formEnd(); } public static function config_check($data = array()){ $diags = array(); $diags[l_('CF_DIAG_FILE_EXISTS')] = is_file($data['path']); return $diags; } }
mowema/mmusica
wp-content/plugins/chronoforms/admin/chronoforms/actions/file_download/file_download.php
PHP
gpl-2.0
1,590
/* * Seven Kingdoms: Ancient Adversaries * * Copyright 1997,1998 Enlight Software Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ //Filename : OUNITAI.CPP //Description : Object Unit AI #include <OSYS.h> #include <OSPY.h> #include <OREBEL.h> #include <OUNIT.h> #include <OCONFIG.h> #include <OREGIONS.h> #include <OF_CAMP.h> #include <ONATION.h> #ifdef NO_DEBUG_UNIT #undef err_when #undef err_here #undef err_if #undef err_else #undef err_now #define err_when(cond) #define err_here() #define err_if(cond) #define err_else #define err_now(msg) #undef DEBUG #endif //--------- Begin of function Unit::process_ai --------// // // [int] forceExecute - whether force execute all AI functions // without checking day interavals. // (default: 0) // void Unit::process_ai() { err_when( !nation_recno ); //-*********** simulate aat ************-// #ifdef DEBUG if(debug_sim_game_type) return; #endif //-*********** simulate aat ************-// //------ the aggressive_mode of AI units is always 1 ------// aggressive_mode = 1; //------- handle Seek Path failures ------// if( ai_handle_seek_path_fail() ) return; //--- if it's a spy from other nation, don't control it ---// if( spy_recno && true_nation_recno() != nation_recno ) { //--- a random chance of the AI catching the spy and resign it ---// if( is_visible() && m.random(365 * FRAMES_PER_DAY)==0 ) // if the unit stay outside for one year, it will get caught { stop2(); resign(COMMAND_AI); return; } if( !spy_array[spy_recno]->notify_cloaked_nation_flag ) // if notify_cloaked_nation_flag is 1, the nation will take it as its own spies return; } //----- think about rewarding this unit -----// if( race_id && rank_id != RANK_KING && info.game_date%5 == sprite_recno%5 ) { think_reward(); } //-----------------------------------------// if( !is_visible() ) return; //--- if the unit has stopped, but ai_action_id hasn't been reset ---// if( cur_action==SPRITE_IDLE && action_mode==ACTION_STOP && action_mode2==ACTION_STOP && ai_action_id ) { nation_array[nation_recno]->action_failure(ai_action_id, sprite_recno); err_when( ai_action_id ); // it should have been reset } //---- King flees under attack or surrounded by enemy ---// if( race_id && rank_id==RANK_KING ) { if( think_king_flee() ) return; } //---- General flees under attack or surrounded by enemy ---// if( race_id && rank_id==RANK_GENERAL && info.game_date%7 == sprite_recno%7 ) { if( think_general_flee() ) return; } //-- let Unit::next_day() process it process original_action_mode --// if( original_action_mode ) return; //------ if the unit is not stop right now ------// if( !is_ai_all_stop() ) { think_stop_chase(); return; } //-----------------------------------------// if( mobile_type==UNIT_LAND ) { if( ai_escape_fire() ) return; } //---------- if this is your spy --------// if( spy_recno && true_nation_recno()==nation_recno ) think_spy_action(); //------ if this unit is from a camp --------// if( home_camp_firm_recno ) { Firm* firmCamp = firm_array[home_camp_firm_recno]; int rc; if( rank_id == RANK_SOLDIER ) rc = firmCamp->worker_count < MAX_WORKER; else rc = !firmCamp->overseer_recno; if( rc ) { if( return_camp() ) return; } home_camp_firm_recno = 0; // the camp is already occupied by somebody } //----------------------------------------// if( race_id && rank_id==RANK_KING ) { think_king_action(); } else if( race_id && rank_id==RANK_GENERAL ) { think_general_action(); } else { if( unit_res[unit_id]->unit_class == UNIT_CLASS_WEAPON ) { if( info.game_date%15 == sprite_recno%15 ) // don't call too often as the action may fail and it takes a while to call the function each time { think_weapon_action(); //-- ships AI are called in UnitMarine --// } } else if( race_id ) { //--- if previous attempts for new action failed, don't call think_normal_human_action() so frequently then ---// if( ai_no_suitable_action ) { if( info.game_date%15 != sprite_recno%15 ) // don't call too often as the action may fail and it takes a while to call the function each time return; } //---------------------------------// if( !think_normal_human_action() ) { ai_no_suitable_action = 1; // set this flag so think_normal_human_action() won't be called continously if( !leader_unit_recno ) // only when the unit is not led by a commander { resign(COMMAND_AI); } else { ai_move_to_nearby_town(); } } } } } //---------- End of function Unit::process_ai --------// //--------- Begin of function Unit::think_stop_chase --------// int Unit::think_stop_chase() { //-----------------------------------------------------// // // Stop the chase if the target is being far away from // its original attacking location. // //-----------------------------------------------------// if( !(action_mode==ACTION_ATTACK_UNIT && ai_original_target_x_loc>=0) ) return 0; if( unit_array.is_deleted(action_para) ) { stop2(); return 1; } Unit* targetUnit = unit_array[action_para]; if( !targetUnit->is_visible() ) { stop2(); return 1; } //----------------------------------------// int aiChaseDistance = 10 + nation_array[nation_recno]->pref_military_courage/20; // chase distance: 10 to 15 int curDistance = m.points_distance( targetUnit->next_x_loc(), targetUnit->next_y_loc(), ai_original_target_x_loc, ai_original_target_y_loc ); if( curDistance <= aiChaseDistance ) return 0; //--------- stop the unit ----------------// stop2(); //--- if this unit leads a troop, stop the action of all troop members as well ---// int leaderUnitRecno; if( leader_unit_recno ) leaderUnitRecno = leader_unit_recno; else leaderUnitRecno = sprite_recno; TeamInfo* teamInfo = unit_array[leaderUnitRecno]->team_info; if( teamInfo ) { for( int i=teamInfo->member_count-1 ; i>=0 ; i-- ) { int unitRecno = teamInfo->member_unit_array[i]; if( unit_array.is_deleted(unitRecno) ) continue; unit_array[unitRecno]->stop2(); } } return 1; } //---------- End of function Unit::think_stop_chase --------// //--------- Begin of function Unit::is_ai_all_stop --------// int Unit::is_ai_all_stop() { return cur_action==SPRITE_IDLE && action_mode==ACTION_STOP && action_mode2==ACTION_STOP && !ai_action_id; } //---------- End of function Unit::is_ai_all_stop --------// //--------- Begin of function Unit::ai_move_to_nearby_town --------// void Unit::ai_move_to_nearby_town() { //---- look for towns to assign to -----// Nation* ownNation = nation_array[nation_recno]; Town *townPtr, *bestTown=NULL; int regionId = world.get_region_id( next_x_loc(), next_y_loc() ); int curDistance, curRating, bestRating=0; int curXLoc = next_x_loc(), curYLoc = next_y_loc(); for( int i=town_array.size() ; i>0 ; i-- ) // can't use ai_town_array[] because this function will be called by Unit::betray() when a unit defected to the player's kingdom { if( town_array.is_deleted(i) ) continue; townPtr = town_array[i]; if( townPtr->nation_recno != nation_recno ) continue; if( townPtr->region_id != regionId ) continue; //-------------------------------------// curDistance = m.points_distance(curXLoc, curYLoc, townPtr->center_x, townPtr->center_y ); if( curDistance < 10 ) // no need to move if the unit is already close enough to the town. return; curRating = 100 - 100 * curDistance / MAX_WORLD_X_LOC; curRating += townPtr->population; //-------------------------------------// if( curRating > bestRating ) { bestRating = curRating; bestTown = townPtr; } } if( bestTown ) move_to_town_surround(bestTown->loc_x1, bestTown->loc_y1, sprite_info->loc_width, sprite_info->loc_height); } //---------- End of function Unit::ai_move_to_nearby_town --------// //--------- Begin of function Unit::ai_escape_fire --------// // // Move away if the unit currently stands on a burning ground. // int Unit::ai_escape_fire() { if(cur_action!=SPRITE_IDLE) return 0; if(mobile_type!=UNIT_LAND) return 0; Location *locPtr = world.get_loc(next_x_loc(), next_y_loc()); if( !locPtr->fire_str() ) return 0; //--------------------------------------------// int checkLimit = 400; // checking for 400 location int xShift, yShift, checkXLoc, checkYLoc; int curXLoc = next_x_loc(); int curYLoc = next_y_loc(); for(int i=2; i<checkLimit; i++) { m.cal_move_around_a_point(i, 20, 20, xShift, yShift); checkXLoc = curXLoc + xShift; checkYLoc = curYLoc + yShift; if(checkXLoc<0 || checkXLoc>=MAX_WORLD_X_LOC || checkYLoc<0 || checkYLoc>=MAX_WORLD_Y_LOC) continue; if(!locPtr->can_move(mobile_type)) continue; locPtr = world.get_loc(checkXLoc, checkYLoc); if( locPtr->fire_str()==0 ) // move to a safe place now { move_to(checkXLoc, checkYLoc); return 1; } } return 0; } //---------- End of function Unit::ai_escape_fire --------// //--------- Begin of function Unit::think_spy_action --------// void Unit::think_spy_action() { ai_move_to_nearby_town(); // just move it to one of our towns } //---------- End of function Unit::think_spy_action --------// //--------- Begin of function Unit::think_king_action --------// int Unit::think_king_action() { return think_leader_action(); } //---------- End of function Unit::think_king_action --------// //--------- Begin of function Unit::think_general_action --------// int Unit::think_general_action() { if( think_leader_action() ) return 1; //--- if the general is not assigned to a camp due to its low competency ----// Nation* ownNation = nation_array[nation_recno]; int rc = 0; if( team_info->member_count <= 1 ) { rc = 1; } //--- if the skill of the general and the number of soldiers he commands is not large enough to justify building a new camp ---// else if( skill.skill_level + team_info->member_count*4 < 40 + ownNation->pref_keep_general/5 ) // 40 to 60 { rc = 1; } //-- think about splitting the team and assign them into other forts --// else if( ownNation->ai_has_too_many_camp() ) { rc = 1; } //--------- demote the general to soldier and disband the troop -------// if( rc ) { set_rank(RANK_SOLDIER); return think_normal_human_action(); } return 0; } //---------- End of function Unit::think_general_action --------// //--------- Begin of function Unit::think_leader_action --------// // // Think about the action of a leader (either a general or a king). // int Unit::think_leader_action() { Nation* nationPtr = nation_array[nation_recno]; FirmCamp *firmCamp, *bestCamp=NULL; int curRating, bestRating=10, delActionRecno=0; int curXLoc = next_x_loc(), curYLoc = next_y_loc(); int curRegionId = world.get_region_id( curXLoc, curYLoc ); if( rank_id == RANK_KING ) // if this unit is the king, always assign it to a camp regardless of whether the king is a better commander than the existing one bestRating = -1000; err_when( skill.skill_id != SKILL_LEADING ); //----- think about which camp to move to -----// for( int i=nationPtr->ai_camp_count-1 ; i>=0 ; i-- ) { firmCamp = (FirmCamp*) firm_array[ nationPtr->ai_camp_array[i] ]; if( firmCamp->region_id != curRegionId ) continue; //--- if the commander of this camp is the king, never replace him ---// if( firmCamp->overseer_recno == nationPtr->king_unit_recno ) continue; //-------------------------------------// int curLeadership = firmCamp->cur_commander_leadership(); int newLeadership = firmCamp->new_commander_leadership(race_id, skill.skill_level); curRating = newLeadership - curLeadership; //-------------------------------------// if( curRating > bestRating ) { //--- if there is already somebody being assigned to it ---// int actionRecno=0; if( rank_id != RANK_KING ) // don't check this if the current unit is the king { actionRecno = nationPtr->is_action_exist(firmCamp->loc_x1, firmCamp->loc_y1, -1, -1, ACTION_AI_ASSIGN_OVERSEER, FIRM_CAMP); if( actionRecno && nationPtr->get_action(actionRecno)->processing_instance_count ) continue; } bestRating = curRating; bestCamp = firmCamp; delActionRecno = actionRecno; } } if( !bestCamp ) return 0; //----- delete an unprocessed queued action if there is any ----// if( delActionRecno ) nationPtr->del_action(delActionRecno); //--------- move to the camp now ---------// //-- if there is room in the camp to host all soldiers led by this general --// if( team_info->member_count-1 <= MAX_WORKER-bestCamp->worker_count ) { validate_team(); unit_array.assign( bestCamp->loc_x1, bestCamp->loc_y1, 0, COMMAND_AI, team_info->member_unit_array, team_info->member_count ); return 1; } else //--- otherwise assign the general only ---// { return nationPtr->add_action(bestCamp->loc_x1, bestCamp->loc_y1, -1, -1, ACTION_AI_ASSIGN_OVERSEER, FIRM_CAMP, 1, sprite_recno); } return 0; } //---------- End of function Unit::think_leader_action --------// //--------- Begin of function Unit::think_normal_human_action --------// int Unit::think_normal_human_action() { if( home_camp_firm_recno ) return 0; if( leader_unit_recno && unit_array[leader_unit_recno]->is_visible() ) // if the unit is led by a commander, let the commander makes the decision. If the leader has been assigned to a firm, don't consider it as a leader anymore { return 0; } err_when( !race_id ); err_when( !nation_recno ); //---- think about assign the unit to a firm that needs workers ----// Nation* ownNation = nation_array[nation_recno]; Firm *firmPtr, *bestFirm=NULL; int regionId = world.get_region_id( next_x_loc(), next_y_loc() ); int skillId = skill.skill_id; int skillLevel = skill.skill_level; int i, curRating, bestRating=0; int curXLoc = next_x_loc(), curYLoc = next_y_loc(); if( skill.skill_id ) { for( i=firm_array.size() ; i>0 ; i-- ) { if( firm_array.is_deleted(i) ) continue; firmPtr = firm_array[i]; if( firmPtr->nation_recno != nation_recno ) continue; if( firmPtr->region_id != regionId ) continue; curRating = 0; if( skill.skill_id == SKILL_CONSTRUCTION ) // if this is a construction worker { if( firmPtr->builder_recno ) // assign the construction worker to this firm as an residental builder continue; } else { if( !firmPtr->worker_array || firmPtr->firm_skill_id != skillId ) { continue; } //----- if the firm is full of worker ------// if( firmPtr->is_worker_full() ) { //---- get the lowest skill worker of the firm -----// Worker* workerPtr = firmPtr->worker_array; int minSkill=100; for( int j=0 ; j<firmPtr->worker_count ; j++, workerPtr++ ) { if( workerPtr->skill_level < minSkill ) minSkill = workerPtr->skill_level; } //------------------------------// if( firmPtr->majority_race() == race_id ) { if( skill.skill_level < minSkill+10 ) continue; } else //-- for different race, only assign if the skill is significantly higher than the existing ones --// { if( skill.skill_level < minSkill+30 ) continue; } } else { curRating += 300; // if the firm is not full, rating + 300 } } //-------- calculate the rating ---------// curRating += world.distance_rating( curXLoc, curYLoc, firmPtr->center_x, firmPtr->center_y ); if( firmPtr->majority_race() == race_id ) curRating += 70; curRating += (MAX_WORKER - firmPtr->worker_count) * 10; //-------------------------------------// if( curRating > bestRating ) { bestRating = curRating; bestFirm = firmPtr; } } if( bestFirm ) { assign(bestFirm->loc_x1, bestFirm->loc_y1); return 1; } } //---- look for towns to assign to -----// bestRating = 0; int hasTownInRegion=0; Town *townPtr, *bestTown=NULL; for( i=town_array.size() ; i>0 ; i-- ) // can't use ai_town_array[] because this function will be called by Unit::betray() when a unit defected to the player's kingdom { if( town_array.is_deleted(i) ) continue; townPtr = town_array[i]; if( townPtr->nation_recno != nation_recno ) continue; if( townPtr->region_id != regionId ) continue; hasTownInRegion = 1; if( townPtr->population >= MAX_TOWN_POPULATION || !townPtr->is_base_town ) continue; //--- only assign to towns of the same race ---// if( ownNation->pref_town_harmony > 50 ) { if( townPtr->majority_race() != race_id ) continue; } //-------- calculate the rating ---------// curRating = world.distance_rating(curXLoc, curYLoc, townPtr->center_x, townPtr->center_y ); curRating += 300 * townPtr->race_pop_array[race_id-1] / townPtr->population; // racial homogenous bonus curRating += MAX_TOWN_POPULATION - townPtr->population; //-------------------------------------// if( curRating > bestRating ) { bestRating = curRating; bestTown = townPtr; } } if( bestTown ) { assign(bestTown->loc_x1, bestTown->loc_y1); return 1; } //----- if we don't have any existing towns in this region ----// if( !hasTownInRegion ) { //#ifdef AMPLUS // --- if region is too small don't consider this area, stay in the island forever --// if( region_array[regionId]->region_stat_id == 0 ) return 0; //#endif //-- if we also don't have any existing camps in this region --// if( region_array.get_region_stat(regionId)->camp_nation_count_array[nation_recno-1]==0 ) { //---- try to build one if this unit can ----// if( ownNation->cash > firm_res[FIRM_CAMP]->setup_cost && firm_res[FIRM_CAMP]->can_build(sprite_recno) && !leader_unit_recno ) // if this unit is commanded by a leader, let the leader build the camp { ai_build_camp(); } } else // if there is already a camp in this region, try to settle a new town next to the camp { ai_settle_new_town(); } return 1; // if we don't have any town in this region, return 1, so this unit won't be resigned and so it can wait for other units to set up camps and villages later ---// } return 0; } //---------- End of function Unit::think_normal_human_action --------// //--------- Begin of function Unit::think_weapon_action --------// int Unit::think_weapon_action() { //---- first try to assign the weapon to an existing camp ----// if( think_assign_weapon_to_camp() ) return 1; //----- if no camp to assign, build a new one ------// if( think_build_camp() ) return 1; return 0; } //---------- End of function Unit::think_weapon_action --------// //--------- Begin of function Unit::think_assign_weapon_to_camp --------// int Unit::think_assign_weapon_to_camp() { Nation *nationPtr = nation_array[nation_recno]; FirmCamp *firmCamp, *bestCamp=NULL; int curRating=0, bestRating=0; int regionId = world.get_region_id( next_x_loc(), next_y_loc() ); int curXLoc = next_x_loc(), curYLoc = next_y_loc(); for( int i=0 ; i<nationPtr->ai_camp_count ; i++ ) { firmCamp = (FirmCamp*) firm_array[ nationPtr->ai_camp_array[i] ]; if( firmCamp->region_id != regionId || firmCamp->is_worker_full() ) continue; //-------- calculate the rating ---------// curRating = world.distance_rating(curXLoc, curYLoc, firmCamp->center_x, firmCamp->center_y ); curRating += (MAX_WORKER - firmCamp->worker_count) * 10; //-------------------------------------// if( curRating > bestRating ) { bestRating = curRating; bestCamp = firmCamp; } } //-----------------------------------// if( bestCamp ) { assign(bestCamp->loc_x1, bestCamp->loc_y1); return 1; } return 0; } //---------- End of function Unit::think_assign_weapon_to_camp --------// //--------- Begin of function Unit::think_build_camp --------// // // Think about building a camp next to the town which is // closest to the unit. // int Unit::think_build_camp() { //---- select a town to build the camp ---// Nation* ownNation = nation_array[nation_recno]; Town *townPtr, *bestTown=NULL; int curRating=0, bestRating=0; int regionId = world.get_region_id( next_x_loc(), next_y_loc() ); int curXLoc = next_x_loc(), curYLoc = next_y_loc(); for( int i=ownNation->ai_town_count-1 ; i>=0 ; i-- ) { townPtr = town_array[ ownNation->ai_town_array[i] ]; if( townPtr->region_id != regionId ) continue; if( !townPtr->is_base_town || townPtr->no_neighbor_space ) continue; curRating = world.distance_rating(curXLoc, curYLoc, townPtr->center_x, townPtr->center_y ); if( curRating > bestRating ) { bestRating = curRating; bestTown = townPtr; } } if( bestTown ) return bestTown->ai_build_neighbor_firm(FIRM_CAMP); return 0; } //---------- End of function Unit::think_build_camp --------// //--------- Begin of function Unit::think_reward --------// int Unit::think_reward() { Nation* ownNation = nation_array[nation_recno]; //----------------------------------------------------------// // The need to secure high loyalty on this unit is based on: // -its skill // -its combat level // -soldiers commanded by this unit //----------------------------------------------------------// if( spy_recno && true_nation_recno() == nation_recno ) // if this is a spy of ours { return 0; // Spy::think_reward() will handle this. } int curLoyalty = loyalty; int neededLoyalty; //----- if this unit is on a mission ------/ if( ai_action_id ) { neededLoyalty = UNIT_BETRAY_LOYALTY+10; } //----- otherwise only reward soldiers and generals ------// else if( skill.skill_id == SKILL_LEADING ) { //----- calculate the needed loyalty --------// neededLoyalty = commanded_soldier_count()*5 + skill.skill_level; if( unit_mode == UNIT_MODE_OVERSEE ) // if this unit is an overseer { if( loyalty < UNIT_BETRAY_LOYALTY ) // if this unit's loyalty is < betrayel level, reward immediately { reward(nation_recno); // reward it immediatley if it's an overseer, don't check ai_should_spend() return 1; } neededLoyalty += 30; } neededLoyalty = MAX( UNIT_BETRAY_LOYALTY+10, neededLoyalty ); // 10 points above the betray loyalty level to prevent betrayal neededLoyalty = MIN( 100, neededLoyalty ); } else { return 0; } //------- if the loyalty is already high enough ------// if( curLoyalty >= neededLoyalty ) return 0; //---------- see how many cash & profit we have now ---------// int rewardNeedRating = neededLoyalty - curLoyalty; if( curLoyalty < UNIT_BETRAY_LOYALTY+5 ) rewardNeedRating += 50; if( ownNation->ai_should_spend(rewardNeedRating) ) { reward(nation_recno); return 1; } return 0; } //---------- End of function Unit::think_reward --------// //--------- Begin of function Unit::ai_leader_being_attacked --------// // // This function is called when the king is under attack. // // <int> attackerUnitRecno - recno of the attacker unit. // void Unit::ai_leader_being_attacked(int attackerUnitRecno) { err_when( !team_info ); if( unit_array[attackerUnitRecno]->nation_recno == nation_recno ) // this can happen when the unit has just changed nation return; //------------------------------------// int rc=0, callIntervalDays; if( rank_id == RANK_KING ) { rc = 1; callIntervalDays = 7; } else if( rank_id == RANK_GENERAL ) { rc = skill.skill_level >= 30 + (100-nation_array[nation_recno]->pref_keep_general)/2; // 30 to 80 callIntervalDays = 15; // don't call too freqently } if( rc ) { if( info.game_date > team_info->ai_last_request_defense_date + callIntervalDays ) { team_info->ai_last_request_defense_date = info.game_date; nation_array[nation_recno]->ai_defend(attackerUnitRecno); } } } //---------- End of function Unit::ai_leader_being_attacked --------// //--------- Begin of function Unit::think_king_flee --------// // // Note: we still need to keep think_king_action() because // between these two functions, a number of things // may be done, like returning home camp. We only // carry out actions in this function if the king // is in danger and urgently need to flee. // int Unit::think_king_flee() { if( force_move_flag && cur_action != SPRITE_IDLE ) // the king is already fleeing now return 1; //------- if the king is alone --------// Nation* ownNation = nation_array[nation_recno]; //------------------------------------------------// // When the king is alone and there is no assigned action OR // when the king is injured, the king will flee // back to its camp. //------------------------------------------------// if( ( team_info->member_count==0 && !ai_action_id ) || hit_points < 125-ownNation->pref_military_courage/4 ) { //------------------------------------------// // // If the king is currently under attack, flee // to the nearest camp with the maximum protection. // //------------------------------------------// Firm *firmCamp, *bestCamp=NULL; int curRating, bestRating=0; int curXLoc = next_x_loc(), curYLoc = next_y_loc(); int curRegionId = world.get_region_id( curXLoc, curYLoc ); if( cur_action == SPRITE_ATTACK ) { for( int i=ownNation->ai_camp_count-1 ; i>=0 ; i-- ) { firmCamp = (FirmCamp*) firm_array[ ownNation->ai_camp_array[i] ]; if( firmCamp->region_id != curRegionId ) continue; if( firmCamp->overseer_recno && rank_id!=RANK_KING ) // if there is already a commander in this camp. However if this is the king, than ingore this continue; curRating = world.distance_rating( curXLoc, curYLoc, firmCamp->center_x, firmCamp->center_y ); if( curRating > bestRating ) { bestRating = curRating; bestCamp = firmCamp; } } } else if( home_camp_firm_recno ) // if there is a home for the king { bestCamp = firm_array[home_camp_firm_recno]; } //------------------------------------// if( bestCamp ) { if( config.ai_aggressiveness > OPTION_LOW ) force_move_flag = 1; assign( bestCamp->loc_x1, bestCamp->loc_y1 ); } else // if the king is neither under attack or has a home camp, then call the standard think_leader_action() { think_leader_action(); } return cur_action != SPRITE_IDLE; } return 0; } //---------- End of function Unit::think_king_flee --------// //--------- Begin of function Unit::think_general_flee --------// int Unit::think_general_flee() { if( force_move_flag && cur_action != SPRITE_IDLE ) // the general is already fleeing now return 1; //------- if the general is alone --------// Nation* ownNation = nation_array[nation_recno]; //------------------------------------------------// // When the general is alone and there is no assigned action OR // when the general is injured, the general will flee // back to its camp. //------------------------------------------------// if( ( team_info->member_count==0 && !ai_action_id ) || hit_points < max_hit_points * (75+ownNation->pref_military_courage/2) / 200 ) // 75 to 125 / 200 { //------------------------------------------// // // If the general is currently under attack, flee // to the nearest camp with the maximum protection. // //------------------------------------------// Firm *firmCamp, *bestCamp=NULL; int curRating, bestRating=0; int curXLoc = next_x_loc(), curYLoc = next_y_loc(); int curRegionId = world.get_region_id( curXLoc, curYLoc ); if( cur_action == SPRITE_ATTACK ) { for( int i=ownNation->ai_camp_count-1 ; i>=0 ; i-- ) { firmCamp = (FirmCamp*) firm_array[ ownNation->ai_camp_array[i] ]; if( firmCamp->region_id != curRegionId ) continue; curRating = world.distance_rating( curXLoc, curYLoc, firmCamp->center_x, firmCamp->center_y ); if( curRating > bestRating ) { bestRating = curRating; bestCamp = firmCamp; } } } else if( home_camp_firm_recno ) // if there is a home for the general { bestCamp = firm_array[home_camp_firm_recno]; } //------------------------------------// if( bestCamp ) { if( bestCamp->overseer_recno ) // if there is already an overseer there, just move close to the camp for protection { if( config.ai_aggressiveness > OPTION_LOW ) force_move_flag = 1; move_to( bestCamp->loc_x1, bestCamp->loc_y1 ); } else assign( bestCamp->loc_x1, bestCamp->loc_y1 ); } else // if the general is neither under attack or has a home camp, then call the standard think_leader_action() { think_leader_action(); } return cur_action != SPRITE_IDLE; } return 0; } //---------- End of function Unit::think_general_flee --------// //--------- Begin of function Unit::ai_build_camp --------// // // Order this unit to build a camp in its region. // int Unit::ai_build_camp() { //--- to prevent building more than one camp at the same time ---// int curRegionId = region_id(); Nation* ownNation = nation_array[nation_recno]; if( ownNation->is_action_exist( ACTION_AI_BUILD_FIRM, FIRM_CAMP, curRegionId ) ) return 0; //------- locate a place for the camp --------// FirmInfo* firmInfo = firm_res[FIRM_CAMP]; int xLoc=0, yLoc=0; char teraMask = UnitRes::mobile_type_to_mask(UNIT_LAND); if( world.locate_space_random(xLoc, yLoc, MAX_WORLD_X_LOC-1, MAX_WORLD_Y_LOC-1, firmInfo->loc_width+2, firmInfo->loc_height+2, // leave at least one location space around the building MAX_WORLD_X_LOC*MAX_WORLD_Y_LOC, curRegionId, 1, teraMask) ) { return ownNation->add_action( xLoc, yLoc, -1, -1, ACTION_AI_BUILD_FIRM, FIRM_CAMP, 1, sprite_recno ); } return 0; } //---------- End of function Unit::ai_build_camp --------// //--------- Begin of function Unit::ai_settle_new_town --------// // // Settle a new village next to one of the camps in this region. // int Unit::ai_settle_new_town() { //----- locate a suitable camp for the new town to settle next to ----// Nation* ownNation = nation_array[nation_recno]; FirmCamp* firmCamp, *bestCamp=NULL; int curRegionId = region_id(); int curRating, bestRating=0; for( int i=ownNation->ai_camp_count-1 ; i>=0 ; i-- ) { firmCamp = (FirmCamp*) firm_array[ ownNation->ai_camp_array[i] ]; if( firmCamp->region_id != curRegionId ) continue; curRating = firmCamp->total_combat_level(); if( curRating > bestRating ) { bestRating = curRating; bestCamp = firmCamp; } } if( !bestCamp ) return 0; //--------- settle a new town now ---------// int xLoc=bestCamp->loc_x1; int yLoc=bestCamp->loc_y1; if( world.locate_space(xLoc, yLoc, bestCamp->loc_x2, bestCamp->loc_y2, STD_TOWN_LOC_WIDTH, STD_TOWN_LOC_HEIGHT, UNIT_LAND, curRegionId, 1 ) ) // 1-build flag { settle( xLoc, yLoc ); return 1; } return 0; } //---------- End of function Unit::ai_settle_new_town --------// //--------- Begin of function Unit::ai_handle_seek_path_fail --------// // // This function is used for handling cases when AI units are not // able to seek a path successfully. // int Unit::ai_handle_seek_path_fail() { if( seek_path_fail_count < 5 ) // wait unit it has failed many times return 0; //----- try to move to a new location -----// if( seek_path_fail_count==5 ) { stop2(); // stop the unit and think for new action return 0; } //--- if the seek path has failed too many times, resign the unit ---// int resignFlag = 0; if( rank_id == RANK_SOLDIER && !leader_unit_recno ) { if( seek_path_fail_count>=7 ) resignFlag = 1; } else if( rank_id == RANK_GENERAL ) { if( seek_path_fail_count >= 7+skill.skill_level/10 ) resignFlag = 1; } if( resignFlag && is_visible() ) { resign(COMMAND_AI); return 1; } else return 0; } //---------- End of function Unit::ai_handle_seek_path_fail --------//
brianV/7kaa
src/client/OUNITAI.cpp
C++
gpl-2.0
32,657
/** Copyright (C) SYSTAP, LLC 2006-2015. All rights reserved. Contact: SYSTAP, LLC 2501 Calvert ST NW #106 Washington, DC 20008 licenses@systap.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Created on June 10, 2015 */ package com.bigdata.rdf.sparql.ast.optimizers; import java.util.ArrayList; import java.util.List; import org.openrdf.query.algebra.StatementPattern.Scope; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.bindingSet.ListBindingSet; import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.model.BigdataURI; import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueFactory; import com.bigdata.rdf.sparql.ast.ASTContainer; import com.bigdata.rdf.sparql.ast.AbstractASTEvaluationTestCase; import com.bigdata.rdf.sparql.ast.ConstantNode; import com.bigdata.rdf.sparql.ast.FilterNode; import com.bigdata.rdf.sparql.ast.FunctionNode; import com.bigdata.rdf.sparql.ast.FunctionRegistry; import com.bigdata.rdf.sparql.ast.IQueryNode; import com.bigdata.rdf.sparql.ast.IValueExpressionNode; import com.bigdata.rdf.sparql.ast.JoinGroupNode; import com.bigdata.rdf.sparql.ast.ProjectionNode; import com.bigdata.rdf.sparql.ast.QueryHints; import com.bigdata.rdf.sparql.ast.QueryNodeWithBindingSet; import com.bigdata.rdf.sparql.ast.QueryRoot; import com.bigdata.rdf.sparql.ast.QueryType; import com.bigdata.rdf.sparql.ast.StatementPatternNode; import com.bigdata.rdf.sparql.ast.StaticAnalysis; import com.bigdata.rdf.sparql.ast.ValueExpressionNode; import com.bigdata.rdf.sparql.ast.VarNode; import com.bigdata.rdf.sparql.ast.eval.AST2BOpContext; /** * Test suite for the {@link ASTFilterNormalizationOptimizer} class and associated * utility methods in {@link StaticAnalysis}. * * @author <a href="mailto:ms@metaphacts.com">Michael Schmidt</a> */ @SuppressWarnings({ "rawtypes" }) public class TestASTFilterNormalizationOptimizer extends AbstractASTEvaluationTestCase { public TestASTFilterNormalizationOptimizer() { } public TestASTFilterNormalizationOptimizer(String name) { super(name); } /** * Test the {@link ASTFilterNormalizationOptimizer#extractToplevelConjuncts( * com.bigdata.rdf.sparql.ast.IValueExpressionNode, List)} method. */ public void testExtractTopLevelConjunctsMethod() { // conjunct 1 final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); // conjunct 2 final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode not1 = FunctionNode.NOT(bound2); // conjunct 3 final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode or1 = FunctionNode.OR(FunctionNode.AND(bound3,bound4), bound5); // conjunct 4 final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final FunctionNode toCheck = FunctionNode.AND(bound1, FunctionNode.AND( not1, FunctionNode.AND(or1, bound6))); final List<IValueExpressionNode> actual = StaticAnalysis.extractToplevelConjuncts( toCheck, new ArrayList<IValueExpressionNode>()); assertFalse(StaticAnalysis.isCNF(toCheck)); assertEquals(actual.size(), 4); assertEquals(actual.get(0), bound1); assertEquals(actual.get(1), not1); assertEquals(actual.get(2), or1); assertEquals(actual.get(3), bound6); } /** * Test the {@link ASTFilterNormalizationOptimizer#constructFiltersForValueExpressionNode( * IValueExpressionNode, List)} method. */ public void testConstructFiltersForValueExpressionNodeMethod() { // conjunct 1 final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode or1 = FunctionNode.OR(FunctionNode.AND(bound3,bound4), bound5); // conjunct 2 final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode not1 = FunctionNode.NOT(bound2); // conjunct 3 final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); // conjunct 4 final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode base = FunctionNode.AND( FunctionNode.AND( or1, FunctionNode.AND(not1, bound6)),bound1); final ASTFilterNormalizationOptimizer filterOptimizer = new ASTFilterNormalizationOptimizer(); final List<FilterNode> filters = filterOptimizer.constructFiltersForValueExpressionNode( base, new ArrayList<FilterNode>()); assertFalse(StaticAnalysis.isCNF(base)); assertEquals(filters.size(), 4); assertEquals(filters.get(0), new FilterNode(or1)); assertEquals(filters.get(1), new FilterNode(not1)); assertEquals(filters.get(2), new FilterNode(bound6)); assertEquals(filters.get(3), new FilterNode(bound1)); } /** * Test the {@link ASTFilterNormalizationOptimizer#toConjunctiveValueExpression(List)} * method. */ public void testToConjunctiveValueExpressionMethod() { // conjunct 1 final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); // conjunct 2 final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode not1 = FunctionNode.NOT(bound2); // conjunct 3 final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode or1 = FunctionNode.OR(FunctionNode.AND(bound3,bound4), bound5); // conjunct 4 final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final List<IValueExpressionNode> baseConjuncts = new ArrayList<IValueExpressionNode>(); baseConjuncts.add(bound1); baseConjuncts.add(not1); baseConjuncts.add(or1); baseConjuncts.add(bound6); final IValueExpressionNode expected = FunctionNode.AND( FunctionNode.AND( FunctionNode.AND(bound1, not1), or1), bound6); final IValueExpressionNode actual = StaticAnalysis.toConjunctiveValueExpression(baseConjuncts); assertFalse(StaticAnalysis.isCNF(actual)); assertEquals(expected, actual); } /** * The FILTER * * <pre> * SELECT ?s where { ?s ?p ?o . FILTER(?s=?o) } * </pre> * * is not being modified. */ public void testFilterDecompositionNoOp() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); given.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); whereClause.addChild( new FilterNode( FunctionNode.EQ(new VarNode("s"), new VarNode("o")))); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); expected.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); final FilterNode filterNode = new FilterNode( FunctionNode.EQ(new VarNode("s"), new VarNode("o"))); assertTrue(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * The FILTER * * <pre> * SELECT ?s where { ?s ?p ?o . FILTER(?s=?o && ?s!=<http://www.test.com>) } * </pre> * * is rewritten as * * <pre> * SELECT ?s where { ?s ?p ?o . FILTER(?s=?o) . FILTER(?s!=<http://www.test.com>) } * </pre> * */ public void testSimpleConjunctiveFilter() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final BigdataValueFactory f = store.getValueFactory(); final BigdataURI testUri = f.createURI("http://www.test.com"); final IV test = makeIV(testUri); final BigdataValue[] values = new BigdataValue[] { testUri }; store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); final FilterNode filterNode = new FilterNode( FunctionNode.AND( FunctionNode.EQ(new VarNode("s"), new VarNode("o")), FunctionNode.NE(new VarNode("s"), new ConstantNode(test)))); assertTrue(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); whereClause.addChild( new FilterNode( FunctionNode.EQ(new VarNode("s"), new VarNode("o")))); whereClause.addChild( new FilterNode( FunctionNode.NE(new VarNode("s"), new ConstantNode(test)))); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * The FILTER * * <pre> * SELECT ?s where { FILTER(NOT(?s<?o || BOUND(?o))) . OPTIONAL { ?s ?p ?o } } * </pre> * * is rewritten as * * <pre> * SELECT ?s where { OPTIONAL { ?s ?p ?o } . FILTER(?s>=?o) . FILTER(!BOUND(?s) } * </pre> * */ public void testSimpleDisjunctiveFilter() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.OR( FunctionNode.LT(new VarNode("s"), new VarNode("o")), new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") })))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); spn.setOptional(true); whereClause.addChild(spn); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); spn.setOptional(true); whereClause.addChild(spn); whereClause.addChild( new FilterNode( FunctionNode.GE(new VarNode("s"), new VarNode("o")))); whereClause.addChild( new FilterNode( FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") })))); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test rewriting of negated leaves, such as !(?x=?y) -> ?x!=?y, * !(?a<?b) -> ?a>=?b, etc. in */ public void testNegationLeafRewriting01() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final FunctionNode filterEq = FunctionNode.EQ(new VarNode("s"), new VarNode("o")); final FunctionNode filterNeq = FunctionNode.NE(new VarNode("s"), new VarNode("o")); final FunctionNode filterLe = FunctionNode.LE(new VarNode("s"), new VarNode("o")); final FunctionNode filterLt = FunctionNode.LT(new VarNode("s"), new VarNode("o")); final FunctionNode filterGe = FunctionNode.GE(new VarNode("s"), new VarNode("o")); final FunctionNode filterGt = FunctionNode.GT(new VarNode("s"), new VarNode("o")); final FunctionNode comb1 = FunctionNode.AND(filterEq, filterNeq); final FunctionNode comb2 = FunctionNode.AND(filterLe, filterLt); final FunctionNode comb3 = FunctionNode.AND(filterGt, filterGe); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.AND(FunctionNode.AND(comb1, comb2),comb3))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final FunctionNode filterEqInv = FunctionNode.NE(new VarNode("s"), new VarNode("o")); final FunctionNode filterNeqInv = FunctionNode.EQ(new VarNode("s"), new VarNode("o")); final FunctionNode filterLeInv = FunctionNode.GT(new VarNode("s"), new VarNode("o")); final FunctionNode filterLtInv = FunctionNode.GE(new VarNode("s"), new VarNode("o")); final FunctionNode filterGeInv = FunctionNode.LT(new VarNode("s"), new VarNode("o")); final FunctionNode filterGtInv = FunctionNode.LE(new VarNode("s"), new VarNode("o")); final FunctionNode comb1 = FunctionNode.OR(filterEqInv, filterNeqInv); final FunctionNode comb2 = FunctionNode.OR(filterLeInv, filterLtInv); final FunctionNode comb3 = FunctionNode.OR(filterGtInv, filterGeInv); final FilterNode filterNode = new FilterNode( FunctionNode.OR(FunctionNode.OR(comb1, comb2),comb3)); assertTrue(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test rewriting of negated leaves, such as !(?x=?y) -> ?x!=?y, * !(?a<?b) -> ?a>=?b, etc. (differs from v01 in tree shape). */ public void testNegationLeafRewriting02() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final FunctionNode filterEq = FunctionNode.EQ(new VarNode("s"), new VarNode("o")); final FunctionNode filterNeq = FunctionNode.NE(new VarNode("s"), new VarNode("o")); final FunctionNode filterLe = FunctionNode.LE(new VarNode("s"), new VarNode("o")); final FunctionNode filterLt = FunctionNode.LT(new VarNode("s"), new VarNode("o")); final FunctionNode filterGe = FunctionNode.GE(new VarNode("s"), new VarNode("o")); final FunctionNode filterGt = FunctionNode.GT(new VarNode("s"), new VarNode("o")); final FunctionNode comb1 = FunctionNode.AND(filterEq, filterNeq); final FunctionNode comb2 = FunctionNode.AND(filterLe, filterLt); final FunctionNode comb3 = FunctionNode.AND(filterGt, filterGe); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.AND(comb1, FunctionNode.AND(comb2,comb3)))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final FunctionNode filterEqInv = FunctionNode.NE(new VarNode("s"), new VarNode("o")); final FunctionNode filterNeqInv = FunctionNode.EQ(new VarNode("s"), new VarNode("o")); final FunctionNode filterLeInv = FunctionNode.GT(new VarNode("s"), new VarNode("o")); final FunctionNode filterLtInv = FunctionNode.GE(new VarNode("s"), new VarNode("o")); final FunctionNode filterGeInv = FunctionNode.LT(new VarNode("s"), new VarNode("o")); final FunctionNode filterGtInv = FunctionNode.LE(new VarNode("s"), new VarNode("o")); final FunctionNode comb1 = FunctionNode.OR(filterEqInv, filterNeqInv); final FunctionNode comb2 = FunctionNode.OR(filterLeInv, filterLtInv); final FunctionNode comb3 = FunctionNode.OR(filterGtInv, filterGeInv); final FilterNode filterNode = new FilterNode( FunctionNode.OR(comb1, FunctionNode.OR(comb2,comb3))); assertTrue(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test level three pushing of negation. */ public void testNestedNegationRewriting() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final FunctionNode filterANot1 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") })); final FunctionNode filterANot2 = FunctionNode.NOT(filterANot1); final FunctionNode filterANot3 = FunctionNode.NOT(filterANot2); final FunctionNode filterBNot1 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.EQ, null, new ValueExpressionNode[] { new VarNode("s"), new VarNode("o") })); final FunctionNode filterBNot2 = FunctionNode.NOT(filterBNot1); final FunctionNode filterBNot3 = FunctionNode.NOT(filterBNot2); final FunctionNode filterBNot4 = FunctionNode.NOT(filterBNot3); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.AND(filterANot3, filterBNot4))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final FunctionNode bound = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") }); final FunctionNode neq = new FunctionNode(FunctionRegistry.NE, null, new ValueExpressionNode[] { new VarNode("s"), new VarNode("o") }); FilterNode filterNode = new FilterNode(FunctionNode.OR(bound, neq)); assertTrue(StaticAnalysis.isCNF(filterNode)); // all NOT nodes should be resolved whereClause.addChild(filterNode); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test level three pushing of negation. */ public void testNestedNegationRewritingAndSplit() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final FunctionNode filterANot1 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") })); final FunctionNode filterANot2 = FunctionNode.NOT(filterANot1); final FunctionNode filterANot3 = FunctionNode.NOT(filterANot2); final FunctionNode filterBNot1 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.EQ, null, new ValueExpressionNode[] { new VarNode("s"), new VarNode("o") })); final FunctionNode filterBNot2 = FunctionNode.NOT(filterBNot1); final FunctionNode filterBNot3 = FunctionNode.NOT(filterBNot2); final FunctionNode filterBNot4 = FunctionNode.NOT(filterBNot3); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.OR(filterANot3, filterBNot4))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final FunctionNode bound = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("o") }); final FunctionNode neq = new FunctionNode(FunctionRegistry.NE, null, new ValueExpressionNode[] { new VarNode("s"), new VarNode("o") }); whereClause.addChild(new FilterNode(bound)); whereClause.addChild(new FilterNode(neq)); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test switch of OR over AND expression expression. */ public void testSimpleOrAndSwitch() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FilterNode filterNode = new FilterNode( FunctionNode.OR( FunctionNode.AND(bound1, bound2), FunctionNode.AND(bound3, FunctionNode.AND(bound4, bound5)))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode and1 = FunctionNode.OR(bound1, bound3); final FunctionNode and2 = FunctionNode.OR(bound1, bound4); final FunctionNode and3 = FunctionNode.OR(bound1, bound5); final FunctionNode and4 = FunctionNode.OR(bound2, bound3); final FunctionNode and5 = FunctionNode.OR(bound2, bound4); final FunctionNode and6 = FunctionNode.OR(bound2, bound5); // after splitting, we should get the following conjuncts whereClause.addChild(new FilterNode(and1)); whereClause.addChild(new FilterNode(and2)); whereClause.addChild(new FilterNode(and3)); whereClause.addChild(new FilterNode(and4)); whereClause.addChild(new FilterNode(and5)); whereClause.addChild(new FilterNode(and6)); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test switch of OR over AND expression with top-level negation expression. */ public void testOrAndSwitchWithNegation() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setQueryHint(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode notBound1 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") })); final FunctionNode notBound2 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") })); final FunctionNode notBound3 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") })); final FunctionNode notBound4 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") })); final FunctionNode notBound5 = FunctionNode.NOT( new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") })); final FilterNode filterNode = new FilterNode( FunctionNode.NOT( FunctionNode.AND( FunctionNode.OR(notBound1, notBound2), FunctionNode.OR(notBound3, FunctionNode.OR(notBound4, notBound5))))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setQueryHint(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode or1 = FunctionNode.OR(bound1, bound3); final FunctionNode or2 = FunctionNode.OR(bound1, bound4); final FunctionNode or3 = FunctionNode.OR(bound1, bound5); final FunctionNode or4 = FunctionNode.OR(bound2, bound3); final FunctionNode or5 = FunctionNode.OR(bound2, bound4); final FunctionNode or6 = FunctionNode.OR(bound2, bound5); // after splitting, we should get the following conjuncts whereClause.addChild(new FilterNode(or1)); whereClause.addChild(new FilterNode(or2)); whereClause.addChild(new FilterNode(or3)); whereClause.addChild(new FilterNode(or4)); whereClause.addChild(new FilterNode(or5)); whereClause.addChild(new FilterNode(or6)); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test recursive optimization of OR - AND - OR - AND pattern. */ public void testOrAndSwitchRecursive() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final FunctionNode bound7 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s7") }); final FunctionNode bound8 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s8") }); final FunctionNode bound9 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s9") }); final FunctionNode bound10 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s10") }); final FunctionNode bound11 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s11") }); final FunctionNode bound12 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s12") }); final FunctionNode bound13 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s13") }); final FunctionNode bound14 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s14") }); final FunctionNode bound15 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s15") }); final FunctionNode bound16 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s16") }); final FilterNode filterNode = new FilterNode( FunctionNode.OR( FunctionNode.AND( FunctionNode.OR( FunctionNode.AND(bound1, bound2), FunctionNode.AND(bound3, bound4) ), FunctionNode.OR( FunctionNode.AND(bound5, bound6), FunctionNode.AND(bound7, bound8) ) ), FunctionNode.AND( FunctionNode.OR( FunctionNode.AND(bound9, bound10), FunctionNode.AND(bound11, bound12) ), FunctionNode.OR( FunctionNode.AND(bound13, bound14), FunctionNode.AND(bound15, bound16) )))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final FunctionNode bound7 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s7") }); final FunctionNode bound8 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s8") }); final FunctionNode bound9 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s9") }); final FunctionNode bound10 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s10") }); final FunctionNode bound11 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s11") }); final FunctionNode bound12 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s12") }); final FunctionNode bound13 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s13") }); final FunctionNode bound14 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s14") }); final FunctionNode bound15 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s15") }); final FunctionNode bound16 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s16") }); /** * Sketch of intended rewriting process (bottom-up) * * ### STEP 1: for the four leaf nodes we get the following. * * FunctionNode.OR( * FunctionNode.AND( * FunctionNode.AND( * FunctionNode.OR(bound1,bound3) * FunctionNode.OR(bound1,bound4) * FunctionNode.OR(bound2,bound3) * FunctionNode.OR(bound2,bound4) * ), * FunctionNode.AND( * FunctionNode.OR(bound5,bound7) * FunctionNode.OR(bound5,bound8) * FunctionNode.OR(bound6,bound7) * FunctionNode.OR(bound6,bound8) * ) * ), * FunctionNode.AND( * FunctionNode.AND( * FunctionNode.OR(bound9,bound11) * FunctionNode.OR(bound9,bound12) * FunctionNode.OR(bound10,bound11) * FunctionNode.OR(bound10,bound12) * ), * FunctionNode.AND( * FunctionNode.OR(bound13,bound15) * FunctionNode.OR(bound13,bound16) * FunctionNode.OR(bound14,bound15) * FunctionNode.OR(bound14,bound16) * ) * ) * ) * * ### STEP 2: pushing down the top-level OR, we compute the cross * product of the left and right disjuncts (we flatten * out the and in the representation below): * * FunctionNode.AND( * FunctionNode.AND( * FunctionNode.OR( * FunctionNode.OR(bound1,bound3), * FunctionNode.OR(bound9,bound11) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound3), * FunctionNode.OR(bound9,bound12) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound3), * FunctionNode.OR(bound10,bound11) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound3), * FunctionNode.OR(bound10,bound12) * ), * * FunctionNode.OR( * FunctionNode.OR(bound1,bound4), * FunctionNode.OR(bound9,bound11) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound4), * FunctionNode.OR(bound9,bound12) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound4), * FunctionNode.OR(bound10,bound11) * ), * FunctionNode.OR( * FunctionNode.OR(bound1,bound4), * FunctionNode.OR(bound10,bound12) * ), * * ... * * Each of those topmost OR expression gives us one FILTER expression * in the end, resulting in 8x8 = 64 FILTERs. We construct them * schematically below. */ final List<FunctionNode> lefts = new ArrayList<FunctionNode>(); lefts.add(FunctionNode.OR(bound1,bound3)); lefts.add(FunctionNode.OR(bound1,bound4)); lefts.add(FunctionNode.OR(bound2,bound3)); lefts.add(FunctionNode.OR(bound2,bound4)); lefts.add(FunctionNode.OR(bound5,bound7)); lefts.add(FunctionNode.OR(bound5,bound8)); lefts.add(FunctionNode.OR(bound6,bound7)); lefts.add(FunctionNode.OR(bound6,bound8)); final List<FunctionNode> rights = new ArrayList<FunctionNode>(); rights.add(FunctionNode.OR(bound9,bound11)); rights.add(FunctionNode.OR(bound9,bound12)); rights.add(FunctionNode.OR(bound10,bound11)); rights.add(FunctionNode.OR(bound10,bound12)); rights.add(FunctionNode.OR(bound13,bound15)); rights.add(FunctionNode.OR(bound13,bound16)); rights.add(FunctionNode.OR(bound14,bound15)); rights.add(FunctionNode.OR(bound14,bound16)); for (final FunctionNode left : lefts) { for (final FunctionNode right : rights) { whereClause.addChild( new FilterNode(FunctionNode.OR(left, right))); } } } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test recursive optimization of OR - OR - AND pattern. */ public void testOrOrAndSwitch() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final FunctionNode bound7 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s7") }); final FunctionNode bound8 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s8") }); final FilterNode filterNode = new FilterNode( FunctionNode.OR( FunctionNode.OR( FunctionNode.AND(bound1, bound2), FunctionNode.AND(bound3, bound4) ), FunctionNode.OR( FunctionNode.AND(bound5, bound6), FunctionNode.AND(bound7, bound8) ))); assertFalse(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spn = new StatementPatternNode( new VarNode("s"), new VarNode("p"), new VarNode("o"), null, Scope.DEFAULT_CONTEXTS); whereClause.addChild(spn); final FunctionNode bound1 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }); final FunctionNode bound2 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s2") }); final FunctionNode bound3 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s3") }); final FunctionNode bound4 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s4") }); final FunctionNode bound5 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s5") }); final FunctionNode bound6 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s6") }); final FunctionNode bound7 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s7") }); final FunctionNode bound8 = new FunctionNode(FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s8") }); /** * * ### STEP 1: generates to OR connected leafs in CNF * * FunctionNode.OR( * FunctionNode.AND( * FunctionNode.AND( * FunctionNode.OR(bound1, bound3), * FunctionNode.OR(bound1, bound4) * ), * FunctionNode.AND( * FunctionNode.OR(bound2, bound3), * FunctionNode.OR(bound2, bound4) * ) * ), * FunctionNode.AND( * FunctionNode.AND( * FunctionNode.OR(bound5, bound7), * FunctionNode.OR(bound5, bound8) * ), * FunctionNode.AND( * FunctionNode.OR(bound6, bound7), * FunctionNode.OR(bound6, bound8) * ) * ) * ) * * ### STEP 2: pushes down the uppermost OR expression * * Considers all OR-leafs in the left top-level AND expression * and joins them with OR-leafs in the right top-level AND expression. * After decomposing, this actually gives us 4x4 = 16 FILTERs. * */ final List<FunctionNode> lefts = new ArrayList<FunctionNode>(); lefts.add(FunctionNode.OR(bound1,bound3)); lefts.add(FunctionNode.OR(bound1,bound4)); lefts.add(FunctionNode.OR(bound2,bound3)); lefts.add(FunctionNode.OR(bound2,bound4)); final List<FunctionNode> rights = new ArrayList<FunctionNode>(); rights.add(FunctionNode.OR(bound5,bound7)); rights.add(FunctionNode.OR(bound5,bound8)); rights.add(FunctionNode.OR(bound6,bound7)); rights.add(FunctionNode.OR(bound6,bound8)); for (final FunctionNode left : lefts) { for (final FunctionNode right : rights) { whereClause.addChild( new FilterNode(FunctionNode.OR(left, right))); } } } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test removal of duplicate filter. */ public void testRemoveDuplicateFilter() { final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s1"), new VarNode("p1"), new VarNode("o1"), null/* c */, Scope.DEFAULT_CONTEXTS)); // just noise // two times exactly the same pattern final FunctionNode simpleFunctionNode1 = FunctionNode.NE(new VarNode("s1"), new VarNode("s2")); final FunctionNode simpleFunctionNode2 = FunctionNode.NE(new VarNode("s1"), new VarNode("s2")); // three times the same pattern final FunctionNode complexFunctionNode1 = FunctionNode.OR( FunctionNode.NE(new VarNode("s1"), new VarNode("s2")), FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }))); final FunctionNode complexFunctionNode2 = FunctionNode.OR( FunctionNode.NE(new VarNode("s1"), new VarNode("s2")), FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }))); final FunctionNode complexFunctionNode3 = FunctionNode.OR( FunctionNode.NE(new VarNode("s1"), new VarNode("s2")), FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }))); whereClause.addChild(new FilterNode(simpleFunctionNode1)); whereClause.addChild(new FilterNode(simpleFunctionNode2)); whereClause.addChild(new FilterNode(complexFunctionNode1)); whereClause.addChild(new FilterNode(complexFunctionNode2)); whereClause.addChild(new StatementPatternNode(new VarNode("s2"), new VarNode("p2"), new VarNode("o2"), null/* c */, Scope.DEFAULT_CONTEXTS)); // just noise whereClause.addChild(new FilterNode(complexFunctionNode3)); assertTrue(StaticAnalysis.isCNF(simpleFunctionNode1)); assertTrue(StaticAnalysis.isCNF(simpleFunctionNode2)); assertTrue(StaticAnalysis.isCNF(complexFunctionNode1)); assertTrue(StaticAnalysis.isCNF(complexFunctionNode2)); assertTrue(StaticAnalysis.isCNF(complexFunctionNode3)); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s1"), new VarNode("p1"), new VarNode("o1"), null/* c */, Scope.DEFAULT_CONTEXTS)); // just noise // the simple function node final FunctionNode simpleFunctionNode = FunctionNode.NE(new VarNode("s1"), new VarNode("s2")); // the complex function node final FunctionNode complexFunctionNode = FunctionNode.OR( FunctionNode.NE(new VarNode("s1"), new VarNode("s2")), FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null, new ValueExpressionNode[] { new VarNode("s1") }))); whereClause.addChild(new FilterNode(simpleFunctionNode)); whereClause.addChild(new StatementPatternNode(new VarNode("s2"), new VarNode("p2"), new VarNode("o2"), null/* c */, Scope.DEFAULT_CONTEXTS)); // just noise whereClause.addChild(new FilterNode(complexFunctionNode)); assertTrue(StaticAnalysis.isCNF(simpleFunctionNode)); assertTrue(StaticAnalysis.isCNF(complexFunctionNode)); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test removal of duplicate filter, where the duplicate is introduced * through the CNF based decomposition process. This is a variant of test * {@link TestASTFilterNormalizationOptimizer#testSimpleConjunctiveFilter()}, * where we just add a duplicate. */ public void testRemoveDuplicateGeneratedFilter() { /* * Note: DO NOT share structures in this test!!!! */ final BigdataValueFactory f = store.getValueFactory(); final BigdataURI testUri = f.createURI("http://www.test.com"); final IV test = makeIV(testUri); final BigdataValue[] values = new BigdataValue[] { testUri }; store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); final FilterNode filterNode = new FilterNode( FunctionNode.AND( FunctionNode.EQ(new VarNode("s"), new VarNode("o")), FunctionNode.NE(new VarNode("s"), new ConstantNode(test)))); // difference towards base test: this is the duplicate to be dropped whereClause.addChild( new FilterNode( FunctionNode.EQ(new VarNode("s"), new VarNode("o")))); assertTrue(StaticAnalysis.isCNF(filterNode)); whereClause.addChild(filterNode); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); whereClause.addChild( new FilterNode( FunctionNode.EQ(new VarNode("s"), new VarNode("o")))); whereClause.addChild( new FilterNode( FunctionNode.NE(new VarNode("s"), new ConstantNode(test)))); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } /** * Test removal of unsatisfiable filters. More precisely, the query * * SELECT ?s WHERE { * ?s ?p ?o1 . * { ?s ?p ?o2 } * OPTIONAL { ?s ?p ?o3 } * * FILTER(bound(?o1)) * FILTER(bound(?o2)) * FILTER(bound(?o3)) * * FILTER(!bound(?o1)) * FILTER(!bound(?o2)) * FILTER(!bound(?o3)) * FILTER(!bound(?o4)) * * // some duplicates (which should be dropped) * FILTER(!bound(?o2)) * FILTER(!bound(?o3)) * } * * will be rewritten to * * SELECT ?s WHERE { * ?s ?p ?o1 . * { ?s ?p ?o2 } * OPTIONAL { ?s ?p ?o3 } * * // ?o1 and ?o2 are definitely bound, so we can't optimize away * FILTER(bound(?o3)) * * // ?o4 is the only variable that is definitely not bound * FILTER(!bound(?o1)) * FILTER(!bound(?o2)) * FILTER(!bound(?o3)) * } * */ public void testRemoveUnsatisfiableFilters() { /* * Note: DO NOT share structures in this test!!!! */ final IBindingSet[] bsets = new IBindingSet[] { new ListBindingSet() }; // The source AST. final QueryRoot given = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); given.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); given.setWhereClause(whereClause); final StatementPatternNode spo1 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o1"), null/* c */, Scope.DEFAULT_CONTEXTS); final StatementPatternNode spo2 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o2"), null/* c */, Scope.DEFAULT_CONTEXTS); final JoinGroupNode jgn = new JoinGroupNode(spo2); final StatementPatternNode spo3 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o3"), null/* c */, Scope.DEFAULT_CONTEXTS); spo3.setOptional(true); whereClause.addChild(spo1); whereClause.addChild(jgn); whereClause.addChild(spo3); final FunctionNode filterBound1 = new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o1")}); final FunctionNode filterBound2 = new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o2")}); final FunctionNode filterBound3 = new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o3")}); final FunctionNode filterNotBound1 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o1")})); final FunctionNode filterNotBound2 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o2")})); final FunctionNode filterNotBound3 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o3")})); final FunctionNode filterNotBound4 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o4")})); whereClause.addChild(new FilterNode(filterBound1)); whereClause.addChild(new FilterNode(filterBound2)); whereClause.addChild(new FilterNode(filterBound3)); whereClause.addChild(new FilterNode(filterNotBound1)); whereClause.addChild(new FilterNode(filterNotBound2)); whereClause.addChild(new FilterNode(filterNotBound3)); whereClause.addChild(new FilterNode(filterNotBound4)); // add some duplicates (they should be removed) whereClause.addChild(new FilterNode(filterNotBound2)); whereClause.addChild(new FilterNode(filterNotBound3)); } // The expected AST after the rewrite. final QueryRoot expected = new QueryRoot(QueryType.SELECT); { final ProjectionNode projection = new ProjectionNode(); expected.setProjection(projection); projection.addProjectionVar(new VarNode("s")); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.setProperty(QueryHints.NORMALIZE_FILTER_EXPRESSIONS, "true"); expected.setWhereClause(whereClause); final StatementPatternNode spo1 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o1"), null/* c */, Scope.DEFAULT_CONTEXTS); final StatementPatternNode spo2 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o2"), null/* c */, Scope.DEFAULT_CONTEXTS); final JoinGroupNode jgn = new JoinGroupNode(spo2); final StatementPatternNode spo3 = new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o3"), null/* c */, Scope.DEFAULT_CONTEXTS); spo3.setOptional(true); whereClause.addChild(spo1); whereClause.addChild(jgn); whereClause.addChild(spo3); final FunctionNode filterBound3 = new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o3")}); final FunctionNode filterNotBound1 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o1")})); final FunctionNode filterNotBound2 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o2")})); final FunctionNode filterNotBound3 = FunctionNode.NOT( new FunctionNode( FunctionRegistry.BOUND, null/* scalarValues */, new ValueExpressionNode[] { new VarNode("o3")})); whereClause.addChild(new FilterNode(filterBound3)); whereClause.addChild(new FilterNode(filterNotBound1)); whereClause.addChild(new FilterNode(filterNotBound2)); whereClause.addChild(new FilterNode(filterNotBound3)); } final AST2BOpContext context = new AST2BOpContext(new ASTContainer(given), store); final ASTFilterNormalizationOptimizer rewriter = new ASTFilterNormalizationOptimizer(); final IQueryNode actual = rewriter.optimize(context, new QueryNodeWithBindingSet(given, bsets)). getQueryNode(); assertSameAST(expected, actual); } }
rac021/blazegraph_1_5_3_cluster_2_nodes
bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/optimizers/TestASTFilterNormalizationOptimizer.java
Java
gpl-2.0
79,136
# pylint:disable=R0201 from OpenOrange import * from User import User from RetroactiveAccounts import RetroactiveAccounts class HeirFinder(RetroactiveAccounts): def doReplacements(self, txt): d = {1:"ONE", 2:"TWO"} us = User.bring("USER") txt = txt.replace(":1", us.Name + d[1]) return txt def run(self): query8 = self.getQuery() query8.sql = self.doReplacements(query8.sql) #pylint:disable=E6601 query8.open() #there will be missing tables here
ancho85/pylint-playero-plugin
tests/input/func_noerror_query_heir.py
Python
gpl-2.0
522
/*************************************************************************** SignalVisitor.cpp - description ------------------- begin : Wed Jan 26 2000 copyright : (C) 2000 by Henrik Enqvist email : henqvist@excite.com ***************************************************************************/ #include "Private.h" #include "SignalSender.h" #include "Group.h" #include "Behavior.h" #include <cstddef> SignalSender * SignalSender::p_SignalSender = NULL; SignalSender::SignalSender() { } SignalSender::~SignalSender() { p_SignalSender = NULL; } SignalSender * SignalSender::getInstance() { if (p_SignalSender == NULL) { p_SignalSender = new SignalSender(); } return p_SignalSender; } void SignalSender::addSignal(int signal, int delay, Group * sender, Group * reciever) { SignalStruct sig; sig.signal = signal; sig.delay = delay; sig.sender = sender; sig.reciever = reciever; // add the signal to the buffer m_vSignalBuffer.push_back(sig); } void SignalSender::addGroup(Group * g) { EmAssert(g != NULL, "Added NULL as a group to SignalSender"); // TODO: check that the group is not added already m_vGroup.push_back(g); } void SignalSender::clear() { EM_COUT("SignalSender::clear()", 1); m_vSignal.clear(); m_vSignalBuffer.clear(); m_vGroup.clear(); } /* Called each engine tick. */ void SignalSender::tick() { EM_COUT("SignalSender::tick() " << m_vGroup.size() << " groups", 0); // use a buffer to avoid changes in m_vSignal during loop vector<SignalStruct>::iterator sigIter = m_vSignalBuffer.begin(); vector<SignalStruct>::iterator sigEnd = m_vSignalBuffer.end(); for (; sigIter != sigEnd; sigIter++) { m_vSignal.push_back((*sigIter)); } m_vSignalBuffer.clear(); // send signals sigIter = m_vSignal.begin(); sigEnd = m_vSignal.end(); for (; sigIter != sigEnd; ++sigIter) { // check the delay and re-add it to the buffer if ((*sigIter).delay > 0) { (*sigIter).delay--; m_vSignalBuffer.push_back((*sigIter)); continue; } // send to groups vector<Group*>::iterator groupIter = m_vGroup.begin(); vector<Group*>::iterator groupEnd = m_vGroup.end(); for(; groupIter != groupEnd; ++groupIter) { if ((*groupIter)->m_iProperties & EM_GROUP_NO_SIGNAL) continue; // check the address, NULL is multicast if ((*sigIter).reciever != NULL && (*sigIter).reciever != (*groupIter)) continue; // call onSignal function i behaviors // TODO: should use a hashtable for groups //cerr << "size " << (*groupIter)->m_vBehavior.size() << endl; // vector<Behavior*>::iterator behIter = (*groupIter)->m_vBehavior.begin(); // vector<Behavior*>::iterator behEnd = (*groupIter)->m_vBehavior.end(); // for (; behIter != behEnd; ++behIter) { // (*behIter)->onSignal((*sigIter).signal, (*sigIter).sender); // } if ((*groupIter)->getBehavior() != NULL) { (*groupIter)->getBehavior()->onSignal((*sigIter).signal, (*sigIter).sender); } } } m_vSignal.clear(); }
rzr/pinball
base/SignalSender.cpp
C++
gpl-2.0
3,167
<!-- Post sidebar --> <aside class="add-side"> <!-- Social news --> <div class="aside-block"> <h3 class="main-title">Популярне за тиждень</h3> <ul class="aside-social-news"> <?php //TODO: get just last weeks posts $topPosts = array(); $data = toolsApiRequest("news.posts.topviewed", array("count" => 5)); if(isset($data -> posts)){ $topPosts = $data -> posts; } ?> <?php if (count($topPosts) > 0) : ?> <?php for ($i = 0; $i < count($topPosts); $i++):?> <?php $sidebarPost = getSidebarPostData(get_post($topPosts[$i])); ?> <li> <a href="<?php echo $sidebarPost["url"]; ?>" class="social-news-item"> <span class="visual"> <img src="<?php echo modImgURL($sidebarPost["img_url"], 45, 45); ?>" alt=""> </span> <span class="content"> <span class="description"><?php echo $sidebarPost["title"]; ?></span> <span class="features-list"> <span class="date"> <?php echo $sidebarPost["date"]; ?> <span class="mark">, <?php echo $sidebarPost["category"]; ?></span> </span> <span class="views features"><?php echo $sidebarPost["views_count"]; ?></span> <span class="comments features"><?php echo $sidebarPost["comments_count"]; ?></span> </span> </span> </a> </li> <?php endfor; ?> <?php wp_reset_postdata();?> <?php endif; ?> </ul> </div> <!-- Social news --> <!-- Editor's news --> <div class="aside-block"> <h3 class="main-title">Вибір редактора</h3> <ul class="aside-social-news"> <?php $args = array('category_name' => 'main', 'posts_per_page' => 5); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) : ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php $sidebarPost = getSidebarPostData($post); ?> <li> <a href="<?php echo $sidebarPost["url"]; ?>" class="social-news-item"> <span class="visual"> <img src="<?php echo modImgURL($sidebarPost["img_url"], 45, 45); ?>" alt=""> </span> <span class="content"> <span class="description"><?php echo $sidebarPost["title"]; ?></span> <span class="features-list"> <span class="date"> <?php echo $sidebarPost["date"]; ?> <span class="mark">, <?php echo $sidebarPost["category"]; ?></span> </span> <span class="views features"><?php echo $sidebarPost["views_count"]; ?></span> <span class="comments features"><?php echo $sidebarPost["comments_count"]; ?></span> </span> </span> </a> </li> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php endif; ?> </ul> </div> <!-- /Editor's news --> <!-- Facebook page --> <div class="aside-block facebook-page"> <h3 class="main-title">Facebook</h3> <div class="facebook-page-holder"> <div class="fb-like-box" data-href="https://www.facebook.com/kgtv.kremenchug" data-width="299" data-height="299" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="false"></div> </div> </div> <!-- /Facebook page --> <!-- VK page --> <div class="aside-block vk-page"> <h3 class="main-title">VK</h3> <div class="vk-page-holder"> <script type="text/javascript" src="//vk.com/js/api/openapi.js?115"></script> <div id="vk_groups"></div> <script type="text/javascript"> VK.Widgets.Group("vk_groups", {mode: 0, width: "299", height: "299", color1: 'FFFFFF', color2: '666', color3: 'ee7829'}, 69310253); </script> </div> </div> <!-- /Facebook page --> </aside> <!-- /Post sidebar
okononenko/hromadske
wp-content/themes/CHTV/sidebar.php
PHP
gpl-2.0
3,624
<?php /** * Custom functions that act independently of the theme templates * * Eventually, some of the functionality here could be replaced by core features. * * @package evolt */ /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function evolt_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'group-blog'; } // Adds a class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; } return $classes; } add_filter( 'body_class', 'evolt_body_classes' ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function evolt_pingback_header() { if ( is_singular() && pings_open() ) { echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">'; } } add_action( 'wp_head', 'evolt_pingback_header' ); //Ajout des options du thème [ACF] if( function_exists('acf_add_options_page') ) { // Main Theme Settings Page $parent = acf_add_options_page( array( 'page_title' => 'Theme General Settings', 'menu_title' => 'Theme Settings', 'redirect' => 'Theme Settings', ) ); $languages = array( 'fr', 'en' ); foreach ( $languages as $lang ) { acf_add_options_sub_page( array( 'page_title' => 'Options (' . strtoupper( $lang ) . ')', 'menu_title' => __('Options (' . strtoupper( $lang ) . ')', 'text-domain'), 'menu_slug' => "options-${lang}", 'post_id' => $lang, 'parent' => $parent['menu_slug'] ) ); } } // REMOVE WP EMOJI remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles'); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'admin_print_styles', 'print_emoji_styles' );
alineEvolt/evolt
inc/extras.php
PHP
gpl-2.0
1,921
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest18518") public class BenchmarkTest18518 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { org.owasp.benchmark.helpers.SeparateClassRequest scr = new org.owasp.benchmark.helpers.SeparateClassRequest( request ); String param = scr.getTheParameter("foo"); String bar = doSomething(param); java.security.Provider[] provider = java.security.Security.getProviders(); javax.crypto.Cipher c; try { if (provider.length > 1) { c = javax.crypto.Cipher.getInstance("DES/CBC/PKCS5PADDING", java.security.Security.getProvider("SunJCE")); } else { c = javax.crypto.Cipher.getInstance("DES/CBC/PKCS5PADDING", java.security.Security.getProvider("SunJCE")); } } catch (java.security.NoSuchAlgorithmException e) { System.out.println("Problem executing crypto - javax.crypto.Cipher.getInstance(java.lang.String,java.security.Provider) Test Case"); throw new ServletException(e); } catch (javax.crypto.NoSuchPaddingException e) { System.out.println("Problem executing crypto - javax.crypto.Cipher.getInstance(java.lang.String,java.security.Provider) Test Case"); throw new ServletException(e); } response.getWriter().println("Crypto Test javax.crypto.Cipher.getInstance(java.lang.String,java.security.Provider) executed"); } // end doPost private static String doSomething(String param) throws ServletException, IOException { String bar = org.owasp.esapi.ESAPI.encoder().encodeForHTML(param); return bar; } }
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest18518.java
Java
gpl-2.0
2,872
<?php namespace GL\Core\Exception; /* * Based on HttpKernel Symfony module */ class HttpException extends \RuntimeException { private $statusCode; private $headers; public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0) { $this->statusCode = $statusCode; $this->headers = $headers; parent::__construct($message, $code, $previous); } public function getStatusCode() { return $this->statusCode; } public function getHeaders() { return $this->headers; } }
kletellier/MVC
vendor/GL/Core/Exception/HttpException.php
PHP
gpl-2.0
616
#include "src/gcreatedialog.h" #include "ui_gcreatedialog.h" GCreateDialog::GCreateDialog(QWidget *parent) : QDialog(parent), ui(new Ui::GCreateDialog) { ui->setupUi(this); ui->lineEdit_GName->setStyleSheet("QLineEdit#lineEdit_GName { border-radius: 2px; }"); } GCreateDialog::~GCreateDialog() { delete ui; }
mkocs/BusinessCount
src/gcreatedialog.cpp
C++
gpl-2.0
332
package net.iharding.core.timer; import java.text.ParseException; import net.iharding.modules.task.model.TimeTask; import net.iharding.modules.task.service.TimeTaskService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.quartz.CronTriggerFactoryBean; /** * spring4.1 数据库的读取配置任务触发器 * @author zhangxuhui * @date 2013-9-22 * @version 1.0 */ public class DataBaseCronTriggerBean extends CronTriggerFactoryBean{ @Autowired private TimeTaskService timeTaskService; /** * 读取数据库更新文件 */ public void afterPropertiesSet() throws ParseException { super.afterPropertiesSet(); TimeTask task = timeTaskService.findUniqueBy("taskId",this.getObject().getKey().getName()); if(task!=null && task.getIsEffect().equals("1") &&!task.getCronExpression().equals(this.getObject().getCronExpression())){ this.setCronExpression(task.getCronExpression()); DynamicTask.updateSpringMvcTaskXML(getObject(),task.getCronExpression()); } } }
joezxh/DATAX-UI
eshbase-console/src/main/java/net/iharding/core/timer/DataBaseCronTriggerBean.java
Java
gpl-2.0
1,042
// bsp.cpp -- by Thatcher Ulrich <tu@tulrich.com> 2001 // This code is in the public domain. // Code to make a collision-bsp tree out of triangle soup. #include <math.h> #include <stdio.h> #include <stdlib.h> #include <engine/utility.h> #include <engine/bsp.h> const bool print_debug = 0; /* sort faces by size? Or order them randomly?; make root bsp node w/ the first face; for rest of faces { root->add_face( a, b, c, plane( normal, d ) ); } */ enum plane_class { INSIDE = -1, ON = 0, OUTSIDE = 1 }; ////const float BSP_SLOP = 1.1923435f; //const float BSP_SLOP = 0.1f; plane_class classify_point( const plane_info& p, vec3 a, float slop ) // Classify the given point with respect to the given plane; use a tolerance // of +/- slop to determine when a point is ON the plane. { float distance = p.normal * a - p.d; if ( distance < -slop ) { return INSIDE; } else if ( distance > slop ) { if ( print_debug ) { printf( "d = %f, pn = %f %f %f, pd = %f, a = %f %f %f, p*a = %f\n", distance, p.normal.get_x(), p.normal.get_y(), p.normal.get_z(), p.d, a.get_x(), a.get_y(), a.get_z(), p.normal * a ); //xxxx } return OUTSIDE; } else { return ON; } } vec3 intersect( const plane_info& p, const vec3& a, const vec3& b ) // Returns the point of intersection between the plane p and the // line segment defined by a and b. // // NB: does not check to ensure that a & b intersects p! { float da = p.normal * a - p.d; float db = p.normal * b - p.d; float diff = db - da; if ( fabs( diff ) < 0.000001f ) { // Segment is parallel to plane. Just pick the midpoint of // the segment as the intersection point. return ( a + b ) * 0.5f; } else { // Compute how far along the segment the intersection is. float f = ( 0 - da ) / diff; // printf( "f = %f\n", f );//xxxxx return a + ( b - a ) * f; } } bsp_node::bsp_node( const plane_info& p ) // Constructor. Make a root node using the given plane info. { m_plane = p; m_inside = m_outside = 0; m_partitioning_plane = true; m_face_list = 0; m_face_count = 0; } bsp_node::~bsp_node() // Destructor. Delete our child trees recursively. { if ( m_inside ) { delete m_inside; } if ( m_outside ) { delete m_outside; } if ( m_face_list ) { free( m_face_list ); // using malloc/free because of realloc... } } void bsp_node::add_partition( const plane_info& p ) // Add a partitioning plane to this bsp tree. Basically propagates // the plane and adds it to all leaf nodes. // // NB: VERY IMPORTANT: You must add partitioning planes before adding // faces. Otherwise volume queries will be wrong. { if ( m_partitioning_plane != true ) { assert(0); // Trying to add a partitioning plane to a tree that already // contains faces. Refuse to add the plane. return; } if ( m_inside ) { m_inside->add_partition( p ); } else { m_inside = new bsp_node( p ); } if ( m_outside ) { m_outside->add_partition( p ); } else { m_outside = new bsp_node( p ); } } void bsp_node::add_face( const vec3& a, const vec3& b, const vec3& c, const plane_info& p, int face_index, float slop ) // Inserts the given triangle into this node's bsp tree. face_index // is a reference to the original face, which is passed back during // ray_cast() if the caller gives a pointer to a face_test_callback // function. // // The slop parameter determines how far a vertex may be from a // splitting plane and still be considered "on" the plane. // // @@ slop could possibly be replaced by using a fraction of the // longest face edge length. { // Classify the three verts of the triangle w/r/t this node's plane. plane_class ca = classify_point( m_plane, a, slop ); plane_class cb = classify_point( m_plane, b, slop ); plane_class cc = classify_point( m_plane, c, slop ); if ( print_debug ) { //x printf( "ca = %d, cb = %d, cc = %d\n", ca, cb, cc );//xxx } if ( ca == ON && cb == ON && cc == ON ) { // All points are in this node's plane. if ( p.normal * m_plane.normal < 0 ) { // Face's plane and our node plane are opposite each other. // Add the face on the outside of this plane. add_outside_face( a, b, c, p, face_index, slop ); } else { // This face fits in this node. Add the face index to our list. if ( print_debug ) printf( "o\n" );//xxxxx insert_into_face_list( face_index ); } return; } else if ( ( ca && cb && ( ca != cb ) ) || ( cb && cc && ( cb != cc ) ) || ( cc && ca && ( cc != ca ) ) ) { // printf( "*\n" ); // return; //xxxxxxxx // This triangle straddles the plane. // Make references to the verts, so we can sort them. const vec3* pa = &a; const vec3* pb = &b; const vec3* pc = &c; // Sort the vert references so that *pa is the most inside, and *pc is the most outside. const vec3* t; plane_class ct; if ( ca > cb ) { t = pa; pa = pb; pb = t; // swap( &a, &b ); ct = ca; ca = cb; cb = ct; } if ( cb > cc ) { t = pb; pb = pc; pc = t; // swap( &b, &c ); ct = cb; cb = cc; cc = ct; } if ( ca > cb ) { t = pa; pa = pb; pb = t; // swap( &a, &b ); ct = ca; ca = cb; cb = ct; } if ( cb == INSIDE ) { if ( print_debug ) printf( "^" );//xxxx // a and b are INSIDE the plane, c is OUTSIDE. vec3 d = intersect( m_plane, *pa, *pc ); vec3 e = intersect( m_plane, *pb, *pc ); add_inside_face( *pa, *pb, d, p, face_index, slop ); add_inside_face( *pb, d, e, p, face_index, slop ); add_outside_face( d, e, *pc, p, face_index, slop ); } else if ( cb == ON ) { if ( print_debug ) printf( "<" );//xxxx // a is INSIDE, b is ON, c is OUTSIDE. vec3 d = intersect( m_plane, *pa, *pc ); add_inside_face( *pa, *pb, d, p, face_index, slop ); add_outside_face( *pb, d, *pc, p, face_index, slop ); } else { if ( print_debug ) printf( "V: " );//xxxx // a is INSIDE, b and c are OUTSIDE. vec3 d = intersect( m_plane, *pa, *pb ); vec3 e = intersect( m_plane, *pa, *pc ); add_inside_face( *pa, d, e, p, face_index, slop ); add_outside_face( d, e, *pb, p, face_index, slop ); add_outside_face( e, *pb, *pc, p, face_index, slop ); } } else { // This triangle is fully on one side of the plane or the other. if ( ca == INSIDE || cb == INSIDE || cc == INSIDE ) { add_inside_face( a, b, c, p, face_index, slop ); } else { add_outside_face( a, b, c, p, face_index, slop ); } } } void bsp_node::add_inside_face( const vec3& a, const vec3& b, const vec3& c, const plane_info& p, int face_index, float slop ) // Adds the given triangle with the specified plane info to the inside // half of this node. Creates a new inside node if necessary. { if ( print_debug ) printf( "/" );//xxxx if ( m_inside ) { m_inside->add_face( a, b, c, p, face_index, slop ); } else { if ( print_debug ) printf( "x\n" );//xxxxx m_inside = new bsp_node( p ); m_inside->insert_into_face_list( face_index ); } } void bsp_node::add_outside_face( const vec3& a, const vec3& b, const vec3& c, const plane_info& p, int face_index, float slop ) // Adds the given triangle with the specified plane info to the outside // half-space of this node. Creates a new outside node if necessary. { if ( print_debug ) printf( "\\" );//xxxx if ( m_outside ) { m_outside->add_face( a, b, c, p, face_index, slop ); } else { if ( print_debug ) printf( "y\n" );//xxxxx m_outside = new bsp_node( p ); m_outside->insert_into_face_list( face_index ); } } void bsp_node::insert_into_face_list( int face_index ) // Adds the given face index into our array of face lists. { m_face_count++; // Make storage for the new face index. if ( m_face_list ) { m_face_list = (int*) realloc( m_face_list, m_face_count * sizeof( face_index ) ); } else { m_face_list = (int*) malloc( m_face_count * sizeof( face_index ) ); } m_face_list[ m_face_count - 1 ] = face_index; // Mark this node as having geometry. m_partitioning_plane = false; } bool bsp_node::ray_cast( collision_info* result, const vec3& p0, const vec3& dir, float distance, bool (*face_test_callback)( const vec3& normal, const vec3& pt, int face_index ) ) // Cast the specified ray through this BSP tree. Finds the nearest // hit, if any. If a hit is found, the results are put in *result and // returns true; otherwise returns false and leaves *result alone. // // If face_test_callback is not null, then use it to verify hits. // This function will call face_test_callback() with candidate // intersection points and a face_index. The candidate point is // guaranteed to be in the plane of the face, so the callback just // needs to determine if the point is within the triangle, and return // true if it is. { float dot = dir * m_plane.normal; float d0 = p0 * m_plane.normal - m_plane.d; float delta_n = dot * distance; float d1 = d0 + delta_n; bool parallel = fabs( dot ) < 0.000001f; // printf( "%f %f %f %f\n", d0, d1, dot, distance ); //xxxxx if ( parallel == false ) { // The ray might cross our plane. float hit_distance = -d0 / dot; // printf( "hd = %f\n", hit_distance );//xxxxx if ( d0 > 0 && d1 <= 0 ) { // // Ray crosses from the outside to the inside of this half-space. // // printf( "+" ); //xxxxxx // Check the first half of the ray against the outside. if ( m_outside && m_outside->ray_cast( result, p0, dir, hit_distance, face_test_callback ) ) { return true; } vec3 hit_point = p0 + dir * hit_distance; if ( m_partitioning_plane == false ) { // If the crossing point is on the inside of our inside // tree, then we have a potential hit. // if ( m_inside == 0 // || m_inside->test_point( hit_point ) ) // { // Check the faces for a hit. int i; for ( i = 0; i < m_face_count; i++ ) { if ( face_test_callback == 0 || face_test_callback( m_plane.normal, hit_point, m_face_list[ i ] ) ) { result->point = hit_point; result->normal = m_plane.normal; // get face properties from callback? return true; } } // } } // No hits so far... check the inside portion of the ray. return m_inside && m_inside->ray_cast( result, hit_point, dir, distance - hit_distance, face_test_callback ); } if ( d0 <= 0 && d1 > 0 ) { // // Ray crosses from the inside to the outside of this half-space. // // Check the first half of the ray against the inside. if ( m_inside && m_inside->ray_cast( result, p0, dir, hit_distance, face_test_callback ) ) { return true; } vec3 hit_point = p0 + dir * hit_distance; // If no hit, check the second half against the outside. return m_outside && m_outside->ray_cast( result, hit_point, dir, distance - hit_distance, face_test_callback ); } } // // Ray does not cross our plane. Check which side of the plane // the ray is on, and only check that side. // // printf( "O\n" ); //xxxx if ( d0 <= 0 ) { // printf( "/" );//xxx return m_inside && m_inside->ray_cast( result, p0, dir, distance, face_test_callback ); } else { // printf( "\\" );//xxx return m_outside && m_outside->ray_cast( result, p0, dir, distance, face_test_callback ); } } bool bsp_node::test_point( const vec3& a ) // Return true if the given point is inside our volume; false otherwise. { float d = m_plane.normal * a - m_plane.d; if ( d <= 0 ) { // Point is inside this node. if ( m_inside == 0 && m_partitioning_plane == true ) { // Point is in an empty partitioning volume. Assume we're // outside any volume. // // @@ This is not strictly correct, because we could be // inside a volume defined by faces which entirely enclose // the partitioning volume, without intersecting it. Such // volumes will have hollow cells inside them defined by // the partitioning planes. However, this shouldn't be a // practical problem for ray tracing, because valid test // points will be on a real volume plane. // // There is one potential failure case: if a ray hits a // big volume very near a point where the corner or edge // of an internal partitioning volume touches the big // volume, it's conceivable that the raycast will miss due // to the test_point() call returning false for that // point. Hm. One solution would be to mark leaf // partitioning planes that are inside such volumes with // an "inside" flag; in which case we'd return "true" // here, and everything would be hunky-dory. return false; } return m_inside == 0 || m_inside->test_point( a ); } else { // Point is on the outside of this node... return m_outside && m_outside->test_point( a ); } }
nsmoooose/csp
csp/tools/chunkdemo_prototype/engine/bsp.cpp
C++
gpl-2.0
12,653
<<<<<<< HEAD <?php /* * $Id$ * v1.0.4 * Friday Sep-02-2011 * @component JooComments * @copyright Copyright (C) Abhiram Mishra www.bullraider.com * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); jimport ( 'joomla.application.component.model' ); class plgContentJooComments extends JPlugin { function plgContentJooComments( &$subject, $config ) { parent::__construct( $subject, $config ); //incase language strings are not available do load the default en-GB $jlang =& JFactory::getLanguage(); $jlang->load('com_joocomments', JPATH_SITE, 'en-GB', true); $jlang->load('com_joocomments', JPATH_SITE, $jlang->getDefault(), true); $jlang->load('com_joocomments', JPATH_SITE, null, true); $this->loadLanguage('com_joocomments',JPATH_SITE); } //display top of content function onContentAfterDisplay($context, &$row, &$params, $page=0){ $app = JFactory::getApplication(); $component = JComponentHelper::getComponent( 'com_joocomments' ); if ( $app->isAdmin() ) { return; } if(!file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'joocomments.php')){ return ''; } $option = JRequest::getCmd('option'); $view = JRequest::getCmd("view"); if($option != "com_content" ){ return ''; } $var=$row->params->toArray(); $isCommentsEnabled=array_key_exists('comments_enabled', $var); $isCommentsEnabled=$isCommentsEnabled ?($var['comments_enabled']=='0'?false:true): !$isCommentsEnabled; if($isCommentsEnabled==false){ return ''; } if($view == "article"){ $isCommentsAllowed=array_key_exists('comments_allowed', $var); $isCommentsAllowed=$isCommentsAllowed ? ($var['comments_allowed']=='0'?false:true):$isCommentsAllowed; $captchaEnabled=$component->params->get( 'captcha_enabled', '0' ); $this->commentDisplay($row,$isCommentsAllowed,$captchaEnabled); } if(($view=="featured" && $component->params->get( 'frontend-comment_feature_link', '0' )==1) || ($view=="category" && $component->params->get( 'frontend-comment_category_link', '0' )==1)){ $vtm=JRegistryFormatJSON::getInstance('json'); $ctm=$vtm->stringToObject($row->attribs); $isCtsEnabled=isset($ctm->comments_enabled)?($ctm->comments_enabled=='0'?0:1): 1; $isCtsAllowed=isset($ctm->comments_allowed)?($ctm->comments_allowed=='0'?0:1):0; if($isCtsEnabled) $this->addLink($view,$row); } } function addLink($view,$row){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $captchaEnabled=$component->params->get( 'captcha_enabled', '0' ); $vari=''; $link=JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid)); if($component->params->get( 'frontend-comment_count_in_link', '0' )==1){ if(file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'models'.DS.'commentpage.php')){ require_once JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'models'.DS.'commentpage.php'; $s=new JooCommentsModelCommentpage(); $vari=' ('. count($s->retriveComments($row->id)).')'; } } $row->introtext=$row->introtext.'<p class=\'readmore\'><a href=\''.$link.'#comment-wrapper'.'\'>'.JText::_('COM_JOOCOMMENTS_LINK_NAME_VALUE').$vari.'</a></p>'; } function commentDisplay(&$article,$isCommentsAllowed,$captchaEnabled) { $view = JRequest::getVar('view'); $app = JFactory::getApplication(); $user = JFactory::getUser(); //make sure the mootools-more.js is loaded JHtml::_('behavior.framework',true); $doc = JFactory::getDocument(); require_once dirname(__FILE__).DS.'helpers'.DS.'Helper.php'; if(file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'joocomments.php')){ if ( $app->isAdmin() ) { return; } ob_start(); ?> <div id="comment-wrapper"></div> <?php if($isCommentsAllowed==true) echo JText::_('COM_JOOCOOMENTS_NEW_COMMENTS_DISABLED').'<div id="comments"></div>';?> <?php //need to add these stylesheet in the header,Which JHTML:stylesheet() will do, JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/main.css'); JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/wmd.css'); JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/message.css'); ?> <script src='<?php echo JURI::root().'components/com_joocomments/assets/js/showdown.js';?>' type='text/javascript'></script> <script language="javascript" type="text/javascript"><!-- //<![CDATA[ // version 1.0.4 var currentLanguage='<?php echo Helper::languageString($doc->language);?>'; var arr=Locale.list().toString(); var tempUrl=''; var waitTitle='<?php echo JText::_('COM_JOOCOMMENTS_WAITING_TITLE');?>'; var waitMessage='<?php echo JText::_('COM_JOOCOMMENTS_WAITING_MESSAGE');?>'; // check if current language is already available in Locale if(arr.indexOf(currentLanguage)==-1){ <?php echo 'Locale.define(\''.Helper::languageString($doc->language).'\', \'FormValidator\', {'; echo 'required: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_REQUIRED_ERROR').'\','; echo 'email: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_EMAIL_WRONG_ERROR').'\','; echo 'errorPrefix: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_ERROR_PREFIX').'\''; echo '});' ?> } Locale.use('<?php echo Helper::languageString($doc->language);?>'); var article_id="<?php echo $article->id; ?>"; var urlCurrentPage=window.location; var valCU=urlCurrentPage.toString().indexOf("://www.", 0); tempUrl = "<?php echo JURI::base(); ?>index.php?option=com_joocomments"; var valTU=tempUrl.toString().indexOf("://www.",0); if((valCU==4 || valCU==5) && valTU <4 ){tempUrl=tempUrl.replace("://","://www.");} if(valCU<4 && (valTU==4 || valTU==5)){tempUrl=tempUrl.replace("://www.","://");} var paImg=''; window.addEvent("load", function() { initialize(tempUrl); paImg='<?php echo JURI::root().'components/com_joocomments/assets/img/' ?>'; var myImages = Asset.images([paImg+'okMedium.png',paImg+'cautionMedium.png',paImg+'blackWaiter.gif']); //comments are not closed ie 0 then only load. <?php if($isCommentsAllowed==false){ ?> // url = "<?php echo JURI::base(); ?>index.php?option=com_joocomments&random=" + Math.random(); document.id('comment-wrapper').set('html', '<?php echo '<img src="'.JURI::root().'components/com_joocomments/assets/img/spinner.gif'.'" />'.JText::_('COM_JOOCOOMENTS_COMMENTS_LIST_LOADING');?>'); var req = new Request({ method: 'get', url: tempUrl+"&random=" + Math.random(), onComplete: function(text) { document.id('comment-wrapper').innerHTML = "" + text; loadTextEditor(); } }).send(); <?php }else{?> showComments(); <?php }?> }); <?php if($isCommentsAllowed==false){ ?> function loadTextEditor(){ wmd_options.ajaxForm=true; Attacklab.wmd(); Attacklab.wmd_defaults={buttons:"<?php echo $this->getConfiguredButtons(); ?>"}; Attacklab.wmdBase(); Attacklab.loadEnv(); Attacklab.Util.startEditor(); var myForm = document.id('myForm'); myForm.action=tempUrl+"&task=postComment"; // Labels over the inputs. myForm.getElements('[type=text], textarea').each(function(el){ new OverText(el); }); // Validation. var formValidator=new Form.Validator.Inline(myForm,{evaluateFieldsOnBlur:false, evaluateFieldsOnChange:false, onFormValidate:function(s,ele,on){ <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?>refreshCaptcha(); document.id('captchaText').value=""; <?php }?> if(sp!=null)sp.hide(true); } } ); <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?> formValidator.add('captchaValidator',{errorMsg:'<?php echo JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_CAPTCHA_ERROR');?>', test:function(field){ return validateCaptcha(field); } } );<?php }?> // Ajax (integrates with the validator). new Form.Request(myForm,null, { onComplete:function(){showComments();showEffect(arguments);<?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?>refreshCaptcha();<?php }?>if(sp!=null)sp.hide(true);} ,async:false, requestOptions: {'spinnerTarget': 'progress'}, extraData: {'article_id': article_id} }); showComments(); }<?php }?> function showComments(){ var parameter="&article_id="+article_id; var htmlRequest = new Request.HTML({url: tempUrl+'&task=showComments&view=commentpage'+parameter, onRequest: function(){ document.id('comments').set('html', '<?php echo '<img src="'.JURI::root().'components/com_joocomments/assets/img/spinner.gif'.'"/>'.JText::_('COM_JOOCOOMENTS_COMMENTS_LIST_LOADING');?>'); }, onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){ document.id('comments').empty(); document.id('comments').innerHTML=responseHTML; <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?> refreshCaptcha();<?php }?> }}).send(); } //]]> --></script> <script src='<?php echo JURI::root().'components/com_joocomments/assets/js/wmd.js';?>' type='text/javascript'></script> <?php $output = ob_get_contents(); ob_end_clean(); $pagination=''; if (!empty($article->pagination) AND $article->pagination AND $article->paginationposition AND!$article->paginationrelative){ $pagination=$article->pagination; $article->pagination=''; } $article->text=$article->text.$pagination.$output.$this->dynamicCss().'<center>Powered by <a href="http://www.bullraider.com" title="bullraider">Bullraider.com</a></center>'; JHTML::script(JURI::root().'components/com_joocomments/assets/js/message.js'); JHTML::script(JURI::root().'components/com_joocomments/assets/js/main.js'); return true; }else{ return false; } } function getConfiguredButtons(){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $originalList=array('bold', 'italic', 'link','blockquote', 'code', 'image', 'ol', 'ul', 'heading', 'hr'); $optionList=array('wmd-bold-button','wmd-italic-button','wmd-link-button','wmd-quote-button','wmd-code-button','wmd-image-button','wmd-olist-button','wmd-ulist-button','wmd-heading-button','wmd-hr-button'); $buttonValues=array(); for($j=0;$j<=9;$j++){ if($component->params->get(str_replace("-", "_", $optionList[$j]),'1')=='1'){ $buttonValues[$j]=$originalList[$j]; } } return implode(" ", $buttonValues); } function dynamicCss(){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $arr=array('wmd-bold-button','wmd-italic-button','wmd-spacer1','wmd-link-button','wmd-quote-button','wmd-code-button','wmd-image-button','wmd-spacer2','wmd-olist-button','wmd-ulist-button','wmd-heading-button','wmd-hr-button','wmd-spacer3','wmd-undo-button','wmd-redo-button' ); $buttonValues=array(); for($j=0;$j<13;$j++){ $buttonValues[$arr[$j]]=$component->params->get(str_replace("-", "_", $arr[$j]),'1'); if($j==2){ if($buttonValues['wmd-bold-button']=='1' || $buttonValues['wmd-italic-button']=='1'){ $buttonValues[$arr[2]]='1'; }else{ $buttonValues[$arr[2]]='0'; } } if($j==7){ if($buttonValues['wmd-link-button']=='1' || $buttonValues['wmd-quote-button']=='1' ||$buttonValues['wmd-code-button']=='1' ||$buttonValues['wmd-image-button']=='1'){ $buttonValues[$arr[7]]='1'; }else{ $buttonValues[$arr[7]]='0'; } } if($j==12){ if($buttonValues['wmd-olist-button']=='1' || $buttonValues['wmd-ulist-button']=='1' ||$buttonValues['wmd-heading-button']=='1' ||$buttonValues['wmd-hr-button']=='1'){ $buttonValues[$arr[12]]='1'; }else{ $buttonValues[$arr[12]]='0'; } } } $str=''; $counter=0; //count the number of buttons enabled for($i=0;$i<15;$i++){ if($i<12){ if($buttonValues[$arr[$i]]=='1'){ $str.='#wmd-button-bar #'.$arr[$i].'{left: '.($counter*25).'px !important;}'; $counter++; }}else{ $str.='#wmd-button-bar #'.$arr[$i].'{left: '.($counter*25).'px !important;}'; $counter++; } } return '<style>'.$str. '</style>'; } ======= <?php /* * $Id$ * v1.0.4 * Friday Sep-02-2011 * @component JooComments * @copyright Copyright (C) Abhiram Mishra www.bullraider.com * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); jimport ( 'joomla.application.component.model' ); class plgContentJooComments extends JPlugin { function plgContentJooComments( &$subject, $config ) { parent::__construct( $subject, $config ); //incase language strings are not available do load the default en-GB $jlang =& JFactory::getLanguage(); $jlang->load('com_joocomments', JPATH_SITE, 'en-GB', true); $jlang->load('com_joocomments', JPATH_SITE, $jlang->getDefault(), true); $jlang->load('com_joocomments', JPATH_SITE, null, true); $this->loadLanguage('com_joocomments',JPATH_SITE); } //display top of content function onContentAfterDisplay($context, &$row, &$params, $page=0){ $app = JFactory::getApplication(); $component = JComponentHelper::getComponent( 'com_joocomments' ); if ( $app->isAdmin() ) { return; } if(!file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'joocomments.php')){ return ''; } $option = JRequest::getCmd('option'); $view = JRequest::getCmd("view"); if($option != "com_content" ){ return ''; } $var=$row->params->toArray(); $isCommentsEnabled=array_key_exists('comments_enabled', $var); $isCommentsEnabled=$isCommentsEnabled ?($var['comments_enabled']=='0'?false:true): !$isCommentsEnabled; if($isCommentsEnabled==false){ return ''; } if($view == "article"){ $isCommentsAllowed=array_key_exists('comments_allowed', $var); $isCommentsAllowed=$isCommentsAllowed ? ($var['comments_allowed']=='0'?false:true):$isCommentsAllowed; $captchaEnabled=$component->params->get( 'captcha_enabled', '0' ); $this->commentDisplay($row,$isCommentsAllowed,$captchaEnabled); } if(($view=="featured" && $component->params->get( 'frontend-comment_feature_link', '0' )==1) || ($view=="category" && $component->params->get( 'frontend-comment_category_link', '0' )==1)){ $vtm=JRegistryFormatJSON::getInstance('json'); $ctm=$vtm->stringToObject($row->attribs); $isCtsEnabled=isset($ctm->comments_enabled)?($ctm->comments_enabled=='0'?0:1): 1; $isCtsAllowed=isset($ctm->comments_allowed)?($ctm->comments_allowed=='0'?0:1):0; if($isCtsEnabled) $this->addLink($view,$row); } } function addLink($view,$row){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $captchaEnabled=$component->params->get( 'captcha_enabled', '0' ); $vari=''; $link=JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid)); if($component->params->get( 'frontend-comment_count_in_link', '0' )==1){ if(file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'models'.DS.'commentpage.php')){ require_once JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'models'.DS.'commentpage.php'; $s=new JooCommentsModelCommentpage(); $vari=' ('. count($s->retriveComments($row->id)).')'; } } $row->introtext=$row->introtext.'<p class=\'readmore\'><a href=\''.$link.'#comment-wrapper'.'\'>'.JText::_('COM_JOOCOMMENTS_LINK_NAME_VALUE').$vari.'</a></p>'; } function commentDisplay(&$article,$isCommentsAllowed,$captchaEnabled) { $view = JRequest::getVar('view'); $app = JFactory::getApplication(); $user = JFactory::getUser(); //make sure the mootools-more.js is loaded JHtml::_('behavior.framework',true); $doc = JFactory::getDocument(); require_once dirname(__FILE__).DS.'helpers'.DS.'Helper.php'; if(file_exists(JPATH_SITE.DS.'components'.DS.'com_joocomments'.DS.'joocomments.php')){ if ( $app->isAdmin() ) { return; } ob_start(); ?> <div id="comment-wrapper"></div> <?php if($isCommentsAllowed==true) echo JText::_('COM_JOOCOOMENTS_NEW_COMMENTS_DISABLED').'<div id="comments"></div>';?> <?php //need to add these stylesheet in the header,Which JHTML:stylesheet() will do, JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/main.css'); JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/wmd.css'); JHTML::stylesheet(JURI::root().'components/com_joocomments/assets/css/message.css'); ?> <script src='<?php echo JURI::root().'components/com_joocomments/assets/js/showdown.js';?>' type='text/javascript'></script> <script language="javascript" type="text/javascript"><!-- //<![CDATA[ // version 1.0.4 var currentLanguage='<?php echo Helper::languageString($doc->language);?>'; var arr=Locale.list().toString(); var tempUrl=''; var waitTitle='<?php echo JText::_('COM_JOOCOMMENTS_WAITING_TITLE');?>'; var waitMessage='<?php echo JText::_('COM_JOOCOMMENTS_WAITING_MESSAGE');?>'; // check if current language is already available in Locale if(arr.indexOf(currentLanguage)==-1){ <?php echo 'Locale.define(\''.Helper::languageString($doc->language).'\', \'FormValidator\', {'; echo 'required: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_REQUIRED_ERROR').'\','; echo 'email: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_EMAIL_WRONG_ERROR').'\','; echo 'errorPrefix: \''.JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_FIELD_ERROR_PREFIX').'\''; echo '});' ?> } Locale.use('<?php echo Helper::languageString($doc->language);?>'); var article_id="<?php echo $article->id; ?>"; var urlCurrentPage=window.location; var valCU=urlCurrentPage.toString().indexOf("://www.", 0); tempUrl = "<?php echo JURI::base(); ?>index.php?option=com_joocomments"; var valTU=tempUrl.toString().indexOf("://www.",0); if((valCU==4 || valCU==5) && valTU <4 ){tempUrl=tempUrl.replace("://","://www.");} if(valCU<4 && (valTU==4 || valTU==5)){tempUrl=tempUrl.replace("://www.","://");} var paImg=''; window.addEvent("load", function() { initialize(tempUrl); paImg='<?php echo JURI::root().'components/com_joocomments/assets/img/' ?>'; var myImages = Asset.images([paImg+'okMedium.png',paImg+'cautionMedium.png',paImg+'blackWaiter.gif']); //comments are not closed ie 0 then only load. <?php if($isCommentsAllowed==false){ ?> // url = "<?php echo JURI::base(); ?>index.php?option=com_joocomments&random=" + Math.random(); document.id('comment-wrapper').set('html', '<?php echo '<img src="'.JURI::root().'components/com_joocomments/assets/img/spinner.gif'.'" />'.JText::_('COM_JOOCOOMENTS_COMMENTS_LIST_LOADING');?>'); var req = new Request({ method: 'get', url: tempUrl+"&random=" + Math.random(), onComplete: function(text) { document.id('comment-wrapper').innerHTML = "" + text; loadTextEditor(); } }).send(); <?php }else{?> showComments(); <?php }?> }); <?php if($isCommentsAllowed==false){ ?> function loadTextEditor(){ wmd_options.ajaxForm=true; Attacklab.wmd(); Attacklab.wmd_defaults={buttons:"<?php echo $this->getConfiguredButtons(); ?>"}; Attacklab.wmdBase(); Attacklab.loadEnv(); Attacklab.Util.startEditor(); var myForm = document.id('myForm'); myForm.action=tempUrl+"&task=postComment"; // Labels over the inputs. myForm.getElements('[type=text], textarea').each(function(el){ new OverText(el); }); // Validation. var formValidator=new Form.Validator.Inline(myForm,{evaluateFieldsOnBlur:false, evaluateFieldsOnChange:false, onFormValidate:function(s,ele,on){ <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?>refreshCaptcha(); document.id('captchaText').value=""; <?php }?> if(sp!=null)sp.hide(true); } } ); <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?> formValidator.add('captchaValidator',{errorMsg:'<?php echo JText::sprintf('COM_JOOCOOMENTS_COMMENTS_FORM_CAPTCHA_ERROR');?>', test:function(field){ return validateCaptcha(field); } } );<?php }?> // Ajax (integrates with the validator). new Form.Request(myForm,null, { onComplete:function(){showComments();showEffect(arguments);<?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?>refreshCaptcha();<?php }?>if(sp!=null)sp.hide(true);} ,async:false, requestOptions: {'spinnerTarget': 'progress'}, extraData: {'article_id': article_id} }); showComments(); }<?php }?> function showComments(){ var parameter="&article_id="+article_id; var htmlRequest = new Request.HTML({url: tempUrl+'&task=showComments&view=commentpage'+parameter, onRequest: function(){ document.id('comments').set('html', '<?php echo '<img src="'.JURI::root().'components/com_joocomments/assets/img/spinner.gif'.'"/>'.JText::_('COM_JOOCOOMENTS_COMMENTS_LIST_LOADING');?>'); }, onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){ document.id('comments').empty(); document.id('comments').innerHTML=responseHTML; <?php if($captchaEnabled=='0' || ($captchaEnabled=='2' && $user->guest)){?> refreshCaptcha();<?php }?> }}).send(); } //]]> --></script> <script src='<?php echo JURI::root().'components/com_joocomments/assets/js/wmd.js';?>' type='text/javascript'></script> <?php $output = ob_get_contents(); ob_end_clean(); $pagination=''; if (!empty($article->pagination) AND $article->pagination AND $article->paginationposition AND!$article->paginationrelative){ $pagination=$article->pagination; $article->pagination=''; } $article->text=$article->text.$pagination.$output.$this->dynamicCss().'<center>Powered by <a href="http://www.bullraider.com" title="bullraider">Bullraider.com</a></center>'; JHTML::script(JURI::root().'components/com_joocomments/assets/js/message.js'); JHTML::script(JURI::root().'components/com_joocomments/assets/js/main.js'); return true; }else{ return false; } } function getConfiguredButtons(){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $originalList=array('bold', 'italic', 'link','blockquote', 'code', 'image', 'ol', 'ul', 'heading', 'hr'); $optionList=array('wmd-bold-button','wmd-italic-button','wmd-link-button','wmd-quote-button','wmd-code-button','wmd-image-button','wmd-olist-button','wmd-ulist-button','wmd-heading-button','wmd-hr-button'); $buttonValues=array(); for($j=0;$j<=9;$j++){ if($component->params->get(str_replace("-", "_", $optionList[$j]),'1')=='1'){ $buttonValues[$j]=$originalList[$j]; } } return implode(" ", $buttonValues); } function dynamicCss(){ $component = JComponentHelper::getComponent( 'com_joocomments' ); $arr=array('wmd-bold-button','wmd-italic-button','wmd-spacer1','wmd-link-button','wmd-quote-button','wmd-code-button','wmd-image-button','wmd-spacer2','wmd-olist-button','wmd-ulist-button','wmd-heading-button','wmd-hr-button','wmd-spacer3','wmd-undo-button','wmd-redo-button' ); $buttonValues=array(); for($j=0;$j<13;$j++){ $buttonValues[$arr[$j]]=$component->params->get(str_replace("-", "_", $arr[$j]),'1'); if($j==2){ if($buttonValues['wmd-bold-button']=='1' || $buttonValues['wmd-italic-button']=='1'){ $buttonValues[$arr[2]]='1'; }else{ $buttonValues[$arr[2]]='0'; } } if($j==7){ if($buttonValues['wmd-link-button']=='1' || $buttonValues['wmd-quote-button']=='1' ||$buttonValues['wmd-code-button']=='1' ||$buttonValues['wmd-image-button']=='1'){ $buttonValues[$arr[7]]='1'; }else{ $buttonValues[$arr[7]]='0'; } } if($j==12){ if($buttonValues['wmd-olist-button']=='1' || $buttonValues['wmd-ulist-button']=='1' ||$buttonValues['wmd-heading-button']=='1' ||$buttonValues['wmd-hr-button']=='1'){ $buttonValues[$arr[12]]='1'; }else{ $buttonValues[$arr[12]]='0'; } } } $str=''; $counter=0; //count the number of buttons enabled for($i=0;$i<15;$i++){ if($i<12){ if($buttonValues[$arr[$i]]=='1'){ $str.='#wmd-button-bar #'.$arr[$i].'{left: '.($counter*25).'px !important;}'; $counter++; }}else{ $str.='#wmd-button-bar #'.$arr[$i].'{left: '.($counter*25).'px !important;}'; $counter++; } } return '<style>'.$str. '</style>'; } >>>>>>> 20e94369ec6225c2380eda267bdfb4b8f5929cfb }
baxri/cvote
plugins/content/joocomments/joocomments.php
PHP
gpl-2.0
27,139
/************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ package com.espertech.esper.epl.agg.access; import com.espertech.esper.client.EventBean; import com.espertech.esper.collection.MultiKeyUntyped; import com.espertech.esper.epl.expression.ExprEvaluator; import com.espertech.esper.epl.expression.ExprEvaluatorContext; import java.util.*; /** * Implementation of access function for single-stream (not joins). */ public class AggregationStateSortedImpl implements AggregationStateWithSize, AggregationStateSorted { protected final AggregationStateSortedSpec spec; protected final TreeMap<Object, Object> sorted; protected int size; /** * Ctor. * @param spec aggregation spec */ public AggregationStateSortedImpl(AggregationStateSortedSpec spec) { this.spec = spec; sorted = new TreeMap<Object, Object>(spec.getComparator()); } public void clear() { sorted.clear(); size = 0; } public void applyEnter(EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext) { EventBean theEvent = eventsPerStream[spec.getStreamId()]; if (theEvent == null) { return; } if (referenceEvent(theEvent)) { Object comparable = getComparable(spec.getCriteria(), eventsPerStream, true, exprEvaluatorContext); Object existing = sorted.get(comparable); if (existing == null) { sorted.put(comparable, theEvent); } else if (existing instanceof EventBean) { ArrayDeque coll = new ArrayDeque(2); coll.add(existing); coll.add(theEvent); sorted.put(comparable, coll); } else { ArrayDeque q = (ArrayDeque) existing; q.add(theEvent); } size++; } } protected boolean referenceEvent(EventBean theEvent) { // no action return true; } protected boolean dereferenceEvent(EventBean theEvent) { // no action return true; } public void applyLeave(EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext) { EventBean theEvent = eventsPerStream[spec.getStreamId()]; if (theEvent == null) { return; } if (dereferenceEvent(theEvent)) { Object comparable = getComparable(spec.getCriteria(), eventsPerStream, false, exprEvaluatorContext); Object existing = sorted.get(comparable); if (existing != null) { if (existing.equals(theEvent)) { sorted.remove(comparable); size--; } else if (existing instanceof ArrayDeque) { ArrayDeque q = (ArrayDeque) existing; q.remove(theEvent); if (q.isEmpty()) { sorted.remove(comparable); } size--; } } } } public EventBean getFirstValue() { if (sorted.isEmpty()) { return null; } Map.Entry<Object, Object> max = sorted.firstEntry(); return checkedPayload(max.getValue()); } public EventBean getLastValue() { if (sorted.isEmpty()) { return null; } Map.Entry<Object, Object> min = sorted.lastEntry(); return checkedPayload(min.getValue()); } public Iterator<EventBean> iterator() { return new AggregationStateSortedIterator(sorted, false); } public Iterator<EventBean> getReverseIterator() { return new AggregationStateSortedIterator(sorted, true); } public Collection<EventBean> collectionReadOnly() { return new AggregationStateSortedWrappingCollection(sorted, size); } public int size() { return size; } protected static Object getComparable(ExprEvaluator[] criteria, EventBean[] eventsPerStream, boolean istream, ExprEvaluatorContext exprEvaluatorContext) { if (criteria.length == 1) { return criteria[0].evaluate(eventsPerStream, istream, exprEvaluatorContext); } else { Object[] result = new Object[criteria.length]; int count = 0; for(ExprEvaluator expr : criteria) { result[count++] = expr.evaluate(eventsPerStream, true, exprEvaluatorContext); } return new MultiKeyUntyped(result); } } private EventBean checkedPayload(Object value) { if (value instanceof EventBean) { return (EventBean) value; } ArrayDeque<EventBean> q = (ArrayDeque<EventBean>) value; return q.getFirst(); } }
sungsoo/esper
esper/src/main/java/com/espertech/esper/epl/agg/access/AggregationStateSortedImpl.java
Java
gpl-2.0
5,476
/* Copyright 2015 Michelle Mabuyo 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.cmput301.mmabuyo.readysetpress; /** * Created by mmabuyo on 2015-10-01. * Purpose: * This class is responsible for the multiplayer mode of the game. It stores and updates * the results of two, three and four player games as persistent data. * Design Rationale: * Results are stored in integer arrays, the size of which depends on how many * players are playing that round. The first value in the array corresponds to Player One, and * so on and so forth. * Outstanding Issues: * None. */ public class GameshowResults { protected int[] twoPlayerResults; protected int[] threePlayerResults; protected int[] fourPlayerResults; protected MemoryManager memoryManager = new MemoryManager(); public GameshowResults() { twoPlayerResults = new int[2]; threePlayerResults = new int[3]; fourPlayerResults = new int[4]; } public int[] getTwoPlayerResults() { return twoPlayerResults; } public void setTwoPlayerResults(int[] twoPlayerResults) { this.twoPlayerResults = twoPlayerResults; } public int[] getThreePlayerResults() { return threePlayerResults; } public void setThreePlayerResults(int[] threePlayerResults) { this.threePlayerResults = threePlayerResults; } public int[] getFourPlayerResults() { return fourPlayerResults; } public void setFourPlayerResults(int[] fourPlayerResults) { this.fourPlayerResults = fourPlayerResults; } protected void addClick(Player player, int numberOfPlayers) { switch(numberOfPlayers) { case 2: getTwoPlayerResults()[player.getPid()-1]++; break; case 3: getThreePlayerResults()[player.getPid()-1]++; break; case 4: getFourPlayerResults()[player.getPid()-1]++; break; } } protected void clear() { this.setTwoPlayerResults(new int[2]); this.setThreePlayerResults(new int[3]); this.setFourPlayerResults(new int[4]); } }
mabuyo/ready-set-press
app/src/main/java/com/cmput301/mmabuyo/readysetpress/GameshowResults.java
Java
gpl-2.0
2,703
<?php /** * @category Core * @package JomSocial * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php */ // Disallow direct access to this file defined('_JEXEC') or die('Restricted access'); ?> <fieldset class="adminform" id="com_karmaPoints"> <legend><?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA' ); ?></legend> <table class="admintable" cellspacing="1"> <tbody> <tr> <td width="20" class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_ENABLE' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_ENABLE_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_ENABLE' ); ?> </span> </td> <td valign="top"> <?php echo JHTML::_('select.booleanlist' , 'enablekarma' , null , $this->config->get('enablekarma') , JText::_('COM_COMMUNITY_YES_OPTION') , JText::_('COM_COMMUNITY_NO_OPTION') ); ?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_DEFAULT_POINTS' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_DEFAULT_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_DEFAULT_POINTS' ); ?> </span> </td> <td valign="top"> <input type="text" name="defaultpoint" value="<?php echo $this->config->get('defaultpoint');?>" size="40" /> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_SMALLER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_SMALLER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point0' , $this->config->get('point0'), true );?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point1' , $this->config->get('point1') , false, 'point0');?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point2' , $this->config->get('point2') );?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point3' , $this->config->get('point3') );?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point4' , $this->config->get('point4') );?> </td> </tr> <tr> <td class="key"> <span class="hasTip" title="<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?>::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_KARMA_POINTS_TIPS'); ?>"> <?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_KARMA_GREATER_THAN' ); ?> </span> </td> <td valign="top"> <?php echo $this->getKarmaHTML( 'point5' , $this->config->get('point5') );?> </td> </tr> </tbody> </table> </fieldset>
epireve/joomla
administrator/components/com_community/views/configuration/tmpl/karma.php
PHP
gpl-2.0
4,180
<!--_____________ NODE.TPL BASIQUE _____________________ --> <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"> <div class="node-inner"> <?php /* choix du layout selon nombre de colonne * .col1_layout_200_570_200{} .col1_layout_330_all{} .col1_layout_18_56_25{} * .col2_layout_200_570_200{} .col2_layout_330_all{} .col2_layout_18_56_25{} * .col3_layout_200_570_200{} .col3_layout_330_all{} .col3_layout_18_56_25{} * * Couleur des border de separation,sur la colonne 2 * .rouge-bleu * .rose-bleu * .noir-vert * .bleu-violet * .vert-violet * Couleur des H1 de page : * rouge * orange * vert * bleu * rose * violet * */?> <!-- ______________________ COLONNE C1 _______________________ --> <div id="colonne-1" class="CHOIX_DU_LAYOUT"> <?php if ($title): ?> <h1 class="title bleu"><?php print $title; ?></h1> <?php endif; ?> <?php //region colonne C1 global $theme_path; include ($theme_path.'/includes/inc_region_col_C1.php'); ?> </div> <!--fin du contenu gauche --> <?php if (!$page): ?> <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> <?php endif; ?> <?php print $user_picture; ?> <?php if ($display_submitted): ?> <span class="submitted"><?php print $date; ?> — <?php print $name; ?></span> <?php endif; ?> <!-- ______________________ COLONNE C2 _______________________ --> <div id="colonne-2" class="CHOIX_DU_LAYOUT rose-bleu"> <?php // We hide the comments and links now so that we can render them later. hide($content['comments']); hide($content['links']); print render($content['body']); ?> <?php /* inclure des champs CCK dans le node selon http://robotlikehuman.com/web/printing-cck-content-field-values-drupal-7 * Ce qui donne pour D7 */ print render($content['field_EXAMPLE']); ?> <?php //region colonne C2 global $theme_path; include ($theme_path.'/includes/inc_region_col_C2.php'); ?> <?php if (!empty($content['links']['terms'])): ?> <div class="terms"><?php print render($content['links']['terms']); ?></div> <?php endif;?> <?php if (!empty($content['links'])): ?> <div class="links"><?php print render($content['links']); ?></div> <?php endif; ?> </div> <!-- /colonne 2 --> <!-- ______________________ COLONNE C3 _______________________ --> <div id="colonne-3" class="CHOIX_DU_LAYOUT"> <?php //region colonne C3 global $theme_path; include ($theme_path.'/includes/inc_region_col_C3.php'); ?> </div> </div> <!-- /node-inner --> </div> <!-- /node--> <?php print render($content['comments']); ?>
webmasterpf/CyranoD7_ER
templates/node/node.tpl.php
PHP
gpl-2.0
2,987
<?php /** * @package J2Store * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org * @license GNU GPL v3 or later */ // No direct access to this file defined('_JEXEC') or die; class J2StoreModelProductsBehaviorConfigurable extends F0FModelBehavior { private $_rawData = array(); public function onAfterGetItem(&$model, &$record) { //we just have the products. Get the variants $variantModel = F0FModel::getTmpInstance('Variants', 'J2StoreModel'); $variantModel->setState('product_type', $record->product_type); $app = JFactory::getApplication(); //Its a simple product. So we will have only one variant record try { $variants = $variantModel->product_id($record->j2store_product_id)->is_master(1)->getList(); $record->variants = $variants[0]; }catch(Exception $e) { $this->setError($e->getMessage()); $record->variants = F0FTable::getInstance('Variants', 'J2StoreTable'); } try { //lets load product options as well $option_model = F0FModel::getTmpInstance('ProductOptions', 'J2StoreModel') ->clearState() ->product_id($record->j2store_product_id) ->limit(0) ->limitstart(0); $view = $app->input->getCmd('view', ''); //TODO we should find an alternative method. This is a quick fix. if($app->isSite() && $view != 'form') { $option_model->setState('parent_id', 0); } $record->product_options = $option_model->getList(); }catch (Exception $e) { $this->setError($e->getMessage()); } $registry = new JRegistry(); $registry->loadString($record->params, 'JSON'); $record->params = $registry; } public function onBeforeSave(&$model, &$data) { if(!isset($data['product_type']) || $data['product_type'] != 'configurable') return; $utility_helper = J2Store::utilities(); if(!isset( $data['visibility'] )){ $data['visibility'] = 1; } if(isset($data['cross_sells'])) { $data['cross_sells'] = $utility_helper->to_csv($data['cross_sells']); }else{ $data['cross_sells'] =''; } if(isset($data['up_sells'])) { $data['up_sells'] = $utility_helper->to_csv($data['up_sells']); }else{ $data['up_sells'] =''; } if(isset($data['shippingmethods']) && !empty($data['shippingmethods'])){ $data['shippingmethods'] = implode(',',$data['shippingmethods']); } if(isset($data['item_options']) && count($data['item_options']) > 0){ $data['has_options'] = 1; } //bind existing params if($data['j2store_product_id'] ){ $product = F0FTable::getAnInstance('Product','J2StoreTable')->getClone(); $product->load($data['j2store_product_id']); if($product->params){ $product->params = json_decode($product->params); if(!isset($data['params']) || empty($data['params'])) { $data['params'] = new JRegistry('{}'); }else { $data['params'] = array_merge((array)$product->params,(array)$data['params']); } //$data['params'] = array_merge((array)$product->params,(array)$data['params']); } } if(isset($data['params']) && !empty($data['params'])){ $data['params'] = json_encode($data['params']); } $this->_rawData = $data; } public function onAfterSave(&$model) { if($this->_rawData) { $table = $model->getTable(); //sanity check if($table->product_type != 'configurable') return; //since post has too much of information, this could do the job $variant = F0FTable::getInstance('Variant', 'J2StoreTable')->getClone(); $variant->bind($this->_rawData); //by default it is treated as master product. $variant->is_master = 1; $variant->product_id = $table->j2store_product_id; $variant->store(); //get the item options if(isset($this->_rawData['item_options'])) { foreach($this->_rawData['item_options'] as $item){ $poption = F0FTable::getInstance('Productoption', 'J2StoreTable')->getClone(); $item->product_id = $table->j2store_product_id; try { $poption->save($item); }catch (Exception $e) { throw new Exception($e->getMessage()); } } } if(isset($this->_rawData['quantity'] )) { $inventory = $this->_rawData['quantity']; $productQuantity = F0FTable::getInstance('Productquantity', 'J2StoreTable'); $productQuantity->load(array('variant_id'=>$variant->j2store_variant_id)); $productQuantity->variant_id = $variant->j2store_variant_id; try { $productQuantity->save($inventory); }catch (Exception $e) { throw new Exception($e->getMessage()); } } //save product images $images = F0FTable::getInstance('ProductImage', 'J2StoreTable'); if(isset($this->_rawData['additional_images']) && !empty($this->_rawData['additional_images'] )){ if(is_object($this->_rawData['additional_images'])){ $this->_rawData['additional_images'] = json_encode(JArrayHelper::fromObject($this->_rawData['additional_images'])); }else{ $this->_rawData['additional_images'] = json_encode($this->_rawData['additional_images']); } } $this->_rawData['product_id'] = $table->j2store_product_id; //just make sure that we do not have a double entry there $images->load(array('product_id'=>$table->j2store_product_id)); $images->save($this->_rawData); //save product filters F0FTable::getAnInstance('ProductFilter', 'J2StoreTable' )->addFilterToProduct ( $this->_rawData ['productfilter_ids'], $table->j2store_product_id ); } } public function onBeforeDelete(&$model) { $id = $model->getId(); if(!$id) return; $product = F0FTable::getAnInstance('Product', 'J2StoreTable')->getClone(); if($product->load($id)) { if($product->product_type != 'configurable') return; $variantModel = F0FModel::getTmpInstance('Variants', 'J2StoreModel'); //get variants $variants = $variantModel->limit(0)->limitstart(0)->product_id($id)->getItemList(); foreach($variants as $variant) { $variantModel->setIds(array($variant->j2store_variant_id))->delete(); } } } public function onAfterGetProduct(&$model, &$product) { //sanity check if($product->product_type != 'configurable') return; $j2config = J2Store::config (); $product_helper = J2Store::product (); //we just have the products. Get the variants $variantModel = F0FModel::getTmpInstance('Variants', 'J2StoreModel'); $variantModel->setState('product_type', $product->product_type); //Its a simple product. So we will have only one variant record try { $variants = $variantModel->product_id($product->j2store_product_id)->is_master(1)->getList(); $product->variants = current($variants); }catch(Exception $e) { $this->setError($e->getMessage()); $product->variants = F0FTable::getAnInstance('Variants', 'J2StoreTable'); } // links $product_helper->getAddtocartAction ( $product ); $product_helper->getCheckoutLink ( $product ); $product_helper->getProductLink( $product ); $registry = new JRegistry (); $registry->loadString ( $product->params, 'JSON' ); $product->params = $registry; // process variant $product->variant = $product->variants; // get quantity restrictions $product_helper->getQuantityRestriction ( $product->variant ); // now process the quantity if (isset($product->variant->quantity_restriction) && $product->variant->min_sale_qty > 0) { $product->quantity = $product->variant->min_sale_qty; } else { $product->quantity = 1; } //check stock status if ($product_helper->check_stock_status ( $product->variant, $product->quantity )) { // reset the availability $product->variant->availability = 1; } else { $product->variant->availability = 0; } // process pricing. returns an object $product->pricing = $product_helper->getPrice ( $product->variant, $product->quantity ); $product->options = array (); if ($product->has_options) { try { //lets load product options as well $option_model = F0FModel::getTmpInstance('ProductOptions', 'J2StoreModel') ->clearState() ->product_id($product->j2store_product_id) ->limit(0) ->limitstart(0); if(JFactory::getApplication()->isSite()) { $option_model->setState('parent_id', 0); } $product->product_options = $option_model->getList(); }catch (Exception $e) { $this->setError($e->getMessage()); } try { $product->options = $product_helper->getProductOptions ( $product); } catch ( Exception $e ) { // do nothing } } } public function onUpdateProduct(&$model, &$product) { $app = JFactory::getApplication (); $params = J2Store::config (); $product_helper = J2Store::product (); $product_id = $app->input->getInt ( 'product_id', 0 ); if (! $product_id) return false; // 1. fetch parent options (select box) and set default selected value $po_id = $app->input->getInt ( 'po_id', 0 ); // echo $po_id;exit; $pov_id = $app->input->getInt ( 'pov_id', 0 ); $html = ''; $response_option = array(); if ($po_id && $pov_id) { // ~ now get the children for the above two $attributes = array (); $a = array (); // 2. fetch the children $db = JFactory::getDBO (); $query = $db->getQuery ( true )->select ( 'j2store_productoption_id, option_id' )->from ( '#__j2store_product_options' )->where ( 'j2store_productoption_id IN (' . $po_id . ')' ); $db->setQuery ( $query ); $parent_id = $db->loadObjectList ( 'j2store_productoption_id' ); $a = array (); $child_opts = ''; if($pov_id) { $child_opts = $product_helper->getChildProductOptions ( $product_id, $parent_id [$po_id]->option_id, $pov_id ); } if (! empty ( $child_opts )) { $options = array (); foreach ( $child_opts as $index => $attr ) { if (count ( $attr ['optionvalue'] ) > 0) // if optionvalue exist or not. then only display form.otherwise form display only heading without option name { array_push ( $options, $attr ); } } $product->options = $options; $response_option = $options; $controller = F0FController::getTmpInstance ( 'com_j2store', 'Products'); $view = $controller->getView ( 'Product', 'Html', 'J2StoreView' ); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); // Look for template files in component folders $view->addTemplatePath(JPATH_SITE.DS.'components'.DS.'com_j2store'.DS.'views'.DS.'product'.DS.'tmpl'); if ($model = $controller->getModel ( 'Products', 'J2StoreModel' )) { // Push the model into the view (as default) $view->setModel ( $model, true ); } $model->setState('task', 'read'); $view->assign('product', $product ); $view->assign( 'params', $params ); $view->setLayout ( 'item_configurableoptions' ); ob_start (); $view->display ( ); $html = ob_get_contents (); ob_end_clean (); } } // get variant $variants = F0FModel::getTmpInstance ( 'Variants', 'J2StoreModel' )->product_id ( $product->j2store_product_id )->is_master ( 1 )->getList (); $product->variants = $variants [0]; // process variant $product->variant = $product->variants; // get quantity restrictions $product_helper->getQuantityRestriction ( $product->variant ); // now process the quantity $product->quantity = $app->input->getFloat ( 'product_qty', 1 ); if ($product->variant->quantity_restriction && $product->variant->min_sale_qty > 0) { $product->quantity = $product->variant->min_sale_qty; } // process pricing. returns an object $pricing = $product_helper->getPrice ( $product->variant, $product->quantity ); $parent_product_options = $app->input->get ( 'product_option', array (), 'ARRAY' ); // get the selected option price if (count ( $parent_product_options )) { $product_option_data = $product_helper->getOptionPrice ( $parent_product_options, $product->j2store_product_id ); $base_price = $pricing->base_price + $product_option_data ['option_price']; $price = $pricing->price + $product_option_data ['option_price']; } else { $base_price = $pricing->base_price; $price = $pricing->price; } $return = array (); $return ['pricing'] = array (); $return ['pricing'] ['base_price'] = J2Store::product ()->displayPrice ( $base_price, $product, $params ); $return ['pricing'] ['price'] = J2Store::product ()->displayPrice ( $price, $product, $params ); $return ['child_options'] = $response_option; $return ['optionhtml'] = $html; $return ['pricing'] ['orginal'] = array(); $return ['pricing'] ['orginal']['base_price'] = $base_price; $return ['pricing'] ['orginal']['price'] = $price; return $return; } }
faridrn/Documentary
administrator/components/com_j2store/models/behavior/configurable.php
PHP
gpl-2.0
12,512
package org.ab.akademikbilisim; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.TextView; public class Detay extends ActionBarActivity { private Intent ben; private String yazi; private TextView girilenDeger; private Button btnKapat; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detay); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); ben = getIntent(); yazi = ben.getStringExtra("gonderilen"); girilenDeger = (TextView) findViewById(R.id.girilen_deger); girilenDeger.setText(yazi); btnKapat = (Button) findViewById(R.id.btn_kapat); btnKapat.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_detay, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if(id == android.R.id.home){ // geri butonuna tıklandı finish(); } //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
akademikbilisim/ab2015-android-a
ab2015-3/app/src/main/java/org/ab/akademikbilisim/Detay.java
Java
gpl-2.0
2,025
from __future__ import division from __future__ import print_function from __future__ import absolute_import import wx from .common import update_class class Separator(wx.StaticLine): def __init__(self, parent): wx.StaticLine.__init__(self, parent.get_container(), -1, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) update_class(Separator)
lunixbochs/fs-uae-gles
launcher/fs_uae_launcher/fsui/wx/separator.py
Python
gpl-2.0
394
<?php get_header(); ?> <section id="content"> <div class="container block"> <div class="row"> <div id="main" class="col-md-9"> <?php if ( have_posts()) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( __( 'Category Archives: %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?></h1> </header><!-- .page-header --> <?php // Start the Loop. while ( have_posts()) : the_post(); if('post' === get_post_type()): /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content' ); endif; endwhile; the_posts_pagination( array( 'screen_reader_text' => ' ', 'prev_text' => __( 'Previous page' ), 'next_text' => __( 'Next page' ), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page' ) . ' </span>', ) ); //twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div> <?php get_sidebar(); ?> </section> <?php get_footer(); ?>
saiponethaaung/mjs
wp-content/themes/borhters/category.php
PHP
gpl-2.0
2,048
package cmd import ( "fmt" "time" "github.com/spf13/cobra" "github.com/streadway/amqp" ) // rabbitCmd represents the rabbit command var rabbitCmd = &cobra.Command{ Use: "rabbit", Short: "A brief description of your command", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Connecting to RabbitMQ ...") conn, _ := amqp.Dial(amqpURL) defer conn.Close() ch, _ := conn.Channel() defer ch.Close() q, _ := ch.QueueDeclare( "DemoQueue", //name true, //durable false, //delete when unused false, //exclusive false, //no-wait nil, //arguements ) body := "Hello world!" //Publish to the queue ch.Publish( "", //exchange q.Name, //routing key false, //mandatory false, //immediate amqp.Publishing{ ContentType: "text/plain", Body: []byte(body), }) msgs, _ := ch.Consume( "DemoQueue", //queue "", //consumer true, //auto-ack false, //exclusive false, //no-local false, //no-wait nil, //args ) msgCount := 0 go func() { for d := range msgs { msgCount++ fmt.Printf("\nMessage Count: %d, Message Body: %s\n", msgCount, d.Body) } }() select { case <-time.After(time.Second * 2): fmt.Printf("Total Messages Fetched: %d\n", msgCount) fmt.Println("No more messages in queue. Timing out...") } }, } func init() { rootCmd.AddCommand(rabbitCmd) rabbitCmd.Flags().StringVarP(&amqpURL, "amqp", "q", "", "URL of RabbitMQ.") }
zhongwei/zgo
cmd/rabbit.go
GO
gpl-2.0
1,545
<?php /** * Generates HTML from tokens. * @todo Refactor interface so that configuration/context is determined * upon instantiation, no need for messy generateFromTokens() calls * @todo Make some of the more internal functions protected, and have * unit tests work around that */ class HTMLPurifier_Generator { /** * Whether or not generator should produce XML output. * @type bool */ private $_xhtml = true; /** * :HACK: Whether or not generator should comment the insides of <script> tags. * @type bool */ private $_scriptFix = false; /** * Cache of HTMLDefinition during HTML output to determine whether or * not attributes should be minimized. * @type HTMLPurifier_HTMLDefinition */ private $_def; /** * Cache of %Output.SortAttr. * @type bool */ private $_sortAttr; /** * Cache of %Output.FlashCompat. * @type bool */ private $_flashCompat; /** * Cache of %Output.FixInnerHTML. * @type bool */ private $_innerHTMLFix; /** * Stack for keeping track of object information when outputting IE * compatibility code. * @type array */ private $_flashStack = array(); /** * Configuration for the generator * @type HTMLPurifier_Config */ protected $config; /** * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context */ public function __construct($config, $context) { $this->config = $config; $this->_scriptFix = $config->get('Output.CommentScriptContents'); $this->_innerHTMLFix = $config->get('Output.FixInnerHTML'); $this->_sortAttr = $config->get('Output.SortAttr'); $this->_flashCompat = $config->get('Output.FlashCompat'); $this->_def = $config->getHTMLDefinition(); $this->_xhtml = $this->_def->doctype->xml; } /** * Generates HTML from an array of tokens. * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token * @return string Generated HTML */ public function generateFromTokens($tokens) { if (!$tokens) { return ''; } // Basic algorithm $html = ''; for ($i = 0, $size = count($tokens); $i < $size; $i++) { if ($this->_scriptFix && $tokens[$i]->name === 'script' && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { // script special case // the contents of the script block must be ONE token // for this to work. $html .= $this->generateFromToken($tokens[$i++]); $html .= $this->generateScriptFromToken($tokens[$i++]); } $html .= $this->generateFromToken($tokens[$i]); } // Tidy cleanup if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { $tidy = new Tidy; $tidy->parseString( $html, array( 'indent'=> true, 'output-xhtml' => $this->_xhtml, 'show-body-only' => true, 'indent-spaces' => 2, 'wrap' => 68, ), 'utf8' ); $tidy->cleanRepair(); $html = (string) $tidy; // explicit cast necessary } // Normalize newlines to system defined value if ($this->config->get('Core.NormalizeNewlines')) { $nl = $this->config->get('Output.Newline'); if ($nl === null) { $nl = PHP_EOL; } if ($nl !== "\n") { $html = str_replace("\n", $nl, $html); } } return $html; } /** * Generates HTML from a single token. * @param HTMLPurifier_Token $token HTMLPurifier_Token object. * @return string Generated HTML */ public function generateFromToken($token) { if (!$token instanceof HTMLPurifier_Token) { trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); return ''; } elseif ($token instanceof HTMLPurifier_Token_Start) { $attr = $this->generateAttributes($token->attr, $token->name); if ($this->_flashCompat) { if ($token->name === "object") { $flash = new stdClass(); $flash->attr = $token->attr; $flash->param = array(); $this->_flashStack[] = $flash; } } return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; } elseif ($token instanceof HTMLPurifier_Token_End) { $_extra = ''; if ($this->_flashCompat) { if ($token->name === "object" && !empty($this->_flashStack)) { // doesn't do anything for now } } return $_extra . '</' . $token->name . '>'; } elseif ($token instanceof HTMLPurifier_Token_Empty) { if ($this->_flashCompat && $token->name === "param" && !empty($this->_flashStack)) { $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; } $attr = $this->generateAttributes($token->attr, $token->name); return '<' . $token->name . ($attr ? ' ' : '') . $attr . ( $this->_xhtml ? ' /': '' ) // <br /> v. <br> . '>'; } elseif ($token instanceof HTMLPurifier_Token_Text) { return $this->escape($token->data, ENT_NOQUOTES); } elseif ($token instanceof HTMLPurifier_Token_Comment) { return '<!--' . $token->data . '-->'; } else { return ''; } } /** * Special case processor for the contents of script tags * @param HTMLPurifier_Token $token HTMLPurifier_Token object. * @return string * @warning This runs into problems if there's already a literal * --> somewhere inside the script contents. */ public function generateScriptFromToken($token) { if (!$token instanceof HTMLPurifier_Token_Text) { return $this->generateFromToken($token); } // Thanks <http://lachy.id.au/log/2005/05/script-comments> $data = preg_replace('#//\s*$#', '', $token->data); return '<!--//--><![CDATA[//><!--' . "\n" . trim($data) . "\n" . '//--><!]]>'; } /** * Generates attribute declarations from attribute array. * @note This does not include the leading or trailing space. * @param array $assoc_array_of_attributes Attribute array * @param string $element Name of element attributes are for, used to check * attribute minimization. * @return string Generated HTML fragment for insertion. */ public function generateAttributes($assoc_array_of_attributes, $element = '') { $html = ''; if ($this->_sortAttr) { ksort($assoc_array_of_attributes); } foreach ($assoc_array_of_attributes as $key => $value) { if (!$this->_xhtml) { // Remove namespaced attributes if (strpos($key, ':') !== false) { continue; } // Check if we should minimize the attribute: val="val" -> val if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { $html .= $key . ' '; continue; } } // Workaround for Internet Explorer innerHTML bug. // Essentially, Internet Explorer, when calculating // innerHTML, omits quotes if there are no instances of // angled brackets, quotes or spaces. However, when parsing // HTML (for example, when you assign to innerHTML), it // treats backticks as quotes. Thus, // <img alt="``" /> // becomes // <img alt=`` /> // becomes // <img alt='' /> // Fortunately, all we need to do is trigger an appropriate // quoting style, which we do by adding an extra space. // This also is consistent with the W3C spec, which states // that user agents may ignore leading or trailing // whitespace (in fact, most don't, at least for attributes // like alt, but an extra space at the end is barely // noticeable). Still, we have a configuration knob for // this, since this transformation is not necesary if you // don't process user input with innerHTML or you don't plan // on supporting Internet Explorer. if ($this->_innerHTMLFix) { if (strpos($value, '`') !== false) { // check if correct quoting style would not already be // triggered if (strcspn($value, '"\' <>') === strlen($value)) { // protect! $value .= ' '; } } } $html .= $key.'="'.$this->escape($value).'" '; } return rtrim($html); } /** * Escapes raw text data. * @todo This really ought to be protected, but until we have a facility * for properly generating HTML here w/o using tokens, it stays * public. * @param string $string String data to escape for HTML. * @param int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is * permissible for non-attribute output. * @return string escaped data. */ public function escape($string, $quote = null) { // Workaround for APC bug on Mac Leopard reported by sidepodcast // http://htmlpurifier.org/phorum/read.php?3,4823,4846 if ($quote === null) { $quote = ENT_COMPAT; } return htmlspecialchars($string, $quote, 'UTF-8'); } } // vim: et sw=4 sts=4
mambax7/257
htdocs/xoops_lib/modules/protector/library/HTMLPurifier/Generator.php
PHP
gpl-2.0
10,254
<?php /** * DB Replacer Default View * * @package DB Replacer * @version 3.2.0 * * @author Peter van Westen <peter@nonumber.nl> * @link http://www.nonumber.nl * @copyright Copyright © 2014 NoNumber All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; // Import VIEW object class jimport('joomla.application.component.view'); /** * DB Replacer Default View */ class DBReplacerViewDefault extends JViewLegacy { /** * Custom Constructor */ public function __construct($config = array()) { /** set up global variable for sorting etc * $context is used in VIEW abd in MODEL **/ global $context; $context = 'list.list.'; parent::__construct($config); } /** * Display the view * take data from MODEL and put them into * reference variables */ function display($tpl = null) { $viewLayout = JFactory::getApplication()->input->get('layout', 'default'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $this->parameters = NNParameters::getInstance(); $this->config = $this->parameters->getComponentParams('com_dbreplacer'); JHtml::stylesheet('nnframework/style.min.css', false, true); JHtml::stylesheet('dbreplacer/style.min.css', false, true); // Set document title JFactory::getDocument()->setTitle(JText::_('DB_REPLACER')); // Set ToolBar title JToolbarHelper::title(JText::_('DB_REPLACER'), 'dbreplacer icon-nonumber'); // Set toolbar items for the page if (JFactory::getUser()->authorise('core.admin', 'com_dbreplacer')) { JToolbarHelper::preferences('com_dbreplacer', '300'); } $uri = JFactory::getURI()->toString(); $tables = $this->renderTables(); $this->assignRef('request_url', $uri); $this->assignRef('tables', $tables); // call parent display parent::display($tpl); } function renderTables() { $db = JFactory::getDBO(); $ignore = explode(',', trim($this->config->ignore_tables)); $selected = JRequest::getVar('table', '', 'default', 'none', 2); if (empty($selected)) { $selected = trim(str_replace('#__', $db->getPrefix(), $this->config->default_table)); } $query = 'SHOW TABLES'; $db->setQuery($query); $tables = $db->loadColumn(); if (!empty($ignore)) { $ignores = array(); foreach ($ignore as $table) { if (trim($table) != '') { $query = 'SHOW TABLES LIKE ' . $db->quoteName(trim($table) . '%'); $db->setQuery($query); $ignores = array_merge($ignores, $db->loadColumn()); } } if (!empty($ignores)) { $tables = array_diff($tables, $ignores); } } $options = array(); $prefix = 0; $first = 1; foreach ($tables as $table) { $name = $table; if (strpos($name, $db->getPrefix()) === 0) { if (!$prefix) { if (!$first) { $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', true); } $options[] = JHtml::_('select.option', '-', $db->getPrefix(), 'value', 'text', true); $prefix = 1; } $name = substr($name, strlen($db->getPrefix())); } else { if ($prefix) { $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', true); $prefix = 0; } } $options[] = JHTML::_('select.option', $table, $name, 'value', 'text', 0); $first = 0; } return JHTML::_('select.genericlist', $options, 'table', 'size="20" class="dbr_element"', 'value', 'text', $selected, 'paramstable'); } }
xmarlem/BM_stage
administrator/components/com_dbreplacer/views/default/view.html.php
PHP
gpl-2.0
3,525
<?php /** * @package hubzero-cms * @copyright Copyright (c) 2005-2020 The Regents of the University of California. * @license http://opensource.org/licenses/MIT MIT */ defined('_HZEXEC_') or die(); $canDo = \Components\Cart\Admin\Helpers\Permissions::getActions('orders'); Toolbar::title(Lang::txt('COM_CART') . ': Items Ordered', 'cart.png'); if ($canDo->get('core.admin')) { Toolbar::preferences($this->option, '550'); Toolbar::spacer(); } Toolbar::custom('downloadorders', 'download.png', '', 'Download CSV', false); Toolbar::spacer(); Toolbar::help('downloads'); ?> <?php $this->view('_submenu') ->display(); ?> <form action="<?php echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller); ?>" method="post" name="adminForm" id="adminForm"> <table class="adminlist"> <thead> <tr> <th scope="col"><?php echo Html::grid('sort', 'COM_CART_SKU_ID', 'sId', @$this->filters['sort_Dir'], @$this->filters['sort']); ?></th> <th scope="col">Product</th> <th scope="col">QTY</th> <th scope="col">Price</th> <th scope="col"><?php echo Html::grid('sort', 'COM_CART_ORDER_ID', 'tId', @$this->filters['sort_Dir'], @$this->filters['sort']); ?></th> <th scope="col"><?php echo Html::grid('sort', 'COM_CART_ORDER_PALCED', 'tLastUpdated', @$this->filters['sort_Dir'], @$this->filters['sort']); ?></th> <th scope="col"><?php echo Html::grid('sort', 'COM_CART_ORDERED_BY', 'Name', @$this->filters['sort_Dir'], @$this->filters['sort']); ?></th> </tr> </thead> <tfoot> <tr> <td colspan="7"><?php // Initiate paging echo $this->pagination( $this->total, $this->filters['start'], $this->filters['limit'] ); ?></td> </tr> </tfoot> <tbody> <?php $k = 0; $i = 0; foreach ($this->rows as $row) { $itemInfo = $row->itemInfo['info']; ?> <tr class="<?php echo "row$k"; ?>"> <td> <?php $sId = '<a href="' . Route::url('index.php?option=com_storefront&controller=skus&task=edit&id=' . $itemInfo->sId) . '">' . $this->escape(stripslashes($row->sId)) . '</a>'; ?> <span><?php echo $sId; ?></span> </td> <td> <?php $product = '<a href="' . Route::url('index.php?option=com_storefront&controller=products&task=edit&id=' . $itemInfo->pId) . '">' . $this->escape(stripslashes($itemInfo->pName)) . '</a>'; if (!stripslashes($itemInfo->pName)) { $product = '<span class="missing">Product n/a</span>'; } if (!stripslashes($itemInfo->sSku)) { $product .= ', <span class="missing">SKU n/a</span>'; } else { $product .= ', ' . '<a href="' . Route::url('index.php?option=com_storefront&controller=skus&task=edit&id=' . $row->sId) . '">' . $this->escape(stripslashes($itemInfo->sSku)) . '</a>'; } ?> <span><?php echo $product; ?></span> </td> <td> <span><?php echo $this->escape(stripslashes($row->tiQty)); ?></span> </td> <td> <span><?php echo $this->escape(stripslashes($row->tiPrice)); ?></span> </td> <td> <?php $tId = '<a href="' . Route::url('index.php?option=com_cart&controller=orders&task=view&id=' . $row->tId) . '">' . $this->escape(stripslashes($row->tId)) . '</a>'; ?> <span><?php echo $tId; ?></span> </td> <td> <span><?php echo $this->escape(stripslashes($row->tLastUpdated)); ?></span> </td> <td> <span><?php echo $this->escape(stripslashes($row->name)); ?></span> </td> </tr> <?php $i++; $k = 1 - $k; } ?> </tbody> </table> <input type="hidden" name="option" value="<?php echo $this->option ?>" /> <input type="hidden" name="controller" value="<?php echo $this->controller; ?>" /> <input type="hidden" name="task" value="<?php echo $this->task; ?>" /> <input type="hidden" name="filter_order" value="<?php echo $this->filters['sort']; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $this->filters['sort_Dir']; ?>" /> <?php echo Html::input('token'); ?> </form>
hubzero/hubzero-cms
core/components/com_cart/admin/views/orders/tmpl/downloadorders.php
PHP
gpl-2.0
4,044
/* ************************************************************** #Inicia as funções e plugins * ***************************************************************/ (function() { // Ativa o menu mobile app.menu(); // Ativa o slideshow, se presente na página. var slideshow = document.getElementById("slider"); if(slideshow) { window.mySwipe = new Swipe(slideshow, { speed: 400, auto: 4000, continuous: false, callback: function(){ // Ativa os bullets de navegação do slideshow var i = mySwipe.getPos(), el = document.querySelectorAll("#slider > ul > li"); // Remove a classe ".is-active" de todos os bullets for(var x = 0; x < el.length; x++) { if(el[x].classList.contains("is-active")) { el[x].classList.remove("is-active"); } }; // Ativa a bullet correta el[i].classList.add("is-active"); } }); }; })();
nelclassico/hapvidaplanos
wp-content/themes/hapvida/src/js/init.js
JavaScript
gpl-2.0
969
/** \file "util/STL/stack_fwd.hh" Forward declaration of std::stack. No wrapping. $Id: stack_fwd.hh,v 1.6 2006/04/23 07:37:29 fang Exp $ */ #ifndef __UTIL_STL_STACK_FWD_HH__ #define __UTIL_STL_STACK_FWD_HH__ #include "util/STL/deque_fwd.hh" BEGIN_NAMESPACE_STD // doesn't like redeclaring default template arguments... // template <class T, class Alloc = std::allocator<T> > template <class T, class Seq> class stack; template <class T> struct default_stack { typedef stack<T, typename default_deque<T>::type> type; template <class S> struct rebind : public default_stack<S> { }; }; // end struct default_stack END_NAMESPACE_STD #endif // __UTIL_STL_STACK_FWD_HH__
fangism/hackt
src/util/STL/stack_fwd.hh
C++
gpl-2.0
684
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Elements part // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- // Pre-compilation #include "MediaInfo/PreComp.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Setup.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #ifdef MEDIAINFO_WM_YES //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Multiple/File_Wm.h" #if defined(MEDIAINFO_VC1_YES) #include "MediaInfo/Video/File_Vc1.h" #endif #if defined(MEDIAINFO_MPEGV_YES) #include "MediaInfo/Video/File_Mpegv.h" #endif #if defined(MEDIAINFO_AC3_YES) #include "MediaInfo/Audio/File_Ac3.h" #endif #if defined(MEDIAINFO_MPEGA_YES) #include "MediaInfo/Audio/File_Mpega.h" #endif #include "MediaInfo/MediaInfo_Config_MediaInfo.h" #if MEDIAINFO_DEMUX #include "ThirdParty/base64/base64.h" #endif //MEDIAINFO_DEMUX #include "ZenLib/Utils.h" using namespace ZenLib; //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Constants //*************************************************************************** static const char* Wm_CodecList_Kind(int32u Kind) { switch (Kind) { case 0x01 : return "Video"; case 0x02 : return "Audio"; default : return ""; } } static const char* Wm_BannerImageData_Type(int32u Type) { switch (Type) { case 0x00 : return ""; case 0x01 : return "Bitmap"; case 0x02 : return "JPEG"; case 0x03 : return "GIF"; default : return ""; } } #define UUID(NAME, PART1, PART2, PART3, PART4, PART5) \ const int64u NAME =((int64u(0x##PART1))&0xFF)<<56 | ((int64u(0x##PART1)>>8)&0xFF)<<48 | ((int64u(0x##PART1)>>16)&0xFF)<<40 | ((int64u(0x##PART1)>>24)&0xFF)<<32 | ((int64u(0x##PART2))&0xFF)<<24 | ((int64u(0x##PART2)>>8)&0xFF)<<16 | ((int64u(0x##PART3))&0xFF)<<8 | ((int64u(0x##PART3)>>8)&0xFF); \ const int64u NAME##2=0x##PART4##PART5##ULL; \ namespace Elements { UUID(Header, 75B22630, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_FileProperties, 8CABDCA1, A947, 11CF, 8EE4, 00C00C205365) UUID(Header_StreamProperties, B7DC0791, A9B7, 11CF, 8EE6, 00C00C205365) UUID(Header_StreamProperties_Audio, F8699E40, 5B4D, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_Video, BC19EFC0, 5B4D, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_Command, 59DACFC0, 59E6, 11D0, A3AC, 00A0C90348F6) UUID(Header_StreamProperties_JFIF, B61BE100, 5B4E, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_DegradableJPEG, 35907DE0, E415, 11CF, A917, 00805F5C442B) UUID(Header_StreamProperties_FileTransfer, 91BD222C, F21C, 497A, 8B6D, 5AA86BFC0185) UUID(Header_StreamProperties_Binary, 3AFB65E2, 47EF, 40F2, AC2C, 70A90D71D343) UUID(Header_StreamProperties_Binary_WebStreamMediaSubType, 776257D4, C627, 41CB, 8F81, 7AC7FF1C40CC) UUID(Header_StreamProperties_Binary_WebStreamFormat, DA1E6B13, 8359, 4050, B398, 388E965BF00C) UUID(Header_HeaderExtension, 5FBF03B5, A92E, 11CF, 8EE3, 00C00C205365) UUID(Header_HeaderExtension_ExtendedStreamProperties, 14E6A5CB, C672, 4332, 8399, A96952065B5A) UUID(Header_HeaderExtension_AdvancedMutualExclusion, A08649CF, 4775, 4670, 8A16, 6E35357566CD) UUID(Header_HeaderExtension_GroupMutualExclusion, D1465A40, 5A79, 4338, B71B, E36B8FD6C249) UUID(Header_HeaderExtension_StreamPrioritization, D4FED15B, 88D3, 454F, 81F0, ED5C45999E24) UUID(Header_HeaderExtension_BandwidthSharing, A69609E6, 517B, 11D2, B6AF, 00C04FD908E9) UUID(Header_HeaderExtension_LanguageList, 7C4346A9, EFE0, 4BFC, B229, 393EDE415C85) UUID(Header_HeaderExtension_Metadata, C5F8CBEA, 5BAF, 4877, 8467, AA8C44FA4CCA) UUID(Header_HeaderExtension_MetadataLibrary, 44231C94, 9498, 49D1, A141, 1D134E457054) UUID(Header_HeaderExtension_IndexParameters, D6E229DF, 35DA, 11D1, 9034, 00A0C90349BE) UUID(Header_HeaderExtension_MediaIndexParameters, 6B203BAD, 3F11, 48E4, ACA8, D7613DE2CFA7) UUID(Header_HeaderExtension_TimecodeIndexParameters, F55E496D, 9797, 4B5D, 8C8B, 604DFE9BFB24) UUID(Header_HeaderExtension_Compatibility, 26F18B5D, 4584, 47EC, 9F5F, 0E651F0452C9) UUID(Header_HeaderExtension_AdvancedContentEncryption, 43058533, 6981, 49E6, 9B74, AD12CB86D58C) UUID(Header_HeaderExtension_IndexPlaceholder, D9AADE20, 7C17, 4F9C, BC28, 8555DD98E2A2) UUID(Header_CodecList, 86D15240, 311D, 11D0, A3A4, 00ACC90348F6) UUID(Header_ScriptCommand, 1EFB1A30, 0B62, 11D0, A39B, 00A0C90348F6) UUID(Header_Marker, F487CD01, A951, 11CF, 8EE6, 00C00C205365) UUID(Header_BitRateMutualExclusion, D6E229DC, 35DA, 11D1, 9034, 00A0C90349BE) UUID(Header_ErrorCorrection, 75B22635, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_ContentDescription, 75B22633, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_ExtendedContentDescription, D2D0A440, E307, 11D2, 97F0, 00A0C95EA850) UUID(Header_StreamBitRate, 7BF875CE, 468D, 11D1, 8D82, 006097C9A2B2) UUID(Header_ContentBranding, 2211B3FA, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_ContentEncryption, 2211B3FB, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_ExtendedContentEncryption, 298AE614, 2622, 4C17, B935, DAE07EE9289C) UUID(Header_DigitalSignature, 2211B3FC, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_Padding, 1806D474, CADF, 4509, A4BA, 9AABCB96AAE8) UUID(Data, 75B22636, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(SimpleIndex, 33000890, E5B1, 11CF, 89F4, 00A0C90349CB) UUID(Index, D6E229D3, 35DA, 11D1, 9034, 00A0C90349BE) UUID(MediaIndex, FEB103F8, 12AD, 4C64, 840F, 2A1D2F7AD48C) UUID(TimecodeIndex, 3CB73FD0, 0C4A, 4803, 953D, EDF7B6228F0C) UUID(Payload_Extension_System_TimeStamp, 1135BEB7, 3A39, 478A, 98D9, 15C76B00EB69); UUID(Mutex_Language, D6E22A00, 35DA, 11D1, 9034, 00A0C90349BE); UUID(Mutex_Bitrate, D6E22A01, 35DA, 11D1, 9034, 00A0C90349BE); } static const char* Wm_StreamType(const int128u& Kind) { switch (Kind.hi) { case Elements::Header_StreamProperties_Audio : return "Audio"; case Elements::Header_StreamProperties_Video : return "Video"; case Elements::Header_StreamProperties_Command : return "Command"; case Elements::Header_StreamProperties_JFIF : return "JFIF"; case Elements::Header_StreamProperties_DegradableJPEG : return "Degradable JPEG"; case Elements::Header_StreamProperties_FileTransfer : return "File Transfer"; case Elements::Header_StreamProperties_Binary : return "Binary"; default : return ""; } } static const char* Wm_ExclusionType(const int128u& ExclusionType) { switch (ExclusionType.hi) { case Elements::Header_StreamProperties_Audio : return "Language"; case Elements::Header_StreamProperties_Video : return "Bitrate"; default : return ""; } } //*************************************************************************** // Format //*************************************************************************** //--------------------------------------------------------------------------- // Element parse // void File_Wm::Data_Parse() { //Parsing DATA_BEGIN LIST(Header) ATOM_BEGIN ATOM(Header_FileProperties) ATOM(Header_StreamProperties) LIST(Header_HeaderExtension) ATOM_BEGIN ATOM(Header_HeaderExtension_ExtendedStreamProperties) ATOM(Header_HeaderExtension_AdvancedMutualExclusion) ATOM(Header_HeaderExtension_GroupMutualExclusion) ATOM(Header_HeaderExtension_StreamPrioritization) ATOM(Header_HeaderExtension_BandwidthSharing) ATOM(Header_HeaderExtension_LanguageList) ATOM(Header_HeaderExtension_Metadata) ATOM(Header_HeaderExtension_MetadataLibrary) ATOM(Header_HeaderExtension_IndexParameters) ATOM(Header_HeaderExtension_MediaIndexParameters) ATOM(Header_HeaderExtension_TimecodeIndexParameters) ATOM(Header_HeaderExtension_Compatibility) ATOM(Header_HeaderExtension_AdvancedContentEncryption) ATOM(Header_HeaderExtension_IndexPlaceholder) ATOM(Header_Padding) ATOM_END ATOM(Header_CodecList) ATOM(Header_ScriptCommand) ATOM(Header_Marker) ATOM(Header_BitRateMutualExclusion) ATOM(Header_ErrorCorrection) ATOM(Header_ContentDescription) ATOM(Header_ExtendedContentDescription) ATOM(Header_StreamBitRate) ATOM(Header_ContentBranding) ATOM(Header_ContentEncryption) ATOM(Header_ExtendedContentEncryption) ATOM(Header_DigitalSignature) ATOM(Header_Padding) ATOM_END LIST(Data) ATOM_DEFAULT_ALONE(Data_Packet) LIST_SKIP(SimpleIndex) LIST_SKIP(Index) ATOM(MediaIndex) ATOM(TimecodeIndex) DATA_END } //*************************************************************************** // Elements //*************************************************************************** //--------------------------------------------------------------------------- void File_Wm::Header() { Data_Accept("Windows Media"); Element_Name("Header"); //Parsing Skip_L4( "Number of Header Objects"); Skip_L1( "Alignment"); Skip_L1( "Architecture"); FILLING_BEGIN(); Fill(Stream_General, 0, General_Format, "Windows Media"); Header_StreamProperties_StreamOrder=0; FILLING_END(); } //--------------------------------------------------------------------------- void File_Wm::Header_FileProperties() { Element_Name("File Properties"); //Parsing int64u CreationDate, PlayDuration, SendDuration, Preroll; int32u Flags, MaximumBitRate; Skip_GUID( "File ID"); Skip_L8( "File Size"); Get_L8 (CreationDate, "Creation Date"); Param_Info1(Ztring().Date_From_Milliseconds_1601(CreationDate/10000)); Skip_L8( "Data Packets Count"); Get_L8 (PlayDuration, "Play Duration"); Param_Info_From_Milliseconds(PlayDuration/10000); Get_L8 (SendDuration, "Send Duration"); Param_Info_From_Milliseconds(SendDuration/10000); Get_L8 (Preroll, "Preroll"); Param_Info_From_Milliseconds(Preroll); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Broadcast"); Skip_Flags(Flags, 1, "Seekable"); Skip_Flags(Flags, 2, "Use Packet Template"); Skip_Flags(Flags, 3, "Live"); Skip_Flags(Flags, 4, "Recordable"); Skip_Flags(Flags, 5, "Unknown Data Size"); Skip_L4( "Minimum Data Packet Size"); Get_L4 (MaximumDataPacketSize, "Maximum Data Packet Size"); Get_L4 (MaximumBitRate, "Maximum Bitrate"); //Filling if (MaximumBitRate) Fill(Stream_General, 0, General_OverallBitRate_Maximum, MaximumBitRate); Ztring Encoded_Date_New=Ztring().Date_From_Seconds_1601(CreationDate/10000000); const Ztring& Encoded_Date_Old=Retrieve_Const(Stream_General, 0, General_Encoded_Date); if (Encoded_Date_Old.empty() || Encoded_Date_New!=Encoded_Date_Old) Fill(Stream_General, 0, General_Encoded_Date, Encoded_Date_New); if (PlayDuration/1000>Preroll) Fill(Stream_General, 0, General_Duration, PlayDuration/10000-Preroll); FileProperties_Preroll=(int32u)(Preroll); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties () { Element_Name("Stream Properties"); //Parsing int128u StreamType; int32u StreamTypeLength, ErrorCorrectionTypeLength; Get_GUID(StreamType, "StreamType"); Param_Info1(Wm_StreamType(StreamType)); Element_Info1(Wm_StreamType(StreamType)); Skip_GUID( "Error Correction Type"); Skip_L8( "Time Offset"); Get_L4 (StreamTypeLength, "Type-Specific Data Length"); Get_L4 (ErrorCorrectionTypeLength, "Error Correction Data Length"); Get_L2 (Stream_Number, "Stream Number"); if (Stream_Number&0x8000) { Param_Info1("Encrypted Content"); Stream[Stream_Number&0x007F].Info["Encryption"]=__T("Encrypted"); } Stream_Number&=0x007F; //Only 7bits Element_Info1(Stream_Number); Skip_L4( "Reserved"); switch (StreamType.hi) { case Elements::Header_StreamProperties_Audio : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Audio(); Element_End0(); break; case Elements::Header_StreamProperties_Video : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Video(); Element_End0(); break; case Elements::Header_StreamProperties_JFIF : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_JFIF(); Element_End0(); break; case Elements::Header_StreamProperties_DegradableJPEG : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_DegradableJPEG(); Element_End0(); break; case Elements::Header_StreamProperties_FileTransfer : case Elements::Header_StreamProperties_Binary : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Binary(); StreamKind_Last=Stream_Max; StreamPos_Last=(size_t)-1; Element_End0(); break; default : if (StreamTypeLength>0) Skip_XX(StreamTypeLength, "Type-Specific Data"); StreamKind_Last=Stream_Max; StreamPos_Last=(size_t)-1; } if (ErrorCorrectionTypeLength) Skip_XX(ErrorCorrectionTypeLength, "Error Correction Data"); //Filling stream& StreamItem = Stream[Stream_Number]; StreamItem.StreamKind=StreamKind_Last; StreamItem.StreamPos=StreamPos_Last; StreamItem.Info["ID"].From_Number(Stream_Number); StreamItem.Info["StreamOrder"].From_Number(Header_StreamProperties_StreamOrder); Header_StreamProperties_StreamOrder++; } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio () { Element_Name("Audio"); //Parsing int32u SamplingRate, BytesPerSec; int16u CodecID, Channels, Data_Size, Resolution; Get_L2 (CodecID, "Codec ID"); Get_L2 (Channels, "Number of Channels"); Get_L4 (SamplingRate, "Samples Per Second"); Get_L4 (BytesPerSec, "Average Number of Bytes Per Second"); Skip_L2( "Block Alignment"); Get_L2 (Resolution, "Bits / Sample"); Get_L2 (Data_Size, "Codec Specific Data Size"); //Filling Stream_Prepare(Stream_Audio); Stream[Stream_Number].IsCreated=true; Ztring Codec; Codec.From_Number(CodecID, 16); Codec.MakeUpperCase(); CodecID_Fill(Codec, Stream_Audio, StreamPos_Last, InfoCodecID_Format_Riff); Fill(Stream_Audio, StreamPos_Last, Audio_Codec, Codec); //May be replaced by codec parser Fill(Stream_Audio, StreamPos_Last, Audio_Codec_CC, Codec); if (Channels) Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Channels); if (SamplingRate) Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, SamplingRate); if (BytesPerSec) Fill(Stream_Audio, StreamPos_Last, Audio_BitRate, BytesPerSec*8); if (Resolution) Fill(Stream_Audio, StreamPos_Last, Audio_BitDepth, Resolution); FILLING_BEGIN(); //Creating the parser if (0); #if defined(MEDIAINFO_MPEGA_YES) else if (MediaInfoLib::Config.CodecID_Get(Stream_Audio, InfoCodecID_Format_Riff, Ztring::ToZtring(CodecID, 16))==__T("MPEG Audio")) { stream& StreamItem = Stream[Stream_Number]; File_Mpega* Parser = new File_Mpega; StreamItem.Parser= Parser; Parser->Frame_Count_Valid=8; StreamItem.Parser->ShouldContinueParsing=true; } #endif Open_Buffer_Init(Stream[Stream_Number].Parser); FILLING_END(); //Parsing if (Data_Size>0) { Element_Begin1("Codec Specific Data"); switch (CodecID) { case 0x0161 : case 0x0162 : case 0x0163 : Header_StreamProperties_Audio_WMA(); break; case 0x7A21 : case 0x7A22 : Header_StreamProperties_Audio_AMR(); break; default : Skip_XX(Data_Size, "Unknown"); } Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio_WMA () { Element_Info1("WMA"); //Demux #if MEDIAINFO_DEMUX switch (Config->Demux_InitData_Get()) { case 0 : //In demux event Demux_Level=2; //Container Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_Header); break; case 1 : //In field { std::string Data_Raw((const char*)(Buffer+Buffer_Offset+Element_Offset), (size_t)10);//Element_Size-(Element_Offset)); std::string Data_Base64(Base64::encode(Data_Raw)); Fill(Stream_Audio, StreamPos_Last, "Demux_InitBytes", Data_Base64); Fill_SetOptions(Stream_Audio, StreamPos_Last, "Demux_InitBytes", "N NT"); } break; default : ; } #endif //MEDIAINFO_DEMUX //Parsing Skip_L4( "SamplesPerBlock"); Skip_L2( "EncodeOptions"); Skip_L4( "SuperBlockAlign"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio_AMR () { Element_Info1("AMR"); //Parsing int32u Flags; bool VBR; Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "SID is used"); Get_Flags (Flags, 1, VBR, "Varying bitrate"); //Filling Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Mode, VBR?"VBR":"CBR"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Video () { Element_Name("Video"); //Parsing int32u Width, Height, Compression; int16u Data_Size, Resolution; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L1( "Flags"); Get_L2 (Data_Size, "Format Data Size"); Skip_L4( "Size"); Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L2( "Planes"); Get_L2 (Resolution, "BitCount"); Get_C4 (Compression, "Compression"); Skip_L4( "SizeImage"); Skip_L4( "XPelsPerMeter"); Skip_L4( "YPelsPerMeter"); Skip_L4( "ClrUsed"); Skip_L4( "ClrImportant"); //Filling Stream_Prepare(Stream_Video); Stream[Stream_Number].IsCreated=true; CodecID_Fill(Ztring().From_CC4(Compression), Stream_Video, StreamPos_Last, InfoCodecID_Format_Riff); Fill(Stream_Video, StreamPos_Last, Video_Codec, Ztring().From_CC4(Compression)); //May be replaced by codec parser Fill(Stream_Video, StreamPos_Last, Video_Codec_CC, Ztring().From_CC4(Compression)); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); if (Resolution>0) Fill(Stream_Video, StreamPos_Last, Video_BitDepth, (Resolution%3)?Resolution:(Resolution/3)); //If not a multiple of 3, the total resolution is filled if (Compression==CC4("DVR ")) IsDvrMs=true; //From Content description (we imagine that data is for all video streams...) if (Header_ExtendedContentDescription_AspectRatioX && Header_ExtendedContentDescription_AspectRatioY) { if (Header_ExtendedContentDescription_AspectRatioX==16 && Header_ExtendedContentDescription_AspectRatioY==9) Fill(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio, ((float32)16)/9, 3); else if (Header_ExtendedContentDescription_AspectRatioX==4 && Header_ExtendedContentDescription_AspectRatioY==3) Fill(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio, ((float32)4)/3, 3); else Fill(Stream_Video, StreamPos_Last, Video_PixelAspectRatio, ((float32)Header_ExtendedContentDescription_AspectRatioX)/Header_ExtendedContentDescription_AspectRatioY, 3, true); } //Creating the parser if (0); #if defined(MEDIAINFO_VC1_YES) else if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression), InfoCodecID_Format)==__T("VC-1")) { stream& StreamItem = Stream[Stream_Number]; File_Vc1* Parser = new File_Vc1; StreamItem.Parser= Parser; if (Compression==CC4("WMV3")) { Parser->From_WMV3=true; Parser->MustSynchronize=false; } Parser->FrameIsAlwaysComplete=true; //Warning: this is not always the case, see data parsing Open_Buffer_Init(StreamItem.Parser); if (Data_Size>40) { //Demux #if MEDIAINFO_DEMUX switch (Config->Demux_InitData_Get()) { case 0 : //In demux event Element_Code=Stream_Number; Demux_Level=2; //Container Demux(Buffer+(size_t)Element_Offset, (size_t)(Data_Size-40), ContentType_Header); break; case 1 : //In field { std::string Data_Raw((const char*)(Buffer+(size_t)Element_Offset), (size_t)(Data_Size-40)); std::string Data_Base64(Base64::encode(Data_Raw)); Fill(Stream_Video, StreamPos_Last, "Demux_InitBytes", Data_Base64); Fill_SetOptions(Stream_Video, StreamPos_Last, "Demux_InitBytes", "N NT"); } break; default : ; } #endif //MEDIAINFO_DEMUX stream& StreamItem = Stream[Stream_Number]; Open_Buffer_Continue(StreamItem.Parser, (size_t)(Data_Size-40)); if (StreamItem.Parser->Status[IsFinished]) { Finish(StreamItem.Parser); Merge(*StreamItem.Parser, Stream_Video, 0, StreamPos_Last); delete StreamItem.Parser; StreamItem.Parser=NULL; } else { ((File_Vc1*)StreamItem.Parser)->Only_0D=true; ((File_Vc1*)StreamItem.Parser)->MustSynchronize=false; } } } #endif #if defined(MEDIAINFO_MPEGV_YES) else if (MediaInfoLib::Config.Codec_Get(Ztring().From_CC4(Compression), InfoCodec_KindofCodec).find(__T("MPEG-2"))==0) { stream& StreamItem = Stream[Stream_Number]; File_Mpegv* Parser = new File_Mpegv; StreamItem.Parser = Parser; Parser->Frame_Count_Valid=30; //For searching Pulldown Open_Buffer_Init(StreamItem.Parser); } #endif else if (Data_Size>40) //TODO: see "The Mummy_e" Skip_XX(Data_Size-40, "Codec Specific Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_JFIF () { Element_Name("JFIF"); //Parsing int32u Width, Height; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L4( "Reserved"); //Filling Stream_Prepare(Stream_Image); Fill(Stream_Video, StreamPos_Last, Video_Format, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Codec, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_DegradableJPEG () { Element_Name("Degradable JPEG"); int32u Width, Height; int16u InterchangeDataLength; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L2( "Reserved"); Skip_L2( "Reserved"); Skip_L2( "Reserved"); Get_L2 (InterchangeDataLength, "Interchange data length"); if (InterchangeDataLength>0) Skip_XX(InterchangeDataLength, "Interchange data"); else Skip_L1( "Zero"); //Filling Stream_Prepare(Stream_Image); Fill(Stream_Video, StreamPos_Last, Video_Format, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Codec, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Binary () { Element_Name("Binary"); //Parsing int32u FormatDataLength; Skip_GUID( "Major media type"); Skip_GUID( "Media subtype"); Skip_L4( "Fixed-size samples"); Skip_L4( "Temporal compression"); Skip_L4( "Sample size"); Skip_GUID( "Format type"); Get_L4 (FormatDataLength, "Format data size"); if (FormatDataLength>0) Skip_XX(FormatDataLength, "Format data"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension() { Element_Name("Header Extension"); //Parsing int32u Size; Skip_GUID( "ClockType"); Skip_L2( "ClockSize"); Get_L4 (Size, "Extension Data Size"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_ExtendedStreamProperties() { Element_Name("Extended Stream Properties"); //Parsing int64u AverageTimePerFrame; int32u DataBitrate, Flags; int16u StreamNumber, LanguageID, StreamNameCount, PayloadExtensionSystemCount; Info_L8(StartTime, "Start Time"); Param_Info_From_Milliseconds(StartTime); Info_L8(EndTime, "End Time"); Param_Info_From_Milliseconds(EndTime); Get_L4 (DataBitrate, "Data Bitrate"); Skip_L4( "Buffer Size"); Skip_L4( "Initial Buffer Fullness"); Skip_L4( "Alternate Data Bitrate"); Skip_L4( "Alternate Buffer Size"); Skip_L4( "Alternate Initial Buffer Fullness"); Skip_L4( "Maximum Object Size"); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Reliable"); Skip_Flags(Flags, 1, "Seekable"); Skip_Flags(Flags, 2, "No Cleanpoints"); Skip_Flags(Flags, 3, "Resend Live Cleanpoints"); Get_L2 (StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L2 (LanguageID, "Stream Language ID Index"); Get_L8 (AverageTimePerFrame, "Average Time Per Frame"); Get_L2 (StreamNameCount, "Stream Name Count"); Get_L2 (PayloadExtensionSystemCount, "Payload Extension System Count"); for (int16u Pos=0; Pos<StreamNameCount; Pos++) { Element_Begin1("Stream Name"); int16u StreamNameLength; Skip_L2( "Language ID Index"); Get_L2 (StreamNameLength, "Stream Name Length"); Skip_UTF16L(StreamNameLength, "Stream Name"); Element_End0(); } for (int16u Pos=0; Pos<PayloadExtensionSystemCount; Pos++) { Element_Begin1("Payload Extension System"); stream::payload_extension_system Payload_Extension_System; int32u ExtensionSystemInfoLength; Get_GUID(Payload_Extension_System.ID, "Extension System ID"); Get_L2 (Payload_Extension_System.Size, "Extension Data Size"); Get_L4 (ExtensionSystemInfoLength, "Extension System Info Length"); if (ExtensionSystemInfoLength>0) Skip_XX(ExtensionSystemInfoLength, "Extension System Info"); Element_End0(); //Filling Stream[StreamNumber].Payload_Extension_Systems.push_back(Payload_Extension_System); } //Header_StreamProperties if (Element_Offset<Element_Size) { //This could be everything, but in theory this is only Header_StreamProperties int128u Name; int64u Size; Element_Begin1("Stream Properties Object"); Element_Begin1("Header"); Get_GUID(Name, "Name"); Get_L8 (Size, "Size"); Element_End0(); if (Size>=24 && Element_Offset+Size-24==Element_Size) { switch (Name.hi) { case Elements::Header_StreamProperties : Header_StreamProperties(); break; default : Skip_XX(Size-24, "Unknown"); } } else Skip_XX(Element_Size-Element_Offset, "Problem"); Element_End0(); } //Filling stream& StreamItem = Stream[StreamNumber]; StreamItem.LanguageID=LanguageID; StreamItem.AverageBitRate=DataBitrate; StreamItem.AverageTimePerFrame=AverageTimePerFrame; } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_AdvancedMutualExclusion() { Element_Name("Advanced Mutual Exclusion"); //Parsing int16u Count; Info_GUID(ExclusionType, "Exclusion Type"); Param_Info1(Wm_ExclusionType(ExclusionType)); Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) { Info_L2(StreamNumber, "Stream Number"); Element_Info1(StreamNumber); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_GroupMutualExclusion() { Element_Name("Group Mutual Exclusion"); //Parsing Skip_XX(Element_Size, "Unknown"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_StreamPrioritization() { Element_Name("Stream Prioritization"); //Parsing int16u Count; Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) { int16u Flags; Element_Begin1("Stream"); Info_L2(StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L2 (Flags, "Flags"); Skip_Flags(Flags, 0, "Mandatory"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_BandwidthSharing() { Element_Name("Bandwidth Sharing"); //Parsing Skip_XX(Element_Size, "Unknown"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_LanguageList() { Element_Name("Language List"); //Parsing Ztring LanguageID; int16u Count; int8u LanguageID_Length; Get_L2 (Count, "Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Language ID"); Get_L1 (LanguageID_Length, "Language ID Length"); if (LanguageID_Length>0) { Get_UTF16L(LanguageID_Length, LanguageID, "Language ID"); Element_Info1(LanguageID); } Element_End0(); //Filling Languages.push_back(LanguageID); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_MetadataLibrary() { Element_Name("Metadata Library"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_Metadata() { Element_Name("Metadata"); //Parsing float32 AspectRatioX=0, AspectRatioY=0; int16u Count; Get_L2 (Count, "Description Records Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Description Record"); Ztring Name, Data; int64u Data_Int64=0; int32u Data_Length; int16u StreamNumber, Name_Length, Data_Type; Skip_L2( "Reserved"); Get_L2 (StreamNumber, "Stream Number"); Get_L2 (Name_Length, "Name Length"); Get_L2 (Data_Type, "Data Type"); Get_L4 (Data_Length, "Data Length"); Get_UTF16L(Name_Length, Name, "Name Length"); switch (Data_Type) { case 0x00 : Get_UTF16L(Data_Length, Data, "Data"); break; case 0x01 : Skip_XX(Data_Length, "Data"); Data=__T("(Binary)"); break; case 0x02 : {int16u Data_Int; Get_L2 (Data_Int, "Data"); Data=(Data_Int==0)?__T("No"):__T("Yes"); Data_Int64=Data_Int;} break; case 0x03 : {int32u Data_Int; Get_L4 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; case 0x04 : {int64u Data_Int; Get_L8 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; case 0x05 : {int16u Data_Int; Get_L2 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; default : Skip_XX(Data_Length, "Data"); Data=__T("(Unknown)"); break; } Element_Info1(Name); Element_Info1(Data); Element_End0(); if (Name==__T("IsVBR")) Stream[StreamNumber].Info["BitRate_Mode"]=(Data_Int64==0)?"CBR":"VBR"; else if (Name==__T("AspectRatioX")) { AspectRatioX=Data.To_float32(); if (AspectRatioX && AspectRatioY) Stream[StreamNumber].Info["PixelAspectRatio"].From_Number(AspectRatioX/AspectRatioY, 3); } else if (Name==__T("AspectRatioY")) { AspectRatioY=Data.To_float32(); if (AspectRatioX && AspectRatioY) Stream[StreamNumber].Info["PixelAspectRatio"].From_Number(AspectRatioX/AspectRatioY, 3); } else if (Name==__T("DeviceConformanceTemplate")) { if (Data!=__T("@") && Data.find(__T('@'))!=std::string::npos) Stream[StreamNumber].Info["Format_Profile"]=Data; } else if (Name==__T("WM/WMADRCPeakReference")) {} else if (Name==__T("WM/WMADRCAverageReference")) {} else if (Name==__T("WM/WMADRCAverageTarget")) {} else if (Name==__T("WM/WMADRCPeakTarget")) {} else Stream[StreamNumber].Info[Name.To_Local()]=Data; } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_IndexParameters() { Element_Name("Index Parameters"); //Parsing int16u Count; Skip_L4( "Index Entry Time Interval"); Get_L2 (Count, "Index Specifiers Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Index Specifier"); int16u IndexType; Skip_L2( "Stream Number"); Get_L2 (IndexType, "Index Type"); Element_Info1(IndexType); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_MediaIndexParameters() { Header_HeaderExtension_IndexParameters(); Element_Name("MediaIndex Parameters"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_TimecodeIndexParameters() { Header_HeaderExtension_IndexParameters(); Element_Name("Timecode Index Parameters"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_Compatibility() { Element_Name("Compatibility"); //Parsing Skip_L1( "Profile"); Skip_L1( "Mode"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_AdvancedContentEncryption() { Element_Name("Advanced Content Encryption"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_IndexPlaceholder() { Element_Name("Index Placeholder"); } //--------------------------------------------------------------------------- void File_Wm::Header_CodecList() { Element_Name("Codec List"); //Parsing Ztring CodecName, CodecDescription; int32u Count32; int16u Count, Type, CodecNameLength, CodecDescriptionLength, CodecInformationLength; Skip_GUID( "Reserved"); Get_L4 (Count32, "Codec Entries Count"); Count=(int16u)Count32; CodecInfos.resize(Count); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Codec Entry"); Get_L2 (Type, "Type"); Param_Info1(Wm_CodecList_Kind(Type)); Get_L2 (CodecNameLength, "Codec Name Length"); Get_UTF16L(CodecNameLength*2, CodecName, "Codec Name"); Get_L2 (CodecDescriptionLength, "Codec Description Length"); Get_UTF16L(CodecDescriptionLength*2, CodecDescription, "Codec Description"); Get_L2 (CodecInformationLength, "Codec Information Length"); if (Type==2 && CodecInformationLength==2) //Audio and 2CC Skip_L2( "2CC"); //Not used, we have it elsewhere else if (Type==1 && CodecInformationLength==4) //Video and 4CC Skip_C4( "4CC"); //Not used, we have it elsewhere else Skip_XX(CodecInformationLength, "Codec Information"); Element_End0(); FILLING_BEGIN(); CodecInfos[Pos].Type=Type; CodecInfos[Pos].Info=CodecName; if (!CodecDescription.empty()) { CodecInfos[Pos].Info+=__T(" - "); CodecInfos[Pos].Info+=CodecDescription; } Codec_Description_Count++; FILLING_END(); } } //--------------------------------------------------------------------------- void File_Wm::Header_ScriptCommand() { Element_Name("Script Command"); //Parsing Skip_GUID( "Reserved"); int16u Commands_Count, CommandTypes_Count; Get_L2 (Commands_Count, "Commands Count"); Get_L2 (CommandTypes_Count, "Command Types Count"); for (int16u Pos=0; Pos<CommandTypes_Count; Pos++) { Element_Begin1("Command Type"); int16u Length; Get_L2 (Length, "Command Type Length"); if (Length>0) Skip_UTF16L(Length*2, "Command Type"); Element_End0(); } for (int16u Pos=0; Pos<Commands_Count; Pos++) { Element_Begin1("Command"); int16u Length; Skip_L2( "Type Index"); Get_L2 (Length, "Command Length"); if (Length>0) Skip_UTF16L(Length*2, "Command"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_Marker() { Element_Name("Markers"); //Parsing Skip_GUID( "Reserved"); int32u Markers_Count; int16u Name_Length; Get_L4 (Markers_Count, "Markers Count"); Skip_L2( "Reserved"); Get_L2 (Name_Length, "Name Length"); if (Name_Length>0) Skip_UTF16L(Name_Length, "Name"); //Filling if (Markers_Count>0) Stream_Prepare(Stream_Menu); //Parsing for (int32u Pos=0; Pos<Markers_Count; Pos++) { Element_Begin1("Marker"); Ztring Marker; int32u Marker_Length; Skip_L8( "Offset"); Info_L8(PresentationTime, "Presentation Time"); Param_Info_From_Milliseconds(PresentationTime/10000); Skip_L2( "Entry Length"); Info_L4(SendTime, "Send Time"); Param_Info_From_Milliseconds(SendTime); Skip_L4( "Flags"); Get_L4 (Marker_Length, "Marker Description Length"); if (Marker_Length>0) Get_UTF16L(Marker_Length*2, Marker, "Marker Description"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_BitRateMutualExclusion() { Element_Name("BitRate Mutual Exclusion"); //Parsing int16u Count; Skip_GUID( "Exclusion Type"); Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) Skip_L2( "Stream Number"); } //--------------------------------------------------------------------------- void File_Wm::Header_ErrorCorrection() { Element_Name("Error Correction"); } //--------------------------------------------------------------------------- void File_Wm::Header_ContentDescription() { Element_Name("Content Description"); //Parsing Ztring Title, Author, Copyright, Description, Rating; int16u TitleLength, AuthorLength, CopyrightLength, DescriptionLength, RatingLength; Get_L2 (TitleLength, "TitleLength"); Get_L2 (AuthorLength, "AuthorLength"); Get_L2 (CopyrightLength, "CopyrightLength"); Get_L2 (DescriptionLength, "DescriptionLength"); Get_L2 (RatingLength, "RatingLength"); if (TitleLength>0) Get_UTF16L(TitleLength, Title, "Title"); if (AuthorLength>0) Get_UTF16L(AuthorLength, Author, "Author"); if (CopyrightLength>0) Get_UTF16L(CopyrightLength, Copyright, "Copyright"); if (DescriptionLength>0) Get_UTF16L(DescriptionLength, Description, "Description"); if (RatingLength>0) Get_UTF16L(RatingLength, Rating, "Rating"); //Filling Fill(Stream_General, 0, General_Title, Title); Fill(Stream_General, 0, General_Performer, Author); Fill(Stream_General, 0, General_Copyright, Copyright); Fill(Stream_General, 0, General_Comment, Description); Fill(Stream_General, 0, General_Rating, Rating); } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentDescription() { Element_Name("Extended Content Description"); //Parsing int16u Count; Get_L2 (Count, "Content Descriptors Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Content Descriptor"); Ztring Name, Value; int64u Value_Int64=0; int16u Name_Length, Value_Type, Value_Length; Get_L2 (Name_Length, "Name Length"); Get_UTF16L(Name_Length, Name, "Name"); Get_L2 (Value_Type, "Value Data Type"); Get_L2 (Value_Length, "Value Length"); switch (Value_Type) { case 0x00 : Get_UTF16L(Value_Length, Value, "Value"); break; case 0x01 : if (Name==__T("ASFLeakyBucketPairs")) Header_ExtendedContentDescription_ASFLeakyBucketPairs(Value_Length); else {Skip_XX(Value_Length, "Value"); Value=__T("(Binary)");} break; case 0x02 : {int32u Value_Int; Get_L4 (Value_Int, "Value"); Value=(Value_Int==0)?__T("No"):__T("Yes"); Value_Int64=Value_Int;} break; case 0x03 : {int32u Value_Int; Get_L4 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; case 0x04 : {int64u Value_Int; Get_L8 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; case 0x05 : {int16u Value_Int; Get_L2 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; default : Skip_XX(Value_Length, "Value"); Value=__T("(Unknown)"); break; } Element_Info1(Name); Element_Info1(Value); Element_End0(); //Filling if (!Value.empty()) { if (Name==__T("Agility FPS")) {} else if (Name==__T("ASFLeakyBucketPairs")) {} //Already done elsewhere else if (Name==__T("AspectRatioX")) Header_ExtendedContentDescription_AspectRatioX=Value_Int64; else if (Name==__T("AspectRatioY")) Header_ExtendedContentDescription_AspectRatioY=Value_Int64; else if (Name==__T("Buffer Average")) {} else if (Name==__T("DVR Index Granularity")) {} else if (Name==__T("DVR File Version")) {} else if (Name==__T("IsVBR")) Fill(Stream_General, 0, General_OverallBitRate_Mode, Value_Int64==0?"CBR":"VBR"); else if (Name==__T("VBR Peak")) {} //Already in "Stream Bitrate" chunk else if (Name==__T("WMFSDKVersion")) {} else if (Name==__T("WMFSDKNeeded")) {} else if (Name==__T("WM/AlbumTitle")) Fill(Stream_General, 0, General_Album, Value); else if (Name==__T("WM/AlbumArtist")) { const Ztring& Previous=Retrieve(Stream_General, 0, General_Performer); if (!Previous.empty() && Previous != Value) Fill(Stream_General, 0, General_Accompaniment, Previous); // Microsoft "Contributing artists" Fill(Stream_General, 0, General_Performer, Value, true); } else if (Name==__T("WM/ArtistSortOrder")) Fill(Stream_General, 0, General_Performer_Sort, Value); else if (Name==__T("WM/AuthorURL")) Fill(Stream_General, 0, "Author/Url", Value); else if (Name==__T("WM/BeatsPerMinute")) Fill(Stream_General, 0, General_BPM, Value); else if (Name==__T("WM/Binary")) Fill(Stream_General, 0, General_Cover, "Y"); else if (Name==__T("WM/Comments")) Fill(Stream_General, 0, General_Comment, Value, true); //Clear last value else if (Name==__T("WM/Composer")) Fill(Stream_General, 0, General_Composer, Value); else if (Name==__T("WM/Conductor")) Fill(Stream_General, 0, General_Conductor, Value); else if (Name==__T("WM/EncodedBy")) Fill(Stream_General, 0, General_EncodedBy, Value); else if (Name==__T("WM/EncoderSettings")) Fill(Stream_General, 0, General_Encoded_Library_Settings, Value); else if (Name==__T("WM/EncodingTime")) { Ztring Encoded_Date_New=Ztring().Date_From_Seconds_1601(Value_Int64/10000000); const Ztring& Encoded_Date_Old=Retrieve_Const(Stream_General, 0, General_Encoded_Date); if (Encoded_Date_Old.empty() || Encoded_Date_New!=Encoded_Date_Old) Fill(Stream_General, 0, General_Encoded_Date, Encoded_Date_New); } else if (Name==__T("WM/Genre")) Fill(Stream_General, 0, General_Genre, Value, true); //Clear last value else if (Name==__T("WM/GenreID")) { if (Retrieve(Stream_General, 0, General_Genre).empty()) Fill(Stream_General, 0, General_Genre, Value); } else if (Name==__T("WM/Language")) Language_ForAll=Value; else if (Name==__T("WM/MediaCredits")) Fill(Stream_General, 0, General_ThanksTo, Value); else if (Name==__T("WM/MediaPrimaryClassID")) {} else if (Name==__T("WM/MCDI")) {} else if (Name==__T("WM/ModifiedBy")) Fill(Stream_General, 0, General_RemixedBy, Value); else if (Name==__T("WM/OriginalAlbumTitle")) Fill(Stream_General, 0, "Original/Album", Value); else if (Name==__T("WM/OriginalReleaseTime")) Fill(Stream_General, 0, "Original/Released_Date", Value); else if (Name==__T("WM/ParentalRating")) Fill(Stream_General, 0, General_LawRating, Value); else if (Name==__T("WM/ParentalRatingReason")) Fill(Stream_General, 0, General_LawRating_Reason, Value); else if (Name==__T("WM/Picture")) Fill(Stream_General, 0, General_Cover, "Y"); else if (Name==__T("WM/Provider")) Fill(Stream_General, 0, "Provider", Value); else if (Name==__T("WM/Publisher")) Fill(Stream_General, 0, General_Publisher, Value); else if (Name==__T("WM/RadioStationName")) Fill(Stream_General, 0, General_ServiceName, Value); else if (Name==__T("WM/RadioStationOwner")) Fill(Stream_General, 0, General_ServiceProvider, Value); else if (Name==__T("WM/SubTitle")) Fill(Stream_General, 0, General_Title_More, Value); else if (Name==__T("WM/SubTitleDescription")) Fill(Stream_General, 0, General_Title_More, Value); else if (Name==__T("WM/ToolName")) Fill(Stream_General, 0, General_Encoded_Application, Value); else if (Name==__T("WM/ToolVersion")) Fill(Stream_General, 0, General_Encoded_Application, Retrieve(Stream_General, 0, General_Encoded_Application)+__T(" ")+Value, true); else if (Name==__T("WM/TrackNumber")) Fill(Stream_General, 0, General_Track_Position, Value, true); //Clear last value, like WM/Track else if (Name==__T("WM/Track")) { if (Retrieve(Stream_General, 0, General_Track_Position).empty()) Fill(Stream_General, 0, General_Track_Position, Value.To_int32u()+1); } else if (Name==__T("WM/UniqueFileIdentifier")) { if (Value.empty() || Value[0]!=__T(';')) //Test if there is only the separator { Value.FindAndReplace(__T(";"), MediaInfoLib::Config.TagSeparator_Get()); Fill(Stream_General, 0, General_UniqueID, Value); } } else if (Name==__T("WM/Writer")) Fill(Stream_General, 0, General_WrittenBy, Value); else if (Name==__T("WM/Year")) Fill(Stream_General, 0, General_Recorded_Date, Value); else Fill(Stream_General, 0, Name.To_Local().c_str(), Value); } } } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentDescription_ASFLeakyBucketPairs(int16u Value_Length) { Element_Begin1("ASFLeakyBucketPairs"); Skip_L2( "Reserved"); for (int16u Pos=2; Pos<Value_Length; Pos+=8) { Element_Begin1("Bucket"); Skip_L4( "BitRate"); Skip_L4( "msBufferWindow"); Element_End0(); } Element_End0(); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamBitRate() { Element_Name("Stream Bitrate"); //Parsing int16u Count; Get_L2 (Count, "Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Stream"); int32u AverageBitRate; int16u StreamNumber; Get_L2 (StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L4 (AverageBitRate, "Average Bitrate"); Element_Info1(AverageBitRate); Element_End0(); //Filling stream& StreamItem = Stream[StreamNumber]; if (StreamItem.AverageBitRate==0) //Prefere Average bitrate of Extended Stream Properties if present StreamItem.AverageBitRate=AverageBitRate; } } //--------------------------------------------------------------------------- void File_Wm::Header_ContentBranding() { Element_Name("Content Branding"); //Parsing Ztring CopyrightURL, BannerImageURL; int32u BannerImageData_Type, BannerImageData_Length, BannerImageURL_Length, CopyrightURL_Length; Get_L4 (BannerImageData_Type, "Banner Image Data Type"); Param_Info1(Wm_BannerImageData_Type(BannerImageData_Type)); Get_L4 (BannerImageData_Length, "Banner Image Data Length"); if (BannerImageData_Length>0) Skip_XX(BannerImageData_Length, "Banner Image Data"); Get_L4 (BannerImageURL_Length, "Banner Image URL Length"); if (BannerImageURL_Length>0) Get_Local(BannerImageURL_Length, BannerImageURL, "Banner Image URL"); Get_L4 (CopyrightURL_Length, "Copyright URL Length"); if (CopyrightURL_Length>0) Get_Local(CopyrightURL_Length, CopyrightURL, "Copyright URL"); } //--------------------------------------------------------------------------- void File_Wm::Header_ContentEncryption() { Element_Name("Content Encryption"); //Parsing Ztring LicenseURL; int32u SecretDataLength, ProtectionTypeLength, KeyIDLength, LicenseURLLength; Get_L4 (SecretDataLength, "Secret Data Length"); Skip_XX(SecretDataLength, "Secret Data"); Get_L4 (ProtectionTypeLength, "Protection Type Length"); Skip_Local(ProtectionTypeLength, "Protection Type"); Get_L4 (KeyIDLength, "Key ID Length"); Skip_Local(KeyIDLength, "Key ID Type"); Get_L4 (LicenseURLLength, "License URL Length"); Get_Local(LicenseURLLength, LicenseURL, "License URL"); //Filling Fill(Stream_General, 0, "Encryption", LicenseURL); } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentEncryption() { Element_Name("Extended Content Encryption"); //Parsing int32u DataLength; Get_L4 (DataLength, "Data Length"); Skip_XX(DataLength, "Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_DigitalSignature() { Element_Name("Digital Signature"); //Parsing int32u DataLength; Skip_L4( "Signature Type"); Get_L4 (DataLength, "Signature Data Length"); Skip_XX(DataLength, "Signature Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_Padding() { Element_Name("Padding"); //Parsing Skip_XX(Element_Size, "Padding"); } //--------------------------------------------------------------------------- void File_Wm::Data() { Element_Name("Data"); //Parsing Skip_GUID( "File ID"); Skip_L8( "Total Data Packets"); Skip_L1( "Alignment"); Skip_L1( "Packet Alignment"); //Filling Fill(Stream_General, 0, General_HeaderSize, File_Offset+Buffer_Offset-24); Fill(Stream_General, 0, General_DataSize, Element_TotalSize_Get()+24); //For each stream Streams_Count=0; std::map<int16u, stream>::iterator Temp=Stream.begin(); while (Temp!=Stream.end()) { #if defined(MEDIAINFO_MPEGA_YES) if (IsDvrMs && !Temp->second.Parser && Temp->second.AverageBitRate>=32768) { Temp->second.Parser=new File_Mpega; //No stream properties, trying to detect it in datas... ((File_Mpega*)Temp->second.Parser)->Frame_Count_Valid=8; Open_Buffer_Init(Temp->second.Parser); } #endif if (Temp->second.Parser || Temp->second.StreamKind==Stream_Video) //We need Stream_Video for Frame_Rate computing { Temp->second.SearchingPayload=true; Streams_Count++; } ++Temp; } //Enabling the alternative parser MustUseAlternativeParser=true; Data_AfterTheDataChunk=File_Offset+Buffer_Offset+Element_TotalSize_Get(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet() { //Counting Packet_Count++; Element_Info1(Packet_Count); size_t Element_Show_Count=0; //Parsing int32u PacketLength=0, SizeOfMediaObject=0; int8u Flags, ErrorCorrectionData_Length, ErrorCorrectionLengthType, SequenceType, PaddingLengthType, PacketLengthType; bool ErrorCorrectionPresent; Element_Begin1("Error Correction"); Get_L1 (Flags, "Flags"); Get_FlagsM(Flags&0x0F, ErrorCorrectionData_Length, "Error Correction Data Length"); //4 lowest bits Skip_Flags(Flags, 4, "Opaque Data Present"); Get_FlagsM((Flags>>5)&0x03, ErrorCorrectionLengthType, "Error Correction Length Type"); //bits 6 and 7 Get_Flags (Flags, 7, ErrorCorrectionPresent, "Error Correction Present"); if (ErrorCorrectionPresent && ErrorCorrectionLengthType==0 && ErrorCorrectionData_Length==2) { int8u TypeNumber; Get_L1 (TypeNumber, "Type/Number"); Skip_FlagsM((TypeNumber>>4)&0x0F, "Type"); Skip_FlagsM( TypeNumber &0x0F, "Number"); Skip_L1( "Cycle"); } Element_End0(); Element_Begin1("Payload Parsing Information"); Get_L1 (Flags, "Length Type Flags"); Get_Flags (Flags, 0, MultiplePayloadsPresent, "Multiple Payloads Present"); Get_FlagsM((Flags>>1)&0x3, SequenceType, "Sequence Type"); Get_FlagsM((Flags>>3)&0x3, PaddingLengthType, "Padding Length Type"); Get_FlagsM((Flags>>5)&0x3, PacketLengthType, "Packet Length Type"); Skip_Flags(Flags, 7, "Error Correction Present"); Get_L1 (Flags, "Property Flags"); Get_FlagsM( Flags &0x3, ReplicatedDataLengthType, "Replicated Data Length Type"); Get_FlagsM((Flags>>2)&0x3, OffsetIntoMediaObjectLengthType, "Offset Into Media Object Length Type"); Get_FlagsM((Flags>>4)&0x3, MediaObjectNumberLengthType, "Media Object Number Length Type"); Get_FlagsM((Flags>>6)&0x3, StreamNumberLengthType, "Stream Number Length Type"); switch (PacketLengthType) { case 1 : {int8u Data; Get_L1(Data, "Packet Length"); PacketLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Packet Length"); PacketLength=Data;} break; case 3 : Get_L4(PacketLength, "Packet Length"); break; default: ; } switch (SequenceType) { case 1 : Skip_L1( "Sequence"); break; case 2 : Skip_L2( "Sequence"); break; case 3 : Skip_L4( "Sequence"); break; default: ; } switch (PaddingLengthType) { case 1 : {int8u Data; Get_L1(Data, "Padding Length"); Data_Parse_Padding=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Padding Length"); Data_Parse_Padding=Data;} break; case 3 : Get_L4(Data_Parse_Padding, "Padding Length"); break; default: Data_Parse_Padding=0; } Skip_L4( "Send Time"); Skip_L2( "Duration"); Element_End0(); if (MultiplePayloadsPresent) { //Parsing Element_Begin1("Multiple Payloads additional flags"); int8u AdditionalFlags; Get_L1 (AdditionalFlags, "Flags"); Get_FlagsM( AdditionalFlags &0x3F, NumberPayloads, "Number of Payloads"); //6 bits Get_FlagsM((AdditionalFlags>>6)&0x03, PayloadLengthType, "Payload Length Type"); //bits 6 and 7 Element_End0(); } else { SizeOfMediaObject=(int32u)(Element_Size-Element_Offset-Data_Parse_Padding); NumberPayloads=1; } for (NumberPayloads_Pos=0; NumberPayloads_Pos<NumberPayloads; NumberPayloads_Pos++) { Element_Begin1("Payload"); int32u ReplicatedDataLength=0, PayloadLength=0; int8u StreamNumber; Get_L1 (StreamNumber, "Stream Number"); Stream_Number=StreamNumber&0x7F; //For KeyFrame Element_Info1(Stream_Number); switch (MediaObjectNumberLengthType) { case 1 : Skip_L1( "Media Object Number"); break; case 2 : Skip_L2( "Media Object Number"); break; case 3 : Skip_L4( "Media Object Number"); break; default: Trusted_IsNot("Media Object Number"); return; //Problem } switch (OffsetIntoMediaObjectLengthType) { case 1 : Skip_L1( "Offset Into Media Object"); break; case 2 : Skip_L2( "Offset Into Media Object"); break; case 3 : Skip_L4( "Offset Into Media Object"); break; default: Trusted_IsNot("Offset Into Media Object"); return; //Problem } switch (ReplicatedDataLengthType) { case 1 : {int8u Data; Get_L1(Data, "Replicated Data Length"); ReplicatedDataLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Replicated Data Length"); ReplicatedDataLength=Data;} break; case 3 : Get_L4(ReplicatedDataLength, "Replicated Data Length"); break; default: Trusted_IsNot("Replicated Data Length"); return; //Problem } if (ReplicatedDataLengthType!=0 && ReplicatedDataLength>0) { if (ReplicatedDataLength>=8) { int32u PresentationTime; Get_L4 (SizeOfMediaObject, "Size Of Media Object"); Get_L4 (PresentationTime, "Presentation Time"); if (ReplicatedDataLength>8) Data_Packet_ReplicatedData(ReplicatedDataLength-8); //Presentation time delta std::map<int16u, stream>::iterator Strea=Stream.find(Stream_Number); if (Strea!=Stream.end() && Strea->second.StreamKind==Stream_Video) { Strea->second.PresentationTimes.insert(PresentationTime); } } else if (ReplicatedDataLength==1) { Skip_L1( "Presentation Time Delta"); //TODO } else { Skip_XX(ReplicatedDataLength, "Replicated Data"); } } if (MultiplePayloadsPresent) { switch (PayloadLengthType) { case 1 : {int8u Data; Get_L1(Data, "Payload Length"); PayloadLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Payload Length"); PayloadLength=Data;} break; case 3 : Get_L4(PayloadLength, "Payload Length"); break; default: Trusted_IsNot("Payload Length"); return; //Problem } } else if (Element_Size-Element_Offset>Data_Parse_Padding) PayloadLength=(int32u)(Element_Size-(Element_Offset+Data_Parse_Padding)); else { Trusted_IsNot("Padding size problem"); } if (Element_Offset+PayloadLength+Data_Parse_Padding>Element_Size) { Trusted_IsNot("Payload Length problem"); } else { //Demux Element_Code=Stream_Number; Demux(Buffer+(size_t)Element_Offset, (size_t)PayloadLength, ContentType_MainStream); //Analyzing stream& StreamItem = Stream[Stream_Number]; if (StreamItem.Parser && StreamItem.SearchingPayload) { //Handling of spanned on multiple chunks #if defined(MEDIAINFO_VC1_YES) bool FrameIsAlwaysComplete=true; #endif if (PayloadLength!=SizeOfMediaObject) { if (SizeOfMediaObject_BytesAlreadyParsed==0) SizeOfMediaObject_BytesAlreadyParsed=SizeOfMediaObject-PayloadLength; else SizeOfMediaObject_BytesAlreadyParsed-=PayloadLength; if (SizeOfMediaObject_BytesAlreadyParsed==0) Element_Show_Count++; #if defined(MEDIAINFO_VC1_YES) else FrameIsAlwaysComplete=false; #endif } else Element_Show_Count++; //Codec specific #if defined(MEDIAINFO_VC1_YES) if (Retrieve(StreamItem.StreamKind, StreamItem.StreamPos, Fill_Parameter(StreamItem.StreamKind, Generic_Format))==__T("VC-1")) ((File_Vc1*)StreamItem.Parser)->FrameIsAlwaysComplete=FrameIsAlwaysComplete; #endif Open_Buffer_Continue(StreamItem.Parser, (size_t)PayloadLength); if (StreamItem.Parser->Status[IsFinished] || (StreamItem.PresentationTimes.size()>=300 && Config->ParseSpeed<1.0)) { StreamItem.Parser->Open_Buffer_Unsynch(); StreamItem.SearchingPayload=false; Streams_Count--; } Element_Show(); } else { Skip_XX(PayloadLength, "Data"); if (StreamItem.SearchingPayload && (StreamItem.StreamKind==Stream_Video && StreamItem.PresentationTimes.size()>=300)) { StreamItem.SearchingPayload=false; Streams_Count--; } } } Element_End0(); } if (Data_Parse_Padding) Skip_XX(Data_Parse_Padding, "Padding"); //Jumping if needed if (Streams_Count==0 || (Packet_Count>=1000 && Config->ParseSpeed<1.0)) { Info("Data, Jumping to end of chunk"); GoTo(Data_AfterTheDataChunk, "Windows Media"); } if (Element_Show_Count>0) Element_Show(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet_ReplicatedData(int32u Size) { Element_Begin1("Replicated Data"); int64u Element_Offset_Final=Element_Offset+Size; stream& StreamItem = Stream[Stream_Number]; for (size_t Pos=0; Pos<StreamItem.Payload_Extension_Systems.size(); Pos++) { Element_Begin0(); switch (StreamItem.Payload_Extension_Systems[Pos].ID.hi) { case Elements::Payload_Extension_System_TimeStamp : Data_Packet_ReplicatedData_TimeStamp(); break; default : //Not enough info to validate this algorithm //if (StreamItem.Payload_Extension_Systems[Pos].Size!=(int16u)-1) //{ // Element_Name("Unknown"); // Skip_XX(StreamItem.Payload_Extension_Systems[Pos].Size, "Unknown"); //} //else Pos=StreamItem.Payload_Extension_Systems.size(); //Disabling the rest, all is unknown } Element_End0(); } if (Element_Offset<Element_Offset_Final) { Element_Begin1("Other chunks"); Skip_XX(Element_Offset_Final-Element_Offset, "Unknown"); Element_End0(); } Element_End0(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet_ReplicatedData_TimeStamp() { Element_Name("TimeStamp"); //Parsing int64u TS0; Skip_L2( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); Get_L8 (TS0, "TS0"); #if MEDIAINFO_TRACE if (TS0!=(int64u)-1) Param_Info1(TS0/10000); #endif //MEDIAINFO_TRACE Info_L8(TS1, "TS1"); #if MEDIAINFO_TRACE if (TS1!=(int64u)-1) Param_Info1(TS1/10000); #endif //MEDIAINFO_TRACE Skip_L4( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); stream& StreamItem = Stream[Stream_Number]; if (StreamItem.TimeCode_First==(int64u)-1 && TS0!=(int64u)-1) StreamItem.TimeCode_First=TS0/10000; } //--------------------------------------------------------------------------- void File_Wm::SimpleIndex() { Element_Name("Simple Index"); //Parsing /* int32u Count; Skip_GUID( "File ID"); Skip_L8( "Index Entry Time Interval"); Skip_L4( "Maximum Packet Count"); Get_L4 (Count, "Index Entries Count"); for (int32u Pos=0; Pos<Count; Pos++) { Element_Begin1("Index Entry", 6); int32u PacketNumber; int16u PacketCount; Get_L4 (PacketNumber, "Packet Number"); Get_L2 (PacketCount, "Packet Count"); Element_End0(); } */ Skip_XX(Element_TotalSize_Get()-Element_Offset, "Indexes"); } //--------------------------------------------------------------------------- void File_Wm::Index() { Element_Name("Index"); //Parsing /* int32u Blocks_Count; int16u Specifiers_Count; Skip_L4( "Index Entry Time Interval"); Get_L2 (Specifiers_Count, "Index Specifiers Count"); Get_L4 (Blocks_Count, "Index Blocks Count"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) { Element_Begin1("Specifier"); Skip_L2( "Stream Number"); Skip_L2( "Index Type"); Element_End0(); } for (int32u Pos=0; Pos<Blocks_Count; Pos++) { Element_Begin1("Block"); int32u Entry_Count; Get_L4 (Entry_Count, "Index Entry Count"); Element_Begin1("Block Positions"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) Skip_L4( "Position"); Element_End0(); for (int32u Pos=0; Pos<Entry_Count; Pos++) { Element_Begin1("Entry"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) Skip_L4( "Offset"); Element_End0(); } Element_End0(); } */ Skip_XX(Element_TotalSize_Get()-Element_Offset, "Indexes"); } //--------------------------------------------------------------------------- void File_Wm::MediaIndex() { Element_Name("MediaIndex"); } //--------------------------------------------------------------------------- void File_Wm::TimecodeIndex() { Element_Name("Timecode Index"); //Parsing int32u TimeCode_First=(int32u)-1; int32u IndexBlocksCount; int16u IndexSpecifiersCount; Skip_L4( "Reserved"); Get_L2 (IndexSpecifiersCount, "Index Specifiers Count"); Get_L4 (IndexBlocksCount, "Index Blocks Count"); Element_Begin1("Index Specifiers"); for (int16u Pos=0; Pos<IndexSpecifiersCount; ++Pos) { Element_Begin1("Index Specifier"); Skip_L2( "Stream Number"); Info_L2(IndexType, "Index Type"); Element_Info1(IndexType); Element_End0(); } Element_End0(); Element_Begin1("Index Blocks"); for (int16u Pos=0; Pos<IndexBlocksCount; ++Pos) { Element_Begin1("Index Block"); int32u IndexEntryCount; Get_L4 (IndexEntryCount, "Index Entry Count"); Skip_L2( "Timecode Range"); Element_Begin1("Block Positions"); for (int16u Pos=0; Pos<IndexSpecifiersCount; ++Pos) Skip_L8( "Block Position"); Element_End0(); Element_Begin1("Index Entries"); for (int32u Pos=0; Pos<IndexEntryCount; ++Pos) { Element_Begin1("Index Entry"); if (TimeCode_First==(int32u)-1) Get_L4 (TimeCode_First, "Timecode"); else Skip_L4( "Timecode"); for (int16u Pos=0; Pos<IndexSpecifiersCount; ++Pos) Skip_L4( "Offsets"); Element_End0(); } Element_End0(); Element_End0(); } Element_End0(); FILLING_BEGIN(); Stream_Prepare(Stream_Other); Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code"); Fill(Stream_Other, StreamPos_Last, Other_Format, "WM TC"); if (TimeCode_First!=(int32u)-1) { int8u H1= TimeCode_First>>28; int8u H2=(TimeCode_First>>24)&0xF; int8u M1=(TimeCode_First>>20)&0xF; int8u M2=(TimeCode_First>>16)&0xF; int8u S1=(TimeCode_First>>12)&0xF; int8u S2=(TimeCode_First>> 8)&0xF; int8u F1=(TimeCode_First>> 4)&0xF; int8u F2= TimeCode_First &0xF; if (H1<10 && H2<10 && M1<10 && M2<10 && S1<10 && S2<10 && F1<10 && F2<10) { string TC; TC+='0'+H1; TC+='0'+H2; TC+=':'; TC+='0'+M1; TC+='0'+M2; TC+=':'; TC+='0'+S1; TC+='0'+S2; TC+=':'; TC+='0'+F1; TC+='0'+F2; Fill(Stream_Other, StreamPos_Last, Other_TimeCode_FirstFrame, TC.c_str()); } } FILLING_END(); } //*************************************************************************** // C++ //*************************************************************************** } //NameSpace #endif //MEDIAINFO_WM_YES
pavel-pimenov/flylinkdc-r5xx
MediaInfoLib/Source/MediaInfo/Multiple/File_Wm_Elements.cpp
C++
gpl-2.0
86,075
'use strict'; function solve(args) { var $number = +args[0]; var $significantBit = $number => (($number >> 3) & 1); console.log($significantBit($number)); } solve(['15']); solve(['1024']);
iDonev/JavaScript-Fundamentals
Lecture 5. Operators and Expressions/ThirdBit.js
JavaScript
gpl-2.0
199
<?php /** * Created by PhpStorm. * User: jantonio * Date: 21/10/15 * Time: 14:11 */ require_once ("../modules/Federations.php"); $feds=Federations::getFederationList(); foreach($feds as $fed) { echo "ID:{$fed['ID']} : {$fed['LongName']}\n"; // print_r($fed); } ?>
nedy13/AgilityContest
agility/tests/Federation_test.php
PHP
gpl-2.0
276
/*********************************************************************** Mosaicker - Program to reproject, resample, and join a set of georeferenced color images into a single multiresolution mosaic image. Copyright (c) 2007-2008 Oliver Kreylos This file is part of the DEM processing and visualization package. The DEM processing and visualization package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The DEM processing and visualization package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the DEM processing and visualization package; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #include <cstdlib> #include <cstring> #include <stdexcept> #include <iostream> #include <construo/Builder.h> #include <crustacore/LayerData.h> using namespace crusta; int main(int argc, char* argv[]) { enum BuildType { UNDEFINED_BUILD, DEM_BUILD, COLORTEXTURE_BUILD, LAYERF_BUILD }; //- Parse the command line //flag whether to create color or DEM mosaics BuildType buildType = UNDEFINED_BUILD; /* the current offset value to be applied to values of the input data. This value can be changed on the command line during parsing by using the -offset flag */ double offset = 0.0; /* the current scaling factor to be applied to values of the input data. This value can be changed on the command line during parsing by using the -scale flag */ double scale = 1.0; /* the current grid type flag, defaults to area sampling */ bool pointSampled = false; /* the current nodata string, initialized to the empty string */ std::string nodata; //the tile size should only be an internal parameter static const size_t tileSize[2] = {TILE_RESOLUTION, TILE_RESOLUTION}; std::string globeFileName; std::string settingsFileName; BuilderBase::ImagePatchSources imageSources; for (int i=1; i<argc; ++i) { if (strcasecmp(argv[i], "-dem") == 0) { //create/update a color texture spheroid buildType = DEM_BUILD; ++i; if (i<argc) { globeFileName = std::string(argv[i]); } else { std::cerr << "Dangling globe file name argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-color") == 0) { //create/update a color texture spheroid buildType = COLORTEXTURE_BUILD; //read the spheroid filename ++i; if (i<argc) { globeFileName = std::string(argv[i]); } else { std::cerr << "Dangling globe file name argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-layerf") == 0) { //create/update a color texture spheroid buildType = LAYERF_BUILD; //read the spheroid filename ++i; if (i<argc) { globeFileName = std::string(argv[i]); } else { std::cerr << "Dangling globe file name argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-offset") == 0) { //read the offset for the following input data ++i; if (i<argc) { offset = atof(argv[i]); } else { std::cerr << "Dangling offset argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-noOffset") == 0) { offset = 0.0; } else if (strcasecmp(argv[i], "-scale") == 0) { //read the scale for the following input data ++i; if (i<argc) { scale = atof(argv[i]); } else { std::cerr << "Dangling scale argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-noScale") == 0) { scale = 1.0; } else if (strcasecmp(argv[i], "-nodata") == 0) { //read the nodata value string for the following input data ++i; if (i<argc) { nodata = std::string(argv[i]); } else { std::cerr << "Dangling 'nodata' argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-defaultNodata") == 0) { nodata = ""; } else if (strcasecmp(argv[i], "-pointsampling") == 0) { pointSampled = true; } else if (strcasecmp(argv[i], "-areasampling") == 0) { pointSampled = false; } else if (strcasecmp(argv[i], "-settings") == 0) { //read the settings filename ++i; if (i<argc) { settingsFileName = std::string(argv[i]); } else { std::cerr << "Dangling configuration file name argument" << std::endl; return 1; } } else if (strcasecmp(argv[i], "-version") == 0 || strcasecmp(argv[i], "-v") == 0) { std::cout << "Construo version: " << CRUSTA_VERSION << std::endl; return 0; } else { //gather the image patch name and scale factor for the values imageSources.push_back(BuilderBase::ImagePatchSource( argv[i], offset, scale, nodata, pointSampled)); } } if (buildType == UNDEFINED_BUILD) { std::cerr << "Usage:\nconstruo -dem | -color | -layerf <globe file " "name> [-offset <scalar> | -noOffset] [-scale <scalar> | " "-noScale] [-nodata <value> | -defaultNodata] " "[-pointsampling] [-areasampling] [-settings <settings " "file>] [-version] <input files>\n"; return 1; } if (globeFileName.empty()) { std::cerr << "No globe file name provided" << std::endl; return 1; } else { //remove trailing slashes while (globeFileName[globeFileName.size()-1] == '/') globeFileName.resize(globeFileName.size()-1); } if (imageSources.empty()) { std::cerr << "No data sources provided" << std::endl; return 1; } CONSTRUO_SETTINGS.loadFromFile(settingsFileName); //reate the builder object BuilderBase* builder = NULL; switch (buildType) { case DEM_BUILD: builder = new Builder<DemHeight>(globeFileName, tileSize); break; case COLORTEXTURE_BUILD: builder = new Builder<TextureColor>(globeFileName, tileSize); break; case LAYERF_BUILD: builder = new Builder<LayerDataf>(globeFileName, tileSize); break; default: std::cerr << "Unsupported build type" << std::endl; return 1; break; } builder->addImagePatches(imageSources); //update the spheroid builder->update(); //clean up and return delete builder; return 0; }
KeckCAVES/crusta
src/construo/Construo.cpp
C++
gpl-2.0
8,225
package controllers; import play.mvc.*; public class PublicMementoControl extends Controller { public static Result getRandomMemento(String lang) { /** @TODO */ return TODO; } public static Result getMemento(Long mid) { /** @TODO */ return TODO; } public static Result getMementoList(Long decade, String place, String lat, String lon, String rad, String lang) { /** @TODO */ return TODO; } }
cdparra/reminiscens-lifeapi
app/controllers/PublicMementoControl.java
Java
gpl-2.0
429
<?php /** * @Project SectionCategoryArticleList * @author Mathias Hortig * @package SectionCategoryArticleList * @copyright Copyright (C) 2011-2012 tuts4you.de . All rights reserved. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2 */ // No direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.application.component.controller'); class SectionCategoryArticleListController extends JController { /** * Method to display the view * * @access public */ function display() { parent::display(); } }
thiyagarajan/newschool
components/com_sectioncategoryarticlelist/controller.php
PHP
gpl-2.0
632
package dk.dmaa0214.controllerLayer; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.xml.bind.DatatypeConverter; import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.StringWebResponse; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomNodeList; import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.html.HtmlPage; import dk.dmaa0214.modelLayer.SPNews; public class SPNewsScraper { //public static void main(String [] args) { // new SPNewsScraper(); //} private WebClient webClient; public SPNewsScraper(String user, String pass) { webClient = new WebClient(); webClient.getOptions().setJavaScriptEnabled(false); webClient.getOptions().setCssEnabled(false); DefaultCredentialsProvider credentialProvider = (DefaultCredentialsProvider) webClient.getCredentialsProvider(); credentialProvider.addNTLMCredentials(user, pass, null, -1, "localhost", "UCN"); } public void getSingleNews(SPNews spNews) throws FailingHttpStatusCodeException, NullPointerException, IOException { int id = spNews.getId(); String siteDialogURL = "http://ecampus.ucn.dk/Noticeboard/Lists/NoticeBoard/DispForm.aspx?" + "NoticeBoardItem=" + id + "&WebID=87441127-db6f-4499-8c99-3dea925e04a8&IsDlg=1"; HtmlPage page = webClient.getPage(siteDialogURL); DomNode div = page.getFirstByXPath("//td[@class='wt-2column-t1-td1']/div/div"); if(div == null) { throw new NullPointerException("Nyhedstekst kunne ikke hentes. Internkode: #3"); } DomNodeList<DomNode> list = div.getChildNodes(); String fullText = ""; for (int i = 5; i < list.size()-3; i++) { DomNode dn = list.get(i); fullText += dn.asXml(); } StringWebResponse response = new StringWebResponse(fullText, page.getUrl()); HtmlPage newPage = HTMLParser.parseHtml(response, webClient.getCurrentWindow()); makeImgToBase64(newPage); HtmlElement body = newPage.getBody(); spNews.setFullText(body.asXml()); } private void makeImgToBase64(HtmlPage page) throws FailingHttpStatusCodeException, MalformedURLException, IOException { @SuppressWarnings("unchecked") List<HtmlImage> imageList = (List<HtmlImage>) page.getByXPath("//img"); for (HtmlImage image : imageList) { InputStream ins = webClient.getPage("http://ecampus.ucn.dk" + image.getSrcAttribute()).getWebResponse().getContentAsStream(); byte[] imageBytes = new byte[0]; for(byte[] ba = new byte[ins.available()]; ins.read(ba) != -1;) { byte[] baTmp = new byte[imageBytes.length + ba.length]; System.arraycopy(imageBytes, 0, baTmp, 0, imageBytes.length); System.arraycopy(ba, 0, baTmp, imageBytes.length, ba.length); imageBytes = baTmp; } image.setAttribute("src", "data:image/gif;base64," + DatatypeConverter.printBase64Binary(imageBytes)); } } public ArrayList<SPNews> getNewsList() throws NullPointerException, FailingHttpStatusCodeException, MalformedURLException, IOException { String siteURL = "http://ecampus.ucn.dk/Noticeboard/_Layouts/NoticeBoard/Ajax.aspx?Action=" + "GetNewsList&ShowBodyContent=SHORT100&WebId=87441127-db6f-4499-8c99-3dea925e04a8" + "&ChannelList=11776,4096,3811,3817,4311,4312,4313,4768,4314,4315,4316,4317,4310," + "&DateFormat=dd/MM/yyyy HH:mm&List=Current,Archived&IncludeRead=true&MaxToShow=10" + "&Page=1&frontpageonly=false"; HtmlPage page = webClient.getPage(siteURL); return ScrapeNewsList(page.asText()); } private ArrayList<SPNews> ScrapeNewsList(String input) throws NullPointerException { ArrayList<SPNews> newslist = new ArrayList<SPNews>(); int iStart = getNextIndex(input, 0); if(!input.substring(0, iStart).equals("OK")) { throw new NullPointerException("Nyhederne kan ikke læses. Internkode: #1. Status: " + input.substring(0, iStart)); } String[] allNews = input.split("\\|\\$\\$\\|"); //System.out.println("count: " + (allNews.length-1)); for (int i = 1; i < allNews.length; i++) { String[] singleNews = allNews[i].split("\\|\\$\\|"); if(singleNews.length != 11) { throw new NullPointerException("Nyhederne kan ikke læses. Internkode: #2. Rapport: " + singleNews.length); } int id = getIntFromString(singleNews[0]); String title = singleNews[1].trim(); String date = singleNews[2].trim(); boolean read = (getIntFromString(singleNews[3]) == 1); String[] channelArray = singleNews[4].trim().split("\\|"); ArrayList<String> channels = new ArrayList<String>(Arrays.asList(channelArray)); String addedBy = singleNews[6].trim(); String text = singleNews[7].trim(); //7 and 8 is equal. SPNews newsObj = new SPNews(id, title, date, channels, text, addedBy, read); newslist.add(newsObj); } return newslist; } private int getIntFromString(String str) { int ret = -1; try { ret = Integer.parseInt(str); } catch (NumberFormatException e) { ret = -1; } return ret; } private int getNextIndex(String text, int fromIndex){ int i = text.indexOf("|$|", fromIndex); if (i == -1) { throw new NullPointerException("Nyhederne kan ikke læses"); } return i; } }
CodingDK/eCampus-Dmaa0214
eCampus-Dmaa0214/src/dk/dmaa0214/controllerLayer/SPNewsScraper.java
Java
gpl-2.0
5,592
<?php /** * @package Azura Joomla Pagebuilder * @author Cththemes - www.cththemes.com * @date: 15-07-2014 * * @copyright Copyright ( C ) 2014 cththemes.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die; $classes = "azp_iconbox iconbox_zoomindelay"; $animationData = ''; if($animationArgs['animation'] == '1'){ //$classes .= ' animate-in'; $animationData = 'data-anim-type="'.$animationArgs['animationtype'].'" data-anim-delay="'.$animationArgs['animationdelay'].'"'; } if(!empty($extraclass)){ $classes .= ' '.$extraclass; } if($isactive === '1'){$classes .= ' active';} $classes = 'class="'.$classes.'"'; ?> <div <?php echo $classes.' '.$iconboxstyle;?>> <?php if(!empty($link)) :?> <a href="<?php echo $link;?>"> <?php else :?> <a href="javascript:void(0);"> <?php endif;?> <?php if(!empty($iconclass)) :?> <i class="<?php echo $iconclass;?> animate-in" data-anim-type="zoom-in"></i> <?php elseif(!empty($image)) :?> <img src="<?php echo JURI::root(true).'/'.$image;?>" class="hoxa-img-icon animate" data-anim-type="zoom-in" alt="<?php echo $title;?>"> <?php endif;?> <?php if(!empty($title)) :?> <strong class="animate-in" <?php echo $animationData;?>><?php echo $title;?></strong> <?php endif;?> <?php echo $content;?> </a> </div> <div class="clearfix"></div>
charlanalves/mfmiguel
templates/hoxa/html/com_azurapagebuilder/plugin/shortcodes_template/azuraiconbox-zoomindelay.php
PHP
gpl-2.0
1,520
<?php if ( ! function_exists( 'et_custom_comments_display' ) ) : function et_custom_comments_display($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div class="comment-top-left"></div> <div class="comment-top-main"></div> <div class="bubble"></div> <div class="comment-top-right"></div> <div id="comment-<?php comment_ID(); ?>" class="comment-body"> <div class="comment-author vcard"> <?php echo get_avatar($comment,$size='50'); ?> <div class="comment-info"> <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>','TheCorporation'), get_comment_author_link()) ?> <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(esc_html__('%1$s at %2$s','TheCorporation'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(esc_html__('(Edit)','TheCorporation'),' ','') ?></div> </div> <!-- end comment-info--> </div> <?php if ($comment->comment_approved == '0') : ?> <em class="moderation"><?php esc_html_e('Your comment is awaiting moderation.') ?></em> <br /> <?php endif; ?> <div class="comment-content"><?php comment_text() ?></div> <!-- end comment-content--> <?php $et_comment_reply_link = get_comment_reply_link( array_merge( $args, array('reply_text' => esc_attr__('reply','TheCorporation'),'depth' => $depth, 'max_depth' => $args['max_depth'])) ); if ( $et_comment_reply_link ) echo '<div class="reply-container">' . $et_comment_reply_link . '</div>'; ?> </div> <!-- end comment-body--> <div class="comment-bottom-left"></div><div class="comment-bottom-right"></div> <?php } endif; ?>
rjbaniel/upoor
wp-content/themes/TheCorporation/includes/functions/comments.php
PHP
gpl-2.0
1,835
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\DICOM; use PHPExiftool\Driver\AbstractTag; class EdgePointIndexList extends AbstractTag { protected $Id = '0066,0024'; protected $Name = 'EdgePointIndexList'; protected $FullName = 'DICOM::Main'; protected $GroupName = 'DICOM'; protected $g0 = 'DICOM'; protected $g1 = 'DICOM'; protected $g2 = 'Image'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Edge Point Index List'; }
Droces/casabio
vendor/phpexiftool/phpexiftool/lib/PHPExiftool/Driver/Tag/DICOM/EdgePointIndexList.php
PHP
gpl-2.0
724
using UnityEngine; [RequireComponent(typeof(SpriteRenderer))] public class SpriteEntity : MonoBehaviour { public SpriteRenderer SpriteRenderer { get; protected set; } public float Width { get { return SpriteRenderer.bounds.size.x; } } public float Height { get { return SpriteRenderer.bounds.size.y; } } public float Angle { get { return transform.eulerAngles.z; } set { transform.eulerAngles = new Vector3(transform.transform.eulerAngles.x, transform.transform.eulerAngles.y, value); } } public Color Color { get { return SpriteRenderer.color; } set { SpriteRenderer.color = value; } } protected virtual void Awake() { SpriteRenderer = GetComponent<SpriteRenderer>(); } }
HyagoOliveira/NewAmaru
Assets/Scripts/GamePlatform/Sprites/SpriteEntity.cs
C#
gpl-2.0
770
/* (c) Copyright 2002, 2003 Rogier van Dalen (R.C.van.Dalen@umail.leidenuniv.nl for any comments, questions or bugs) This file is part of my OpenType/TrueType Font Tools. The OpenType/TrueType Font Tools is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The OpenType/TrueType Font Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the OpenType/TrueType Font Tools; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA In addition, as a special exception, Rogier van Dalen gives permission to link the code of this program with Qt non-commercial edition (or with modified versions of Qt non-commercial edition that use the same license as Qt non-commercial edition), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt non-commercial edition. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include <qpushbutton.h> #include "glyphviewerdialogextension.h" GlyphViewerDialogExtension::GlyphViewerDialogExtension (QWidget* parent) : GlyphViewerDialogExtensionBase (parent) { connect( buttonFirstInstruction, SIGNAL( clicked() ), parent, SLOT( firstInstruction() ) ); connect( buttonBackInstruction, SIGNAL( clicked() ), parent, SLOT( backInstruction() ) ); connect( buttonPreviousInstruction, SIGNAL( clicked() ), parent, SLOT( previousInstruction() ) ); connect( buttonNextInstruction, SIGNAL( clicked() ), parent, SLOT( nextInstruction() ) ); connect( buttonForwardInstruction, SIGNAL( clicked() ), parent, SLOT( forwardInstruction() ) ); connect( buttonLastInstruction, SIGNAL( clicked() ), parent, SLOT( lastInstruction() ) ); connect( buttonStackViewer, SIGNAL( clicked() ), parent, SLOT( openStackViewer() ) ); connect( buttonStorageViewer, SIGNAL( clicked() ), parent, SLOT( openStorageViewer() ) ); connect( buttonCVTViewer, SIGNAL( clicked() ), parent, SLOT( openCVTViewer() ) ); connect( buttonGraphicsStateViewer, SIGNAL( clicked() ), parent, SLOT( openGraphicsStateViewer() ) ); } GlyphViewerDialogExtension::~GlyphViewerDialogExtension() {}
kennytm/tticomp
TrueTypeViewer/glyphviewerdialogextension.cpp
C++
gpl-2.0
2,739
<?php /*--------------------------------------------------------------- # Package - Joomla Template based on CGrocket Framework # --------------------------------------------------------------- # Author - CGrocket http://www.cgrocket.com # Copyright (C) 2011 - 2012 Cgrocket.com. All Rights Reserved. # license - PHP files are licensed under GNU/GPL V2 # Websites: http://www.cgrocket.com - http://www.leweb2.com -----------------------------------------------------------------*/ //no direct accees class JSMin { const ORD_LF = 10; const ORD_SPACE = 32; protected $a = ''; protected $b = ''; protected $input = ''; protected $inputIndex = 0; protected $inputLength = 0; protected $lookAhead = null; protected $output = ''; // -- Public Static Methods -------------------------------------------------- public static function minify($js) { $jsmin = new JSMin($js); return $jsmin->min(); } // -- Public Instance Methods ------------------------------------------------ public function __construct($input) { $this->input = str_replace("\r\n", "\n", $input); $this->inputLength = strlen($this->input); } // -- Protected Instance Methods --------------------------------------------- protected function action($d) { switch($d) { case 1: $this->output .= $this->a; case 2: $this->a = $this->b; if ($this->a === "'" || $this->a === '"') { for (;;) { $this->output .= $this->a; $this->a = $this->get(); if ($this->a === $this->b) { break; } if (ord($this->a) <= self::ORD_LF) { throw new JSMinException('Unterminated string literal.'); } if ($this->a === '\\') { $this->output .= $this->a; $this->a = $this->get(); } } } case 3: $this->b = $this->next(); if ($this->b === '/' && ( $this->a === '(' || $this->a === ',' || $this->a === '=' || $this->a === ':' || $this->a === '[' || $this->a === '!' || $this->a === '&' || $this->a === '|' || $this->a === '?')) { $this->output .= $this->a . $this->b; for (;;) { $this->a = $this->get(); if ($this->a === '/') { break; } elseif ($this->a === '\\') { $this->output .= $this->a; $this->a = $this->get(); } elseif (ord($this->a) <= self::ORD_LF) { throw new JSMinException('Unterminated regular expression '. 'literal.'); } $this->output .= $this->a; } $this->b = $this->next(); } } } protected function get() { $c = $this->lookAhead; $this->lookAhead = null; if ($c === null) { if ($this->inputIndex < $this->inputLength) { $c = substr($this->input, $this->inputIndex, 1); $this->inputIndex += 1; } else { $c = null; } } if ($c === "\r") { return "\n"; } if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) { return $c; } return ' '; } protected function isAlphaNum($c) { return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1; } protected function min() { $this->a = "\n"; $this->action(3); while ($this->a !== null) { switch ($this->a) { case ' ': if ($this->isAlphaNum($this->b)) { $this->action(1); } else { $this->action(2); } break; case "\n": switch ($this->b) { case '{': case '[': case '(': case '+': case '-': $this->action(1); break; case ' ': $this->action(3); break; default: if ($this->isAlphaNum($this->b)) { $this->action(1); } else { $this->action(2); } } break; default: switch ($this->b) { case ' ': if ($this->isAlphaNum($this->a)) { $this->action(1); break; } $this->action(3); break; case "\n": switch ($this->a) { case '}': case ']': case ')': case '+': case '-': case '"': case "'": $this->action(1); break; default: if ($this->isAlphaNum($this->a)) { $this->action(1); } else { $this->action(3); } } break; default: $this->action(1); break; } } } return $this->output; } protected function next() { $c = $this->get(); if ($c === '/') { switch($this->peek()) { case '/': for (;;) { $c = $this->get(); if (ord($c) <= self::ORD_LF) { return $c; } } case '*': $this->get(); for (;;) { switch($this->get()) { case '*': if ($this->peek() === '/') { $this->get(); return ' '; } break; case null: throw new JSMinException('Unterminated comment.'); } } default: return $c; } } return $c; } protected function peek() { $this->lookAhead = $this->get(); return $this->lookAhead; } } // -- Exceptions --------------------------------------------------------------- class JSMinException extends Exception {}
anhtuan8591/shop
plugins/system/cgrocket/core/class.jsmin.php
PHP
gpl-2.0
6,383
<?php /* @Module: List view @Since: 1.0 @Package: WooComposer */ if(!class_exists('WooComposer_ViewCarousel')){ class WooComposer_ViewCarousel { function __construct(){ add_action('admin_init',array($this,'WooComposer_Init_Carousel')); add_shortcode('woocomposer_carousel',array($this,'WooComposer_Carousel')); } // end constructor function WooComposer_Init_Carousel(){ if(function_exists('vc_map')){ $categories = get_terms( 'product_cat', array( 'orderby' => 'count', 'hide_empty' => 0, ) ); $cat_arr = array(); if(is_array($categories)){ foreach($categories as $cats){ $cat_arr[$cats->name] = $cats->slug; } } vc_map( array( "name" => __("Product Carousel [Beta]", "woocommerce"), "base" => "woocomposer_carousel", "icon" => "woo_carousel", "class" => "woo_carousel", "category" => __("WooComposer [ Beta ]", "woocommerce"), "description" => "Display products in carousel slider", "controls" => "full", "show_settings_on_create" => true, "params" => array( array( "type" => "woocomposer", "class" => "", "heading" => __("Query Builder", "woocomposer"), "param_name" => "shortcode", "value" => "", "module" => "grid", "labels" => array( "products_from" => __("Display:","woocomposer"), "per_page" => __("How Many:","woocomposer"), "columns" => __("Columns:","woocomposer"), "order_by" => __("Order By:","woocomposer"), "order" => __("Display Order:","woocomposer"), "category" => __("Category:","woocomposer"), ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Display Style", "woocommerce"), "param_name" => "product_style", "admin_label" => true, "value" => array( "Style 01" => "style01", "Style 02" => "style02", "Style 03" => "style03", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "checkbox", "class" => "", "heading" => __("Select options to display", "woocomposer"), "param_name" => "display_elements", "admin_label" => true, "value" => array( "Category<br>" => "category", "Reviews<br>" => "reviews", "Quick View<br>" => "quick", "Description<br>" => "description", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Product Text Alignment", "woocomposer"), "param_name" => "text_align", "value" => array( "Left"=> "left", "Center"=> "center", "Right" => "right", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "textfield", "class" => "", "heading" => __("Sale Notification Label", "woocomposer"), "param_name" => "label_on_sale", "value" => "", "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Sale Notification Style", "woocomposer"), "param_name" => "on_sale_style", "admin_label" => true, "value" => array( "Circle" => "wcmp-sale-circle", "Square" => "wcmp-sale-rectangle", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Sale Notification Alignment", "woocomposer"), "param_name" => "on_sale_alignment", "admin_label" => true, "value" => array( "Right" => "wcmp-sale-right", "Left" => "wcmp-sale-left", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Image Hover Animation", "woocomposer"), "param_name" => "img_animate", "value" => array( "Rotate Clock"=> "rotate-clock", "Rotate Anti-clock"=> "rotate-anticlock", "Zoom-In" => "zoomin", "Zoom-Out" => "zoomout", "Fade" => "fade", "Gray Scale" => "grayscale", "Shadow" => "imgshadow", "Blur" => "blur", "Anti Grayscale" => "antigrayscale", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Animation","smile"), "param_name" => "product_animation", "value" => array( __("No Animation","smile") => "", __("Swing","smile") => "swing", __("Pulse","smile") => "pulse", __("Fade In","smile") => "fadeIn", __("Fade In Up","smile") => "fadeInUp", __("Fade In Down","smile") => "fadeInDown", __("Fade In Left","smile") => "fadeInLeft", __("Fade In Right","smile") => "fadeInRight", __("Fade In Up Long","smile") => "fadeInUpBig", __("Fade In Down Long","smile") => "fadeInDownBig", __("Fade In Left Long","smile") => "fadeInLeftBig", __("Fade In Right Long","smile") => "fadeInRightBig", __("Slide In Down","smile") => "slideInDown", __("Slide In Left","smile") => "slideInLeft", __("Slide In Left","smile") => "slideInLeft", __("Bounce In","smile") => "bounceIn", __("Bounce In Up","smile") => "bounceInUp", __("Bounce In Down","smile") => "bounceInDown", __("Bounce In Left","smile") => "bounceInLeft", __("Bounce In Right","smile") => "bounceInRight", __("Rotate In","smile") => "rotateIn", __("Light Speed In","smile") => "lightSpeedIn", __("Roll In","smile") => "rollIn", ), "description" => __("", "woocomposer"), "group" => "Initial Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Product Title Color", "woocomposer"), "param_name" => "color_heading", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Categories Color", "woocomposer"), "param_name" => "color_categories", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Price Color", "woocomposer"), "param_name" => "color_price", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Star Ratings Color", "woocomposer"), "param_name" => "color_rating", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Star Rating Background Color", "woocomposer"), "param_name" => "color_rating_bg", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Quick View Icon Color", "woocomposer"), "param_name" => "color_quick", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Quick View Icon Background Color", "woocomposer"), "param_name" => "color_quick_bg", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Cart Icon Color", "woocomposer"), "param_name" => "color_cart", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Cart Icon Background Color", "woocomposer"), "param_name" => "color_cart_bg", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Sale Notification Label Color", "woocomposer"), "param_name" => "color_on_sale", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Sale Notification Background Color", "woocomposer"), "param_name" => "color_on_sale_bg", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Product Description Text Color", "woocomposer"), "param_name" => "color_product_desc", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "colorpicker", "class" => "", "heading" => __("Product Description Background Color", "woocomposer"), "param_name" => "color_product_desc_bg", "value" => "", "description" => __("", "woocomposer"), "group" => "Style Settings", ), array( "type" => "number", "class" => "", "heading" => __("Product Title", "woocomposer"), "param_name" => "size_title", "value" => "", "min" => 10, "max" => 72, "suffix" => "px", "description" => __("", "woocomposer"), "group" => "Size Settings", ), array( "type" => "number", "class" => "", "heading" => __("Categories", "woocomposer"), "param_name" => "size_cat", "value" => "", "min" => 10, "max" => 72, "suffix" => "px", "description" => __("", "woocomposer"), "group" => "Size Settings", ), array( "type" => "number", "class" => "", "heading" => __("Price", "woocomposer"), "param_name" => "size_price", "value" => "", "min" => 10, "max" => 72, "suffix" => "px", "description" => __("", "woocomposer"), "group" => "Size Settings", ), array( "type" => "number", "class" => "", "heading" => __("Sale Notifications", "woocomposer"), "param_name" => "sale_price", "value" => "", "min" => 10, "max" => 72, "suffix" => "px", "description" => __("", "woocomposer"), "group" => "Size Settings", ), array( "type" => "dropdown", "class" => "", "heading" => __("Slide to Scroll Setting ", "woocomposer"), "param_name" => "scroll_opts", "value" => array( "Auto" => "auto", "Custom" => "custom", ), "description" => __("", "woocomposer"), "group" => "Carousel Settings", ), array( "type" => "number", "class" => "", "heading" => __("Number of Slides to Scroll", "woocomposer"), "param_name" => "slides_to_scroll", "value" => "1", "min" => 1, "max" => 10, "suffix" => "", "description" => __("The number of slides to move on transition", "woocomposer"), "dependency" => Array("element" => "scroll_opts", "value" => array("custom")), "group" => "Carousel Settings", ), array( "type" => "number", "class" => "", "heading" => __("Slide Scrolling Speed", "woocomposer"), "param_name" => "scroll_speed", "value" => "1000", "min" => 100, "max" => 10000, "suffix" => "ms", "description" => __("Slide transition duration (in ms)", "woocomposer"), "group" => "Carousel Settings", ), array( "type" => "checkbox", "class" => "", "heading" => __("Advanced settings -", "woocomposer"), "param_name" => "advanced_opts", "value" => array( "Enable infinite scroll<br>" => "infinite", "Enable navigation dots<br>" => "dots", "Enable auto play" => "autoplay", ), "description" => __("", "woocomposer"), "group" => "Carousel Settings", ), array( "type" => "number", "class" => "", "heading" => __("Autoplay Speed", "woocomposer"), "param_name" => "autoplay_speed", "value" => "500", "min" => 100, "max" => 10000, "suffix" => "ms", "description" => __("The amount of time (in ms) between each auto transition", "woocomposer"), "group" => "Carousel Settings", "dependency" => Array("element" => "advanced_opts", "value" => array("autoplay")), ), ) ) ); } } // end WooComposer_Init_Carousel function WooComposer_Carousel($atts){ $product_style = $slides_to_scroll = $scroll_speed = $advanced_opts = $output = $autoplay_speed = $scroll_opts = ''; extract(shortcode_atts(array( "product_style" => "", "slides_to_scroll" => "1", "scroll_speed" => "1000", "advanced_opts" => "", "autoplay_speed" => "500", "scroll_opts" => "", ),$atts)); $infinite = $autoplay = $dots = 'false'; $advanced_opts = explode(",", $advanced_opts); if(in_array("infinite",$advanced_opts)){ $infinite = 'true'; } if(in_array("autoplay",$advanced_opts)){ $autoplay = 'true'; } if(in_array("dots",$advanced_opts)){ $dots = 'true'; } ob_start(); $output .= '<div class="woocommerce">'; wc_print_notices(); $output .= ob_get_clean(); $output .= '</div>'; $uid = uniqid(); $output .= '<div id="woo-carousel-'.$uid.'" class="woocomposer_carousel">'; $template = 'design-loop-'.$product_style.'.php'; require_once($template); $function = 'WooComposer_Loop_'.$product_style; $output .= $function($atts,'carousel'); $output .= '</div>'; $output .= '<script> jQuery(document).ready(function(){ var columns = jQuery("#woo-carousel-'.$uid.' > .woocomposer").data("columns"); var slides_scroll_opt = "'.$scroll_opts.'"; var slides_to_scroll; if(slides_scroll_opt == "custom"){ slides_to_scroll = '.$slides_to_scroll.'; } else { slides_to_scroll = columns; } var inline_vc = jQuery(".woocomposer_carousel").find(".wcmp_vc_inline").length; if(inline_vc == 0){ jQuery("#woo-carousel-'.$uid.' > .woocomposer").slick({ infinite: '.$infinite.', slidesToShow: columns, slidesToScroll: slides_to_scroll, speed: '.$scroll_speed.', dots: '.$dots.', autoplay: '.$autoplay.', autoplaySpeed: '.$autoplay_speed.', responsive: [{ breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true, dots: true } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); } var carousel_set = "{infinite: '.$infinite.',\ slidesToShow: columns,\ slidesToScroll: slides_to_scroll,\ speed: '.$scroll_speed.',\ dots: '.$dots.',\ autoplay: '.$autoplay.',\ autoplaySpeed: '.$autoplay_speed.',\ responsive: [{\ breakpoint: 1024,\ settings: {\ slidesToShow: 3,\ slidesToScroll: 3,\ infinite: true,\ dots: true\ }\ }, {\ breakpoint: 600,\ settings: {\ slidesToShow: 2,\ slidesToScroll: 2\ }\ }, {\ breakpoint: 480,\ settings: {\ slidesToShow: 1,\ slidesToScroll: 1\ }\ }]\ });}"; jQuery("#woo-carousel-'.$uid.'").attr("data-slick", carousel_set); }); jQuery(window).load(function(){ //jQuery("[data-save=true]").trigger("click"); }); </script>'; return $output; } // end WooComposer_Carousel } new WooComposer_ViewCarousel; }
jlrc23/hotelMarbella
wp-content/plugins/Ultimate_VC_Addons/woocomposer/modules/shortcode_carousel.php
PHP
gpl-2.0
18,006
<?php /** * Bottom Margin Control * * Outputs a jquery ui slider to allow the * user to control the bottom margin of an * element. * * @package Easy_Google_Fonts * @author Sunny Johal - Titanium Themes <support@titaniumthemes.com> * @license GPL-2.0+ * @link http://wordpress.org/plugins/easy-google-fonts/ * @copyright Copyright (c) 2015, Titanium Themes * @version 1.3.5 * */ ?> <# // Get settings and defaults. var egfMarginBottom = typeof egfSettings.margin_bottom !== "undefined" ? egfSettings.margin_bottom : data.egf_defaults.margin_bottom; #> <div class="egf-font-slider-control egf-margin-bottom-slider"> <span class="egf-slider-title"><?php _e( 'Bottom', 'easy-google-fonts' ); ?></span> <div class="egf-font-slider-display"> <span>{{ egfMarginBottom.amount }}{{ egfMarginBottom.unit }}</span> | <a class="egf-font-slider-reset" href="#"><?php _e( 'Reset', 'easy-google-fonts' ); ?></a> </div> <div class="egf-clear" ></div> <!-- Slider --> <div class="egf-slider" value="{{ egfMarginBottom.amount }}"></div> <div class="egf-clear"></div> </div>
magnusvaughan/emmettphotography
wp-content/plugins/easy-google-fonts/views/customizer/control/positioning/margin/bottom.php
PHP
gpl-2.0
1,101
<!DOCTYPE html> <!--[if lt IE 7]> <html class="ie6 ie" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]--> <!--[if IE 7]> <html class="ie7 ie" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]--> <!--[if IE 8]> <html class="ie8 ie" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]--> <!--[if gt IE 8]> <!--> <html class="" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <!--<![endif]--> <head> <?php print $head; ?> <title><?php print $head_title; ?></title> <?php print $styles; ?> <?php print $scripts; ?> <!-- IE Fix for HTML5 Tags --> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'> <!-- nuevas, reeplazar al final !!!!!! --> <link href='http://fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Oxygen:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Roboto:400,400italic,900&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700,300italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'> <?php BambuTema_user_css(); ?> <!-- <link rel="stylesheet" type="text/css" href="<?php global $root; echo $root;?>/css/switch.css"> <link rel="stylesheet" class="switch" type="text/css" href="<?php global $root; echo $root;?>/css/colors/default.css"> --> </head> <body class="<?php print $classes; ?>" <?php print $attributes;?>> <?php print $page_top; ?> <?php print $page; ?> <?php print $page_bottom; ?> </body> </html>
Tahiche/bambuproducciones.tahiche.es
sites/all/themes/BambuTema/templates/html.tpl.php
PHP
gpl-2.0
2,213
/* * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The Universal Permissive License (UPL), Version 1.0 * * Subject to the condition set forth below, permission is hereby granted to any * person obtaining a copy of this software, associated documentation and/or * data (collectively the "Software"), free of charge and under any and all * copyright rights in the Software, and any and all patent rights owned or * freely licensable by each licensor hereunder covering either (i) the * unmodified Software as contributed to or provided by such licensor, or (ii) * the Larger Works (as defined below), to deal in both * * (a) the Software, and * * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if * one is included with the Software each a "Larger Work" to which the Software * is contributed by such licensors), * * without restriction, including without limitation the rights to copy, create * derivative works of, display, perform, and distribute the Software and make, * use, sell, offer for sale, import, export, have made, and have sold the * Software and the Larger Work(s), and to sublicense the foregoing rights on * either these or other terms. * * This license is subject to the following condition: * * The above copyright notice and either this complete permission notice or at a * minimum a reference to the UPL must be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.oracle.truffle.api.test; import static com.oracle.truffle.api.test.RootNodeTest.verifyStackTraceElementGuestObject; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Queue; import java.util.Set; import java.util.function.Consumer; import java.util.logging.Handler; import java.util.logging.LogRecord; import java.util.regex.Pattern; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.oracle.truffle.api.CallTarget; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.Truffle; import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.TruffleLogger; import com.oracle.truffle.api.TruffleStackTrace; import com.oracle.truffle.api.TruffleStackTraceElement; import com.oracle.truffle.api.exception.AbstractTruffleException; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.interop.ExceptionType; import com.oracle.truffle.api.interop.InteropException; import com.oracle.truffle.api.interop.InteropLibrary; import com.oracle.truffle.api.interop.InvalidArrayIndexException; import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.interop.UnsupportedMessageException; import com.oracle.truffle.api.library.ExportLibrary; import com.oracle.truffle.api.library.ExportMessage; import com.oracle.truffle.api.nodes.ControlFlowException; import com.oracle.truffle.api.nodes.DirectCallNode; import com.oracle.truffle.api.nodes.ExplodeLoop; import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.api.source.SourceSection; import com.oracle.truffle.api.test.polyglot.AbstractPolyglotTest; import com.oracle.truffle.api.test.polyglot.ProxyLanguage; import com.oracle.truffle.tck.tests.TruffleTestAssumptions; public class TruffleExceptionTest extends AbstractPolyglotTest { @BeforeClass public static void runWithWeakEncapsulationOnly() { TruffleTestAssumptions.assumeWeakEncapsulation(); } private VerifyingHandler verifyingHandler; @Before public void setUp() { verifyingHandler = new VerifyingHandler(AbstractTruffleException.class); } @Test public void testTruffleException() { setupEnv(createContext(verifyingHandler), new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { return createAST(AbstractTruffleException.class, languageInstance, (n) -> new TruffleExceptionImpl("Test exception", n), false); } }); verifyingHandler.expect(BlockNode.Kind.TRY, BlockNode.Kind.CATCH, BlockNode.Kind.FINALLY); context.eval(ProxyLanguage.ID, "Test"); } @Test public void testTruffleExceptionCustomGuestObject() { setupEnv(createContext(verifyingHandler), new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { return createAST(AbstractTruffleException.class, languageInstance, (n) -> new TruffleExceptionImpl("Test exception", n), true); } }); verifyingHandler.expect(BlockNode.Kind.TRY, BlockNode.Kind.CATCH, BlockNode.Kind.FINALLY); context.eval(ProxyLanguage.ID, "Test"); } @Test public void testPolyglotStackTrace() { testStackTraceImpl(new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode((n) -> { return new TruffleExceptionImpl("Test exception", n); }); return new TestRootNode(languageInstance, "test", null, throwNode).getCallTarget(); } }, "<proxyLanguage> test", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval"); } @Test public void testPolyglotStackTrace2() { testStackTraceImpl(new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode((n) -> { return new TruffleExceptionImpl("Test exception", n); }); CallTarget throwTarget = new TestRootNode(languageInstance, "test-throw", null, throwNode).getCallTarget(); CallTarget innerInvokeTarget = new TestRootNode(languageInstance, "test-call-inner", null, new InvokeNode(throwTarget)).getCallTarget(); CallTarget outerInvokeTarget = new TestRootNode(languageInstance, "test-call-outer", null, new InvokeNode(innerInvokeTarget)).getCallTarget(); return outerInvokeTarget; } }, "<proxyLanguage> test-throw", "<proxyLanguage> test-call-inner", "<proxyLanguage> test-call-outer", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval"); } @Test public void testPolyglotStackTraceInternalFrame() { testStackTraceImpl(new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode((n) -> { return new TruffleExceptionImpl("Test exception", n); }); CallTarget throwTarget = new TestRootNode(languageInstance, "test-throw-internal", null, true, throwNode).getCallTarget(); CallTarget innerInvokeTarget = new TestRootNode(languageInstance, "test-call-inner", null, new InvokeNode(throwTarget)).getCallTarget(); CallTarget internalInvokeTarget = new TestRootNode(languageInstance, "test-call-internal", null, true, new InvokeNode(innerInvokeTarget)).getCallTarget(); CallTarget outerInvokeTarget = new TestRootNode(languageInstance, "test-call-outer", null, new InvokeNode(internalInvokeTarget)).getCallTarget(); return outerInvokeTarget; } }, "<proxyLanguage> test-call-inner", "<proxyLanguage> test-call-outer", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval"); } @Test public void testPolyglotStackTraceExplicitFillIn() { testStackTraceImpl(new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode((n) -> { TruffleExceptionImpl e = new TruffleExceptionImpl("Test exception", n); TruffleStackTrace.fillIn(e); return e; }); return new TestRootNode(languageInstance, "test", null, throwNode).getCallTarget(); } }, "<proxyLanguage> test", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval"); } @Test public void testPolyglotStackTraceInternalError() { testStackTraceImpl(new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode(new InternalExceptionFactory()); return new TestRootNode(languageInstance, "test", null, throwNode).getCallTarget(); } }, Pattern.quote("com.oracle.truffle.api.test.TruffleExceptionTest$InternalExceptionFactory.apply"), Pattern.quote("com.oracle.truffle.api.test.TruffleExceptionTest$ThrowNode.executeVoid"), Pattern.quote("com.oracle.truffle.api.test.TruffleExceptionTest$TestRootNode.execute"), "<proxyLanguage> test", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval"); } @Test public void testExceptionFromCreateContext() { String message = "Failed to create"; ExceptionType type = ExceptionType.EXIT; assertFails(() -> setupEnv(Context.create(), new ProxyLanguage() { @Override protected LanguageContext createContext(Env env) { throw new TruffleExceptionImpl(message, null, type, null); } }), PolyglotException.class, (pe) -> { Assert.assertEquals(message, pe.getMessage()); Assert.assertTrue(pe.isExit()); Assert.assertFalse(pe.isInternalError()); Assert.assertEquals(0, pe.getExitStatus()); Assert.assertNull(pe.getGuestObject()); }); } private void testStackTraceImpl(ProxyLanguage proxy, String... patterns) { setupEnv(Context.create(), proxy); assertFails(() -> context.eval(ProxyLanguage.ID, "Test"), PolyglotException.class, (pe) -> { verifyStackTrace(pe, patterns); }); } static void verifyStackTrace(PolyglotException pe, String... patterns) { StringWriter buffer = new StringWriter(); try (PrintWriter out = new PrintWriter(buffer)) { pe.printStackTrace(out); } String[] lines = Arrays.stream(buffer.toString().split(System.lineSeparator())).map((l) -> l.trim()).filter((l) -> l.startsWith("at ")).map((l) -> { int end = l.lastIndexOf('('); if (end < 0) { end = l.length(); } return l.substring(3, end); }).toArray((len) -> new String[len]); Assert.assertTrue("Not enough lines " + Arrays.toString(lines), patterns.length <= lines.length); for (int i = 0; i < lines.length && i < patterns.length; i++) { String line = lines[i]; Pattern pattern = Pattern.compile(patterns[i]); Assert.assertTrue("Expected " + patterns[i] + " but got " + line, pattern.matcher(line).matches()); } } @Test public void testExceptionFromPolyglotExceptionConstructor() { testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.RUNTIME_ERROR, false); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.RUNTIME_ERROR, true, TruffleExceptionImpl.MessageKind.IS_EXCEPTION); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.RUNTIME_ERROR, true, TruffleExceptionImpl.MessageKind.GET_EXCEPTION_TYPE); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.EXIT, true, TruffleExceptionImpl.MessageKind.GET_EXCEPTION_EXIT_STATUS); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.PARSE_ERROR, true, TruffleExceptionImpl.MessageKind.IS_EXCEPTION_INCOMPLETE_SOURCE); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.RUNTIME_ERROR, true, TruffleExceptionImpl.MessageKind.HAS_SOURCE_LOCATION); testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType.RUNTIME_ERROR, true, TruffleExceptionImpl.MessageKind.GET_SOURCE_LOCATION); } private void testExceptionFromPolyglotExceptionConstructorImpl(ExceptionType type, boolean internal, TruffleExceptionImpl.MessageKind... failOn) { setupEnv(Context.create(), new ProxyLanguage() { @Override protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { ThrowNode throwNode = new ThrowNode((n) -> new TruffleExceptionImpl("test", n, type, new InjectException(failOn))); return new TestRootNode(languageInstance, "test", "unnamed", throwNode).getCallTarget(); } }); assertFails(() -> context.eval(ProxyLanguage.ID, "Test"), PolyglotException.class, (pe) -> { Assert.assertEquals(internal, pe.isInternalError()); }); } static Context createContext(VerifyingHandler handler) { return Context.newBuilder().option(String.format("log.%s.level", handler.loggerName), "FINE").logHandler(handler).build(); } static CallTarget createAST(Class<?> testClass, TruffleLanguage<ProxyLanguage.LanguageContext> lang, ExceptionFactory exceptionObjectFactroy, boolean customStackTraceElementGuestObject) { ThrowNode throwNode = new ThrowNode(exceptionObjectFactroy); TryCatchNode tryCatch = new TryCatchNode(new BlockNode(testClass, BlockNode.Kind.TRY, throwNode), new BlockNode(testClass, BlockNode.Kind.CATCH), new BlockNode(testClass, BlockNode.Kind.FINALLY)); return new TestRootNode(lang, "test", customStackTraceElementGuestObject ? "unnamed" : null, tryCatch).getCallTarget(); } @SuppressWarnings({"unchecked", "unused"}) static <T extends Throwable> T sthrow(Class<T> type, Throwable t) throws T { throw (T) t; } static final class TestRootNode extends RootNode { private final String name; private final String ownerName; private final boolean internal; private final StackTraceElementGuestObject customStackTraceElementGuestObject; @Child StatementNode body; TestRootNode(TruffleLanguage<?> language, String name, String ownerName, StatementNode body) { this(language, name, ownerName, false, body); } TestRootNode(TruffleLanguage<?> language, String name, String ownerName, boolean internal, StatementNode body) { super(language); this.name = name; this.ownerName = ownerName; this.internal = internal; this.body = body; this.customStackTraceElementGuestObject = ownerName != null ? new StackTraceElementGuestObject(name, ownerName) : null; } @Override public String getQualifiedName() { return ownerName != null ? ownerName + '.' + name : name; } @Override public String getName() { return name; } @Override public Object execute(VirtualFrame frame) { body.executeVoid(frame); return true; } @Override protected Object translateStackTraceElement(TruffleStackTraceElement element) { if (customStackTraceElementGuestObject != null) { return customStackTraceElementGuestObject; } else { return super.translateStackTraceElement(element); } } @Override public boolean isInternal() { return internal; } } @ExportLibrary(InteropLibrary.class) static final class StackTraceElementGuestObject implements TruffleObject { private final String name; private final Object owner; StackTraceElementGuestObject(String name, String ownerName) { this.name = name; this.owner = new OwnerMetaObject(ownerName); } @ExportMessage @SuppressWarnings("static-method") boolean hasExecutableName() { return true; } @ExportMessage Object getExecutableName() { return name; } @ExportMessage @SuppressWarnings("static-method") boolean hasDeclaringMetaObject() { return true; } @ExportMessage Object getDeclaringMetaObject() { return owner; } @ExportLibrary(InteropLibrary.class) static final class OwnerMetaObject implements TruffleObject { private final String name; OwnerMetaObject(String name) { this.name = name; } @ExportMessage @SuppressWarnings("static-method") boolean isMetaObject() { return true; } @ExportMessage @SuppressWarnings({"static-method", "unused"}) boolean isMetaInstance(Object object) { return false; } @ExportMessage Object getMetaQualifiedName() { return name; } @ExportMessage Object getMetaSimpleName() { return name; } } } abstract static class StatementNode extends Node { abstract void executeVoid(VirtualFrame frame); } static class BlockNode extends StatementNode { enum Kind { TRY, CATCH, FINALLY } @Children private StatementNode[] children; BlockNode(Class<?> testClass, Kind kind, StatementNode... children) { this.children = new StatementNode[children.length + 1]; this.children[0] = new LogNode(testClass, kind.name()); System.arraycopy(children, 0, this.children, 1, children.length); } @Override @ExplodeLoop void executeVoid(VirtualFrame frame) { for (StatementNode child : children) { child.executeVoid(frame); } } } private static class LogNode extends StatementNode { private final TruffleLogger log; private final String message; LogNode(Class<?> testClass, String message) { log = TruffleLogger.getLogger(ProxyLanguage.ID, testClass.getName()); this.message = message; } @Override void executeVoid(VirtualFrame frame) { log.fine(message); } } private static final class TryCatchNode extends StatementNode { @Child private BlockNode block; @Child private BlockNode catchBlock; @Child private BlockNode finallyBlock; @Child private InteropLibrary exceptions = InteropLibrary.getFactory().createDispatched(5); private final BranchProfile exceptionProfile = BranchProfile.create(); TryCatchNode(BlockNode block, BlockNode catchBlock, BlockNode finallyBlock) { this.block = block; this.catchBlock = catchBlock; this.finallyBlock = finallyBlock; } @Override void executeVoid(VirtualFrame frame) { Throwable exception = null; try { block.executeVoid(frame); } catch (Throwable ex) { exception = executeCatchBlock(frame, ex, catchBlock); } // Java finally blocks that execute nodes are not allowed for // compilation as code in finally blocks is duplicated // by the Java bytecode compiler. This can lead to // exponential code growth in worst cases. if (finallyBlock != null) { finallyBlock.executeVoid(frame); } if (exception != null) { if (exception instanceof ControlFlowException) { throw (ControlFlowException) exception; } try { throw exceptions.throwException(exception); } catch (UnsupportedMessageException ie) { throw CompilerDirectives.shouldNotReachHere(ie); } } } @SuppressWarnings("unchecked") private <T extends Throwable> Throwable executeCatchBlock(VirtualFrame frame, Throwable ex, BlockNode catchBlk) throws T { if (ex instanceof ControlFlowException) { // run finally blocks for control flow return ex; } exceptionProfile.enter(); if (exceptions.isException(ex)) { assertTruffleExceptionProperties(ex); if (catchBlk != null) { try { catchBlk.executeVoid(frame); return null; } catch (Throwable catchEx) { return executeCatchBlock(frame, catchEx, null); } } else { // run finally blocks for any interop exception return ex; } } else { // do not run finally blocks for internal errors or unwinds throw (T) ex; } } @TruffleBoundary private void assertTruffleExceptionProperties(Throwable ex) { try { Assert.assertEquals(ExceptionType.RUNTIME_ERROR, exceptions.getExceptionType(ex)); AbstractPolyglotTest.assertFails(() -> { exceptions.getExceptionExitStatus(ex); return null; }, UnsupportedMessageException.class); if (ex.getMessage() != null) { Assert.assertTrue(exceptions.hasExceptionMessage(ex)); Assert.assertEquals(ex.getMessage(), exceptions.getExceptionMessage(ex)); } else { Assert.assertFalse(exceptions.hasExceptionMessage(ex)); } assertStackTrace(ex); } catch (InteropException ie) { CompilerDirectives.shouldNotReachHere(ie); } } private void assertStackTrace(Throwable t) throws UnsupportedMessageException, InvalidArrayIndexException { List<TruffleStackTraceElement> stack = TruffleStackTrace.getStackTrace(t); Object stackGuestObject = exceptions.getExceptionStackTrace(t); Assert.assertTrue(exceptions.hasArrayElements(stackGuestObject)); Assert.assertEquals(stack.size(), exceptions.getArraySize(stackGuestObject)); for (int i = 0; i < stack.size(); i++) { Object stackTraceElementObject = exceptions.readArrayElement(stackGuestObject, i); verifyStackTraceElementGuestObject(stackTraceElementObject); Assert.assertTrue(exceptions.hasExecutableName(stackTraceElementObject)); String executableName = exceptions.asString(exceptions.getExecutableName(stackTraceElementObject)); Assert.assertEquals(stack.get(i).getTarget().getRootNode().getName(), executableName); String qualifiedName; if (exceptions.hasDeclaringMetaObject(stackTraceElementObject)) { qualifiedName = exceptions.asString(exceptions.getMetaQualifiedName(exceptions.getDeclaringMetaObject(stackTraceElementObject))) + '.' + executableName; } else { qualifiedName = executableName; } Assert.assertEquals(stack.get(i).getTarget().getRootNode().getQualifiedName(), qualifiedName); } } } interface ExceptionFactory { Object apply(Node t); } static final class InternalExceptionFactory implements ExceptionFactory { @Override public Object apply(Node t) { CompilerDirectives.transferToInterpreter(); throw new RuntimeException(); } } static class ThrowNode extends StatementNode { private final ExceptionFactory exceptionObjectFactory; @Child InteropLibrary interop; ThrowNode(ExceptionFactory exceptionObjectFactroy) { this.exceptionObjectFactory = exceptionObjectFactroy; this.interop = InteropLibrary.getFactory().createDispatched(1); } @Override void executeVoid(VirtualFrame frame) { try { throw interop.throwException(exceptionObjectFactory.apply(this)); } catch (UnsupportedMessageException um) { throw CompilerDirectives.shouldNotReachHere(um); } } } static class InvokeNode extends StatementNode { private final DirectCallNode call; InvokeNode(CallTarget target) { this.call = Truffle.getRuntime().createDirectCallNode(target); } @Override void executeVoid(VirtualFrame frame) { this.call.call(); } } @SuppressWarnings("serial") @ExportLibrary(InteropLibrary.class) static final class TruffleExceptionImpl extends AbstractTruffleException { enum MessageKind { IS_EXCEPTION, THROW_EXCEPTION, GET_EXCEPTION_TYPE, GET_EXCEPTION_EXIT_STATUS, IS_EXCEPTION_INCOMPLETE_SOURCE, HAS_SOURCE_LOCATION, GET_SOURCE_LOCATION } private final ExceptionType exceptionType; private final Consumer<MessageKind> exceptionInjection; TruffleExceptionImpl(String message, Node location) { this(message, location, ExceptionType.RUNTIME_ERROR, null); } TruffleExceptionImpl( String message, Node location, ExceptionType exceptionType, Consumer<MessageKind> exceptionInjection) { super(message, location); this.exceptionType = exceptionType; this.exceptionInjection = exceptionInjection; } @ExportMessage boolean isException() { injectException(MessageKind.IS_EXCEPTION); return true; } @ExportMessage RuntimeException throwException() { injectException(MessageKind.THROW_EXCEPTION); throw this; } @ExportMessage ExceptionType getExceptionType() { injectException(MessageKind.GET_EXCEPTION_TYPE); return exceptionType; } @ExportMessage int getExceptionExitStatus() throws UnsupportedMessageException { injectException(MessageKind.GET_EXCEPTION_EXIT_STATUS); if (exceptionType != ExceptionType.EXIT) { throw UnsupportedMessageException.create(); } else { return 0; } } @ExportMessage boolean isExceptionIncompleteSource() throws UnsupportedMessageException { injectException(MessageKind.IS_EXCEPTION_INCOMPLETE_SOURCE); if (exceptionType != ExceptionType.PARSE_ERROR) { throw UnsupportedMessageException.create(); } else { return true; } } @ExportMessage boolean hasSourceLocation() { injectException(MessageKind.HAS_SOURCE_LOCATION); Node location = getLocation(); return location != null && location.getEncapsulatingSourceSection() != null; } @ExportMessage(name = "getSourceLocation") SourceSection getSource() throws UnsupportedMessageException { injectException(MessageKind.GET_SOURCE_LOCATION); Node location = getLocation(); SourceSection section = location == null ? null : location.getEncapsulatingSourceSection(); if (section == null) { throw UnsupportedMessageException.create(); } else { return section; } } @TruffleBoundary private void injectException(MessageKind messageKind) { if (exceptionInjection != null) { exceptionInjection.accept(messageKind); } } } private static final class InjectException implements Consumer<TruffleExceptionImpl.MessageKind> { private final Set<TruffleExceptionImpl.MessageKind> messages; private InjectException(TruffleExceptionImpl.MessageKind... messages) { this.messages = EnumSet.noneOf(TruffleExceptionImpl.MessageKind.class); Collections.addAll(this.messages, messages); } @Override public void accept(TruffleExceptionImpl.MessageKind kind) { if (messages.contains(kind)) { throw new RuntimeException(); } } } static final class VerifyingHandler extends Handler { final String loggerName; private Queue<String> expected = new ArrayDeque<>(); VerifyingHandler(Class<?> testClass) { loggerName = String.format("%s.%s", ProxyLanguage.ID, testClass.getName()); } void expect(BlockNode.Kind... kinds) { Arrays.stream(kinds).map(BlockNode.Kind::name).forEach(expected::add); } @Override public void publish(LogRecord lr) { if (loggerName.equals(lr.getLoggerName())) { String head = expected.remove(); Assert.assertEquals(head, lr.getMessage()); } } @Override public void flush() { } @Override public void close() { Assert.assertTrue("All expected events must be consumed. Remaining events: " + String.join(", ", expected), expected.isEmpty()); } } }
smarr/Truffle
truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/TruffleExceptionTest.java
Java
gpl-2.0
31,384
/********** This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********/ // "liveMedia" // Copyright (c) 1996-2007 Live Networks, Inc. All rights reserved. // Abstract class for parsing a byte stream // C++ header #ifndef _STREAM_PARSER_HH #define _STREAM_PARSER_HH #ifndef _FRAMED_SOURCE_HH #include "FramedSource.hh" #endif class StreamParser { public: virtual void flushInput(); protected: // we're a virtual base class typedef void (clientContinueFunc)(void* clientData, unsigned char* ptr, unsigned size, struct timeval presentationTime); StreamParser(FramedSource* inputSource, FramedSource::onCloseFunc* onInputCloseFunc, void* onInputCloseClientData, clientContinueFunc* clientContinueFunc, void* clientContinueClientData); virtual ~StreamParser(); void saveParserState(); virtual void restoreSavedParserState(); u_int32_t get4Bytes() { // byte-aligned; returned in big-endian order u_int32_t result = test4Bytes(); fCurParserIndex += 4; fRemainingUnparsedBits = 0; return result; } u_int32_t test4Bytes() { // as above, but doesn't advance ptr ensureValidBytes(4); unsigned char const* ptr = nextToParse(); return (ptr[0]<<24)|(ptr[1]<<16)|(ptr[2]<<8)|ptr[3]; } u_int16_t get2Bytes() { ensureValidBytes(2); unsigned char const* ptr = nextToParse(); u_int16_t result = (ptr[0]<<8)|ptr[1]; fCurParserIndex += 2; fRemainingUnparsedBits = 0; return result; } u_int8_t get1Byte() { // byte-aligned ensureValidBytes(1); fRemainingUnparsedBits = 0; return curBank()[fCurParserIndex++]; } void getBytes(u_int8_t* to, unsigned numBytes) { ensureValidBytes(numBytes); memmove(to, nextToParse(), numBytes); fCurParserIndex += numBytes; fRemainingUnparsedBits = 0; } void skipBytes(unsigned numBytes) { ensureValidBytes(numBytes); fCurParserIndex += numBytes; } void skipBits(unsigned numBits); unsigned getBits(unsigned numBits); // numBits <= 32; returns data into low-order bits of result unsigned curOffset() const { return fCurParserIndex; } unsigned& totNumValidBytes() { return fTotNumValidBytes; } private: unsigned char* curBank() { return fCurBank; } unsigned char* nextToParse() { return &curBank()[fCurParserIndex]; } unsigned char* lastParsed() { return &curBank()[fCurParserIndex-1]; } // makes sure that at least "numBytes" valid bytes remain: void ensureValidBytes(unsigned numBytesNeeded) { // common case: inlined: if (fCurParserIndex + numBytesNeeded <= fTotNumValidBytes) return; ensureValidBytes1(numBytesNeeded); } void ensureValidBytes1(unsigned numBytesNeeded); static void afterGettingBytes(void* clientData, unsigned numBytesRead, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds); private: FramedSource* fInputSource; // should be a byte-stream source?? FramedSource::onCloseFunc* fOnInputCloseFunc; void* fOnInputCloseClientData; clientContinueFunc* fClientContinueFunc; void* fClientContinueClientData; // Use a pair of 'banks', and swap between them as they fill up: unsigned char* fBank[2]; unsigned char fCurBankNum; unsigned char* fCurBank; // The most recent 'saved' parse position: unsigned fSavedParserIndex; // <= fCurParserIndex unsigned char fSavedRemainingUnparsedBits; // The current position of the parser within the current bank: unsigned fCurParserIndex; // <= fTotNumValidBytes unsigned char fRemainingUnparsedBits; // in previous byte: [0,7] // The total number of valid bytes stored in the current bank: unsigned fTotNumValidBytes; // <= BANK_SIZE }; #endif
pilt/stream-server
live-media/liveMedia/StreamParser.hh
C++
gpl-2.0
4,434
/* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.security; import java.io.*; import java.net.URI; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.security.cert.CertificateException; import java.security.spec.AlgorithmParameterSpec; import java.util.*; import javax.crypto.SecretKey; import javax.security.auth.DestroyFailedException; import javax.security.auth.callback.*; /** * This class represents a storage facility for cryptographic * keys and certificates. * * <p> A {@code KeyStore} manages different types of entries. * Each type of entry implements the {@code KeyStore.Entry} interface. * Three basic {@code KeyStore.Entry} implementations are provided: * * <ul> * <li><b>KeyStore.PrivateKeyEntry</b> * <p> This type of entry holds a cryptographic {@code PrivateKey}, * which is optionally stored in a protected format to prevent * unauthorized access. It is also accompanied by a certificate chain * for the corresponding public key. * * <p> Private keys and certificate chains are used by a given entity for * self-authentication. Applications for this authentication include software * distribution organizations which sign JAR files as part of releasing * and/or licensing software. * * <li><b>KeyStore.SecretKeyEntry</b> * <p> This type of entry holds a cryptographic {@code SecretKey}, * which is optionally stored in a protected format to prevent * unauthorized access. * * <li><b>KeyStore.TrustedCertificateEntry</b> * <p> This type of entry contains a single public key {@code Certificate} * belonging to another party. It is called a <i>trusted certificate</i> * because the keystore owner trusts that the public key in the certificate * indeed belongs to the identity identified by the <i>subject</i> (owner) * of the certificate. * * <p>This type of entry can be used to authenticate other parties. * </ul> * * <p> Each entry in a keystore is identified by an "alias" string. In the * case of private keys and their associated certificate chains, these strings * distinguish among the different ways in which the entity may authenticate * itself. For example, the entity may authenticate itself using different * certificate authorities, or using different public key algorithms. * * <p> Whether aliases are case sensitive is implementation dependent. In order * to avoid problems, it is recommended not to use aliases in a KeyStore that * only differ in case. * * <p> Whether keystores are persistent, and the mechanisms used by the * keystore if it is persistent, are not specified here. This allows * use of a variety of techniques for protecting sensitive (e.g., private or * secret) keys. Smart cards or other integrated cryptographic engines * (SafeKeyper) are one option, and simpler mechanisms such as files may also * be used (in a variety of formats). * * <p> Typical ways to request a KeyStore object include * relying on the default type and providing a specific keystore type. * * <ul> * <li>To rely on the default type: * <pre> * KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); * </pre> * The system will return a keystore implementation for the default type. * * <li>To provide a specific keystore type: * <pre> * KeyStore ks = KeyStore.getInstance("JKS"); * </pre> * The system will return the most preferred implementation of the * specified keystore type available in the environment. <p> * </ul> * * <p> Before a keystore can be accessed, it must be * {@link #load(java.io.InputStream, char[]) loaded}. * <pre> * KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); * * // get user password and file input stream * char[] password = getPassword(); * * try (FileInputStream fis = new FileInputStream("keyStoreName")) { * ks.load(fis, password); * } * </pre> * * To create an empty keystore using the above {@code load} method, * pass {@code null} as the {@code InputStream} argument. * * <p> Once the keystore has been loaded, it is possible * to read existing entries from the keystore, or to write new entries * into the keystore: * <pre> * KeyStore.ProtectionParameter protParam = * new KeyStore.PasswordProtection(password); * * // get my private key * KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry) * ks.getEntry("privateKeyAlias", protParam); * PrivateKey myPrivateKey = pkEntry.getPrivateKey(); * * // save my secret key * javax.crypto.SecretKey mySecretKey; * KeyStore.SecretKeyEntry skEntry = * new KeyStore.SecretKeyEntry(mySecretKey); * ks.setEntry("secretKeyAlias", skEntry, protParam); * * // store away the keystore * try (FileOutputStream fos = new FileOutputStream("newKeyStoreName")) { * ks.store(fos, password); * } * </pre> * * Note that although the same password may be used to * load the keystore, to protect the private key entry, * to protect the secret key entry, and to store the keystore * (as is shown in the sample code above), * different passwords or other protection parameters * may also be used. * * <p> Android provides the following <code>KeyStore</code> types: * <table> * <thead> * <tr> * <th>Algorithm</th> * <th>Supported API Levels</th> * </tr> * </thead> * <tbody> * <tr> * <td>AndroidCAStore</td> * <td>14+</td> * </tr> * <tr> * <td>AndroidKeyStore</td> * <td>18+</td> * </tr> * <tr class="deprecated"> * <td>BCPKCS12</td> * <td>1-8</td> * </tr> * <tr> * <td>BKS</td> * <td>1+</td> * </tr> * <tr> * <td>BouncyCastle</td> * <td>1+</td> * </tr> * <tr> * <td>PKCS12</td> * <td>1+</td> * </tr> * <tr class="deprecated"> * <td>PKCS12-DEF</td> * <td>1-8</td> * </tr> * </tbody> * </table> * * These types are described in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore"> * KeyStore section</a> of the * Java Cryptography Architecture Standard Algorithm Name Documentation. * * @author Jan Luehe * * @see java.security.PrivateKey * @see javax.crypto.SecretKey * @see java.security.cert.Certificate * * @since 1.2 */ public class KeyStore { // BEGIN Android-removed: this debugging mechanism is not supported in Android. /* private static final Debug pdebug = Debug.getInstance("provider", "Provider"); private static final boolean skipDebug = Debug.isOn("engine=") && !Debug.isOn("keystore"); */ // END Android-removed: this debugging mechanism is not supported in Android. /* * Constant to lookup in the Security properties file to determine * the default keystore type. * In the Security properties file, the default keystore type is given as: * <pre> * keystore.type=jks * </pre> */ private static final String KEYSTORE_TYPE = "keystore.type"; // The keystore type private String type; // The provider private Provider provider; // The provider implementation private KeyStoreSpi keyStoreSpi; // Has this keystore been initialized (loaded)? private boolean initialized = false; /** * A marker interface for {@code KeyStore} * {@link #load(KeyStore.LoadStoreParameter) load} * and * {@link #store(KeyStore.LoadStoreParameter) store} * parameters. * * @since 1.5 */ public static interface LoadStoreParameter { /** * Gets the parameter used to protect keystore data. * * @return the parameter used to protect keystore data, or null */ public ProtectionParameter getProtectionParameter(); } /** * A marker interface for keystore protection parameters. * * <p> The information stored in a {@code ProtectionParameter} * object protects the contents of a keystore. * For example, protection parameters may be used to check * the integrity of keystore data, or to protect the * confidentiality of sensitive keystore data * (such as a {@code PrivateKey}). * * @since 1.5 */ public static interface ProtectionParameter { } /** * A password-based implementation of {@code ProtectionParameter}. * * @since 1.5 */ public static class PasswordProtection implements ProtectionParameter, javax.security.auth.Destroyable { private final char[] password; private final String protectionAlgorithm; private final AlgorithmParameterSpec protectionParameters; private volatile boolean destroyed = false; /** * Creates a password parameter. * * <p> The specified {@code password} is cloned before it is stored * in the new {@code PasswordProtection} object. * * @param password the password, which may be {@code null} */ public PasswordProtection(char[] password) { this.password = (password == null) ? null : password.clone(); this.protectionAlgorithm = null; this.protectionParameters = null; } /** * Creates a password parameter and specifies the protection algorithm * and associated parameters to use when encrypting a keystore entry. * <p> * The specified {@code password} is cloned before it is stored in the * new {@code PasswordProtection} object. * * @param password the password, which may be {@code null} * @param protectionAlgorithm the encryption algorithm name, for * example, {@code PBEWithHmacSHA256AndAES_256}. * See the Cipher section in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#Cipher"> * Java Cryptography Architecture Standard Algorithm Name * Documentation</a> * for information about standard encryption algorithm names. * @param protectionParameters the encryption algorithm parameter * specification, which may be {@code null} * @exception NullPointerException if {@code protectionAlgorithm} is * {@code null} * * @since 1.8 */ public PasswordProtection(char[] password, String protectionAlgorithm, AlgorithmParameterSpec protectionParameters) { if (protectionAlgorithm == null) { throw new NullPointerException("invalid null input"); } this.password = (password == null) ? null : password.clone(); this.protectionAlgorithm = protectionAlgorithm; this.protectionParameters = protectionParameters; } /** * Gets the name of the protection algorithm. * If none was set then the keystore provider will use its default * protection algorithm. The name of the default protection algorithm * for a given keystore type is set using the * {@code 'keystore.<type>.keyProtectionAlgorithm'} security property. * For example, the * {@code keystore.PKCS12.keyProtectionAlgorithm} property stores the * name of the default key protection algorithm used for PKCS12 * keystores. If the security property is not set, an * implementation-specific algorithm will be used. * * @return the algorithm name, or {@code null} if none was set * * @since 1.8 */ public String getProtectionAlgorithm() { return protectionAlgorithm; } /** * Gets the parameters supplied for the protection algorithm. * * @return the algorithm parameter specification, or {@code null}, * if none was set * * @since 1.8 */ public AlgorithmParameterSpec getProtectionParameters() { return protectionParameters; } /** * Gets the password. * * <p>Note that this method returns a reference to the password. * If a clone of the array is created it is the caller's * responsibility to zero out the password information * after it is no longer needed. * * @see #destroy() * @return the password, which may be {@code null} * @exception IllegalStateException if the password has * been cleared (destroyed) */ public synchronized char[] getPassword() { if (destroyed) { throw new IllegalStateException("password has been cleared"); } return password; } /** * Clears the password. * * @exception DestroyFailedException if this method was unable * to clear the password */ public synchronized void destroy() throws DestroyFailedException { destroyed = true; if (password != null) { Arrays.fill(password, ' '); } } /** * Determines if password has been cleared. * * @return true if the password has been cleared, false otherwise */ public synchronized boolean isDestroyed() { return destroyed; } } /** * A ProtectionParameter encapsulating a CallbackHandler. * * @since 1.5 */ public static class CallbackHandlerProtection implements ProtectionParameter { private final CallbackHandler handler; /** * Constructs a new CallbackHandlerProtection from a * CallbackHandler. * * @param handler the CallbackHandler * @exception NullPointerException if handler is null */ public CallbackHandlerProtection(CallbackHandler handler) { if (handler == null) { throw new NullPointerException("handler must not be null"); } this.handler = handler; } /** * Returns the CallbackHandler. * * @return the CallbackHandler. */ public CallbackHandler getCallbackHandler() { return handler; } } /** * A marker interface for {@code KeyStore} entry types. * * @since 1.5 */ public static interface Entry { /** * Retrieves the attributes associated with an entry. * <p> * The default implementation returns an empty {@code Set}. * * @return an unmodifiable {@code Set} of attributes, possibly empty * * @since 1.8 */ public default Set<Attribute> getAttributes() { return Collections.<Attribute>emptySet(); } /** * An attribute associated with a keystore entry. * It comprises a name and one or more values. * * @since 1.8 */ public interface Attribute { /** * Returns the attribute's name. * * @return the attribute name */ public String getName(); /** * Returns the attribute's value. * Multi-valued attributes encode their values as a single string. * * @return the attribute value */ public String getValue(); } } /** * A {@code KeyStore} entry that holds a {@code PrivateKey} * and corresponding certificate chain. * * @since 1.5 */ public static final class PrivateKeyEntry implements Entry { private final PrivateKey privKey; private final Certificate[] chain; private final Set<Attribute> attributes; /** * Constructs a {@code PrivateKeyEntry} with a * {@code PrivateKey} and corresponding certificate chain. * * <p> The specified {@code chain} is cloned before it is stored * in the new {@code PrivateKeyEntry} object. * * @param privateKey the {@code PrivateKey} * @param chain an array of {@code Certificate}s * representing the certificate chain. * The chain must be ordered and contain a * {@code Certificate} at index 0 * corresponding to the private key. * * @exception NullPointerException if * {@code privateKey} or {@code chain} * is {@code null} * @exception IllegalArgumentException if the specified chain has a * length of 0, if the specified chain does not contain * {@code Certificate}s of the same type, * or if the {@code PrivateKey} algorithm * does not match the algorithm of the {@code PublicKey} * in the end entity {@code Certificate} (at index 0) */ public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain) { this(privateKey, chain, Collections.<Attribute>emptySet()); } /** * Constructs a {@code PrivateKeyEntry} with a {@code PrivateKey} and * corresponding certificate chain and associated entry attributes. * * <p> The specified {@code chain} and {@code attributes} are cloned * before they are stored in the new {@code PrivateKeyEntry} object. * * @param privateKey the {@code PrivateKey} * @param chain an array of {@code Certificate}s * representing the certificate chain. * The chain must be ordered and contain a * {@code Certificate} at index 0 * corresponding to the private key. * @param attributes the attributes * * @exception NullPointerException if {@code privateKey}, {@code chain} * or {@code attributes} is {@code null} * @exception IllegalArgumentException if the specified chain has a * length of 0, if the specified chain does not contain * {@code Certificate}s of the same type, * or if the {@code PrivateKey} algorithm * does not match the algorithm of the {@code PublicKey} * in the end entity {@code Certificate} (at index 0) * * @since 1.8 */ public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<Attribute> attributes) { if (privateKey == null || chain == null || attributes == null) { throw new NullPointerException("invalid null input"); } if (chain.length == 0) { throw new IllegalArgumentException ("invalid zero-length input chain"); } Certificate[] clonedChain = chain.clone(); String certType = clonedChain[0].getType(); for (int i = 1; i < clonedChain.length; i++) { if (!certType.equals(clonedChain[i].getType())) { throw new IllegalArgumentException ("chain does not contain certificates " + "of the same type"); } } if (!privateKey.getAlgorithm().equals (clonedChain[0].getPublicKey().getAlgorithm())) { throw new IllegalArgumentException ("private key algorithm does not match " + "algorithm of public key in end entity " + "certificate (at index 0)"); } this.privKey = privateKey; if (clonedChain[0] instanceof X509Certificate && !(clonedChain instanceof X509Certificate[])) { this.chain = new X509Certificate[clonedChain.length]; System.arraycopy(clonedChain, 0, this.chain, 0, clonedChain.length); } else { this.chain = clonedChain; } this.attributes = Collections.unmodifiableSet(new HashSet<>(attributes)); } /** * Gets the {@code PrivateKey} from this entry. * * @return the {@code PrivateKey} from this entry */ public PrivateKey getPrivateKey() { return privKey; } /** * Gets the {@code Certificate} chain from this entry. * * <p> The stored chain is cloned before being returned. * * @return an array of {@code Certificate}s corresponding * to the certificate chain for the public key. * If the certificates are of type X.509, * the runtime type of the returned array is * {@code X509Certificate[]}. */ public Certificate[] getCertificateChain() { return chain.clone(); } /** * Gets the end entity {@code Certificate} * from the certificate chain in this entry. * * @return the end entity {@code Certificate} (at index 0) * from the certificate chain in this entry. * If the certificate is of type X.509, * the runtime type of the returned certificate is * {@code X509Certificate}. */ public Certificate getCertificate() { return chain[0]; } /** * Retrieves the attributes associated with an entry. * <p> * * @return an unmodifiable {@code Set} of attributes, possibly empty * * @since 1.8 */ @Override public Set<Attribute> getAttributes() { return attributes; } /** * Returns a string representation of this PrivateKeyEntry. * @return a string representation of this PrivateKeyEntry. */ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Private key entry and certificate chain with " + chain.length + " elements:\r\n"); for (Certificate cert : chain) { sb.append(cert); sb.append("\r\n"); } return sb.toString(); } } /** * A {@code KeyStore} entry that holds a {@code SecretKey}. * * @since 1.5 */ public static final class SecretKeyEntry implements Entry { private final SecretKey sKey; private final Set<Attribute> attributes; /** * Constructs a {@code SecretKeyEntry} with a * {@code SecretKey}. * * @param secretKey the {@code SecretKey} * * @exception NullPointerException if {@code secretKey} * is {@code null} */ public SecretKeyEntry(SecretKey secretKey) { if (secretKey == null) { throw new NullPointerException("invalid null input"); } this.sKey = secretKey; this.attributes = Collections.<Attribute>emptySet(); } /** * Constructs a {@code SecretKeyEntry} with a {@code SecretKey} and * associated entry attributes. * * <p> The specified {@code attributes} is cloned before it is stored * in the new {@code SecretKeyEntry} object. * * @param secretKey the {@code SecretKey} * @param attributes the attributes * * @exception NullPointerException if {@code secretKey} or * {@code attributes} is {@code null} * * @since 1.8 */ public SecretKeyEntry(SecretKey secretKey, Set<Attribute> attributes) { if (secretKey == null || attributes == null) { throw new NullPointerException("invalid null input"); } this.sKey = secretKey; this.attributes = Collections.unmodifiableSet(new HashSet<>(attributes)); } /** * Gets the {@code SecretKey} from this entry. * * @return the {@code SecretKey} from this entry */ public SecretKey getSecretKey() { return sKey; } /** * Retrieves the attributes associated with an entry. * <p> * * @return an unmodifiable {@code Set} of attributes, possibly empty * * @since 1.8 */ @Override public Set<Attribute> getAttributes() { return attributes; } /** * Returns a string representation of this SecretKeyEntry. * @return a string representation of this SecretKeyEntry. */ public String toString() { return "Secret key entry with algorithm " + sKey.getAlgorithm(); } } /** * A {@code KeyStore} entry that holds a trusted * {@code Certificate}. * * @since 1.5 */ public static final class TrustedCertificateEntry implements Entry { private final Certificate cert; private final Set<Attribute> attributes; /** * Constructs a {@code TrustedCertificateEntry} with a * trusted {@code Certificate}. * * @param trustedCert the trusted {@code Certificate} * * @exception NullPointerException if * {@code trustedCert} is {@code null} */ public TrustedCertificateEntry(Certificate trustedCert) { if (trustedCert == null) { throw new NullPointerException("invalid null input"); } this.cert = trustedCert; this.attributes = Collections.<Attribute>emptySet(); } /** * Constructs a {@code TrustedCertificateEntry} with a * trusted {@code Certificate} and associated entry attributes. * * <p> The specified {@code attributes} is cloned before it is stored * in the new {@code TrustedCertificateEntry} object. * * @param trustedCert the trusted {@code Certificate} * @param attributes the attributes * * @exception NullPointerException if {@code trustedCert} or * {@code attributes} is {@code null} * * @since 1.8 */ public TrustedCertificateEntry(Certificate trustedCert, Set<Attribute> attributes) { if (trustedCert == null || attributes == null) { throw new NullPointerException("invalid null input"); } this.cert = trustedCert; this.attributes = Collections.unmodifiableSet(new HashSet<>(attributes)); } /** * Gets the trusted {@code Certficate} from this entry. * * @return the trusted {@code Certificate} from this entry */ public Certificate getTrustedCertificate() { return cert; } /** * Retrieves the attributes associated with an entry. * <p> * * @return an unmodifiable {@code Set} of attributes, possibly empty * * @since 1.8 */ @Override public Set<Attribute> getAttributes() { return attributes; } /** * Returns a string representation of this TrustedCertificateEntry. * @return a string representation of this TrustedCertificateEntry. */ public String toString() { return "Trusted certificate entry:\r\n" + cert.toString(); } } /** * Creates a KeyStore object of the given type, and encapsulates the given * provider implementation (SPI object) in it. * * @param keyStoreSpi the provider implementation. * @param provider the provider. * @param type the keystore type. */ protected KeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) { this.keyStoreSpi = keyStoreSpi; this.provider = provider; this.type = type; // BEGIN Android-removed: this debugging mechanism is not supported in Android. /* if (!skipDebug && pdebug != null) { pdebug.println("KeyStore." + type.toUpperCase() + " type from: " + this.provider.getName()); } */ // END Android-removed: this debugging mechanism is not supported in Android. } /** * Returns a keystore object of the specified type. * * <p> This method traverses the list of registered security Providers, * starting with the most preferred Provider. * A new KeyStore object encapsulating the * KeyStoreSpi implementation from the first * Provider that supports the specified type is returned. * * <p> Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the type of keystore. * See the KeyStore section in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard keystore types. * * @return a keystore object of the specified type. * * @exception KeyStoreException if no Provider supports a * KeyStoreSpi implementation for the * specified type. * * @see Provider */ public static KeyStore getInstance(String type) throws KeyStoreException { try { Object[] objs = Security.getImpl(type, "KeyStore", (String)null); return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type); } catch (NoSuchAlgorithmException nsae) { throw new KeyStoreException(type + " not found", nsae); } catch (NoSuchProviderException nspe) { throw new KeyStoreException(type + " not found", nspe); } } /** * Returns a keystore object of the specified type. * * <p> A new KeyStore object encapsulating the * KeyStoreSpi implementation from the specified provider * is returned. The specified provider must be registered * in the security provider list. * * <p> Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the type of keystore. * See the KeyStore section in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard keystore types. * * @param provider the name of the provider. * * @return a keystore object of the specified type. * * @exception KeyStoreException if a KeyStoreSpi * implementation for the specified type is not * available from the specified provider. * * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * * @exception IllegalArgumentException if the provider name is null * or empty. * * @see Provider */ public static KeyStore getInstance(String type, String provider) throws KeyStoreException, NoSuchProviderException { if (provider == null || provider.length() == 0) throw new IllegalArgumentException("missing provider"); try { Object[] objs = Security.getImpl(type, "KeyStore", provider); return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type); } catch (NoSuchAlgorithmException nsae) { throw new KeyStoreException(type + " not found", nsae); } } /** * Returns a keystore object of the specified type. * * <p> A new KeyStore object encapsulating the * KeyStoreSpi implementation from the specified Provider * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * * @param type the type of keystore. * See the KeyStore section in the <a href= * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyStore"> * Java Cryptography Architecture Standard Algorithm Name Documentation</a> * for information about standard keystore types. * * @param provider the provider. * * @return a keystore object of the specified type. * * @exception KeyStoreException if KeyStoreSpi * implementation for the specified type is not available * from the specified Provider object. * * @exception IllegalArgumentException if the specified provider is null. * * @see Provider * * @since 1.4 */ public static KeyStore getInstance(String type, Provider provider) throws KeyStoreException { if (provider == null) throw new IllegalArgumentException("missing provider"); try { Object[] objs = Security.getImpl(type, "KeyStore", provider); return new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type); } catch (NoSuchAlgorithmException nsae) { throw new KeyStoreException(type + " not found", nsae); } } /** * Returns the default keystore type as specified by the * {@code keystore.type} security property, or the string * {@literal "jks"} (acronym for {@literal "Java keystore"}) * if no such property exists. * * <p>The default keystore type can be used by applications that do not * want to use a hard-coded keystore type when calling one of the * {@code getInstance} methods, and want to provide a default keystore * type in case a user does not specify its own. * * <p>The default keystore type can be changed by setting the value of the * {@code keystore.type} security property to the desired keystore type. * * @return the default keystore type as specified by the * {@code keystore.type} security property, or the string {@literal "jks"} * if no such property exists. * @see java.security.Security security properties */ public final static String getDefaultType() { String kstype; kstype = AccessController.doPrivileged(new PrivilegedAction<String>() { public String run() { return Security.getProperty(KEYSTORE_TYPE); } }); if (kstype == null) { kstype = "jks"; } return kstype; } /** * Returns the provider of this keystore. * * @return the provider of this keystore. */ public final Provider getProvider() { return this.provider; } /** * Returns the type of this keystore. * * @return the type of this keystore. */ public final String getType() { return this.type; } /** * Returns the key associated with the given alias, using the given * password to recover it. The key must have been associated with * the alias by a call to {@code setKeyEntry}, * or by a call to {@code setEntry} with a * {@code PrivateKeyEntry} or {@code SecretKeyEntry}. * * @param alias the alias name * @param password the password for recovering the key * * @return the requested key, or null if the given alias does not exist * or does not identify a key-related entry. * * @exception KeyStoreException if the keystore has not been initialized * (loaded). * @exception NoSuchAlgorithmException if the algorithm for recovering the * key cannot be found * @exception UnrecoverableKeyException if the key cannot be recovered * (e.g., the given password is wrong). */ public final Key getKey(String alias, char[] password) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetKey(alias, password); } /** * Returns the certificate chain associated with the given alias. * The certificate chain must have been associated with the alias * by a call to {@code setKeyEntry}, * or by a call to {@code setEntry} with a * {@code PrivateKeyEntry}. * * @param alias the alias name * * @return the certificate chain (ordered with the user's certificate first * followed by zero or more certificate authorities), or null if the given alias * does not exist or does not contain a certificate chain * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final Certificate[] getCertificateChain(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetCertificateChain(alias); } /** * Returns the certificate associated with the given alias. * * <p> If the given alias name identifies an entry * created by a call to {@code setCertificateEntry}, * or created by a call to {@code setEntry} with a * {@code TrustedCertificateEntry}, * then the trusted certificate contained in that entry is returned. * * <p> If the given alias name identifies an entry * created by a call to {@code setKeyEntry}, * or created by a call to {@code setEntry} with a * {@code PrivateKeyEntry}, * then the first element of the certificate chain in that entry * is returned. * * @param alias the alias name * * @return the certificate, or null if the given alias does not exist or * does not contain a certificate. * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final Certificate getCertificate(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetCertificate(alias); } /** * Returns the creation date of the entry identified by the given alias. * * @param alias the alias name * * @return the creation date of this entry, or null if the given alias does * not exist * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final Date getCreationDate(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetCreationDate(alias); } /** * Assigns the given key to the given alias, protecting it with the given * password. * * <p>If the given key is of type {@code java.security.PrivateKey}, * it must be accompanied by a certificate chain certifying the * corresponding public key. * * <p>If the given alias already exists, the keystore information * associated with it is overridden by the given key (and possibly * certificate chain). * * @param alias the alias name * @param key the key to be associated with the alias * @param password the password to protect the key * @param chain the certificate chain for the corresponding public * key (only required if the given key is of type * {@code java.security.PrivateKey}). * * @exception KeyStoreException if the keystore has not been initialized * (loaded), the given key cannot be protected, or this operation fails * for some other reason */ public final void setKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } if ((key instanceof PrivateKey) && (chain == null || chain.length == 0)) { throw new IllegalArgumentException("Private key must be " + "accompanied by certificate " + "chain"); } keyStoreSpi.engineSetKeyEntry(alias, key, password, chain); } /** * Assigns the given key (that has already been protected) to the given * alias. * * <p>If the protected key is of type * {@code java.security.PrivateKey}, it must be accompanied by a * certificate chain certifying the corresponding public key. If the * underlying keystore implementation is of type {@code jks}, * {@code key} must be encoded as an * {@code EncryptedPrivateKeyInfo} as defined in the PKCS #8 standard. * * <p>If the given alias already exists, the keystore information * associated with it is overridden by the given key (and possibly * certificate chain). * * @param alias the alias name * @param key the key (in protected format) to be associated with the alias * @param chain the certificate chain for the corresponding public * key (only useful if the protected key is of type * {@code java.security.PrivateKey}). * * @exception KeyStoreException if the keystore has not been initialized * (loaded), or if this operation fails for some other reason. */ public final void setKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineSetKeyEntry(alias, key, chain); } /** * Assigns the given trusted certificate to the given alias. * * <p> If the given alias identifies an existing entry * created by a call to {@code setCertificateEntry}, * or created by a call to {@code setEntry} with a * {@code TrustedCertificateEntry}, * the trusted certificate in the existing entry * is overridden by the given certificate. * * @param alias the alias name * @param cert the certificate * * @exception KeyStoreException if the keystore has not been initialized, * or the given alias already exists and does not identify an * entry containing a trusted certificate, * or this operation fails for some other reason. */ public final void setCertificateEntry(String alias, Certificate cert) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineSetCertificateEntry(alias, cert); } /** * Deletes the entry identified by the given alias from this keystore. * * @param alias the alias name * * @exception KeyStoreException if the keystore has not been initialized, * or if the entry cannot be removed. */ public final void deleteEntry(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineDeleteEntry(alias); } /** * Lists all the alias names of this keystore. * * @return enumeration of the alias names * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final Enumeration<String> aliases() throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineAliases(); } /** * Checks if the given alias exists in this keystore. * * @param alias the alias name * * @return true if the alias exists, false otherwise * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final boolean containsAlias(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineContainsAlias(alias); } /** * Retrieves the number of entries in this keystore. * * @return the number of entries in this keystore * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final int size() throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineSize(); } /** * Returns true if the entry identified by the given alias * was created by a call to {@code setKeyEntry}, * or created by a call to {@code setEntry} with a * {@code PrivateKeyEntry} or a {@code SecretKeyEntry}. * * @param alias the alias for the keystore entry to be checked * * @return true if the entry identified by the given alias is a * key-related entry, false otherwise. * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final boolean isKeyEntry(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineIsKeyEntry(alias); } /** * Returns true if the entry identified by the given alias * was created by a call to {@code setCertificateEntry}, * or created by a call to {@code setEntry} with a * {@code TrustedCertificateEntry}. * * @param alias the alias for the keystore entry to be checked * * @return true if the entry identified by the given alias contains a * trusted certificate, false otherwise. * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final boolean isCertificateEntry(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineIsCertificateEntry(alias); } /** * Returns the (alias) name of the first keystore entry whose certificate * matches the given certificate. * * <p> This method attempts to match the given certificate with each * keystore entry. If the entry being considered was * created by a call to {@code setCertificateEntry}, * or created by a call to {@code setEntry} with a * {@code TrustedCertificateEntry}, * then the given certificate is compared to that entry's certificate. * * <p> If the entry being considered was * created by a call to {@code setKeyEntry}, * or created by a call to {@code setEntry} with a * {@code PrivateKeyEntry}, * then the given certificate is compared to the first * element of that entry's certificate chain. * * @param cert the certificate to match with. * * @return the alias name of the first entry with a matching certificate, * or null if no such entry exists in this keystore. * * @exception KeyStoreException if the keystore has not been initialized * (loaded). */ public final String getCertificateAlias(Certificate cert) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetCertificateAlias(cert); } /** * Stores this keystore to the given output stream, and protects its * integrity with the given password. * * @param stream the output stream to which this keystore is written. * @param password the password to generate the keystore integrity check * * @exception KeyStoreException if the keystore has not been initialized * (loaded). * @exception IOException if there was an I/O problem with data * @exception NoSuchAlgorithmException if the appropriate data integrity * algorithm could not be found * @exception CertificateException if any of the certificates included in * the keystore data could not be stored */ public final void store(OutputStream stream, char[] password) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineStore(stream, password); } /** * Stores this keystore using the given {@code LoadStoreParameter}. * * @param param the {@code LoadStoreParameter} * that specifies how to store the keystore, * which may be {@code null} * * @exception IllegalArgumentException if the given * {@code LoadStoreParameter} * input is not recognized * @exception KeyStoreException if the keystore has not been initialized * (loaded) * @exception IOException if there was an I/O problem with data * @exception NoSuchAlgorithmException if the appropriate data integrity * algorithm could not be found * @exception CertificateException if any of the certificates included in * the keystore data could not be stored * * @since 1.5 */ public final void store(LoadStoreParameter param) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineStore(param); } /** * Loads this KeyStore from the given input stream. * * <p>A password may be given to unlock the keystore * (e.g. the keystore resides on a hardware token device), * or to check the integrity of the keystore data. * If a password is not given for integrity checking, * then integrity checking is not performed. * * <p>In order to create an empty keystore, or if the keystore cannot * be initialized from a stream, pass {@code null} * as the {@code stream} argument. * * <p> Note that if this keystore has already been loaded, it is * reinitialized and loaded again from the given input stream. * * @param stream the input stream from which the keystore is loaded, * or {@code null} * @param password the password used to check the integrity of * the keystore, the password used to unlock the keystore, * or {@code null} * * @exception IOException if there is an I/O or format problem with the * keystore data, if a password is required but not given, * or if the given password was incorrect. If the error is due to a * wrong password, the {@link Throwable#getCause cause} of the * {@code IOException} should be an * {@code UnrecoverableKeyException} * @exception NoSuchAlgorithmException if the algorithm used to check * the integrity of the keystore cannot be found * @exception CertificateException if any of the certificates in the * keystore could not be loaded */ public final void load(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException { keyStoreSpi.engineLoad(stream, password); initialized = true; } /** * Loads this keystore using the given {@code LoadStoreParameter}. * * <p> Note that if this KeyStore has already been loaded, it is * reinitialized and loaded again from the given parameter. * * @param param the {@code LoadStoreParameter} * that specifies how to load the keystore, * which may be {@code null} * * @exception IllegalArgumentException if the given * {@code LoadStoreParameter} * input is not recognized * @exception IOException if there is an I/O or format problem with the * keystore data. If the error is due to an incorrect * {@code ProtectionParameter} (e.g. wrong password) * the {@link Throwable#getCause cause} of the * {@code IOException} should be an * {@code UnrecoverableKeyException} * @exception NoSuchAlgorithmException if the algorithm used to check * the integrity of the keystore cannot be found * @exception CertificateException if any of the certificates in the * keystore could not be loaded * * @since 1.5 */ public final void load(LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException { keyStoreSpi.engineLoad(param); initialized = true; } /** * Gets a keystore {@code Entry} for the specified alias * with the specified protection parameter. * * @param alias get the keystore {@code Entry} for this alias * @param protParam the {@code ProtectionParameter} * used to protect the {@code Entry}, * which may be {@code null} * * @return the keystore {@code Entry} for the specified alias, * or {@code null} if there is no such entry * * @exception NullPointerException if * {@code alias} is {@code null} * @exception NoSuchAlgorithmException if the algorithm for recovering the * entry cannot be found * @exception UnrecoverableEntryException if the specified * {@code protParam} were insufficient or invalid * @exception UnrecoverableKeyException if the entry is a * {@code PrivateKeyEntry} or {@code SecretKeyEntry} * and the specified {@code protParam} does not contain * the information needed to recover the key (e.g. wrong password) * @exception KeyStoreException if the keystore has not been initialized * (loaded). * @see #setEntry(String, KeyStore.Entry, KeyStore.ProtectionParameter) * * @since 1.5 */ public final Entry getEntry(String alias, ProtectionParameter protParam) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException { if (alias == null) { throw new NullPointerException("invalid null input"); } if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetEntry(alias, protParam); } /** * Saves a keystore {@code Entry} under the specified alias. * The protection parameter is used to protect the * {@code Entry}. * * <p> If an entry already exists for the specified alias, * it is overridden. * * @param alias save the keystore {@code Entry} under this alias * @param entry the {@code Entry} to save * @param protParam the {@code ProtectionParameter} * used to protect the {@code Entry}, * which may be {@code null} * * @exception NullPointerException if * {@code alias} or {@code entry} * is {@code null} * @exception KeyStoreException if the keystore has not been initialized * (loaded), or if this operation fails for some other reason * * @see #getEntry(String, KeyStore.ProtectionParameter) * * @since 1.5 */ public final void setEntry(String alias, Entry entry, ProtectionParameter protParam) throws KeyStoreException { if (alias == null || entry == null) { throw new NullPointerException("invalid null input"); } if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineSetEntry(alias, entry, protParam); } /** * Determines if the keystore {@code Entry} for the specified * {@code alias} is an instance or subclass of the specified * {@code entryClass}. * * @param alias the alias name * @param entryClass the entry class * * @return true if the keystore {@code Entry} for the specified * {@code alias} is an instance or subclass of the * specified {@code entryClass}, false otherwise * * @exception NullPointerException if * {@code alias} or {@code entryClass} * is {@code null} * @exception KeyStoreException if the keystore has not been * initialized (loaded) * * @since 1.5 */ public final boolean entryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass) throws KeyStoreException { if (alias == null || entryClass == null) { throw new NullPointerException("invalid null input"); } if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineEntryInstanceOf(alias, entryClass); } /** * A description of a to-be-instantiated KeyStore object. * * <p>An instance of this class encapsulates the information needed to * instantiate and initialize a KeyStore object. That process is * triggered when the {@linkplain #getKeyStore} method is called. * * <p>This makes it possible to decouple configuration from KeyStore * object creation and e.g. delay a password prompt until it is * needed. * * @see KeyStore * @see javax.net.ssl.KeyStoreBuilderParameters * @since 1.5 */ public static abstract class Builder { // maximum times to try the callbackhandler if the password is wrong static final int MAX_CALLBACK_TRIES = 3; /** * Construct a new Builder. */ protected Builder() { // empty } /** * Returns the KeyStore described by this object. * * @return the {@code KeyStore} described by this object * @exception KeyStoreException if an error occurred during the * operation, for example if the KeyStore could not be * instantiated or loaded */ public abstract KeyStore getKeyStore() throws KeyStoreException; /** * Returns the ProtectionParameters that should be used to obtain * the {@link KeyStore.Entry Entry} with the given alias. * The {@code getKeyStore} method must be invoked before this * method may be called. * * @return the ProtectionParameters that should be used to obtain * the {@link KeyStore.Entry Entry} with the given alias. * @param alias the alias of the KeyStore entry * @throws NullPointerException if alias is null * @throws KeyStoreException if an error occurred during the * operation * @throws IllegalStateException if the getKeyStore method has * not been invoked prior to calling this method */ public abstract ProtectionParameter getProtectionParameter(String alias) throws KeyStoreException; /** * Returns a new Builder that encapsulates the given KeyStore. * The {@linkplain #getKeyStore} method of the returned object * will return {@code keyStore}, the {@linkplain * #getProtectionParameter getProtectionParameter()} method will * return {@code protectionParameters}. * * <p> This is useful if an existing KeyStore object needs to be * used with Builder-based APIs. * * @return a new Builder object * @param keyStore the KeyStore to be encapsulated * @param protectionParameter the ProtectionParameter used to * protect the KeyStore entries * @throws NullPointerException if keyStore or * protectionParameters is null * @throws IllegalArgumentException if the keyStore has not been * initialized */ public static Builder newInstance(final KeyStore keyStore, final ProtectionParameter protectionParameter) { if ((keyStore == null) || (protectionParameter == null)) { throw new NullPointerException(); } if (keyStore.initialized == false) { throw new IllegalArgumentException("KeyStore not initialized"); } return new Builder() { private volatile boolean getCalled; public KeyStore getKeyStore() { getCalled = true; return keyStore; } public ProtectionParameter getProtectionParameter(String alias) { if (alias == null) { throw new NullPointerException(); } if (getCalled == false) { throw new IllegalStateException ("getKeyStore() must be called first"); } return protectionParameter; } }; } /** * Returns a new Builder object. * * <p>The first call to the {@link #getKeyStore} method on the returned * builder will create a KeyStore of type {@code type} and call * its {@link KeyStore#load load()} method. * The {@code inputStream} argument is constructed from * {@code file}. * If {@code protection} is a * {@code PasswordProtection}, the password is obtained by * calling the {@code getPassword} method. * Otherwise, if {@code protection} is a * {@code CallbackHandlerProtection}, the password is obtained * by invoking the CallbackHandler. * * <p>Subsequent calls to {@link #getKeyStore} return the same object * as the initial call. If the initial call to failed with a * KeyStoreException, subsequent calls also throw a * KeyStoreException. * * <p>The KeyStore is instantiated from {@code provider} if * non-null. Otherwise, all installed providers are searched. * * <p>Calls to {@link #getProtectionParameter getProtectionParameter()} * will return a {@link KeyStore.PasswordProtection PasswordProtection} * object encapsulating the password that was used to invoke the * {@code load} method. * * <p><em>Note</em> that the {@link #getKeyStore} method is executed * within the {@link AccessControlContext} of the code invoking this * method. * * @return a new Builder object * @param type the type of KeyStore to be constructed * @param provider the provider from which the KeyStore is to * be instantiated (or null) * @param file the File that contains the KeyStore data * @param protection the ProtectionParameter securing the KeyStore data * @throws NullPointerException if type, file or protection is null * @throws IllegalArgumentException if protection is not an instance * of either PasswordProtection or CallbackHandlerProtection; or * if file does not exist or does not refer to a normal file */ public static Builder newInstance(String type, Provider provider, File file, ProtectionParameter protection) { if ((type == null) || (file == null) || (protection == null)) { throw new NullPointerException(); } if ((protection instanceof PasswordProtection == false) && (protection instanceof CallbackHandlerProtection == false)) { throw new IllegalArgumentException ("Protection must be PasswordProtection or " + "CallbackHandlerProtection"); } if (file.isFile() == false) { throw new IllegalArgumentException ("File does not exist or it does not refer " + "to a normal file: " + file); } return new FileBuilder(type, provider, file, protection, AccessController.getContext()); } private static final class FileBuilder extends Builder { private final String type; private final Provider provider; private final File file; private ProtectionParameter protection; private ProtectionParameter keyProtection; private final AccessControlContext context; private KeyStore keyStore; private Throwable oldException; FileBuilder(String type, Provider provider, File file, ProtectionParameter protection, AccessControlContext context) { this.type = type; this.provider = provider; this.file = file; this.protection = protection; this.context = context; } public synchronized KeyStore getKeyStore() throws KeyStoreException { if (keyStore != null) { return keyStore; } if (oldException != null) { throw new KeyStoreException ("Previous KeyStore instantiation failed", oldException); } PrivilegedExceptionAction<KeyStore> action = new PrivilegedExceptionAction<KeyStore>() { public KeyStore run() throws Exception { if (protection instanceof CallbackHandlerProtection == false) { return run0(); } // when using a CallbackHandler, // reprompt if the password is wrong int tries = 0; while (true) { tries++; try { return run0(); } catch (IOException e) { if ((tries < MAX_CALLBACK_TRIES) && (e.getCause() instanceof UnrecoverableKeyException)) { continue; } throw e; } } } public KeyStore run0() throws Exception { KeyStore ks; if (provider == null) { ks = KeyStore.getInstance(type); } else { ks = KeyStore.getInstance(type, provider); } InputStream in = null; char[] password = null; try { in = new FileInputStream(file); if (protection instanceof PasswordProtection) { password = ((PasswordProtection)protection).getPassword(); keyProtection = protection; } else { CallbackHandler handler = ((CallbackHandlerProtection)protection) .getCallbackHandler(); PasswordCallback callback = new PasswordCallback ("Password for keystore " + file.getName(), false); handler.handle(new Callback[] {callback}); password = callback.getPassword(); if (password == null) { throw new KeyStoreException("No password" + " provided"); } callback.clearPassword(); keyProtection = new PasswordProtection(password); } ks.load(in, password); return ks; } finally { if (in != null) { in.close(); } } } }; try { keyStore = AccessController.doPrivileged(action, context); return keyStore; } catch (PrivilegedActionException e) { oldException = e.getCause(); throw new KeyStoreException ("KeyStore instantiation failed", oldException); } } public synchronized ProtectionParameter getProtectionParameter(String alias) { if (alias == null) { throw new NullPointerException(); } if (keyStore == null) { throw new IllegalStateException ("getKeyStore() must be called first"); } return keyProtection; } } /** * Returns a new Builder object. * * <p>Each call to the {@link #getKeyStore} method on the returned * builder will return a new KeyStore object of type {@code type}. * Its {@link KeyStore#load(KeyStore.LoadStoreParameter) load()} * method is invoked using a * {@code LoadStoreParameter} that encapsulates * {@code protection}. * * <p>The KeyStore is instantiated from {@code provider} if * non-null. Otherwise, all installed providers are searched. * * <p>Calls to {@link #getProtectionParameter getProtectionParameter()} * will return {@code protection}. * * <p><em>Note</em> that the {@link #getKeyStore} method is executed * within the {@link AccessControlContext} of the code invoking this * method. * * @return a new Builder object * @param type the type of KeyStore to be constructed * @param provider the provider from which the KeyStore is to * be instantiated (or null) * @param protection the ProtectionParameter securing the Keystore * @throws NullPointerException if type or protection is null */ public static Builder newInstance(final String type, final Provider provider, final ProtectionParameter protection) { if ((type == null) || (protection == null)) { throw new NullPointerException(); } final AccessControlContext context = AccessController.getContext(); return new Builder() { private volatile boolean getCalled; private IOException oldException; private final PrivilegedExceptionAction<KeyStore> action = new PrivilegedExceptionAction<KeyStore>() { public KeyStore run() throws Exception { KeyStore ks; if (provider == null) { ks = KeyStore.getInstance(type); } else { ks = KeyStore.getInstance(type, provider); } LoadStoreParameter param = new SimpleLoadStoreParameter(protection); if (protection instanceof CallbackHandlerProtection == false) { ks.load(param); } else { // when using a CallbackHandler, // reprompt if the password is wrong int tries = 0; while (true) { tries++; try { ks.load(param); break; } catch (IOException e) { if (e.getCause() instanceof UnrecoverableKeyException) { if (tries < MAX_CALLBACK_TRIES) { continue; } else { oldException = e; } } throw e; } } } getCalled = true; return ks; } }; public synchronized KeyStore getKeyStore() throws KeyStoreException { if (oldException != null) { throw new KeyStoreException ("Previous KeyStore instantiation failed", oldException); } try { return AccessController.doPrivileged(action, context); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); throw new KeyStoreException ("KeyStore instantiation failed", cause); } } public ProtectionParameter getProtectionParameter(String alias) { if (alias == null) { throw new NullPointerException(); } if (getCalled == false) { throw new IllegalStateException ("getKeyStore() must be called first"); } return protection; } }; } } static class SimpleLoadStoreParameter implements LoadStoreParameter { private final ProtectionParameter protection; SimpleLoadStoreParameter(ProtectionParameter protection) { this.protection = protection; } public ProtectionParameter getProtectionParameter() { return protection; } } }
google/desugar_jdk_libs
jdk11/src/libcore/ojluni/src/main/java/java/security/KeyStore.java
Java
gpl-2.0
77,059
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.1"> <context> <name>main</name> <message> <source>System Preferences</source> <translation>Ustawienia systemu</translation> </message> <message> <source>Keywords</source> <translation type="unfinished"/> </message> <message> <source>Personal</source> <translation type="unfinished"/> </message> <message> <source>Hardware</source> <translation type="unfinished"/> </message> <message> <source>System</source> <translation type="unfinished"/> </message> </context> </TS>
hawaii-desktop/hawaii-system-preferences
shells/translations/desktopshell_pl.ts
TypeScript
gpl-2.0
657
/* * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ /* * @summary SynchronizerDeadlock creates threads that are deadlocked * waiting for JSR-166 synchronizers. * @author Mandy Chung * @build Barrier */ import java.lang.management.*; import java.util.*; import java.util.concurrent.locks.*; public class SynchronizerDeadlock { private Lock a = new ReentrantLock(); private Lock b = new ReentrantLock(); private Lock c = new ReentrantLock(); private final int EXPECTED_THREADS = 3; private Thread[] dThreads = new Thread[EXPECTED_THREADS]; private Barrier go = new Barrier(1); private Barrier barr = new Barrier(EXPECTED_THREADS); public SynchronizerDeadlock() { dThreads[0] = new DeadlockingThread("Deadlock-Thread-1", a, b); dThreads[1] = new DeadlockingThread("Deadlock-Thread-2", b, c); dThreads[2] = new DeadlockingThread("Deadlock-Thread-3", c, a); // make them daemon threads so that the test will exit for (int i = 0; i < EXPECTED_THREADS; i++) { dThreads[i].setDaemon(true); dThreads[i].start(); } } void goDeadlock() { // Wait until all threads have started barr.await(); // reset for later signals barr.set(EXPECTED_THREADS); while (go.getWaiterCount() != EXPECTED_THREADS) { synchronized(this) { try { wait(100); } catch (InterruptedException e) { // ignore } } } // sleep a little so that all threads are blocked before notified. try { Thread.sleep(100); } catch (InterruptedException e) { // ignore } go.signal(); } void waitUntilDeadlock() { barr.await(); for (int i=0; i < 100; i++) { // sleep a little while to wait until threads are blocked. try { Thread.sleep(100); } catch (InterruptedException e) { // ignore } boolean retry = false; for (Thread t: dThreads) { if (t.getState() == Thread.State.RUNNABLE) { retry = true; break; } } if (!retry) { break; } } } private class DeadlockingThread extends Thread { private final Lock lock1; private final Lock lock2; DeadlockingThread(String name, Lock lock1, Lock lock2) { super(name); this.lock1 = lock1; this.lock2 = lock2; } public void run() { f(); } private void f() { lock1.lock(); try { barr.signal(); go.await(); g(); } finally { lock1.unlock(); } } private void g() { barr.signal(); lock2.lock(); throw new RuntimeException("should not reach here."); } } void checkResult(long[] threads) { if (threads.length != EXPECTED_THREADS) { ThreadDump.threadDump(); throw new RuntimeException("Expected to have " + EXPECTED_THREADS + " to be in the deadlock list"); } boolean[] found = new boolean[EXPECTED_THREADS]; for (int i = 0; i < threads.length; i++) { for (int j = 0; j < dThreads.length; j++) { if (dThreads[j].getId() == threads[i]) { found[j] = true; } } } boolean ok = true; for (int j = 0; j < found.length; j++) { ok = ok && found[j]; } if (!ok) { System.out.print("Returned result is ["); for (int j = 0; j < threads.length; j++) { System.out.print(threads[j] + " "); } System.out.println("]"); System.out.print("Expected result is ["); for (int j = 0; j < threads.length; j++) { System.out.print(dThreads[j] + " "); } System.out.println("]"); throw new RuntimeException("Unexpected result returned " + " by findMonitorDeadlockedThreads method."); } } }
TheTypoMaster/Scaper
openjdk/jdk/test/java/lang/management/ThreadMXBean/SynchronizerDeadlock.java
Java
gpl-2.0
5,419
/* * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.swing.table; import java.awt.Component; import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Insets; import java.awt.Point; import java.awt.Rectangle; import javax.swing.*; import javax.swing.plaf.UIResource; import javax.swing.border.Border; import javax.swing.table.*; import sun.swing.DefaultLookup; public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer implements UIResource { private boolean horizontalTextPositionSet; private Icon sortArrow; private EmptyIcon emptyIcon = new EmptyIcon(); public DefaultTableCellHeaderRenderer() { setHorizontalAlignment(JLabel.CENTER); } public void setHorizontalTextPosition(int textPosition) { horizontalTextPositionSet = true; super.setHorizontalTextPosition(textPosition); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Icon sortIcon = null; boolean isPaintingForPrint = false; if (table != null) { JTableHeader header = table.getTableHeader(); if (header != null) { Color fgColor = null; Color bgColor = null; if (hasFocus) { fgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellForeground"); bgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellBackground"); } if (fgColor == null) { fgColor = header.getForeground(); } if (bgColor == null) { bgColor = header.getBackground(); } setForeground(fgColor); setBackground(bgColor); setFont(header.getFont()); isPaintingForPrint = header.isPaintingForPrint(); } if (!isPaintingForPrint && table.getRowSorter() != null) { if (!horizontalTextPositionSet) { // There is a row sorter, and the developer hasn't // set a text position, change to leading. setHorizontalTextPosition(JLabel.LEADING); } SortOrder sortOrder = getColumnSortOrder(table, column); if (sortOrder != null) { switch(sortOrder) { case ASCENDING: sortIcon = DefaultLookup.getIcon( this, ui, "Table.ascendingSortIcon"); break; case DESCENDING: sortIcon = DefaultLookup.getIcon( this, ui, "Table.descendingSortIcon"); break; case UNSORTED: sortIcon = DefaultLookup.getIcon( this, ui, "Table.naturalSortIcon"); break; } } } } setText(value == null ? "" : value.toString()); setIcon(sortIcon); sortArrow = sortIcon; Border border = null; if (hasFocus) { border = DefaultLookup.getBorder(this, ui, "TableHeader.focusCellBorder"); } if (border == null) { border = DefaultLookup.getBorder(this, ui, "TableHeader.cellBorder"); } setBorder(border); return this; } public static SortOrder getColumnSortOrder(JTable table, int column) { SortOrder rv = null; if (table.getRowSorter() == null) { return rv; } java.util.List<? extends RowSorter.SortKey> sortKeys = table.getRowSorter().getSortKeys(); if (sortKeys.size() > 0 && sortKeys.get(0).getColumn() == table.convertColumnIndexToModel(column)) { rv = sortKeys.get(0).getSortOrder(); } return rv; } @Override public void paintComponent(Graphics g) { boolean b = DefaultLookup.getBoolean(this, ui, "TableHeader.rightAlignSortArrow", false); if (b && sortArrow != null) { //emptyIcon is used so that if the text in the header is right //aligned, or if the column is too narrow, then the text will //be sized appropriately to make room for the icon that is about //to be painted manually here. emptyIcon.width = sortArrow.getIconWidth(); emptyIcon.height = sortArrow.getIconHeight(); setIcon(emptyIcon); super.paintComponent(g); Point position = computeIconPosition(g); sortArrow.paintIcon(this, g, position.x, position.y); } else { super.paintComponent(g); } } private Point computeIconPosition(Graphics g) { FontMetrics fontMetrics = g.getFontMetrics(); Rectangle viewR = new Rectangle(); Rectangle textR = new Rectangle(); Rectangle iconR = new Rectangle(); Insets i = getInsets(); viewR.x = i.left; viewR.y = i.top; viewR.width = getWidth() - (i.left + i.right); viewR.height = getHeight() - (i.top + i.bottom); SwingUtilities.layoutCompoundLabel( this, fontMetrics, getText(), sortArrow, getVerticalAlignment(), getHorizontalAlignment(), getVerticalTextPosition(), getHorizontalTextPosition(), viewR, iconR, textR, getIconTextGap()); int x = getWidth() - i.right - sortArrow.getIconWidth(); int y = iconR.y; return new Point(x, y); } private class EmptyIcon implements Icon { int width = 0; int height = 0; public void paintIcon(Component c, Graphics g, int x, int y) {} public int getIconWidth() { return width; } public int getIconHeight() { return height; } } }
TheTypoMaster/Scaper
openjdk/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java
Java
gpl-2.0
7,302
/* A hashtable class, supports a more efficient lookup than standard dynamic relations (c) 2001-2006 F.G. McCabe This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Francis McCabe <frankmccabe@mac.com> */ go.hash{ import go.io. hash[Ky,Vl] <~ { insert:[Ky,Vl]*. find:[Ky]=>Vl. present:[Ky+,Vl]{}. delete:[Ky]*. ext:[]=>list[(Ky,Vl)]. keys:[]=>list[Ky]. values:[]=>list[Vl]. count:[]=>integer }. hash:[list[(Ktp,Vtp)],integer]@>hash[Ktp,Vtp]. hash(I,Size)..{ table:opaque := __newhash(max(Size,listlen(I)*2)). ${ ((H,V) in I *> table:=__hashinsert(table,H,V)); }. insert(Ky,Vl) -> sync{ table:=__hashinsert(table,Ky,Vl)} onerror( error(_,Code) -> raise error("insert",Code) ). find(Ky) => valof{ sync{ __hashsearch(table,Ky,Value) ? valis Value | raise error("find",'eNOTFND') } }. present(Ky,Value) :- action{ sync{ __hashsearch(table,Ky,Value) ? valis true | valis false}}. count() => valof{ sync{ valis __hashcount(table); } }. delete(Ky) -> sync{ __hashdelete(table,Ky) } onerror( error(_,Code) -> raise error("delete",Code) ). ext() => valof{ sync{ valis __hashcontents(table) } onerror( error(_,Code) -> raise error("ext",Code) ) }. keys() => valof{ sync{ valis __hashkeys(table) } onerror( error(_,Code) -> raise error("keys",Code) ) }. values() => valof{ sync{ valis __hashvalues(table) } onerror( error(_,Code) -> raise error("ext",Code) ) }. }. }
fmccabe/go
go/hash.go
GO
gpl-2.0
2,503
# multiAgents.py # -------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to # http://inst.eecs.berkeley.edu/~cs188/pacman/pacman.html # # Attribution Information: The Pacman AI projects were developed at UC Berkeley. # The core projects and autograders were primarily created by John DeNero # (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu). # Student side autograding was added by Brad Miller, Nick Hay, and # Pieter Abbeel (pabbeel@cs.berkeley.edu). from util import manhattanDistance from game import Directions import random, util from game import Agent class ReflexAgent(Agent): """ A reflex agent chooses an action at each choice point by examining its alternatives via a state evaluation function. The code below is provided as a guide. You are welcome to change it in any way you see fit, so long as you don't touch our method headers. """ def getAction(self, gameState): """ You do not need to change this method, but you're welcome to. getAction chooses among the best options according to the evaluation function. Just like in the previous project, getAction takes a GameState and returns some Directions.X for some X in the set {North, South, West, East, Stop} """ # Collect legal moves and successor states legalMoves = gameState.getLegalActions() # Choose one of the best actions scores = [self.evaluationFunction(gameState, action) for action in legalMoves] bestScore = max(scores) bestIndices = [index for index in range(len(scores)) if scores[index] == bestScore] chosenIndex = random.choice(bestIndices) # Pick randomly among the best "Add more of your code here if you want to" return legalMoves[chosenIndex] def evaluationFunction(self, currentGameState, action): """ Design a better evaluation function here. The evaluation function takes in the current and proposed successor GameStates (pacman.py) and returns a number, where higher numbers are better. The code below extracts some useful information from the state, like the remaining food (newFood) and Pacman position after moving (newPos). newScaredTimes holds the number of moves that each ghost will remain scared because of Pacman having eaten a power pellet. Print out these variables to see what you're getting, then combine them to create a masterful evaluation function. """ # Useful information you can extract from a GameState (pacman.py) successorGameState = currentGameState.generatePacmanSuccessor(action) newPos = successorGameState.getPacmanPosition() newFood = successorGameState.getFood() newGhostStates = successorGameState.getGhostStates() newScaredTimes = [ghostState.scaredTimer for ghostState in newGhostStates] "*** YOUR CODE HERE ***" ghost = str(newGhostStates[0]) ghost = ghost[ghost.find('=') + 1 : ghost.rfind(',')] ghost = ghost.replace(".0", "") #print newPos, newGhostStates[0] if str(newPos) == ghost: return -10 if newFood[newPos[0]][newPos[1]]: return 3 if newScaredTimes[0] > 0: return 10 return successorGameState.getScore() def scoreEvaluationFunction(currentGameState): """ This default evaluation function just returns the score of the state. The score is the same one displayed in the Pacman GUI. This evaluation function is meant for use with adversarial search agents (not reflex agents). """ return currentGameState.getScore() class MultiAgentSearchAgent(Agent): """ This class provides some common elements to all of your multi-agent searchers. Any methods defined here will be available to the MinimaxPacmanAgent, AlphaBetaPacmanAgent & ExpectimaxPacmanAgent. You *do not* need to make any changes here, but you can if you want to add functionality to all your adversarial search agents. Please do not remove anything, however. Note: this is an abstract class: one that should not be instantiated. It's only partially specified, and designed to be extended. Agent (game.py) is another abstract class. """ def __init__(self, evalFn = 'scoreEvaluationFunction', depth = '2'): self.index = 0 # Pacman is always agent index 0 self.evaluationFunction = util.lookup(evalFn, globals()) self.depth = int(depth) class MinimaxAgent(MultiAgentSearchAgent): """ Your minimax agent (question 2) """ def getAction(self, gameState): """ Returns the minimax action from the current gameState using self.depth and self.evaluationFunction. Here are some method calls that might be useful when implementing minimax. gameState.getLegalActions(agentIndex): Returns a list of legal actions for an agent agentIndex=0 means Pacman, ghosts are >= 1 gameState.generateSuccessor(agentIndex, action): Returns the successor game state after an agent takes an action gameState.getNumAgents(): Returns the total number of agents in the game """ "*** YOUR CODE HERE ***" util.raiseNotDefined() class AlphaBetaAgent(MultiAgentSearchAgent): """ Your minimax agent with alpha-beta pruning (question 3) """ def getAction(self, gameState): """ Returns the minimax action using self.depth and self.evaluationFunction """ "*** YOUR CODE HERE ***" util.raiseNotDefined() class ExpectimaxAgent(MultiAgentSearchAgent): """ Your expectimax agent (question 4) """ def getAction(self, gameState): """ Returns the expectimax action using self.depth and self.evaluationFunction All ghosts should be modeled as choosing uniformly at random from their legal moves. """ "*** YOUR CODE HERE ***" util.raiseNotDefined() def betterEvaluationFunction(currentGameState): """ Your extreme ghost-hunting, pellet-nabbing, food-gobbling, unstoppable evaluation function (question 5). DESCRIPTION: <write something here so we know what you did> """ "*** YOUR CODE HERE ***" util.raiseNotDefined() # Abbreviation better = betterEvaluationFunction class ContestAgent(MultiAgentSearchAgent): """ Your agent for the mini-contest """ def getAction(self, gameState): """ Returns an action. You can use any method you want and search to any depth you want. Just remember that the mini-contest is timed, so you have to trade off speed and computation. Ghosts don't behave randomly anymore, but they aren't perfect either -- they'll usually just make a beeline straight towards Pacman (or away from him if they're scared!) """ "*** YOUR CODE HERE ***" util.raiseNotDefined()
sumitb/cse537
multiagent/multiAgents.py
Python
gpl-2.0
7,379
<?php /** * @package HikaShop for Joomla! * @version 2.6.4 * @author hikashop.com * @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $style = ''; if(@$this->element['small_cart']) $style='display: none;'; ?> <div class="hkc-xl-6 hkc-md-6 hikashop_module_subblock hikashop_module_edit_product" style="<?php echo $style; ?>" data-part="mini_cart"> <div class="hikashop_module_subblock_content"> <?php $style = ''; if(!@$this->element['show_price']) $style='display: none;'; ?> <div class="hikashop_menu_subblock_title hikashop_module_edit_display_settings_div_title"><?php echo JText::_('HIKA_PRICE_DISPLAY'); ?></div> <dl class="hika_options"> <dt class="hikashop_option_name"> <?php echo JText::_('DISPLAY_PRICE');?> </dt> <dd class="hikashop_option_value"> <?php if(!isset($this->element['show_price'])) $this->element['show_price'] = '-1'; foreach($this->arr as $v){ if($v->value == $this->default_params['show_price']) $v->default = true; } echo JHTML::_('hikaselect.radiolist', $this->arr, $this->name.'[show_price]', 'data-control="price"', 'value', 'text', @$this->element['show_price']); ?> </dd> </dl> <dl class="hika_options" id="price_display_type_line" style="<?php echo $style; ?>" data-part="price"> <dt class="hikashop_option_name"> <?php echo JText::_('HIKA_PRICE_TYPE');?> </dt> <dd class="hikashop_option_value"> <?php if(!isset($this->element['price_display_type'])) $this->element['price_display_type'] = 'inherit'; echo $this->priceDisplayType->display( $this->name.'[price_display_type]',@$this->element['price_display_type']); ?> </dd> </dl> <dl class="hika_options" id="show_taxed_price_line" style="<?php echo $style; ?>" data-part="price"> <dt class="hikashop_option_name"> <?php echo JText::_('SHOW_TAXED_PRICES');?> </dt> <dd class="hikashop_option_value"> <?php if(!isset($this->element['price_with_tax'])) $this->element['price_with_tax'] = 3; echo $this->pricetaxType->display($this->name.'[price_with_tax]' , $this->element['price_with_tax'],true); ?> </dd> </dl> <dl class="hika_options" id="show_original_price_line" style="<?php echo $style; ?>" data-part="price"> <dt class="hikashop_option_name"> <?php echo JText::_('HIKA_ORIGINAL_CURRENCY');?> </dt> <dd class="hikashop_option_value"> <?php if(!isset($this->element['show_original_price'])) $this->element['show_original_price'] = '-1'; foreach($this->arr as $v){ if($v->value == $this->default_params['show_original_price']) $v->default = true; } echo JHTML::_('hikaselect.radiolist', $this->arr, $this->name.'[show_original_price]' , '', 'value', 'text', @$this->element['show_original_price']); ?> </dd> </dl> <dl class="hika_options" id="show_discount_line" style="<?php echo $style; ?>" data-part="price"> <dt class="hikashop_option_name"> <?php echo JText::_('HIKA_DISCOUNT_DISPLAY');?> </dt> <dd class="hikashop_option_value"> <?php if(!isset($this->element['show_discount'])) $this->element['show_discount'] = 3; echo $this->discountDisplayType->display( $this->name.'[show_discount]' ,@$this->element['show_discount']); ?> </dd> </dl> </div> </div> <?php $js = " window.hikashop.ready(function(){ hkjQuery('[data-control=\'price\']').change(function(){ if(hkjQuery(this).val() == '1' || (hkjQuery(this).val() == '-1' && '".@$this->default_params['show_price']."' == '1')) hkjQuery('[data-part=\'price\']').show(); else hkjQuery('[data-part=\'price\']').hide(); }); }); "; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js);
khuongdang/dongtrungtruongsinh
administrator/components/com_hikashop/views/cartmodules/tmpl/options_price.php
PHP
gpl-2.0
3,899
/* * This file is modified by Ivan Maidanski <ivmai@ivmaisoft.com> * Project name: JCGO-SUNAWT (http://www.ivmaisoft.com/jcgo/) */ /* * @(#)BasicSpinnerUI.java 1.18 06/08/17 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package javax.swing.plaf.basic; import java.awt.*; import java.awt.event.*; import java.text.ParseException; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.text.*; import java.beans.*; import java.text.*; import java.util.*; /** * The default Spinner UI delegate. * * @version 1.15 01/23/03 * @author Hans Muller * @since 1.4 */ public class BasicSpinnerUI extends SpinnerUI { /** * The spinner that we're a UI delegate for. Initialized by * the <code>installUI</code> method, and reset to null * by <code>uninstallUI</code>. * * @see #installUI * @see #uninstallUI */ protected JSpinner spinner; /** * The <code>PropertyChangeListener</code> that's added to the * <code>JSpinner</code> itself. This listener is created by the * <code>createPropertyChangeListener</code> method, added by the * <code>installListeners</code> method, and removed by the * <code>uninstallListeners</code> method. * <p> * One instance of this listener is shared by all JSpinners. * * @see #createPropertyChangeListener * @see #installListeners * @see #uninstallListeners */ private static final PropertyChangeListener propertyChangeListener = new PropertyChangeHandler(); /** * The mouse/action listeners that are added to the spinner's * arrow buttons. These listeners are shared by all * spinner arrow buttons. * * @see #createNextButton * @see #createPreviousButton */ private static ArrowButtonHandler nextButtonHandler; private static ArrowButtonHandler previousButtonHandler; private static synchronized void initButtonHandlers() { if (nextButtonHandler == null) nextButtonHandler = new ArrowButtonHandler("increment", true); if (previousButtonHandler == null) previousButtonHandler = new ArrowButtonHandler("decrement", false); } /** * Returns a new instance of BasicSpinnerUI. SpinnerListUI * delegates are allocated one per JSpinner. * * @param c the JSpinner (not used) * @see ComponentUI#createUI * @return a new BasicSpinnerUI object */ public static ComponentUI createUI(JComponent c) { return new BasicSpinnerUI(); } public BasicSpinnerUI() { initButtonHandlers(); } private void maybeAdd(Component c, String s) { if (c != null) { spinner.add(c, s); } } /** * Calls <code>installDefaults</code>, <code>installListeners</code>, * and then adds the components returned by <code>createNextButton</code>, * <code>createPreviousButton</code>, and <code>createEditor</code>. * * @param c the JSpinner * @see #installDefaults * @see #installListeners * @see #createNextButton * @see #createPreviousButton * @see #createEditor */ public void installUI(JComponent c) { this.spinner = (JSpinner)c; installDefaults(); installListeners(); maybeAdd(createNextButton(), "Next"); maybeAdd(createPreviousButton(), "Previous"); maybeAdd(createEditor(), "Editor"); updateEnabledState(); installKeyboardActions(); } /** * Calls <code>uninstallDefaults</code>, <code>uninstallListeners</code>, * and then removes all of the spinners children. * * @param c the JSpinner (not used) */ public void uninstallUI(JComponent c) { uninstallDefaults(); uninstallListeners(); this.spinner = null; c.removeAll(); } /** * Initializes <code>propertyChangeListener</code> with * a shared object that delegates interesting PropertyChangeEvents * to protected methods. * <p> * This method is called by <code>installUI</code>. * * @see #replaceEditor * @see #uninstallListeners */ protected void installListeners() { JComponent editor = spinner.getEditor(); if (editor != null && editor instanceof JSpinner.DefaultEditor) { JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField(); if (tf != null) { tf.removeFocusListener(nextButtonHandler); tf.addFocusListener(nextButtonHandler); tf.removeFocusListener(previousButtonHandler); tf.addFocusListener(previousButtonHandler); } } spinner.addPropertyChangeListener(propertyChangeListener); } /** * Removes the <code>propertyChangeListener</code> added * by installListeners. * <p> * This method is called by <code>uninstallUI</code>. * * @see #installListeners */ protected void uninstallListeners() { spinner.removePropertyChangeListener(propertyChangeListener); JComponent editor = spinner.getEditor(); removeEditorBorderListener(editor); if (editor instanceof JSpinner.DefaultEditor) { JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField(); if (tf != null) { tf.removeFocusListener(nextButtonHandler); tf.removeFocusListener(previousButtonHandler); } } } /** * Initialize the <code>JSpinner</code> <code>border</code>, * <code>foreground</code>, and <code>background</code>, properties * based on the corresponding "Spinner.*" properties from defaults table. * The <code>JSpinners</code> layout is set to the value returned by * <code>createLayout</code>. This method is called by <code>installUI</code>. * * @see #uninstallDefaults * @see #installUI * @see #createLayout * @see LookAndFeel#installBorder * @see LookAndFeel#installColors */ protected void installDefaults() { spinner.setLayout(createLayout()); LookAndFeel.installBorder(spinner, "Spinner.border"); LookAndFeel.installColorsAndFont(spinner, "Spinner.background", "Spinner.foreground", "Spinner.font"); } /** * Sets the <code>JSpinner's</code> layout manager to null. This * method is called by <code>uninstallUI</code>. * * @see #installDefaults * @see #uninstallUI */ protected void uninstallDefaults() { spinner.setLayout(null); } /** * Create a <code>LayoutManager</code> that manages the <code>editor</code>, * <code>nextButton</code>, and <code>previousButton</code> * children of the JSpinner. These three children must be * added with a constraint that identifies their role: * "Editor", "Next", and "Previous". The default layout manager * can handle the absence of any of these children. * * @return a LayoutManager for the editor, next button, and previous button. * @see #createNextButton * @see #createPreviousButton * @see #createEditor */ protected LayoutManager createLayout() { return new SpinnerLayout(); } /** * Create a <code>PropertyChangeListener</code> that can be * added to the JSpinner itself. Typically, this listener * will call replaceEditor when the "editor" property changes, * since it's the <code>SpinnerUI's</code> responsibility to * add the editor to the JSpinner (and remove the old one). * This method is called by <code>installListeners</code>. * * @return A PropertyChangeListener for the JSpinner itself * @see #installListeners */ protected PropertyChangeListener createPropertyChangeListener() { return new PropertyChangeHandler(); } /** * Create a component that will replace the spinner models value * with the object returned by <code>spinner.getPreviousValue</code>. * By default the <code>previousButton</code> is a JButton * who's <code>ActionListener</code> updates it's <code>JSpinner</code> * ancestors model. If a previousButton isn't needed (in a subclass) * then override this method to return null. * * @return a component that will replace the spinners model with the * next value in the sequence, or null * @see #installUI * @see #createNextButton */ protected Component createPreviousButton() { return createArrowButton(SwingConstants.SOUTH, previousButtonHandler); } /** * Create a component that will replace the spinner models value * with the object returned by <code>spinner.getNextValue</code>. * By default the <code>nextButton</code> is a JButton * who's <code>ActionListener</code> updates it's <code>JSpinner</code> * ancestors model. If a nextButton isn't needed (in a subclass) * then override this method to return null. * * @return a component that will replace the spinners model with the * next value in the sequence, or null * @see #installUI * @see #createPreviousButton */ protected Component createNextButton() { return createArrowButton(SwingConstants.NORTH, nextButtonHandler); } private Component createArrowButton(int direction, ArrowButtonHandler handler) { JButton b = new BasicArrowButton(direction); b.addActionListener(handler); b.addMouseListener(handler); Border buttonBorder = UIManager.getBorder("Spinner.arrowButtonBorder"); if (buttonBorder instanceof UIResource) { // Wrap the border to avoid having the UIResource be replaced by // the ButtonUI. This is the opposite of using BorderUIResource. b.setBorder(new CompoundBorder(buttonBorder, null)); } else { b.setBorder(buttonBorder); } return b; } /** * This method is called by installUI to get the editor component * of the <code>JSpinner</code>. By default it just returns * <code>JSpinner.getEditor()</code>. Subclasses can override * <code>createEditor</code> to return a component that contains * the spinner's editor or null, if they're going to handle adding * the editor to the <code>JSpinner</code> in an * <code>installUI</code> override. * <p> * Typically this method would be overridden to wrap the editor * with a container with a custom border, since one can't assume * that the editors border can be set directly. * <p> * The <code>replaceEditor</code> method is called when the spinners * editor is changed with <code>JSpinner.setEditor</code>. If you've * overriden this method, then you'll probably want to override * <code>replaceEditor</code> as well. * * @return the JSpinners editor JComponent, spinner.getEditor() by default * @see #installUI * @see #replaceEditor * @see JSpinner#getEditor */ protected JComponent createEditor() { JComponent editor = spinner.getEditor(); maybeRemoveEditorBorder(editor); installEditorBorderListener(editor); return editor; } /** * Called by the <code>PropertyChangeListener</code> when the * <code>JSpinner</code> editor property changes. It's the responsibility * of this method to remove the old editor and add the new one. By * default this operation is just: * <pre> * spinner.remove(oldEditor); * spinner.add(newEditor, "Editor"); * </pre> * The implementation of <code>replaceEditor</code> should be coordinated * with the <code>createEditor</code> method. * * @see #createEditor * @see #createPropertyChangeListener */ protected void replaceEditor(JComponent oldEditor, JComponent newEditor) { spinner.remove(oldEditor); maybeRemoveEditorBorder(newEditor); installEditorBorderListener(newEditor); spinner.add(newEditor, "Editor"); } /** * Remove the border around the inner editor component for LaFs * that install an outside border around the spinner, */ private void maybeRemoveEditorBorder(JComponent editor) { if (!UIManager.getBoolean("Spinner.editorBorderPainted")) { if (editor instanceof JPanel && editor.getBorder() == null && editor.getComponentCount() > 0) { editor = (JComponent)editor.getComponent(0); } if (editor != null && editor.getBorder() instanceof UIResource) { editor.setBorder(null); } } } /** * Remove the border around the inner editor component for LaFs * that install an outside border around the spinner, */ private void installEditorBorderListener(JComponent editor) { if (!UIManager.getBoolean("Spinner.editorBorderPainted")) { if (editor instanceof JPanel && editor.getBorder() == null && editor.getComponentCount() > 0) { editor = (JComponent)editor.getComponent(0); } if (editor != null && (editor.getBorder() == null || editor.getBorder() instanceof UIResource)) { editor.addPropertyChangeListener(propertyChangeListener); } } } private void removeEditorBorderListener(JComponent editor) { if (!UIManager.getBoolean("Spinner.editorBorderPainted")) { if (editor instanceof JPanel && editor.getComponentCount() > 0) { editor = (JComponent)editor.getComponent(0); } if (editor != null) { editor.removePropertyChangeListener(propertyChangeListener); } } } /** * Updates the enabled state of the children Components based on the * enabled state of the <code>JSpinner</code>. */ private void updateEnabledState() { updateEnabledState(spinner, spinner.isEnabled()); } /** * Recursively updates the enabled state of the child * <code>Component</code>s of <code>c</code>. */ private void updateEnabledState(Container c, boolean enabled) { for (int counter = c.getComponentCount() - 1; counter >= 0;counter--) { Component child = c.getComponent(counter); child.setEnabled(enabled); if (child instanceof Container) { updateEnabledState((Container)child, enabled); } } } /** * Installs the KeyboardActions onto the JSpinner. */ private void installKeyboardActions() { InputMap iMap = getInputMap(JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); SwingUtilities.replaceUIInputMap(spinner, JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, iMap); SwingUtilities.replaceUIActionMap(spinner, getActionMap()); } /** * Returns the InputMap to install for <code>condition</code>. */ private InputMap getInputMap(int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) { return (InputMap)UIManager.get("Spinner.ancestorInputMap"); } return null; } private ActionMap getActionMap() { ActionMap map = (ActionMap)UIManager.get("Spinner.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("Spinner.actionMap", map); } } return map; } private ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); map.put("increment", nextButtonHandler); map.put("decrement", previousButtonHandler); return map; } /** * A handler for spinner arrow button mouse and action events. When * a left mouse pressed event occurs we look up the (enabled) spinner * that's the source of the event and start the autorepeat timer. The * timer fires action events until any button is released at which * point the timer is stopped and the reference to the spinner cleared. * The timer doesn't start until after a 300ms delay, so often the * source of the initial (and final) action event is just the button * logic for mouse released - which means that we're relying on the fact * that our mouse listener runs after the buttons mouse listener. * <p> * Note that one instance of this handler is shared by all slider previous * arrow buttons and likewise for all of the next buttons, * so it doesn't have any state that persists beyond the limits * of a single button pressed/released gesture. */ private static class ArrowButtonHandler extends AbstractAction implements MouseListener, FocusListener, UIResource { final javax.swing.Timer autoRepeatTimer; final boolean isNext; JSpinner spinner = null; JButton arrowButton = null; ArrowButtonHandler(String name, boolean isNext) { super(name); this.isNext = isNext; autoRepeatTimer = new javax.swing.Timer(60, this); autoRepeatTimer.setInitialDelay(300); } private JSpinner eventToSpinner(AWTEvent e) { Object src = e.getSource(); while ((src instanceof Component) && !(src instanceof JSpinner)) { src = ((Component)src).getParent(); } return (src instanceof JSpinner) ? (JSpinner)src : null; } public void actionPerformed(ActionEvent e) { JSpinner spinner = this.spinner; if (!(e.getSource() instanceof javax.swing.Timer)) { // Most likely resulting from being in ActionMap. spinner = eventToSpinner(e); if (e.getSource() instanceof BasicArrowButton) { arrowButton = (JButton)e.getSource(); } } else { if (arrowButton!=null && !arrowButton.getModel().isPressed() && autoRepeatTimer.isRunning()) { autoRepeatTimer.stop(); spinner = null; } } if (spinner != null) { try { int calendarField = getCalendarField(spinner); spinner.commitEdit(); if (calendarField != -1) { ((SpinnerDateModel)spinner.getModel()). setCalendarField(calendarField); } Object value = (isNext) ? spinner.getNextValue() : spinner.getPreviousValue(); if (value != null) { spinner.setValue(value); select(spinner); } } catch (IllegalArgumentException iae) { UIManager.getLookAndFeel().provideErrorFeedback(spinner); } catch (ParseException pe) { UIManager.getLookAndFeel().provideErrorFeedback(spinner); } } } /** * If the spinner's editor is a DateEditor, this selects the field * associated with the value that is being incremented. */ private void select(JSpinner spinner) { JComponent editor = spinner.getEditor(); if (editor instanceof JSpinner.DateEditor) { JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; JFormattedTextField ftf = dateEditor.getTextField(); Format format = dateEditor.getFormat(); Object value; if (format != null && (value = spinner.getValue()) != null) { SpinnerDateModel model = dateEditor.getModel(); DateFormat.Field field = DateFormat.Field.ofCalendarField( model.getCalendarField()); if (field != null) { try { AttributedCharacterIterator iterator = format. formatToCharacterIterator(value); if (!select(ftf, iterator, field) && field == DateFormat.Field.HOUR0) { select(ftf, iterator, DateFormat.Field.HOUR1); } } catch (IllegalArgumentException iae) {} } } } } /** * Selects the passed in field, returning true if it is found, * false otherwise. */ private boolean select(JFormattedTextField ftf, AttributedCharacterIterator iterator, DateFormat.Field field) { int max = ftf.getDocument().getLength(); iterator.first(); do { Map attrs = iterator.getAttributes(); if (attrs != null && attrs.containsKey(field)){ int start = iterator.getRunStart(field); int end = iterator.getRunLimit(field); if (start != -1 && end != -1 && start <= max && end <= max) { ftf.select(start, end); } return true; } } while (iterator.next() != CharacterIterator.DONE); return false; } /** * Returns the calendarField under the start of the selection, or * -1 if there is no valid calendar field under the selection (or * the spinner isn't editing dates. */ private int getCalendarField(JSpinner spinner) { JComponent editor = spinner.getEditor(); if (editor instanceof JSpinner.DateEditor) { JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; JFormattedTextField ftf = dateEditor.getTextField(); int start = ftf.getSelectionStart(); JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter(); if (formatter instanceof InternationalFormatter) { Format.Field[] fields = ((InternationalFormatter) formatter).getFields(start); for (int counter = 0; counter < fields.length; counter++) { if (fields[counter] instanceof DateFormat.Field) { int calendarField; if (fields[counter] == DateFormat.Field.HOUR1) { calendarField = Calendar.HOUR; } else { calendarField = ((DateFormat.Field) fields[counter]).getCalendarField(); } if (calendarField != -1) { return calendarField; } } } } } return -1; } public void mousePressed(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) && e.getComponent().isEnabled()) { spinner = eventToSpinner(e); autoRepeatTimer.start(); focusSpinnerIfNecessary(); } } public void mouseReleased(MouseEvent e) { autoRepeatTimer.stop(); spinner = null; } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } /** * Requests focus on a child of the spinner if the spinner doesn't * have focus. */ private void focusSpinnerIfNecessary() { Component fo = KeyboardFocusManager. getCurrentKeyboardFocusManager().getFocusOwner(); if (spinner.isRequestFocusEnabled() && ( fo == null || !SwingUtilities.isDescendingFrom(fo, spinner))) { Container root = spinner; if (!root.isFocusCycleRoot()) { root = root.getFocusCycleRootAncestor(); } if (root != null) { FocusTraversalPolicy ftp = root.getFocusTraversalPolicy(); Component child = ftp.getComponentAfter(root, spinner); if (child != null && SwingUtilities.isDescendingFrom( child, spinner)) { child.requestFocus(); } } } } public void focusGained(FocusEvent e) { } public void focusLost(FocusEvent e) { if (autoRepeatTimer.isRunning()) { autoRepeatTimer.stop(); } spinner = null; if (arrowButton !=null) { ButtonModel model = arrowButton.getModel(); model.setPressed(false); model.setArmed(false); } } } /** * A simple layout manager for the editor and the next/previous buttons. * See the BasicSpinnerUI javadoc for more information about exactly * how the components are arranged. */ private static class SpinnerLayout implements LayoutManager { private Component nextButton = null; private Component previousButton = null; private Component editor = null; public void addLayoutComponent(String name, Component c) { if ("Next".equals(name)) { nextButton = c; } else if ("Previous".equals(name)) { previousButton = c; } else if ("Editor".equals(name)) { editor = c; } } public void removeLayoutComponent(Component c) { if (c == nextButton) { c = null; } else if (c == previousButton) { previousButton = null; } else if (c == editor) { editor = null; } } /** * Used by the default LayoutManager class - SpinnerLayout for * missing (null) editor/nextButton/previousButton children. */ private static final Dimension zeroSize = new Dimension(0, 0); private Dimension preferredSize(Component c) { return (c == null) ? zeroSize : c.getPreferredSize(); } public Dimension preferredLayoutSize(Container parent) { Dimension nextD = preferredSize(nextButton); Dimension previousD = preferredSize(previousButton); Dimension editorD = preferredSize(editor); /* Force the editors height to be a multiple of 2 */ editorD.height = ((editorD.height + 1) / 2) * 2; Dimension size = new Dimension(editorD.width, editorD.height); size.width += Math.max(nextD.width, previousD.width); Insets insets = parent.getInsets(); size.width += insets.left + insets.right; size.height += insets.top + insets.bottom; return size; } public Dimension minimumLayoutSize(Container parent) { return preferredLayoutSize(parent); } private void setBounds(Component c, int x, int y, int width, int height) { if (c != null) { c.setBounds(x, y, width, height); } } public void layoutContainer(Container parent) { int width = parent.getWidth(); int height = parent.getHeight(); Insets insets = parent.getInsets(); Dimension nextD = preferredSize(nextButton); Dimension previousD = preferredSize(previousButton); int buttonsWidth = Math.max(nextD.width, previousD.width); int editorHeight = height - (insets.top + insets.bottom); // The arrowButtonInsets value is used instead of the JSpinner's // insets if not null. Defining this to be (0, 0, 0, 0) causes the // buttons to be aligned with the outer edge of the spinner's // border, and leaving it as "null" places the buttons completely // inside the spinner's border. Insets buttonInsets = UIManager.getInsets("Spinner.arrowButtonInsets"); if (buttonInsets == null) { buttonInsets = insets; } /* Deal with the spinner's componentOrientation property. */ int editorX, editorWidth, buttonsX; if (parent.getComponentOrientation().isLeftToRight()) { editorX = insets.left; editorWidth = width - insets.left - buttonsWidth - buttonInsets.right; buttonsX = width - buttonsWidth - buttonInsets.right; } else { buttonsX = buttonInsets.left; editorX = buttonsX + buttonsWidth; editorWidth = width - buttonInsets.left - buttonsWidth - insets.right; } int nextY = buttonInsets.top; int nextHeight = (height / 2) + (height % 2) - nextY; int previousY = buttonInsets.top + nextHeight; int previousHeight = height - previousY - buttonInsets.bottom; setBounds(editor, editorX, insets.top, editorWidth, editorHeight); setBounds(nextButton, buttonsX, nextY, buttonsWidth, nextHeight); setBounds(previousButton, buttonsX, previousY, buttonsWidth, previousHeight); } } /** * Detect JSpinner property changes we're interested in and delegate. Subclasses * shouldn't need to replace the default propertyChangeListener (although they * can by overriding createPropertyChangeListener) since all of the interesting * property changes are delegated to protected methods. */ private static class PropertyChangeHandler implements PropertyChangeListener { public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (e.getSource() instanceof JSpinner) { JSpinner spinner = (JSpinner)(e.getSource()); SpinnerUI spinnerUI = spinner.getUI(); if (spinnerUI instanceof BasicSpinnerUI) { BasicSpinnerUI ui = (BasicSpinnerUI)spinnerUI; if ("editor".equals(propertyName)) { JComponent oldEditor = (JComponent)e.getOldValue(); JComponent newEditor = (JComponent)e.getNewValue(); ui.replaceEditor(oldEditor, newEditor); ui.updateEnabledState(); if (oldEditor instanceof JSpinner.DefaultEditor) { JTextField tf = ((JSpinner.DefaultEditor)oldEditor).getTextField(); if (tf != null) { tf.removeFocusListener(nextButtonHandler); tf.removeFocusListener(previousButtonHandler); } } if (newEditor instanceof JSpinner.DefaultEditor) { JTextField tf = ((JSpinner.DefaultEditor)newEditor).getTextField(); if (tf != null) { if (tf.getFont() instanceof UIResource) { tf.setFont(spinner.getFont()); } tf.addFocusListener(nextButtonHandler); tf.addFocusListener(previousButtonHandler); } } } else if ("enabled".equals(propertyName)) { ui.updateEnabledState(); } } } else if (e.getSource() instanceof JComponent) { JComponent c = (JComponent)e.getSource(); if ((c.getParent() instanceof JPanel) && (c.getParent().getParent() instanceof JSpinner) && "border".equals(propertyName)) { JSpinner spinner = (JSpinner)c.getParent().getParent(); SpinnerUI spinnerUI = spinner.getUI(); if (spinnerUI instanceof BasicSpinnerUI) { BasicSpinnerUI ui = (BasicSpinnerUI)spinnerUI; ui.maybeRemoveEditorBorder(c); } } } } } }
ivmai/JCGO
sunawt/fix/javax/swing/plaf/basic/BasicSpinnerUI.java
Java
gpl-2.0
33,804
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Workflow.Model { [Serializable] public partial class Sys_User_Info_Model { public Sys_User_Info_Model() { } #region Model private int _user_id; private string _user_name; private string _user_location; private string _user_dept; private string _user_title; private string _user_mail; private string _user_password; private string _user_phase; private string _user_status; private string _user_lang; private string _user_above_section; private string _user_no_domain; private string _user_contact; private string _user_no_password; /// <summary> /// /// </summary> public int user_id { set { _user_id = value; } get { return _user_id; } } /// <summary> /// /// </summary> public string user_name { set { _user_name = value; } get { return _user_name; } } /// <summary> /// /// </summary> public string user_location { set { _user_location = value; } get { return _user_location; } } /// <summary> /// /// </summary> public string user_dept { set { _user_dept = value; } get { return _user_dept; } } /// <summary> /// /// </summary> public string user_title { set { _user_title = value; } get { return _user_title; } } /// <summary> /// /// </summary> public string user_mail { set { _user_mail = value; } get { return _user_mail; } } /// <summary> /// /// </summary> public string user_password { set { _user_password = value; } get { return _user_password; } } /// <summary> /// /// </summary> public string user_phase { set { _user_phase = value; } get { return _user_phase; } } /// <summary> /// /// </summary> public string user_status { set { _user_status = value; } get { return _user_status; } } /// <summary> /// /// </summary> public string user_lang { set { _user_lang = value; } get { return _user_lang; } } /// <summary> /// /// </summary> public string user_above_section { set { _user_above_section = value; } get { return _user_above_section; } } /// <summary> /// /// </summary> public string user_no_domain { set { _user_no_domain = value; } get { return _user_no_domain; } } /// <summary> /// /// </summary> public string user_contact { set { _user_contact = value; } get { return _user_contact; } } /// <summary> /// /// </summary> public string user_no_password { set { _user_no_password = value; } get { return _user_no_password; } } #endregion Model } }
xlgwr/wf
Workflow.Model/Sys_User_Info_Model.cs
C#
gpl-2.0
3,558
<?php // Name : Addressbook Model // Desc : Addressbook & Fax Book // namespace app\module; final class app_module_AddressbookModel extends app_engine_Model { // // DB Structure public function __construct($reg){ // Call parent's Construct parent::__construct($reg); // // Structure the Database $f = $this->table('addressbook')->field('street', 'text'); $f = $this->table('addressbook')->field('apt', 'text'); $f = $this->table('addressbook')->field('city', 'text'); $f = $this->table('addressbook')->field('state', 'text'); $f = $this->table('addressbook')->field('zip', 'text'); $f = $this->table('addressbook')->field('country', 'text'); } } ?>
wonsong82/wonframework
system/module/addressbook/model.php
PHP
gpl-2.0
687
/* * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "AuthCodes.h" #include "Database/DatabaseEnv.h" #include <cstddef> #include <map> typedef std::map<int, RealmBuildInfo*> RealmBuildContainer; namespace AuthHelper { RealmBuildContainer AcceptedClientBuilds; void InitAcceptedClientBuilds() { AcceptedClientBuilds.clear(); PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_VERSIONS); PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) TC_LOG_ERROR("server.authserver", "Table `versions` is empty. No one will be able to log in."); do { Field* fields = result->Fetch(); RealmBuildInfo* newBuild = new RealmBuildInfo; newBuild->Build = fields[0].GetUInt32(); newBuild->MajorVersion = fields[1].GetUInt32(); newBuild->MinorVersion = fields[2].GetUInt32(); newBuild->BugfixVersion = fields[3].GetUInt32(); newBuild->HotfixVersion = fields[4].GetUInt32(); AcceptedClientBuilds[newBuild->Build] = newBuild; } while (result->NextRow()); } bool IsAcceptedClientBuild(int build) { for (RealmBuildContainer::iterator itr = AcceptedClientBuilds.begin(); itr != AcceptedClientBuilds.end(); itr++) if (itr->second->Build == build) return true; return false; } RealmBuildInfo const* GetBuildInfo(int build) { for (RealmBuildContainer::iterator itr = AcceptedClientBuilds.begin(); itr != AcceptedClientBuilds.end(); itr++) if (itr->second->Build == build) return itr->second; return NULL; } }
Hlkz/Acore
src/server/authserver/Authentication/AuthCodes.cpp
C++
gpl-2.0
2,392
<?php /** * Gerenciador Clínico Odontológico * Copyright (C) 2006 - 2009 * Autores: Ivis Silva Andrade - Engenharia e Design(ivis@expandweb.com) * Pedro Henrique Braga Moreira - Engenharia e Programação(ikkinet@gmail.com) * * Este arquivo é parte do programa Gerenciador Clínico Odontológico * * Gerenciador Clínico Odontológico é um software livre; você pode * redistribuí-lo e/ou modificá-lo dentro dos termos da Licença * Pública Geral GNU como publicada pela Fundação do Software Livre * (FSF); na versão 2 da Licença invariavelmente. * * Este programa é distribuído na esperança que possa ser útil, * mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÂO * a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a * Licença Pública Geral GNU para maiores detalhes. * * Você recebeu uma cópia da Licença Pública Geral GNU, * que está localizada na raíz do programa no arquivo COPYING ou COPYING.TXT * junto com este programa. Se não, visite o endereço para maiores informações: * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (Inglês) * http://www.magnux.org/doc/GPL-pt_BR.txt (Português - Brasil) * * Em caso de dúvidas quanto ao software ou quanto à licença, visite o * endereço eletrônico ou envie-nos um e-mail: * * http://www.smileodonto.com.br/gco * smile@smileodonto.com.br * * Ou envie sua carta para o endereço: * * Smile Odontolóogia * Rua Laudemira Maria de Jesus, 51 - Lourdes * Arcos - MG - CEP 35588-000 * * */ include "../lib/config.inc.php"; include "../lib/func.inc.php"; include "../lib/classes.inc.php"; require_once '../lang/'.$idioma.'.php'; header("Content-type: text/html; charset=UTF-8", true); if(!checklog()) { echo '<script>Ajax("wallpapers/index", "conteudo", "");</script>'; die(); } if(!verifica_nivel('convenios', 'L')) { echo $LANG['general']['you_tried_to_access_a_restricted_area']; die(); } // if($_GET[confirm_del] == "delete") { // mysql_query("DELETE FROM honorarios WHERE codigo = '".$_GET['codigo']."'") or die(mysql_error()); // mysql_query("DELETE FROM honorarios_convenios WHERE codigo_convenio = '".$_GET['codigo']."'") or die(mysql_error()); // } ?> <div class="conteudo" id="conteudo_central"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="conteudo"> <tr> <td width="48%">&nbsp;&nbsp;&nbsp;<img src="honorarios/img/honorarios.png" alt="<?php echo $LANG['menu']['fees']?>"> <span class="h3"><?php echo $LANG['menu']['fees']?> </span></td> <td width="21%" valign="bottom"> <?php/*<table width="100%" border="0"> <tr> <td colspan="2"> <?php echo $LANG['plan']['search_for']?> </td> </tr> <tr> <td> <select name="campo" id="campo" class="forms"> <option value="nomefantasia"><?php echo $LANG['plan']['name']?></option> <option value="cidade"><?php echo $LANG['plan']['city']?></option> </select> </td> <td> <input name="procurar" id="procurar" type="text" class="forms" size="20" maxlength="40" onkeyup="javascript:Ajax('convenios/pesquisa', 'pesquisa', 'pesquisa='%2Bthis.value%2B'&campo='%2BgetElementById('campo').options[getElementById('campo').selectedIndex].value)"> </td> </tr> </table>*/?> </td> <td width="27%" align="right" valign="bottom"><?php echo ((verifica_nivel('convenios', 'I'))?'<img src="imagens/icones/novo.png" alt="Incluir" width="19" height="22" border="0"><a href="javascript:Ajax(\'convenios/incluir\', \'conteudo\', \'\')">'.$LANG['plan']['include_new_plan'].'</a>':'')?></td> <td width="2%" valign="bottom">&nbsp;</td> <td width="2%" valign="bottom">&nbsp;</td> </tr> </table> <div class="conteudo" id="table dados"><br> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0" class="tabela_titulo"> <tr> <td bgcolor="#009BE6" colspan="6">&nbsp;</td> </tr> <tr> <td width="684" align="left"><?php echo $LANG['plan']['fee_table']?></td> <td width="66" align="center">&nbsp;</td> </tr> </table> <div id="pesquisa"></div> <script> Ajax('honorarios/hpesquisa', 'pesquisa', ''); </script> </div>
artsjedi/GCO
http/honorarios/gerenciar_ajax.php
PHP
gpl-2.0
4,493
# -*- coding: utf-8 -*- # # This file is part of CERN Document Server. # Copyright (C) 2016, 2019 CERN. # # CERN Document Server is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # CERN Document Server is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with CERN Document Server; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307, USA. # # In applying this license, CERN does not # waive the privileges and immunities granted to it by virtue of its status # as an Intergovernmental Organization or submit itself to any jurisdiction. """Pytest configuration. Before running any of the tests you must have initialized the assets using the ``script scripts/setup-assets.sh``. """ from __future__ import absolute_import, print_function import os import shutil import tempfile import uuid import pkg_resources import pytest from cds_dojson.marc21 import marc21 from dojson.contrib.marc21.utils import create_record, split_blob from elasticsearch.exceptions import RequestError from invenio_db import db as _db from invenio_indexer.api import RecordIndexer from invenio_pidstore import current_pidstore from invenio_records.api import Record from invenio_search import current_search, current_search_client from selenium import webdriver from sqlalchemy_utils.functions import create_database, database_exists from cds.factory import create_app @pytest.yield_fixture(scope='session', autouse=True) def base_app(request): """Flask application fixture.""" instance_path = tempfile.mkdtemp() os.environ.update( APP_INSTANCE_PATH=instance_path ) app = create_app( # CELERY_ALWAYS_EAGER=True, # CELERY_CACHE_BACKEND="memory", # CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, # CELERY_RESULT_BACKEND="cache", SECRET_KEY="CHANGE_ME", SECURITY_PASSWORD_SALT="CHANGE_ME", MAIL_SUPPRESS_SEND=True, TESTING=True, ) with app.app_context(): yield app # Teardown shutil.rmtree(instance_path) @pytest.yield_fixture(scope='session') def db(base_app): """Initialize database.""" # Init if not database_exists(str(_db.engine.url)): create_database(str(_db.engine.url)) _db.create_all() yield _db # Teardown _db.session.remove() _db.drop_all() @pytest.yield_fixture(scope='session') def es(base_app): """Provide elasticsearch access.""" try: list(current_search.create()) except RequestError: list(current_search.delete()) list(current_search.create()) current_search_client.indices.refresh() yield current_search_client list(current_search.delete(ignore=[404])) @pytest.yield_fixture(scope='session', autouse=True) def app(base_app, es, db): """Application with ES and DB.""" yield base_app def pytest_generate_tests(metafunc): """Override pytest's default test collection function. For each test in this directory which uses the `env_browser` fixture, the given test is called once for each value found in the `E2E_WEBDRIVER_BROWSERS` environment variable. """ if 'env_browser' in metafunc.fixturenames: # In Python 2.7 the fallback kwarg of os.environ.get is `failobj`, # in 3.x it's `default`. browsers = os.environ.get('E2E_WEBDRIVER_BROWSERS', 'Firefox').split() metafunc.parametrize('env_browser', browsers, indirect=True) @pytest.yield_fixture() def env_browser(request): """Fixture for a webdriver instance of the browser.""" if request.param is None: request.param = "Firefox" # Create instance of webdriver.`request.param`() browser = getattr(webdriver, request.param)() yield browser # Quit the webdriver instance browser.quit() @pytest.fixture() def demo_records(app): """Create demo records.""" data_path = pkg_resources.resource_filename( 'cds.modules.fixtures', 'data/records.xml' ) with open(data_path) as source: indexer = RecordIndexer() with _db.session.begin_nested(): for index, data in enumerate(split_blob(source.read()), start=1): # create uuid rec_uuid = uuid.uuid4() # do translate record = marc21.do(create_record(data)) # create PID current_pidstore.minters['recid']( rec_uuid, record ) # create record indexer.index(Record.create(record, id_=rec_uuid)) _db.session.commit() return data_path
CERNDocumentServer/cds
tests/e2e/conftest.py
Python
gpl-2.0
5,085
/* * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javafx.stage; import com.sun.javafx.util.Utils; import com.sun.javafx.event.DirectEvent; import java.util.ArrayList; import java.util.List; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.beans.property.BooleanProperty; import javafx.beans.property.BooleanPropertyBase; import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyDoubleProperty; import javafx.beans.property.ReadOnlyDoubleWrapper; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ChangeListener; import javafx.collections.ObservableList; import javafx.event.Event; import javafx.event.EventHandler; import javafx.geometry.BoundingBox; import javafx.geometry.Bounds; import javafx.geometry.Rectangle2D; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; import com.sun.javafx.event.EventHandlerManager; import com.sun.javafx.event.EventRedirector; import com.sun.javafx.event.EventUtil; import com.sun.javafx.perf.PerformanceTracker; import com.sun.javafx.scene.SceneHelper; import com.sun.javafx.stage.FocusUngrabEvent; import com.sun.javafx.stage.PopupWindowPeerListener; import com.sun.javafx.stage.WindowCloseRequestHandler; import com.sun.javafx.stage.WindowEventDispatcher; import com.sun.javafx.tk.Toolkit; import static com.sun.javafx.FXPermissions.CREATE_TRANSPARENT_WINDOW_PERMISSION; import com.sun.javafx.scene.NodeHelper; import com.sun.javafx.stage.PopupWindowHelper; import com.sun.javafx.stage.WindowHelper; import javafx.beans.property.ObjectPropertyBase; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.WeakChangeListener; import javafx.event.EventTarget; import javafx.event.EventType; import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseEvent; import javafx.scene.input.ScrollEvent; import javafx.scene.layout.Background; import javafx.scene.layout.Pane; /** * PopupWindow is the parent for a variety of different types of popup * based windows including {@link Popup} and {@link javafx.scene.control.Tooltip} * and {@link javafx.scene.control.ContextMenu}. * <p> * A PopupWindow is a secondary window which has no window decorations or title bar. * It doesn't show up in the OS as a top-level window. It is typically * used for tool tip like notification, drop down boxes, menus, and so forth. * <p> * The PopupWindow <strong>cannot be shown without an owner</strong>. * PopupWindows require that an owner window exist in order to be shown. However, * it is possible to create a PopupWindow ahead of time and simply set the owner * (or change the owner) before first being made visible. Attempting to change * the owner while the PopupWindow is visible will result in an IllegalStateException. * <p> * The PopupWindow encapsulates much of the behavior and functionality common to popups, * such as the ability to close when the "esc" key is pressed, or the ability to * hide all child popup windows whenever this window is hidden. These abilities can * be enabled or disabled via properties. * @since JavaFX 2.0 */ public abstract class PopupWindow extends Window { static { PopupWindowHelper.setPopupWindowAccessor(new PopupWindowHelper.PopupWindowAccessor() { @Override public void doVisibleChanging(Window window, boolean visible) { ((PopupWindow) window).doVisibleChanging(visible); } @Override public void doVisibleChanged(Window window, boolean visible) { ((PopupWindow) window).doVisibleChanged(visible); } @Override public ObservableList<Node> getContent(PopupWindow popupWindow) { return popupWindow.getContent(); } }); } /** * A private list of all child popups. */ private final List<PopupWindow> children = new ArrayList<PopupWindow>(); /** * Keeps track of the bounds of the content, and adjust the position and * size of the popup window accordingly. This way as the popup content * changes, the window will be changed to match. */ private final InvalidationListener popupWindowUpdater = new InvalidationListener() { @Override public void invalidated(final Observable observable) { cachedExtendedBounds = null; cachedAnchorBounds = null; updateWindow(getAnchorX(), getAnchorY()); } }; /** * RT-28454: When a parent node or parent window we are associated with is not * visible anymore, possibly because the scene was not valid anymore, we should hide. */ private ChangeListener<Boolean> changeListener = (observable, oldValue, newValue) -> { if (oldValue && !newValue) { hide(); } }; private WeakChangeListener<Boolean> weakOwnerNodeListener = new WeakChangeListener(changeListener); public PopupWindow() { final Pane popupRoot = new Pane(); popupRoot.setBackground(Background.EMPTY); popupRoot.getStyleClass().add("popup"); final Scene scene = SceneHelper.createPopupScene(popupRoot); scene.setFill(null); super.setScene(scene); popupRoot.layoutBoundsProperty().addListener(popupWindowUpdater); popupRoot.boundsInLocalProperty().addListener(popupWindowUpdater); scene.rootProperty().addListener( new InvalidationListener() { private Node oldRoot = scene.getRoot(); @Override public void invalidated(final Observable observable) { final Node newRoot = scene.getRoot(); if (oldRoot != newRoot) { if (oldRoot != null) { oldRoot.layoutBoundsProperty() .removeListener(popupWindowUpdater); oldRoot.boundsInLocalProperty() .removeListener(popupWindowUpdater); oldRoot.getStyleClass().remove("popup"); } if (newRoot != null) { newRoot.layoutBoundsProperty() .addListener(popupWindowUpdater); newRoot.boundsInLocalProperty() .addListener(popupWindowUpdater); newRoot.getStyleClass().add("popup"); } oldRoot = newRoot; cachedExtendedBounds = null; cachedAnchorBounds = null; updateWindow(getAnchorX(), getAnchorY()); } } }); PopupWindowHelper.initHelper(this); } /* * Gets the observable, modifiable list of children which are placed in this * PopupWindow. * * @return the PopupWindow content */ ObservableList<Node> getContent() { final Parent rootNode = getScene().getRoot(); if (rootNode instanceof Group) { return ((Group) rootNode).getChildren(); } if (rootNode instanceof Pane) { return ((Pane) rootNode).getChildren(); } throw new IllegalStateException( "The content of the Popup can't be accessed"); } /** * The window which is the parent of this popup. All popups must have an * owner window. */ private ReadOnlyObjectWrapper<Window> ownerWindow = new ReadOnlyObjectWrapper<Window>(this, "ownerWindow"); public final Window getOwnerWindow() { return ownerWindow.get(); } public final ReadOnlyObjectProperty<Window> ownerWindowProperty() { return ownerWindow.getReadOnlyProperty(); } /** * The node which is the owner of this popup. All popups must have an * owner window but are not required to be associated with an owner node. * If an autohide Popup has an owner node, mouse press inside the owner node * doesn't cause the Popup to hide. */ private ReadOnlyObjectWrapper<Node> ownerNode = new ReadOnlyObjectWrapper<Node>(this, "ownerNode"); public final Node getOwnerNode() { return ownerNode.get(); } public final ReadOnlyObjectProperty<Node> ownerNodeProperty() { return ownerNode.getReadOnlyProperty(); } /** * Note to subclasses: the scene used by PopupWindow is very specifically * managed by PopupWindow. This method is overridden to throw * UnsupportedOperationException. You cannot specify your own scene. * * @param scene the scene to be rendered on this window */ @Override protected final void setScene(Scene scene) { throw new UnsupportedOperationException(); } /** * This convenience variable indicates whether, when the popup is shown, * it should automatically correct its position such that it doesn't end * up positioned off the screen. * @defaultValue true */ private BooleanProperty autoFix = new BooleanPropertyBase(true) { @Override protected void invalidated() { handleAutofixActivation(isShowing(), get()); } @Override public Object getBean() { return PopupWindow.this; } @Override public String getName() { return "autoFix"; } }; public final void setAutoFix(boolean value) { autoFix.set(value); } public final boolean isAutoFix() { return autoFix.get(); } public final BooleanProperty autoFixProperty() { return autoFix; } /** * Specifies whether Popups should auto hide. If a popup loses focus and * autoHide is true, then the popup will be hidden automatically. * <p> * The only exception is when owner Node is specified using {@link #show(javafx.scene.Node, double, double)}. * Focusing owner Node will not hide the PopupWindow. * </p> * @defaultValue false */ private BooleanProperty autoHide = new BooleanPropertyBase() { @Override protected void invalidated() { handleAutohideActivation(isShowing(), get()); } @Override public Object getBean() { return PopupWindow.this; } @Override public String getName() { return "autoHide"; } }; public final void setAutoHide(boolean value) { autoHide.set(value); } public final boolean isAutoHide() { return autoHide.get(); } public final BooleanProperty autoHideProperty() { return autoHide; } /** * Called after autoHide is run. */ private ObjectProperty<EventHandler<Event>> onAutoHide = new SimpleObjectProperty<EventHandler<Event>>(this, "onAutoHide"); public final void setOnAutoHide(EventHandler<Event> value) { onAutoHide.set(value); } public final EventHandler<Event> getOnAutoHide() { return onAutoHide.get(); } public final ObjectProperty<EventHandler<Event>> onAutoHideProperty() { return onAutoHide; } /** * Specifies whether the PopupWindow should be hidden when an unhandled escape key * is pressed while the popup has focus. * @defaultValue true */ private BooleanProperty hideOnEscape = new SimpleBooleanProperty(this, "hideOnEscape", true); public final void setHideOnEscape(boolean value) { hideOnEscape.set(value); } public final boolean isHideOnEscape() { return hideOnEscape.get(); } public final BooleanProperty hideOnEscapeProperty() { return hideOnEscape; } /** * Specifies whether the event, which caused the Popup to hide, should be * consumed. Having the event consumed prevents it from triggering some * additional UI response in the Popup's owner window. * @defaultValue true * @since JavaFX 2.2 */ private BooleanProperty consumeAutoHidingEvents = new SimpleBooleanProperty(this, "consumeAutoHidingEvents", true); public final void setConsumeAutoHidingEvents(boolean value) { consumeAutoHidingEvents.set(value); } public final boolean getConsumeAutoHidingEvents() { return consumeAutoHidingEvents.get(); } public final BooleanProperty consumeAutoHidingEventsProperty() { return consumeAutoHidingEvents; } /** * Show the popup. * @param owner The owner of the popup. This must not be null. * @throws NullPointerException if owner is null * @throws IllegalArgumentException if the specified owner window would * create cycle in the window hierarchy */ public void show(Window owner) { validateOwnerWindow(owner); showImpl(owner); } /** * Shows the popup at the specified location on the screen. The popup window * is positioned in such way that its anchor point ({@link #anchorLocation}) * is displayed at the specified {@code anchorX} and {@code anchorY} * coordinates. * <p> * The popup is associated with the specified owner node. The {@code Window} * which contains the owner node at the time of the call becomes an owner * window of the displayed popup. * </p> * <p> * Note that when {@link #autoHideProperty()} is set to true, mouse press on the owner Node * will not hide the PopupWindow. * </p> * * @param ownerNode The owner Node of the popup. It must not be null * and must be associated with a Window. * @param anchorX the x position of the popup anchor in screen coordinates * @param anchorY the y position of the popup anchor in screen coordinates * @throws NullPointerException if ownerNode is null * @throws IllegalArgumentException if the specified owner node is not * associated with a Window or when the window would create cycle * in the window hierarchy */ public void show(Node ownerNode, double anchorX, double anchorY) { if (ownerNode == null) { throw new NullPointerException("The owner node must not be null"); } final Scene ownerNodeScene = ownerNode.getScene(); if ((ownerNodeScene == null) || (ownerNodeScene.getWindow() == null)) { throw new IllegalArgumentException( "The owner node needs to be associated with a window"); } final Window newOwnerWindow = ownerNodeScene.getWindow(); validateOwnerWindow(newOwnerWindow); this.ownerNode.set(ownerNode); // PopupWindow should disappear when owner node is not visible if (ownerNode != null) { NodeHelper.treeShowingProperty(ownerNode).addListener(weakOwnerNodeListener); } updateWindow(anchorX, anchorY); showImpl(newOwnerWindow); } /** * Shows the popup at the specified location on the screen. The popup window * is positioned in such way that its anchor point ({@link #anchorLocation}) * is displayed at the specified {@code anchorX} and {@code anchorY} * coordinates. * * @param ownerWindow The owner of the popup. This must not be null. * @param anchorX the x position of the popup anchor in screen coordinates * @param anchorY the y position of the popup anchor in screen coordinates * @throws NullPointerException if ownerWindow is null * @throws IllegalArgumentException if the specified owner window would * create cycle in the window hierarchy */ public void show(Window ownerWindow, double anchorX, double anchorY) { validateOwnerWindow(ownerWindow); updateWindow(anchorX, anchorY); showImpl(ownerWindow); } private void showImpl(final Window owner) { // Update the owner field this.ownerWindow.set(owner); if (owner instanceof PopupWindow) { ((PopupWindow)owner).children.add(this); } // PopupWindow should disappear when owner node is not visible if (owner != null) { owner.showingProperty().addListener(weakOwnerNodeListener); } final Scene sceneValue = getScene(); SceneHelper.parentEffectiveOrientationInvalidated(sceneValue); // RT-28447 final Scene ownerScene = getRootWindow(owner).getScene(); if (ownerScene != null) { if (ownerScene.getUserAgentStylesheet() != null) { sceneValue.setUserAgentStylesheet(ownerScene.getUserAgentStylesheet()); } sceneValue.getStylesheets().setAll(ownerScene.getStylesheets()); if (sceneValue.getCursor() == null) { sceneValue.setCursor(ownerScene.getCursor()); } } // It is required that the root window exist and be visible to show the popup. if (getRootWindow(owner).isShowing()) { // We do show() first so that the width and height of the // popup window are initialized. This way the x,y location of the // popup calculated below uses the right width and height values for // its calculation. (fix for part of RT-10675). show(); } } /** * Hide this Popup and all its children */ @Override public void hide() { for (PopupWindow c : children) { if (c.isShowing()) { c.hide(); } } children.clear(); super.hide(); // When popup hides, remove listeners; these are added when the popup shows. if (getOwnerWindow() != null) getOwnerWindow().showingProperty().removeListener(weakOwnerNodeListener); if (getOwnerNode() != null) NodeHelper.treeShowingProperty(getOwnerNode()).removeListener(weakOwnerNodeListener); } /* * This can be replaced by listening for the onShowing/onHiding events * Note: This method MUST only be called via its accessor method. */ private void doVisibleChanging(boolean visible) { PerformanceTracker.logEvent("PopupWindow.storeVisible for [PopupWindow]"); Toolkit toolkit = Toolkit.getToolkit(); if (visible && (getPeer() == null)) { // Setup the peer StageStyle popupStyle; try { final SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(CREATE_TRANSPARENT_WINDOW_PERMISSION); } popupStyle = StageStyle.TRANSPARENT; } catch (final SecurityException e) { popupStyle = StageStyle.UNDECORATED; } setPeer(toolkit.createTKPopupStage(this, popupStyle, getOwnerWindow().getPeer(), acc)); setPeerListener(new PopupWindowPeerListener(PopupWindow.this)); } } private Window rootWindow; /* * This can be replaced by listening for the onShown/onHidden events * Note: This method MUST only be called via its accessor method. */ private void doVisibleChanged(boolean visible) { final Window ownerWindowValue = getOwnerWindow(); if (visible) { rootWindow = getRootWindow(ownerWindowValue); startMonitorOwnerEvents(ownerWindowValue); // currently we consider popup window to be focused when it is // visible and its owner window is focused (we need to track // that through listener on owner window focused property) // a better solution would require some focus manager, which can // track focus state across multiple windows bindOwnerFocusedProperty(ownerWindowValue); WindowHelper.setFocused(this, ownerWindowValue.isFocused()); handleAutofixActivation(true, isAutoFix()); handleAutohideActivation(true, isAutoHide()); } else { stopMonitorOwnerEvents(ownerWindowValue); unbindOwnerFocusedProperty(ownerWindowValue); WindowHelper.setFocused(this, false); handleAutofixActivation(false, isAutoFix()); handleAutohideActivation(false, isAutoHide()); rootWindow = null; } PerformanceTracker.logEvent("PopupWindow.storeVisible for [PopupWindow] finished"); } /** * Specifies the x coordinate of the popup anchor point on the screen. If * the {@code anchorLocation} is set to {@code WINDOW_TOP_LEFT} or * {@code WINDOW_BOTTOM_LEFT} the {@code x} and {@code anchorX} values will * be identical. * * @since JavaFX 8.0 */ private final ReadOnlyDoubleWrapper anchorX = new ReadOnlyDoubleWrapper(this, "anchorX", Double.NaN); public final void setAnchorX(final double value) { updateWindow(value, getAnchorY()); } public final double getAnchorX() { return anchorX.get(); } public final ReadOnlyDoubleProperty anchorXProperty() { return anchorX.getReadOnlyProperty(); } /** * Specifies the y coordinate of the popup anchor point on the screen. If * the {@code anchorLocation} is set to {@code WINDOW_TOP_LEFT} or * {@code WINDOW_TOP_RIGHT} the {@code y} and {@code anchorY} values will * be identical. * * @since JavaFX 8.0 */ private final ReadOnlyDoubleWrapper anchorY = new ReadOnlyDoubleWrapper(this, "anchorY", Double.NaN); public final void setAnchorY(final double value) { updateWindow(getAnchorX(), value); } public final double getAnchorY() { return anchorY.get(); } public final ReadOnlyDoubleProperty anchorYProperty() { return anchorY.getReadOnlyProperty(); } /** * Specifies the popup anchor point which is used in popup positioning. The * point can be set to a corner of the popup window or a corner of its * content. In this context the content corners are derived from the popup * root node's layout bounds. * <p> * In general changing of the anchor location won't change the current * window position. Instead of that, the {@code anchorX} and {@code anchorY} * values are recalculated to correspond to the new anchor point. * </p> * @since JavaFX 8.0 */ private final ObjectProperty<AnchorLocation> anchorLocation = new ObjectPropertyBase<AnchorLocation>( AnchorLocation.WINDOW_TOP_LEFT) { @Override protected void invalidated() { cachedAnchorBounds = null; updateWindow(windowToAnchorX(getX()), windowToAnchorY(getY())); } @Override public Object getBean() { return PopupWindow.this; } @Override public String getName() { return "anchorLocation"; } }; public final void setAnchorLocation(final AnchorLocation value) { anchorLocation.set(value); } public final AnchorLocation getAnchorLocation() { return anchorLocation.get(); } public final ObjectProperty<AnchorLocation> anchorLocationProperty() { return anchorLocation; } /** * Anchor location constants for popup anchor point selection. * * @since JavaFX 8.0 */ public enum AnchorLocation { /** Represents top left window corner. */ WINDOW_TOP_LEFT(0, 0, false), /** Represents top right window corner. */ WINDOW_TOP_RIGHT(1, 0, false), /** Represents bottom left window corner. */ WINDOW_BOTTOM_LEFT(0, 1, false), /** Represents bottom right window corner. */ WINDOW_BOTTOM_RIGHT(1, 1, false), /** Represents top left content corner. */ CONTENT_TOP_LEFT(0, 0, true), /** Represents top right content corner. */ CONTENT_TOP_RIGHT(1, 0, true), /** Represents bottom left content corner. */ CONTENT_BOTTOM_LEFT(0, 1, true), /** Represents bottom right content corner. */ CONTENT_BOTTOM_RIGHT(1, 1, true); private final double xCoef; private final double yCoef; private final boolean contentLocation; private AnchorLocation(final double xCoef, final double yCoef, final boolean contentLocation) { this.xCoef = xCoef; this.yCoef = yCoef; this.contentLocation = contentLocation; } double getXCoef() { return xCoef; } double getYCoef() { return yCoef; } boolean isContentLocation() { return contentLocation; } }; @Override void setXInternal(final double value) { updateWindow(windowToAnchorX(value), getAnchorY()); } @Override void setYInternal(final double value) { updateWindow(getAnchorX(), windowToAnchorY(value)); } @Override void notifyLocationChanged(final double newX, final double newY) { super.notifyLocationChanged(newX, newY); anchorX.set(windowToAnchorX(newX)); anchorY.set(windowToAnchorY(newY)); } private Bounds cachedExtendedBounds; private Bounds cachedAnchorBounds; private Bounds getExtendedBounds() { if (cachedExtendedBounds == null) { final Parent rootNode = getScene().getRoot(); cachedExtendedBounds = union(rootNode.getLayoutBounds(), rootNode.getBoundsInLocal()); } return cachedExtendedBounds; } private Bounds getAnchorBounds() { if (cachedAnchorBounds == null) { cachedAnchorBounds = getAnchorLocation().isContentLocation() ? getScene().getRoot() .getLayoutBounds() : getExtendedBounds(); } return cachedAnchorBounds; } private void updateWindow(final double newAnchorX, final double newAnchorY) { final AnchorLocation anchorLocationValue = getAnchorLocation(); final Parent rootNode = getScene().getRoot(); final Bounds extendedBounds = getExtendedBounds(); final Bounds anchorBounds = getAnchorBounds(); final double anchorXCoef = anchorLocationValue.getXCoef(); final double anchorYCoef = anchorLocationValue.getYCoef(); final double anchorDeltaX = anchorXCoef * anchorBounds.getWidth(); final double anchorDeltaY = anchorYCoef * anchorBounds.getHeight(); double anchorScrMinX = newAnchorX - anchorDeltaX; double anchorScrMinY = newAnchorY - anchorDeltaY; if (autofixActive) { final Screen currentScreen = Utils.getScreenForPoint(newAnchorX, newAnchorY); final Rectangle2D screenBounds = Utils.hasFullScreenStage(currentScreen) ? currentScreen.getBounds() : currentScreen.getVisualBounds(); if (anchorXCoef <= 0.5) { // left side of the popup is more important, try to keep it // visible if the popup width is larger than screen width anchorScrMinX = Math.min(anchorScrMinX, screenBounds.getMaxX() - anchorBounds.getWidth()); anchorScrMinX = Math.max(anchorScrMinX, screenBounds.getMinX()); } else { // right side of the popup is more important anchorScrMinX = Math.max(anchorScrMinX, screenBounds.getMinX()); anchorScrMinX = Math.min(anchorScrMinX, screenBounds.getMaxX() - anchorBounds.getWidth()); } if (anchorYCoef <= 0.5) { // top side of the popup is more important anchorScrMinY = Math.min(anchorScrMinY, screenBounds.getMaxY() - anchorBounds.getHeight()); anchorScrMinY = Math.max(anchorScrMinY, screenBounds.getMinY()); } else { // bottom side of the popup is more important anchorScrMinY = Math.max(anchorScrMinY, screenBounds.getMinY()); anchorScrMinY = Math.min(anchorScrMinY, screenBounds.getMaxY() - anchorBounds.getHeight()); } } final double windowScrMinX = anchorScrMinX - anchorBounds.getMinX() + extendedBounds.getMinX(); final double windowScrMinY = anchorScrMinY - anchorBounds.getMinY() + extendedBounds.getMinY(); // update popup dimensions setWidth(extendedBounds.getWidth()); setHeight(extendedBounds.getHeight()); // update transform rootNode.setTranslateX(-extendedBounds.getMinX()); rootNode.setTranslateY(-extendedBounds.getMinY()); // update popup position // don't set Window.xExplicit unnecessarily if (!Double.isNaN(windowScrMinX)) { super.setXInternal(windowScrMinX); } // don't set Window.yExplicit unnecessarily if (!Double.isNaN(windowScrMinY)) { super.setYInternal(windowScrMinY); } // set anchor x, anchor y anchorX.set(anchorScrMinX + anchorDeltaX); anchorY.set(anchorScrMinY + anchorDeltaY); } private Bounds union(final Bounds bounds1, final Bounds bounds2) { final double minX = Math.min(bounds1.getMinX(), bounds2.getMinX()); final double minY = Math.min(bounds1.getMinY(), bounds2.getMinY()); final double maxX = Math.max(bounds1.getMaxX(), bounds2.getMaxX()); final double maxY = Math.max(bounds1.getMaxY(), bounds2.getMaxY()); return new BoundingBox(minX, minY, maxX - minX, maxY - minY); } private double windowToAnchorX(final double windowX) { final Bounds anchorBounds = getAnchorBounds(); return windowX - getExtendedBounds().getMinX() + anchorBounds.getMinX() + getAnchorLocation().getXCoef() * anchorBounds.getWidth(); } private double windowToAnchorY(final double windowY) { final Bounds anchorBounds = getAnchorBounds(); return windowY - getExtendedBounds().getMinY() + anchorBounds.getMinY() + getAnchorLocation().getYCoef() * anchorBounds.getHeight(); } /** * * Gets the root (non PopupWindow) Window for the provided window. * * @param win the Window for which to get the root window */ private static Window getRootWindow(Window win) { // should be enough to traverse PopupWindow hierarchy here to get to the // first non-popup focusable window while (win instanceof PopupWindow) { win = ((PopupWindow) win).getOwnerWindow(); } return win; } void doAutoHide() { // There is a timing problem here. I would like to have this isVisible // check, such that we don't send an onAutoHide event if it was already // invisible. However, visible is already false by the time this method // gets called, when done by certain code paths. // if (isVisible()) { // hide this popup hide(); if (getOnAutoHide() != null) { getOnAutoHide().handle(new Event(this, this, Event.ANY)); } // } } @Override WindowEventDispatcher createInternalEventDispatcher() { return new WindowEventDispatcher(new PopupEventRedirector(this), new WindowCloseRequestHandler(this), new EventHandlerManager(this)); } @Override Window getWindowOwner() { return getOwnerWindow(); } private void startMonitorOwnerEvents(final Window ownerWindowValue) { final EventRedirector parentEventRedirector = ownerWindowValue.getInternalEventDispatcher() .getEventRedirector(); parentEventRedirector.addEventDispatcher(getEventDispatcher()); } private void stopMonitorOwnerEvents(final Window ownerWindowValue) { final EventRedirector parentEventRedirector = ownerWindowValue.getInternalEventDispatcher() .getEventRedirector(); parentEventRedirector.removeEventDispatcher(getEventDispatcher()); } private ChangeListener<Boolean> ownerFocusedListener; private void bindOwnerFocusedProperty(final Window ownerWindowValue) { ownerFocusedListener = (observable, oldValue, newValue) -> WindowHelper.setFocused(this, newValue); ownerWindowValue.focusedProperty().addListener(ownerFocusedListener); } private void unbindOwnerFocusedProperty(final Window ownerWindowValue) { ownerWindowValue.focusedProperty().removeListener(ownerFocusedListener); ownerFocusedListener = null; } private boolean autofixActive; private void handleAutofixActivation(final boolean visible, final boolean autofix) { final boolean newAutofixActive = visible && autofix; if (autofixActive != newAutofixActive) { autofixActive = newAutofixActive; if (newAutofixActive) { Screen.getScreens().addListener(popupWindowUpdater); updateWindow(getAnchorX(), getAnchorY()); } else { Screen.getScreens().removeListener(popupWindowUpdater); } } } private boolean autohideActive; private void handleAutohideActivation(final boolean visible, final boolean autohide) { final boolean newAutohideActive = visible && autohide; if (autohideActive != newAutohideActive) { // assert rootWindow != null; autohideActive = newAutohideActive; if (newAutohideActive) { rootWindow.increaseFocusGrabCounter(); } else { rootWindow.decreaseFocusGrabCounter(); } } } private void validateOwnerWindow(final Window owner) { if (owner == null) { throw new NullPointerException("Owner window must not be null"); } if (wouldCreateCycle(owner, this)) { throw new IllegalArgumentException( "Specified owner window would create cycle" + " in the window hierarchy"); } if (isShowing() && (getOwnerWindow() != owner)) { throw new IllegalStateException( "Popup is already shown with different owner window"); } } private static boolean wouldCreateCycle(Window parent, final Window child) { while (parent != null) { if (parent == child) { return true; } parent = parent.getWindowOwner(); } return false; } static class PopupEventRedirector extends EventRedirector { private static final KeyCombination ESCAPE_KEY_COMBINATION = KeyCombination.keyCombination("Esc"); private final PopupWindow popupWindow; public PopupEventRedirector(final PopupWindow popupWindow) { super(popupWindow); this.popupWindow = popupWindow; } @Override protected void handleRedirectedEvent(final Object eventSource, final Event event) { if (event instanceof KeyEvent) { handleKeyEvent((KeyEvent) event); return; } final EventType<?> eventType = event.getEventType(); if (eventType == MouseEvent.MOUSE_PRESSED || eventType == ScrollEvent.SCROLL) { handleAutoHidingEvents(eventSource, event); return; } if (eventType == FocusUngrabEvent.FOCUS_UNGRAB) { handleFocusUngrabEvent(); return; } } private void handleKeyEvent(final KeyEvent event) { if (event.isConsumed()) { return; } final Scene scene = popupWindow.getScene(); if (scene != null) { final Node sceneFocusOwner = scene.getFocusOwner(); final EventTarget eventTarget = (sceneFocusOwner != null) ? sceneFocusOwner : scene; if (EventUtil.fireEvent(eventTarget, new DirectEvent(event.copyFor(popupWindow, eventTarget))) == null) { event.consume(); return; } } if ((event.getEventType() == KeyEvent.KEY_PRESSED) && ESCAPE_KEY_COMBINATION.match(event)) { handleEscapeKeyPressedEvent(event); } } private void handleEscapeKeyPressedEvent(final Event event) { if (popupWindow.isHideOnEscape()) { popupWindow.doAutoHide(); if (popupWindow.getConsumeAutoHidingEvents()) { event.consume(); } } } private void handleAutoHidingEvents(final Object eventSource, final Event event) { // we handle mouse pressed only for the immediate parent window, // where we can check whether the mouse press is inside of the owner // control or not, we will force possible child popups to close // by sending the FOCUS_UNGRAB event if (popupWindow.getOwnerWindow() != eventSource) { return; } if (popupWindow.isAutoHide() && !isOwnerNodeEvent(event)) { // the mouse press is outside of the owner control, // fire FOCUS_UNGRAB to child popups Event.fireEvent(popupWindow, new FocusUngrabEvent()); popupWindow.doAutoHide(); if (popupWindow.getConsumeAutoHidingEvents()) { event.consume(); } } } private void handleFocusUngrabEvent() { if (popupWindow.isAutoHide()) { popupWindow.doAutoHide(); } } private boolean isOwnerNodeEvent(final Event event) { final Node ownerNode = popupWindow.getOwnerNode(); if (ownerNode == null) { return false; } final EventTarget eventTarget = event.getTarget(); if (!(eventTarget instanceof Node)) { return false; } Node node = (Node) eventTarget; do { if (node == ownerNode) { return true; } node = node.getParent(); } while (node != null); return false; } } }
teamfx/openjfx-9-dev-rt
modules/javafx.graphics/src/main/java/javafx/stage/PopupWindow.java
Java
gpl-2.0
41,662
<?php /* Import the settings*/ require('config/settings.php'); if ($_GET) { /* Build query */ $data = array('id'=>$_GET['id'], 'DetailFields'=>DETAIL_FIELDS, 'token'=>SF_SECURITY_TOKEN); $query = SALESFORCE_URL . DETAIL_PAGE . '?' . http_build_query($data); /* Connecting Salesforce - Load Data */ $xml = simplexml_load_file($query); $images = simplexml_load_file(SALESFORCE_URL . IMAGE_PAGE . '?' . http_build_query(array('token'=>SF_SECURITY_TOKEN,'id'=>(string)$xml->Id))); /* Matching images with listing */ $xml = __matchImagesForDetailPage($xml,$images); /* Display the property details */ __displayProperty($xml); } else { die("No detail values..."); } /** * HTML-Output function to display the property details * * @param object $xml XML Object with the property * */ function __displayProperty($xml) { include('templates/header.php'); ?> <div id="pb_listingDetail"> <div id="head"> <div class="left"> <h1>Property Details</h1> </div> <div class="right"> <h2>more pictures</h2> </div> </div> <div id="body"> <div class="left"> <img src="<?php print($xml->InventoryImage__c[0]->MidResUrl__c); ?>" width="400" alt="<?php print($xml->InventoryImage__c[0]->ExternalId__c); ?>" /> <p><?php print($xml->ItemName__c); ?></p> <input class="formButton" name="back" id="back" value="Back to results" onclick="history.go(-1);" type="submit"> <input class="formButton" name="new_search" id="new_search" value="New search" onclick="document.location='search.php'" type="submit"> </div> <div class="right"> <div class="thumb_images"> <?php $i = 0; ?> <?php foreach ($xml->InventoryImage__c as $image): ?> <?php if ($i % 2 == 0): ?> <div class="cut img_left"><a class="lightwindow" href="<?php print($image->HighResUrl__c); ?>"><img src="<?php print($image->ThumbnailUrl__c); ?>" width="113" alt="<?php print($image->ExternalId__c); ?>" /></a></div> <?php else: ?> <div class="cut img_right"><a class="lightwindow" href="<?php print($image->HighResUrl__c); ?>"><img src="<?php print($image->ThumbnailUrl__c); ?>" width="113" alt="<?php print($image->ExternalId__c); ?>" /></a></div> <?php endif; ?> <?php $i++; ?> <?php endforeach; ?> <?php if ($i % 2 != 0): ?> <div class="cut img_right"></div> <?php endif; ?> </div> <div class="details"> <h3>Details</h3> <ul> <li>Price: <?php echo number_format((float)$xml->PurchaseListPrice__c,2,'.',',') ?> <?php print($xml->CurrencyIsoCode); ?></li> <li>Bedrooms: <?php print($xml->UnitBedrooms__c); ?></li> <li>Type: <?php print($xml->UnitType__c); ?></li> <li>Reference Number: <?php print($xml->Name); ?></li> <li>Total Area (sqf): <?php print($xml->TotalAreaSqf__c); ?></li> </ul> </div> <div class="details"> <h3>Description</h3> <p><?php print($xml->ItemDescription__c); ?></p> </div> </div> </div> </div> <?php include('templates/footer.php'); } /** * Method used to match images with detail page data * * @param object $xml XMl Object with detail property information * @param object $images XML Object with images * * @return object Propertybase data with images */ function __matchImagesForDetailPage($xml, $images) { $i = 0; /* Loop through all Images */ foreach ($images->InventoryImage__c as $image) { if ((string)$xml->Id == (string)$image->InventoryItemId__c) { $xml->addChild('InventoryImage__c'); $xml->InventoryImage__c[$i]->addChild('ExternalId__c', $image->ExternalId__c); $xml->InventoryImage__c[$i]->addChild('ThumbnailUrl__c', $image->ThumbnailUrl__c); $xml->InventoryImage__c[$i]->addChild('MidResUrl__c', $image->MidResUrl__c); $xml->InventoryImage__c[$i]->addChild('HighResUrl__c', $image->HighResUrl__c); $i++; } } return $xml; } ?>
konsti/Propertybase-Sites-Weblisting
detail.php
PHP
gpl-2.0
3,881
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest11696") public class BenchmarkTest11696 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { org.owasp.benchmark.helpers.SeparateClassRequest scr = new org.owasp.benchmark.helpers.SeparateClassRequest( request ); String param = scr.getTheParameter("foo"); String bar = new Test().doSomething(param); // FILE URIs are tricky because they are different between Mac and Windows because of lack of standardization. // Mac requires an extra slash for some reason. String startURIslashes = ""; if (System.getProperty("os.name").indexOf("Windows") != -1) if (System.getProperty("os.name").indexOf("Windows") != -1) startURIslashes = "/"; else startURIslashes = "//"; try { java.net.URI fileURI = new java.net.URI("file:" + startURIslashes + org.owasp.benchmark.helpers.Utils.testfileDir.replace('\\', '/').replace(' ', '_') + bar); new java.io.File(fileURI); } catch (java.net.URISyntaxException e) { throw new ServletException(e); } } // end doPost private class Test { public String doSomething(String param) throws ServletException, IOException { StringBuilder sbxyz59007 = new StringBuilder(param); String bar = sbxyz59007.append("_SafeStuff").toString(); return bar; } } // end innerclass Test } // end DataflowThruInnerClass
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest11696.java
Java
gpl-2.0
2,757
// // go-rencode v0.1.8 - Go implementation of rencode - fast (basic) // object serialization similar to bencode // Copyright (C) 2015~2019 gdm85 - https://github.com/gdm85/go-rencode/ // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. /* Package rencode is a Go implementation of https://github.com/aresch/rencode The rencode logic is similar to bencode (https://en.wikipedia.org/wiki/Bencode). For complex, heterogeneous data structures with many small elements, r-encodings take up significantly less space than b-encodings. Usage Example of encoder construction and use: b := bytes.Buffer{} e := rencode.NewEncoder(&b) err := e.Encode(100, true, "hello world", rencode.NewList(42, "nesting is awesome"), 3.14, rencode.Dictionary{}) You can use either specific methods to encode one of the supported types, or the interface-generic Encode() method. Example of decoder construction: e := rencode.NewDecoder(&b) The DecodeNext() method can be used to decode the next value from the rencode stream; however this method returns an interface{} while it is usually the norm that there is an expected type instead; in such cases, it is advised to use the Scan() method instead, which accepts a pointer to any of the supported types. Example: var i int var b bool var s string var l rencode.List err := e.Scan(&i, &b, &s, &l) Supported types Only the following types are supported: - rencode.List - rencode.Dictionary - big.Int (any integer with more than 63 bits of information) - bool - float32, float64 - []byte, string (all strings are stored as byte slices anyway) - int8, int16, int32, int64, int - uint8, uint16, uint32, uint64, uint Accessory types The rencode.List and rencode.Dictionary implement Python-alike features and can store values and keys of the simpler types enumerated above. */ package rencode
gdm85/go-rencode
doc.go
GO
gpl-2.0
2,531
using System; namespace iPem.Core.Enum { /// <summary> /// 报文返回结果 /// </summary> /// <remarks> /// 失败(FAILURE) /// 成功(SUCCESS) /// </remarks> public enum EnmBIResult { FAILURE = 0, SUCCESS = 1 } /// <summary> /// 信号值的状态 /// </summary> /// <remarks> /// 正常数据(NOALARM) /// 无效数据(INVALID) /// </remarks> public enum EnmBIState { NOALARM = 0, INVALID = 1 } /// <summary> /// 告警等级 /// </summary> /// <remarks> /// 一级告警(CRITICAL) /// 二级告警(MAJOR) /// 三级告警(MINOR) /// 四级告警(HINT) /// </remarks> public enum EnmBILevel { CRITICAL = 1, MAJOR = 2, MINOR = 3, HINT = 4 } /// <summary> /// 告警标志 /// </summary> /// <remarks> /// 告警开始(BEGIN) /// 告警结束(END) /// </remarks> public enum EnmBIFlag { BEGIN, END } /// <summary> /// 报文类型 /// </summary> /// <remarks> /// 注册(LOGIN) /// 注册响应(LOGIN_ACK) /// 实时告警发送(SEND_ALARM) /// 实时告警发送确认(SEND_ALARM_ACK) /// 监控点数据请求(GET_DATA) /// 请求监控点数据响应(GET_DATA_ACK) /// 写监控点设置值请求(SET_POINT) /// 写监控点设置值响应(SET_POINT_ACK) /// 监控点门限数据请求(GET_THRESHOLD) /// 请求监控点门限数据响应(GET_THRESHOLD_ACK) /// 写监控点门限数据请求(SET_THRESHOLD) /// 写监控点门限数据响应(SET_THRESHOLD_ACK) /// 获取FSU注册信息请求(GET_LOGININFO) /// 获取FSU注册信息响应(GET_LOGININFO_ACK) /// 设置FSU注册信息请求(SET_LOGININFO) /// 设置FSU注册信息响应(SET_LOGININFO_ACK) /// 获取FSU的FTP信息请求(GET_FTP) /// 获取FSU的FTP信息响应(GET_FTP_ACK) /// 设置FSU的FTP信息请求(SET_FTP) /// 设置FSU的FTP信息响应(SET_FTP_ACK) /// 时间同步请求(TIME_CHECK) /// 时间同步响应(TIME_CHECK_ACK) /// 获取FSU的状态参数请求(GET_FSUINFO) /// 获取FSU的状态参数响应(GET_FSUINFO_ACK) /// 更新FSU状态信息获取周期请求(UPDATE_FSUINFO_INTERVAL) /// 更新FSU状态信息获取周期响应(UPDATE_FSUINFO_INTERVAL_ACK) /// 重启FSU请求(SET_FSUREBOOT) /// 重启FSU响应(SET_FSUREBOOT_ACK) /// 监控点存储规则查询请求(GET_STORAGERULE) /// 监控点存储规则查询响应(GET_STORAGERULE_ACK) /// 动环配置数据请求(GET_DEV_CONF) /// 动环配置数据确认(GET_DEV_CONF_ACK) /// 上报动环设备配置变更数据请求(SEND_DEV_CONF_DATA) /// 上报动环设备配置变更数据响应(SEND_DEV_CONF_DATA_ACK) /// 写动环设备配置数据请求(SET_DEV_CONF_DATA) /// 写动环设备配置数据响应(SET_DEV_CONF_DATA_ACK) /// 写监控点存储规则请求(SET_STORAGERULE) /// 写监控点存储规则响应(SET_STORAGERULE_ACK /// </remarks> public enum EnmBIPackType { LOGIN, LOGIN_ACK, SEND_ALARM, SEND_ALARM_ACK, GET_DATA, GET_DATA_ACK, SET_POINT, SET_POINT_ACK, GET_THRESHOLD, GET_THRESHOLD_ACK, SET_THRESHOLD, SET_THRESHOLD_ACK, GET_LOGININFO, GET_LOGININFO_ACK, SET_LOGININFO, SET_LOGININFO_ACK, GET_FTP, GET_FTP_ACK, SET_FTP, SET_FTP_ACK, TIME_CHECK, TIME_CHECK_ACK, GET_FSUINFO, GET_FSUINFO_ACK, UPDATE_FSUINFO_INTERVAL, UPDATE_FSUINFO_INTERVAL_ACK, SET_FSUREBOOT, SET_FSUREBOOT_ACK, GET_STORAGERULE, GET_STORAGERULE_ACK, GET_DEV_CONF, GET_DEV_CONF_ACK, SEND_DEV_CONF_DATA, SEND_DEV_CONF_DATA_ACK, SET_DEV_CONF_DATA, SET_DEV_CONF_DATA_ACK, SET_STORAGERULE, SET_STORAGERULE_ACK } /// <summary> /// Represents the point enumeration /// </summary> /// <remarks> /// 4-遥信信号(DI) /// 3-遥测信号(AI) /// 1-遥控信号(DO) /// 2-遥调信号(AO) /// 0-告警信号(AL) /// </remarks> public enum EnmBIPoint { AL = 0, DO = 1, AO = 2, AI = 3, DI = 4 } }
Delta-SH/iPemSystem
iPem.Core/Enum/EnmBInterface.cs
C#
gpl-2.0
4,662
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Lista6Questao22")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Lista6Questao22")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d0986594-aa51-4838-8620-bf7829e5a9fe")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
alexjosesilva/CursoHelloworld
Lista6/Lista6Questao22/Lista6Questao22/Properties/AssemblyInfo.cs
C#
gpl-2.0
1,406
#line 3 "<stdout>" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer vhdlscanYY_create_buffer #define yy_delete_buffer vhdlscanYY_delete_buffer #define yy_flex_debug vhdlscanYY_flex_debug #define yy_init_buffer vhdlscanYY_init_buffer #define yy_flush_buffer vhdlscanYY_flush_buffer #define yy_load_buffer_state vhdlscanYY_load_buffer_state #define yy_switch_to_buffer vhdlscanYY_switch_to_buffer #define yyin vhdlscanYYin #define yyleng vhdlscanYYleng #define yylex vhdlscanYYlex #define yylineno vhdlscanYYlineno #define yyout vhdlscanYYout #define yyrestart vhdlscanYYrestart #define yytext vhdlscanYYtext #define yywrap vhdlscanYYwrap #define yyalloc vhdlscanYYalloc #define yyrealloc vhdlscanYYrealloc #define yyfree vhdlscanYYfree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE vhdlscanYYrestart(vhdlscanYYin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 262144 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t vhdlscanYYleng; extern FILE *vhdlscanYYin, *vhdlscanYYout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up vhdlscanYYtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up vhdlscanYYtext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via vhdlscanYYrestart()), so that the user can continue scanning by * just pointing vhdlscanYYin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when vhdlscanYYtext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t vhdlscanYYleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow vhdlscanYYwrap()'s to do buffer switches * instead of setting up a fresh vhdlscanYYin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void vhdlscanYYrestart (FILE *input_file ); void vhdlscanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE vhdlscanYY_create_buffer (FILE *file,int size ); void vhdlscanYY_delete_buffer (YY_BUFFER_STATE b ); void vhdlscanYY_flush_buffer (YY_BUFFER_STATE b ); void vhdlscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer ); void vhdlscanYYpop_buffer_state (void ); static void vhdlscanYYensure_buffer_stack (void ); static void vhdlscanYY_load_buffer_state (void ); static void vhdlscanYY_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER vhdlscanYY_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE vhdlscanYY_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE vhdlscanYY_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE vhdlscanYY_scan_bytes (yyconst char *bytes,yy_size_t len ); void *vhdlscanYYalloc (yy_size_t ); void *vhdlscanYYrealloc (void *,yy_size_t ); void vhdlscanYYfree (void * ); #define yy_new_buffer vhdlscanYY_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ vhdlscanYYensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ vhdlscanYY_create_buffer(vhdlscanYYin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ vhdlscanYYensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ vhdlscanYY_create_buffer(vhdlscanYYin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define vhdlscanYYwrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *vhdlscanYYin = (FILE *) 0, *vhdlscanYYout = (FILE *) 0; typedef int yy_state_type; extern int vhdlscanYYlineno; int vhdlscanYYlineno = 1; extern char *vhdlscanYYtext; #define yytext_ptr vhdlscanYYtext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up vhdlscanYYtext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ vhdlscanYYleng = (yy_size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 51 #define YY_END_OF_BUFFER 52 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_acclist[1319] = { 0, 49, 49, 10, 49, 10, 49, 49, 49, 49, 49, 32, 49, 32, 49, 21, 49, 21, 49, 13, 49, 13, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 52, 50, 51, 49, 50, 51, 47, 51, 50, 51, 50, 51, 50, 51, 40, 48, 50, 51, 48, 50, 51, 50, 51, 49, 50, 51, 48, 50, 51, 49, 50, 51, 10, 47, 51, 10, 50, 51, 49, 50, 51, 50, 51, 50, 51, 40, 48, 50, 51, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 50, 51, 48, 50, 51, 49, 50, 51, 10, 47, 51, 10, 50, 51, 49, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 48, 50, 51, 44, 50, 51, 44, 49, 50, 51, 44, 47, 51, 44, 50, 51, 44, 50, 51, 44, 50, 51, 40, 44, 48, 50, 51, 44, 48, 50, 51, 44, 50, 51, 44, 49, 50, 51, 44, 50, 51, 44, 48, 50, 51, 17, 40, 48, 50, 51, 17, 48, 50, 51, 50, 51, 17, 48, 50, 51, 25, 50, 51, 32, 49, 50, 51, 25, 32, 47, 51, 25, 32, 50, 51, 25, 50, 51, 26, 50, 51, 27, 50, 51, 25, 50, 51, 25, 40, 48, 50, 51, 31, 50, 51, 25, 48, 50, 51, 25, 48, 50, 51, 25, 48, 50, 51, 25, 50, 51, 32, 49, 50, 51, 25, 48, 50, 51, 21, 49, 50, 51, 21, 47, 51, 21, 50, 51, 40, 48, 50, 51, 48, 50, 51, 48, 50, 51, 21, 49, 50, 51, 48, 50, 51, 13, 49, 50, 51, 13, 47, 51, 13, 50, 51, 14, 48, 50, 51, 13, 49, 50, 51, 14, 48, 50, 51, 11, 50, 51, 11, 49, 50, 51, 11, 47, 51, 11, 50, 51, 11, 50, 51, 11, 50, 51, 11, 40, 48, 50, 51, 11, 48, 50, 51, 11, 48, 50, 51, 11, 50, 51, 11, 49, 50, 51, 11, 48, 50, 51, 29, 50, 51, 29, 49, 50, 51, 29, 47, 51, 29, 50, 51, 29, 50, 51, 29, 50, 51, 29, 40, 48, 50, 51, 29, 48, 50, 51, 29, 48, 50, 51, 29, 50, 51, 29, 49, 50, 51, 29, 48, 50, 51, 15, 40, 48, 50, 51, 15, 48, 50, 51, 50, 51, 15, 48, 50, 51, 33, 40, 48, 50, 51, 33, 48, 50, 51, 50, 51, 33, 48, 50, 51, 38, 47, 51, 38, 50, 51, 37, 50, 51, 35, 50, 51, 48, 50, 51, 48, 50, 51, 16, 50, 51, 16, 48, 50, 51, 50, 51, 16, 48, 50, 51, 49, 41, 46, 48, 40, 48, 48, 48, 49, 48, 49, 49, 10, 41, 48, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 46, 17, 17, 48, 17, 40, 48, 17, 48, 17, 48, 17, 48, 32, 49, 32, 48, 48, 32, 49, 21, 49, 21, 48, 40, 48, 23, 48, 48, 21, 49, 48, 13, 49, 13, 14, 14, 14, 48, 13, 49, 14, 14, 48, 48, 49, 48, 49, 15, 48, 15, 40, 48, 15, 48, 15, 48, 15, 48, 33, 48, 33, 40, 48, 33, 48, 33, 48, 33, 48, 48, 36, 48, 16, 41, 16, 16, 16, 16, 48, 16, 48, 16, 48, 46, 45, 46, 40, 48, 48, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 43, 45, 46, 17, 40, 48, 17, 17, 48, 48, 48, 40, 48, 48, 48, 14, 14, 48, 48, 48, 15, 40, 48, 15, 48, 33, 40, 48, 33, 48, 48, 16, 48, 45, 46, 45, 46, 40, 39, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 39, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 6, 6, 6, 43, 43, 45, 46, 43, 45, 46, 17, 39, 24, 24, 28, 48, 48, 48, 48, 40, 23, 48, 48, 39, 14, 14, 39, 48, 30, 48, 48, 48, 36, 39, 45, 46,16426, 39, 48, 48, 48, 34, 48, 48, 48, 48, 48, 48, 48, 3, 3, 3, 39, 39, 39, 39, 39, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 6, 6, 6, 43, 43, 43, 45, 46, 17, 39, 24, 48, 48, 48, 48, 48, 23, 23, 23, 48, 48, 39, 14, 39, 48, 48, 48, 48, 48, 36, 36, 36, 39, 48, 48, 48, 34, 48, 48, 48, 48, 48, 48, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 48, 48, 48, 48, 48, 48, 48, 48, 43, 48, 48, 48, 28, 48, 23, 48, 48, 48, 48, 48, 48, 30, 36, 48, 48, 48, 48, 5, 48, 48, 48, 48, 8, 8, 8, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 8234, 5, 48, 48, 48, 5, 5, 5, 5, 48, 48, 48, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 7, 48, 48, 48, 48, 48, 48, 20, 48, 48, 48, 48, 48, 48, 48, 5, 9, 5, 48, 48, 48, 5, 5, 5, 5, 7, 7, 48, 48, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 7, 7, 7, 48, 48, 48, 48, 48, 48, 20, 48, 22, 23, 48, 48, 48, 48, 5, 5, 5, 5, 5, 9, 5, 5, 5, 5, 48, 48, 5, 7, 7, 7, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 48, 48, 48, 22, 48, 48, 48, 48, 48, 5, 5, 5, 5, 5, 48, 48, 5, 5, 5, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 48, 48, 12, 28, 48, 48, 12, 48, 48, 48, 5, 5, 5, 9, 48, 48, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 5, 39, 28, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 30, 48, 48, 48, 48, 48, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 9, 39, 39, 5, 39, 5, 39, 5, 39, 5, 39, 7, 48, 48, 12, 19, 1, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 9, 39, 39, 5, 39, 5, 39, 5, 39, 5, 39, 7, 7, 7, 48, 48, 9, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 48, 9, 9, 4, 4, 39, 39, 9, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 3, 3, 3, 48, 48, 4, 4, 4, 1, 5, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 48, 18, 5, 5, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 5, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 9, 39, 39, 1, 1, 39, 39, 39, 39, 39, 39, 39, 9, 39, 39, 39, 9, 39, 39, 1, 1, 1, 39, 39, 39, 39, 39, 39, 2, 2, 39, 5, 39, 2, 2, 2, 2, 5, 39, 5, 39, 2 } ; static yyconst flex_int16_t yy_accept[1862] = { 0, 1, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15, 17, 19, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 47, 49, 51, 53, 55, 59, 62, 64, 67, 70, 73, 76, 79, 82, 84, 86, 90, 92, 95, 98, 101, 104, 107, 110, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, 167, 170, 173, 176, 179, 184, 188, 191, 195, 198, 202, 207, 211, 213, 217, 220, 224, 228, 232, 235, 238, 241, 244, 249, 252, 256, 260, 264, 267, 271, 275, 279, 282, 285, 289, 292, 295, 299, 302, 306, 309, 312, 316, 320, 324, 327, 331, 334, 337, 340, 343, 348, 352, 356, 359, 363, 367, 370, 374, 377, 380, 383, 386, 391, 395, 399, 402, 406, 410, 415, 419, 421, 425, 430, 434, 436, 440, 443, 446, 449, 452, 455, 458, 461, 465, 467, 471, 472, 472, 472, 472, 473, 473, 474, 474, 475, 477, 478, 478, 478, 479, 480, 480, 481, 482, 482, 483, 483, 483, 483, 483, 483, 483, 483, 484, 484, 485, 485, 485, 485, 485, 485, 485, 486, 488, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 490, 490, 491, 492, 493, 494, 495, 496, 496, 496, 497, 498, 498, 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, 500, 500, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 520, 521, 522, 524, 527, 529, 529, 529, 531, 533, 535, 536, 536, 536, 536, 537, 538, 540, 542, 543, 543, 543, 544, 546, 547, 548, 549, 551, 552, 554, 555, 556, 557, 559, 561, 562, 564, 565, 566, 566, 566, 567, 568, 570, 573, 575, 575, 575, 577, 579, 581, 584, 586, 586, 586, 588, 590, 590, 591, 592, 593, 595, 596, 597, 598, 600, 600, 600, 602, 604, 604, 605, 607, 607, 609, 609, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, 613, 614, 615, 616, 617, 618, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 639, 642, 645, 646, 648, 648, 648, 648, 649, 649, 650, 650, 652, 652, 652, 653, 654, 655, 657, 658, 658, 659, 662, 664, 667, 669, 669, 669, 670, 672, 672, 674, 676, 677, 677, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 679, 680, 680, 680, 680, 681, 682, 683, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 710, 713, 715, 715, 716, 717, 717, 717, 717, 717, 718, 719, 720, 721, 721, 721, 721, 722, 723, 724, 724, 724, 725, 726, 727, 728, 730, 730, 731, 731, 731, 731, 732, 733, 734, 735, 735, 736, 737, 737, 739, 740, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 742, 743, 743, 743, 744, 744, 744, 744, 745, 746, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 766, 766, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 781, 783, 783, 783, 783, 784, 784, 784, 784, 784, 784, 784, 785, 786, 787, 788, 788, 788, 788, 788, 788, 789, 790, 791, 792, 792, 792, 792, 792, 793, 794, 795, 797, 797, 798, 799, 799, 799, 799, 799, 800, 801, 802, 802, 802, 802, 803, 804, 805, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 807, 808, 808, 808, 809, 810, 811, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 833, 833, 834, 835, 836, 837, 838, 838, 838, 838, 838, 838, 838, 839, 840, 841, 841, 842, 842, 842, 843, 844, 844, 844, 844, 844, 845, 846, 846, 846, 847, 848, 848, 848, 849, 850, 850, 851, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 853, 854, 854, 854, 855, 856, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 881, 881, 882, 882, 882, 882, 883, 883, 883, 883, 883, 883, 883, 884, 885, 886, 886, 886, 887, 887, 887, 887, 887, 888, 889, 889, 889, 890, 891, 891, 891, 892, 893, 894, 894, 894, 894, 894, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, 896, 897, 897, 897, 898, 899, 900, 901, 902, 902, 902, 902, 902, 902, 902, 902, 902, 902, 902, 902, 902, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 918, 919, 919, 919, 920, 920, 920, 920, 920, 920, 920, 920, 920, 921, 922, 923, 923, 923, 925, 925, 925, 925, 925, 926, 927, 927, 927, 928, 929, 929, 929, 930, 931, 931, 931, 931, 931, 931, 931, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 933, 933, 934, 935, 936, 936, 936, 937, 938, 939, 940, 941, 941, 941, 941, 941, 941, 942, 942, 942, 943, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 964, 964, 964, 965, 965, 965, 965, 965, 965, 965, 965, 965, 966, 967, 968, 969, 969, 970, 970, 970, 970, 970, 971, 971, 971, 973, 973, 973, 974, 975, 975, 975, 976, 977, 977, 978, 978, 978, 978, 978, 979, 980, 981, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, 983, 983, 984, 985, 986, 987, 988, 989, 989, 989, 989, 989, 989, 989, 990, 990, 990, 991, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1009, 1010, 1011, 1012, 1012, 1012, 1012, 1013, 1013, 1013, 1014, 1014, 1014, 1015, 1016, 1016, 1016, 1017, 1018, 1018, 1019, 1019, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1021, 1022, 1023, 1024, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1047, 1048, 1049, 1049, 1049, 1051, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1053, 1053, 1053, 1054, 1055, 1055, 1055, 1056, 1057, 1057, 1057, 1058, 1059, 1060, 1060, 1060, 1060, 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1063, 1063, 1063, 1063, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1087, 1087, 1087, 1088, 1089, 1089, 1089, 1089, 1089, 1089, 1090, 1090, 1090, 1090, 1091, 1092, 1092, 1092, 1092, 1092, 1093, 1094, 1095, 1096, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1098, 1098, 1098, 1098, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1122, 1123, 1125, 1127, 1129, 1131, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133, 1134, 1134, 1135, 1135, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1156, 1157, 1159, 1161, 1163, 1165, 1166, 1167, 1168, 1168, 1168, 1168, 1169, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1189, 1189, 1189, 1190, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1192, 1192, 1192, 1193, 1193, 1194, 1194, 1194, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1196, 1197, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1221, 1222, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1224, 1225, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1227, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1244, 1245, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1279, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1281, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1291, 1292, 1293, 1295, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1297, 1297, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1306, 1306, 1306, 1306, 1306, 1306, 1307, 1307, 1308, 1310, 1311, 1312, 1313, 1313, 1313, 1314, 1316, 1318, 1318, 1318, 1318, 1319, 1319, 1319, 1319, 1319 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 9, 9, 10, 10, 11, 12, 13, 14, 10, 15, 16, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 19, 20, 20, 20, 9, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 31, 38, 39, 40, 41, 42, 31, 31, 43, 31, 9, 44, 9, 9, 45, 1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 31, 55, 56, 57, 58, 59, 60, 31, 61, 62, 63, 64, 65, 31, 31, 66, 31, 67, 10, 67, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[68] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 6, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 22, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 23 } ; static yyconst flex_int16_t yy_base[2160] = { 0, 0, 67, 134, 200, 264, 331, 398, 465, 532, 38, 599, 666, 733, 800, 867, 934, 1001, 1068, 1135, 1202, 1269, 1336, 204, 0, 208, 0, 1403, 1470, 1537, 1604, 302, 0, 1168,27243, 20, 24, 43, 1670, 1118, 25, 1124, 1736, 369, 54, 1802, 48, 94, 1861, 1920, 98, 284, 1986, 2045, 2105, 0, 2, 4, 68, 2124, 307, 2190, 1761, 1823, 0, 265, 2, 56, 324, 67, 0, 1, 399, 326, 49, 176,27243, 117, 214, 421, 2253, 1109, 204, 1114, 2319, 637, 1100, 451, 445, 389, 2385, 653,27243, 1854, 1942, 1948, 0,27243,27243, 1099, 228, 27243, 1105, 456, 449, 0, 2451, 654, 426, 491, 497, 2505, 2572, 72, 704, 72, 515, 619, 633, 2639, 771, 2706,27243, 696, 700, 754, 0, 1045, 241, 1044, 788, 0, 838, 655,27243, 1624, 1642, 1693, 0, 1035, 306, 1038, 789, 0, 1708, 724, 353, 1032, 2772, 854, 360, 1030, 2838, 855, 763, 777,27243,27243, 2905, 2972, 3038, 508, 3104, 2015, 830, 834, 985, 0,27243, 0, 992, 0, 116, 435, 986, 0, 0, 0, 905, 254, 657, 0, 897, 0, 626, 901, 3170, 3229, 3248, 931, 3297, 961, 627, 628, 3363, 724, 3429, 968, 1021, 1026, 1030, 1088, 1105, 3495, 0, 0, 1956, 974, 2040, 2148, 2065, 2152, 1155, 1159, 957, 3554, 1060, 3573, 398, 338, 1141, 465, 1142, 3620, 3686, 975, 3752, 2162, 0, 1198, 932, 331, 1265, 255, 737, 800, 1271, 1332, 1199, 1200, 2407, 253, 259, 868, 1203, 1268, 1335, 1078, 1270, 1209, 1204, 1208, 603, 8, 1274, 1340, 483, 1143, 673, 1342, 1013, 1077, 1441, 973, 927, 720, 1179, 1423, 786, 3815, 3881, 853, 1455, 2411, 2444, 397, 723, 735, 1486, 1461, 3947, 1051, 1183, 847, 3988, 4039, 4106, 916, 844, 1487, 1781, 1701, 1366, 1433, 0, 0, 4173, 1840, 736, 4240, 1551, 1892, 2077, 790, 1552, 2158, 847, 979, 0, 4306, 4372, 0, 936, 842, 1041, 0, 4438, 4504, 0, 998, 810, 4571, 1232, 4638, 0, 4704, 4770, 0, 1493, 4836, 4902, 0, 1754, 793, 0, 697, 722, 206, 1060, 118, 1309, 1524, 4968, 4987, 1527, 1134, 5044, 5110, 1449, 5176, 1593, 5242, 1898, 2289, 2560, 2627, 0, 5308, 1529, 1342, 1533, 5367, 0, 0, 1602, 5426, 5478, 1797, 1552, 1789, 1848, 1272, 5528, 5594, 1206, 1461, 1395, 1664, 1339, 1667, 1139, 1606, 1598, 1950, 1919, 1671, 2037, 1949, 1941, 2123, 1666, 1951, 1835, 1270, 1396, 2051, 2188, 2197, 1463, 1973, 1643, 1784, 1989, 1746, 2060, 2248, 2250, 2177, 2252, 2249, 2152, 2256, 2262, 2315, 2341, 688, 593, 2015, 5660, 892, 183, 2354, 281, 5726, 2564, 2078, 5779, 5830, 1515, 644, 5897, 2379, 1472, 5964, 2371, 1340, 6030, 637, 520, 491, 493, 1568, 482, 6090, 2475, 0, 487, 0,27243, 439, 0, 2534, 2424, 2027, 2410, 2429, 2260, 6156, 6222, 6288, 6354, 1341, 1607, 2694, 2808, 6420, 2445, 2321, 2507, 2572, 2326, 2449, 2500, 2601, 2663, 2668, 2631, 2870, 2391, 2502, 6479, 6545, 2703, 2560, 2643, 2694, 2704, 2709, 2036, 2712, 2760, 2761, 2705, 2713, 2773, 2772, 2768, 1736, 2769, 2835, 2829, 2896, 1551, 1692, 2120, 2505, 2835, 2839, 2840, 2937, 6612, 2895, 2900, 2905, 2906, 2943, 2749, 3033, 2918, 2973, 2975, 3075, 2194, 2539, 2672, 2994, 372, 431, 0, 921, 3126, 3002, 925, 412, 3131, 3451, 3062,27243, 6678, 6697, 3033, 6760, 1734, 1710, 1866, 376, 2365, 3138, 3162, 6827, 6894, 435, 380, 361, 3025, 2694, 3457, 3707, 3185,27243, 6960, 6979, 3034, 7042, 2612, 340, 296, 288, 2689, 0, 1917, 2329, 7108, 7168, 3267, 3317, 7187, 7253, 7319, 7385, 2428, 2470, 3477, 3656, 3357, 3734, 7451, 7510, 7569, 7628, 2908, 2971, 3549, 3097, 3108, 7687, 7749, 2575, 3328, 3165, 3210, 3277, 3282, 3333, 3237, 3177, 7800, 7866, 3352, 3421, 3393, 3531, 3605, 3408, 3609, 3843, 3652, 3461, 3718, 3838, 7932, 3903, 3863, 3675, 3671, 3873, 2622, 1898, 3596, 3131, 2901, 3301, 3461, 3086, 3206, 3397, 3648, 3743, 7992, 8059, 8126, 3296, 3913, 3441, 3478, 1942, 3885, 3918, 4139, 4206, 3364, 3492, 3749, 3618, 3732, 3567, 3928, 3853, 3981, 3985, 258, 0, 240, 1126, 5270, 4023, 3956,27243, 4925, 2700, 2767, 4294, 4063, 4067, 8192, 8211, 3760, 2779, 8268, 8334, 4071, 2806, 1991, 2974, 3071, 3233, 3252, 3275, 3490, 2193, 2976, 8401, 8468, 980, 239, 3714, 3107, 3125, 4090, 4134, 4130, 4143, 8534, 8553, 3505, 8610, 8676, 4199, 3388, 3513, 3600, 206, 204, 3712, 110, 3510, 2266, 8742, 8795, 3904, 8853, 8919, 8985, 9051, 2407, 3622, 9117, 9176, 9235, 9295, 4342, 9355, 3753, 9420, 322, 4225, 3950, 3963, 4035, 9479, 9528, 3683, 4269, 4172, 99, 4157, 4038, 9591, 9657, 4336, 3814, 3973, 4234, 4226, 4306, 4364, 4250, 4176, 3707, 4371, 4362, 4231, 4363, 3932, 4372, 4044, 4409, 3171, 3309, 3798, 3878, 4294, 4432, 9724, 4458, 9791, 9858, 0, 0, 5291, 80, 9924, 9983, 5330,10042, 4428,10102, 4238, 4439, 3903, 4524, 4532, 4431, 4497, 4553, 4444, 61, 4597, 4528, 3960, 4069, 4664, 4601,10165,10212, 4571,10274,10340, 4089, 4104, 4162, 3977, 3599, 3403, 3498, 3508,10407,10474, 4177, 4247, 4270, 3757, 4669, 4733,10540,10587,10634,10700, 4153, 43, 4294, 3920, 4574, 4383, 4370,10766,10832,10898,10964, 4310, 4739, 4806, 4872, 5014,11030,11089,11148,11207,11266,11328,11387, 5080, 4637, 4143, 4571, 4704, 4636, 4710, 4443, 4375, 4799, 4691, 4772, 4822,11450,11516, 4503, 4703, 4439, 4866, 4452, 11582, 4757, 4769, 4504, 4507, 4890, 4938, 4846, 4510, 4566, 4766, 4826, 4893, 4933, 5006, 5010,11642,11709, 0, 5384, 5398, 5449, 5359, 2942,11775, 5684, 5688,11832, 5764, 5032, 4963, 5028, 5030, 5075, 5139, 5110, 5095, 5199, 5264, 5159, 5508, 5692, 4183, 4313, 5457, 5696,11893,11955, 4927, 4639, 4575, 4659, 5117, 5007, 4697, 4707,12015,12082, 4757, 4683, 4775, 4768, 5770, 5865,12148,12210,27243, 4824, 4826, 5229, 5109, 5463, 5182, 5122, 4986, 4839, 4810, 5468,12259,12319, 5524, 5525, 5952, 5988, 5992, 6126,12378, 5179, 6019, 4894, 12437, 5526, 5529, 5236, 5309, 4847, 5617, 4914, 5207, 5394, 5513, 5622, 5266, 5591, 5245, 5317, 5518, 5389, 5647, 5756, 5178, 5689, 5817, 4985, 5043, 5700, 5596, 5643, 6378, 5088, 5050, 6192, 6382, 6636, 6605, 6640, 6704, 6986, 6918, 5317, 5830, 6135, 6244, 5831, 5125, 5941, 5856, 6326, 5110, 5294, 5923, 6391, 5725, 5818, 6002, 5300, 5367, 0, 5465, 5737, 5161, 5287, 5593, 6117, 5385, 5368, 5464, 5518, 5996, 6451, 5836, 5758, 5525, 5523, 6029, 6002, 5900, 5980, 6141, 5439, 12500,12559, 6282,12618, 6158, 6480, 6815, 7065,12677, 6030, 7079, 7223, 7408, 7412, 5469, 6092, 6155, 4549, 7471, 7489, 5533, 6219, 6224, 6509, 5530, 5824, 5480, 6575, 5947, 5918, 242, 5929, 6068, 6097, 6285, 6156, 6151, 6318, 6407, 6379, 6401, 826, 5608, 6273, 6530, 5543, 5719, 7540, 7599, 6754, 7635,12736,12795, 7530, 7417, 7620, 7707, 7890, 7894, 6922, 6252, 6460, 6395, 6745, 6860, 6409, 5772, 6722, 6796, 6646, 5655, 5729, 7070, 7902, 6089, 6278, 6467, 6407, 5851,27243, 6382, 6582, 5956, 6670,12855, 6716, 6784, 4154, 5894, 5947, 6049, 6073, 7011, 6928, 6479, 6541, 6032, 6665, 6538, 6576, 6820, 6830, 7093, 6791, 7148, 6849, 7160,12921, 7721, 7317, 6961, 7738, 7986, 6037, 6159, 6696, 6291, 6353, 6162, 6154, 6426, 6830, 6932,27243, 6978, 8085, 8238, 7241, 7420, 6531, 6887, 6218, 7074, 7216, 7348, 7711, 6453, 7525, 7313, 7517, 7098, 6972, 1170, 1513, 6460, 6285,12980,13039,13098,13158, 8492, 8028, 8559,13218,13277, 8153, 8702, 8735, 8764, 7716, 7782, 6498, 8217, 7830, 7282, 6352, 6404, 7591, 7851, 6538, 7117, 6985,13336, 6602,13381, 6952,27243,13448, 7210,13515, 6619, 6675, 6611, 8104, 7968, 7824, 6823, 6703, 6690, 7237, 7040, 8114, 7306,13581,13640, 7733, 8159, 7985, 6766, 6748, 7110, 6979, 6771, 7321, 6755, 6813, 7252, 8458, 8039, 8304, 9071, 8354, 7092, 6825, 6890, 8367, 8254, 6971, 8300, 8430, 8320, 7254, 8178, 8502, 7413, 7047, 7789, 9087, 9138, 9157, 13699,13758,13817,13876,13935, 9147, 9203,13998, 9197, 6923, 9228,14064, 9253, 8574, 8596, 7139, 7963, 8640, 8661, 7100, 7244, 8825,14124,14168, 7458, 7616, 8080,14227,27243,14271, 14315, 7184,14382, 8015, 8291, 8371, 7185, 8527, 7329, 8698, 14448,27243,14492, 8706, 8815,14536,14595, 3018,14644,14710, 0, 4017,14776, 8260, 9279, 9076, 9309,14842, 7321, 7319, 9315, 8914, 8979, 9374, 7357, 7388,14901,14960, 1529,15019, 8729, 9391, 9459, 9499,15078,15097, 7401, 8877, 8886,15154, 7404, 8394,15220,15280,15340,15407,15474,15541,15608,15675, 7409, 7421, 8600, 7425, 9578, 7635, 8453, 8954, 9324, 7455, 9257,15741, 9386, 9107, 7455, 8776, 8833, 8434,27243,15800, 15819, 7499, 7549,15882, 8498,15941,15985,16029,16073,16117, 16183,16249, 4094, 7499, 7450, 8648,16315,16359,16403,16447, 16491, 9568, 8904, 8710,27243,16550,16569, 7547,16632,16691, 16757,16823, 8324,16889, 7531, 7476, 9718, 9785, 9885, 9939, 9977, 9998,10071, 7526, 8844,16948, 7536,10081,10122, 7800, 10193,10207,17007, 9006, 9369, 9505,17067, 8837, 8881, 9688, 17086, 7543,17152,17211,10268,17270,17330,17397,17464,17531, 7557, 7576,10395,10497,10524,10567,17598,17665, 7617, 7973, 10670,10736, 9552, 7595, 7904,10984,11002, 9573, 7917, 9016, 9638, 7601, 9813, 9184, 9437,17731, 8966,11061, 9680,17790, 17848,17908,17974,18040,18106, 9442, 7611, 9761, 9642,18172, 18231, 9992, 7636, 9346,10310,10401,10892,11068,11142,11082, 9895, 7615, 9836,18297, 7644,10563, 8908,18356,10188, 9931, 9960,10319,10111,27243,10117,10813,18422, 9825,18468,18534, 10020,18600,11153,10218, 7869,10628,10988,18660,18727, 7814, 7990, 8404, 7636, 7736,18794,18861, 8164, 0, 9466,11212, 642,11226, 8378, 6807, 9023, 9692, 7658,11271,11308,18927, 18974,19032, 0, 7740,19098,10200, 7663,10501, 7684,11312, 11072,11348,19164, 7755, 8234,11486,11553,10506,10528, 9266, 9845,11391,19223, 0, 9954,10664,10730,10865,11418,19289, 10437,19347,11599, 9619,11243,19413,10363,11669,10751,19479, 19538, 8246, 9083, 7999, 7754, 7788, 8582, 8473, 7929, 9851, 7790, 7799, 8389,10757,11736,11779,11569, 4621,10374,11480, 8055, 8917, 7931, 7934, 7863,11809, 4762,11850,11912, 7988, 10819,10692, 8522,27243, 8059,10799,10823, 8133,11320, 8306, 10886,11133,11824,19597, 0,11248,11788,11886,11925,11978, 19663, 9949,10144,11573,19721, 0,10246,10610,10658,10790, 10928,11983,11501,19787,12070,12167,10035, 7993, 8032, 8336, 10102, 9500,11916, 8337, 8052, 8616,19846,19905,12007, 8992, 12194, 8914,12230,12143,10408, 4956, 7371,11407,11546, 9058, 8987, 8099,11441, 9623,12106,12248,11623,27243, 0,11430, 8340,11695,11995, 8341,12189,10060,11635,10517, 0,12324, 12047, 9392, 8397, 8189, 9721,12268, 9166,12312,12357,12393, 9196, 8194,11740, 9695, 8463, 9392, 8208,12110, 9526,27243, 10252, 5032,12002, 5036,11800,12239,12408,19964,10860,12453, 10384,12418,11173, 8273,12171, 9314,12457,12479,12472, 9727, 8495, 9077, 8521,12275,12516, 8406,12540, 8546,12430, 8053, 6111,12521,20022,20088,11745,11933,12566,10575,12586,12135, 12623,12647,12657,12627, 8552,12397, 8625, 9859, 9360,12685, 12695, 8624,10295,12755,12774,10956, 8534, 8623,12301, 7290, 8819,20154, 0, 9646,20220,20286,20352,12875,12879,12883, 12705,12801, 0,20418,12825, 8741, 8598,12913,12939,12950, 13001,12745, 8766,13011,10305, 0, 8600, 8731,12604,13016, 13021, 0, 0,20484,12836,13045,13060, 9711,13075,13080, 13103,20550, 0,20603, 0, 0,13127,13032,10460,13138, 13166,13184, 8743,27243,10688, 9054, 9094,13176,13197,13235, 13226,13245,10870,10951, 9850, 0, 0,20669,13257,13297, 12530,12691,20735,20801,10621,13318,13368, 0, 0,27243, 20868,20891,20914,20937,20960,20983,21006,21029,21052,21075, 21098,21120,21136,21157,21179,21200,21222,21243,21264,21285, 21306,21328,21349,21372,21394,21416,21432,21453,21469,21490, 21513,21535,21552,21573,21596,21609,21630,21651,21672,21693, 21714,21736,21758,21779,21800,21822,21843,21866,21889,21911, 21933,21956,21967,21988,21999,22020,22043,22066,22083,22104, 22121,22142,22165,22181,22202,22223,22245,22267,22288,22310, 22332,22353,22376,22398,22419,22441,22463,22486,22509,22532, 22554,22564,22574,22596,22615,22637,22659,22682,22705,22727, 22749,22772,22794,22815,22836,22859,22882,22905,22928,22950, 22970,22991,23012,23023,23045,23068,23091,23114,23137,23160, 23182,23202,23223,23244,23267,23290,23313,23336,23358,23379, 23401,23424,23446,23467,23488,23509,23532,23555,23578,23601, 23624,23646,23666,23687,23708,23719,23741,23764,23787,23810, 23833,23855,23876,23897,23920,23943,23966,23988,24009,24031, 24054,24077,24099,24120,24141,24162,24185,24208,24231,24254, 24276,24297,24318,24329,24351,24374,24397,24419,24440,24461, 24484,24506,24528,24551,24574,24596,24617,24638,24661,24684, 24707,24729,24750,24772,24795,24817,24838,24859,24881,24904, 24927,24949,24971,24993,25014,25036,25058,25079,25100,25120, 25141,25162,25185,25207,25229,25240,25261,25282,25303,25324, 25345,25366,25388,25411,25433,25454,25475,25496,25517,25540, 25563,25586,25609,25632,25654,25675,25696,25716,25737,25758, 25779,25800,25822,25833,25854,25875,25896,25917,25938,25958, 25979,26000,26022,26044,26065,26086,26107,26128,26149,26170, 26191,26214,26237,26260,26283,26306,26328,26349,26370,26391, 26413,26435,26457,26478,26499,26521,26542,26564,26585,26606, 26627,26648,26669,26692,26715,26738,26760,26781,26802,26823, 26845,26866,26887,26909,26930,26951,26972,26993,27015,27037, 27058,27079,27100,27122,27133,27154,27176,27197,27219 } ; static yyconst flex_int16_t yy_def[2160] = { 0, 1861, 1861, 1860, 3, 1862, 1862, 1863, 1863, 1860, 9, 1864, 1864, 1865, 1865, 1866, 1866, 1867, 1867, 1868, 1868, 1869, 1869, 2, 2, 2, 2, 1870, 1870, 1871, 1871, 2, 2, 1860, 1860, 1860, 1860, 1860, 1872, 1860, 1873, 1873, 1874, 1860, 1873, 1875, 1860, 1860, 1875, 1876, 1877, 1878, 1879, 1880, 1880, 54, 54, 54, 54, 1881, 1878, 48, 1860, 1860, 61, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1860, 1860, 1860, 1860, 1872, 1860, 1873, 1873, 1874, 1860, 1860, 1873, 1882, 1882, 1883, 1882, 1860, 1860, 1860, 1860, 80, 1860, 1860, 1860, 1873, 1860, 1873, 1873, 1873, 84, 1860, 1873, 1860, 1860, 1860, 1884, 1884, 112, 1860, 112, 1885, 1860, 1860, 1886, 1885, 1886, 1860, 1860, 1860, 1860, 80, 1860, 1873, 1873, 1873, 84, 1860, 1873, 1860, 1860, 1860, 1860, 80, 1860, 1873, 1873, 1873, 84, 1860, 1873, 1887, 1887, 1888, 1887, 1889, 1889, 1890, 1889, 1860, 1860, 1860, 1860, 1891, 1891, 1892, 1893, 1894, 1893, 1860, 1860, 1860, 80, 1860, 80, 1895, 1896, 1873, 1873, 1873, 84, 84, 84, 1860, 1860, 1873, 48, 1860, 48, 1897, 1898, 1899, 1900, 1900, 188, 1901, 1860, 80, 1897, 1902, 80, 1902, 1860, 1860, 1898, 1903, 1903, 1903, 1899, 203, 203, 203, 1860, 203, 203, 203, 203, 1860, 1898, 1897, 1904, 203, 1904, 217, 217, 217, 217, 217, 1905, 1905, 224, 48, 1860, 226, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 1860, 1860, 1860, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 1860, 1860, 1895, 1860, 1906, 1906, 1906, 1907, 1907, 270, 1906, 1860, 1860, 1860, 1860, 1860, 1873, 1873, 1860, 1860, 1860, 1908, 1908, 1909, 1909, 1860, 286, 286, 1860, 286, 1910, 1860, 1911, 1911, 1912, 1910, 1911, 1912, 1873, 1860, 1860, 1860, 1873, 1860, 1913, 1913, 1913, 1914, 1914, 310, 1913, 1915, 1915, 1915, 1916, 1916, 317, 1915, 1917, 1918, 1860, 1918, 1919, 1920, 1920, 1919, 1921, 1922, 1922, 330, 1921, 1860, 1895, 1923, 1924, 1873, 1860, 1873, 1860, 1860, 1925, 1925, 343, 343, 1926, 1926, 347, 1927, 1860, 1927, 1928, 1860, 1860, 1929, 1930, 1929, 357, 357, 357, 1929, 361, 361, 357, 1931, 1931, 366, 366, 366, 366, 366, 1932, 1932, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 1860, 1860, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 1860, 1933, 1934, 1935, 1934, 1860, 1860, 1860, 1936, 1860, 1873, 1937, 1938, 1860, 1860, 1938, 430, 1939, 1940, 1873, 1860, 1941, 1942, 1942, 1943, 1943, 1860, 1860, 1944, 1945, 1946, 1947, 1948, 1860, 1860, 1949, 1860, 1860, 343, 343, 343, 343, 1950, 1950, 1951, 1951, 1860, 1860, 1952, 1953, 1953, 465, 465, 465, 465, 465, 366, 366, 1860, 1860, 1954, 366, 366, 366, 366, 1955, 1955, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 1860, 1860, 366, 366, 366, 366, 366, 366, 1956, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 1860, 1860, 1954, 1957, 1958, 1959, 1949, 1960, 1860, 1860, 1860, 1860, 1960, 1961, 1860, 1962, 1962, 539, 1963, 1860, 1860, 1964, 1965, 1966, 1965, 1860, 1967, 1967, 1968, 1969, 1970, 1860, 1964, 1971, 1971, 1972, 1860, 1973, 1973, 561, 1974, 1975, 1976, 1977, 1978, 1860, 1949, 1860, 1860, 1979, 1979, 573, 573, 1980, 1980, 1981, 1981, 1860, 1860, 1982, 1982, 1860, 1982, 1982, 1982, 1983, 1983, 589, 589, 589, 589, 589, 1984, 1984, 1860, 1985, 596, 1860, 1860, 1985, 1985, 596, 596, 1986, 1986, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, 1860, 1860, 596, 596, 596, 596, 596, 1860, 1860, 1985, 1949, 1949, 1987, 1987, 1988, 596, 596, 596, 596, 596, 596, 1860, 1860, 1985, 596, 596, 596, 596, 596, 596, 596, 1860, 1860, 1985, 1989, 1990, 1991, 1949, 1992, 1993, 1993, 1860, 1860, 1860, 1860, 1993, 1860, 1993, 1994, 1994, 675, 675, 1995, 1995, 679, 1860, 1860, 1996, 1997, 1997, 1997, 1998, 1998, 1860, 1860, 1999, 1999, 2000, 2001, 1860, 1996, 1996, 2002, 2002, 1860, 2002, 2003, 2003, 703, 2004, 2004, 706, 2005, 2005, 2005, 2006, 2007, 1860, 1860, 1860, 1860, 2008, 2008, 718, 2009, 2009, 2010, 2010, 1860, 1860, 2011, 2012, 2012, 2013, 2013, 2013, 731, 1860, 733, 731, 731, 731, 731, 2014, 2014, 1860, 2015, 740, 1860, 740, 740, 2016, 2016, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 1860, 1860, 740, 740, 740, 740, 2017, 2018, 2019, 2017, 776, 776, 776, 2018, 776, 776, 776, 776, 740, 740, 740, 740, 740, 2015, 2015, 740, 740, 740, 740, 2020, 2021, 2021, 1860, 1860, 2021, 2021, 2022, 2022, 804, 2023, 2023, 1860, 1860, 2024, 2025, 2026, 2026, 1860, 1860, 2027, 2027, 1860, 1860, 2024, 2024, 2028, 2028, 2029, 2029, 2030, 2030, 2031, 1860, 1860, 1860, 718, 718, 718, 2032, 2032, 2033, 2033, 1860, 1860, 2034, 2034, 2034, 2035, 2034, 2034, 2034, 2034, 2036, 2036, 2037, 850, 1860, 850, 850, 850, 740, 740, 1860, 2015, 740, 740, 740, 2038, 2038, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 1860, 1860, 740, 740, 740, 1860, 1860, 2015, 2039, 2039, 888, 888, 2040, 2040, 888, 2041, 888, 888, 888, 888, 888, 740, 740, 740, 740, 2015, 2015, 740, 1860, 1860, 2015, 740, 2042, 2042, 1860, 1860, 2042, 2042, 2043, 2043, 918, 1860, 1860, 2024, 2044, 2044, 1860, 1860, 2045, 2045, 1860, 1860, 2024, 2024, 2046, 2046, 2047, 2047, 1860, 1860, 1860, 718, 718, 718, 836, 836, 838, 838, 1860, 1860, 2034, 2034, 850, 850, 2048, 2048, 2037, 2037, 2037, 957, 850, 1860, 850, 850, 850, 740, 740, 1860, 2015, 740, 1860, 1860, 2015, 2015, 865, 865, 718, 718, 718, 718, 718, 718, 718, 718, 718, 1860, 1860, 740, 740, 740, 888, 2040, 2040, 2049, 888, 888, 888, 888, 888, 888, 888, 740, 740, 2015, 2015, 740, 1860, 2015, 2042, 2042, 1860, 1860, 2042, 2042, 918, 918, 918, 1860, 1860, 2024, 2044, 2044, 1860, 1860, 928, 928, 1860, 1860, 2024, 2024, 2046, 2046, 936, 936, 1860, 1860, 718, 836, 836, 838, 838, 1860, 2034, 2034, 1860, 2034, 850, 850, 2048, 2048, 2048, 1049, 2048, 2048, 1860, 1860, 957, 957, 957, 1860, 1860, 1860, 961, 850, 850, 961, 740, 740, 1860, 2015, 740, 1860, 1860, 1860, 2015, 865, 865, 718, 718, 718, 718, 718, 718, 1860, 1860, 740, 740, 2040, 2040, 2049, 2049, 2040, 2049, 2049, 2049, 888, 888, 888, 888, 888, 888, 888, 1860, 2015, 740, 2015, 2015, 740, 1860, 2015, 2042, 2042, 1860, 1860, 2042, 2042, 918, 918, 918, 918, 1860, 1860, 2044, 2044, 1860, 1860, 2050, 2044, 1860, 1860, 1860, 1860, 2024, 2024, 2046, 2046, 936, 936, 1860, 1860, 718, 836, 836, 838, 838, 1860, 838, 838, 1860, 2034, 2034, 850, 850, 1860, 1860, 1049, 1049, 1049, 1049, 1049, 1860, 1860, 957, 957, 1860, 1860, 850, 1860, 1860, 961, 850, 740, 740, 1860, 2015, 1860, 1860, 2015, 865, 865, 718, 718, 718, 718, 1860, 1860, 2040, 2040, 2051, 2049, 2049, 888, 888, 888, 888, 2040, 2040, 888, 888, 888, 888, 2015, 2015, 1860, 2015, 2042, 2042, 1860, 1860, 2042, 2042, 918, 918, 918, 2052, 1860, 2053, 2054, 1860, 2053, 2054, 2050, 1860, 1860, 2024, 2055, 2046, 2046, 936, 936, 1860, 1860, 836, 836, 838, 2034, 2034, 850, 850, 850, 1860, 1860, 1049, 1049, 1049, 1049, 1860, 1860, 957, 957, 961, 1860, 1860, 850, 740, 740, 1860, 2015, 1860, 1860, 1860, 2015, 2015, 865, 865, 865, 865, 2040, 2040, 2049, 2049, 2049, 2051, 2049, 2049, 2049, 2049, 888, 888, 2056, 888, 2040, 888, 888, 888, 2015, 2015, 1860, 2015, 2042, 2042, 1860, 1860, 2042, 2057, 2058, 918, 918, 2059, 2060, 1860, 2061, 2062, 1860, 2063, 2064, 2065, 1860, 1860, 2059, 2066, 2059, 2067, 1860, 2068, 2069, 2069, 2070, 2071, 1860, 2072, 2072, 1320, 1320, 2073, 1860, 2074, 1860, 2074, 2075, 1860, 1860, 2076, 2076, 2076, 2076, 1860, 1860, 2077, 1860, 1338, 2077, 1340, 1860, 1860, 2075, 2078, 2078, 1860, 2015, 2015, 2079, 2080, 2080, 2081, 2081, 2082, 2082, 2083, 2083, 2084, 2084, 1360, 1360, 1356, 2080, 1356, 1356, 1356, 2015, 2015, 1860, 2015, 2085, 2086, 1860, 1860, 2086, 2087, 2086, 1860, 2088, 2088, 1381, 1381, 2089, 1860, 2090, 2090, 2091, 2091, 2092, 2092, 2093, 1860, 1860, 2094, 1860, 2095, 2095, 2096, 2096, 2097, 2098, 2099, 2098, 1860, 2100, 2100, 1407, 2101, 2102, 2103, 2103, 1860, 2104, 1860, 1860, 2105, 2105, 2105, 1860, 1860, 2105, 2105, 1860, 1860, 2106, 1860, 2106, 1860, 1860, 1860, 2104, 2104, 2107, 2107, 2108, 2109, 1860, 2110, 2110, 2111, 2112, 2113, 2113, 2112, 2113, 2114, 2114, 2115, 2115, 1450, 1450, 1450, 1450, 2112, 2112, 2116, 2116, 1458, 2112, 2112, 2112, 1448, 1448, 1448, 2112, 2112, 1448, 1448, 2110, 2110, 1860, 2110, 2117, 2117, 2118, 1860, 1860, 2117, 2119, 2119, 2120, 2120, 2121, 2122, 1860, 1860, 2123, 2123, 2124, 2125, 1433, 1860, 1860, 2105, 1860, 1860, 2105, 2105, 2105, 2105, 1860, 1860, 2106, 1860, 1504, 2126, 2127, 2128, 2129, 2129, 2130, 2131, 1860, 2131, 2131, 2132, 2110, 2133, 2133, 2112, 2134, 2134, 1448, 1448, 2112, 2112, 2135, 2135, 1529, 1529, 1529, 2112, 2112, 2136, 2136, 2112, 2112, 1448, 2112, 2112, 2112, 1448, 1860, 2110, 2110, 1860, 2110, 2137, 2138, 2138, 2121, 1552, 1860, 2125, 1555, 1860, 1860, 1860, 2105, 2105, 2105, 2105, 1860, 1860, 1860, 1860, 1504, 1504, 1860, 2126, 2126, 2127, 1573, 1573, 1860, 1860, 2110, 2128, 2128, 2139, 2140, 2141, 2142, 2142, 2143, 2144, 2144, 2110, 2134, 2134, 1448, 1448, 1448, 2112, 2112, 1529, 1529, 1529, 1529, 2112, 2112, 1536, 1536, 2112, 2112, 1448, 1860, 2110, 2137, 1551, 1551, 1860, 1860, 1860, 1563, 1563, 1860, 1860, 1563, 1563, 1860, 1860, 1860, 1860, 2126, 1573, 1573, 2110, 1580, 1860, 2139, 2139, 2140, 1634, 1634, 1860, 1860, 2110, 2141, 2141, 1860, 2142, 2142, 2143, 1645, 1645, 1860, 1860, 2110, 2144, 2144, 2110, 2134, 2112, 2134, 1448, 2112, 2112, 1529, 1529, 1529, 1529, 2112, 2112, 1536, 2112, 2112, 1536, 1536, 2112, 2112, 2112, 1448, 1448, 1860, 1860, 2110, 2137, 1551, 1551, 1860, 1860, 1860, 1860, 1860, 1563, 1860, 1573, 2110, 1860, 2139, 1634, 1634, 2110, 1641, 2142, 1645, 1645, 2144, 2110, 1448, 2112, 2112, 1529, 1529, 1529, 2112, 2112, 1529, 1529, 2112, 2112, 1536, 2112, 1536, 2112, 2137, 1551, 1860, 1860, 1860, 2145, 1634, 2110, 2145, 2145, 2146, 2142, 2144, 1860, 2110, 1448, 2112, 2112, 1529, 2112, 2112, 1529, 1529, 1529, 1529, 2112, 2112, 1536, 2112, 1536, 2112, 2137, 2145, 2147, 2147, 2148, 2149, 2145, 2145, 2146, 2150, 2150, 2151, 2151, 2151, 2152, 1860, 2112, 2112, 2112, 1529, 1529, 1529, 1529, 2112, 2112, 2112, 2112, 1536, 1536, 2112, 1860, 2147, 2147, 2148, 1782, 1782, 2153, 2153, 2154, 1860, 1860, 2110, 2150, 2150, 2155, 2156, 2157, 2112, 2112, 1529, 1529, 2112, 2112, 1529, 1529, 2112, 2112, 2112, 2112, 1860, 2145, 1782, 1634, 1786, 1786, 2154, 1814, 1814, 1814, 1814, 2110, 2145, 2145, 2146, 2155, 2156, 1824, 1824, 2157, 2112, 2112, 2112, 2112, 1529, 2112, 1860, 2147, 1782, 1634, 1814, 1814, 1860, 2110, 2150, 2112, 2112, 2147, 1782, 1634, 2158, 1814, 2150, 2112, 2112, 2159, 2159, 1814, 1814, 1814, 1854, 1854, 0, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860 } ; static yyconst flex_int16_t yy_nxt[27311] = { 0, 34, 35, 36, 37, 35, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 164, 165, 165, 164, 165, 165, 165, 165, 220, 252, 406, 171, 251, 166, 218, 219, 245, 166, 106, 172, 173, 106, 42, 165, 165, 165, 165, 937, 182, 191, 191, 182, 220, 252, 406, 251, 166, 218, 219, 245, 1860, 166, 568, 107, 186, 34, 34, 43, 36, 37, 43, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 107, 180, 246, 259, 220, 44, 894, 182, 191, 191, 182, 197, 198, 198, 199, 221, 250, 222, 289, 291, 166, 744, 42, 186, 180, 246, 259, 186, 220, 44, 164, 165, 165, 164, 450, 1860, 829, 1860, 221, 250, 222, 289, 291, 166, 337, 34, 34, 45, 46, 47, 48, 34, 49, 34, 34, 34, 50, 50, 34, 34, 39, 50, 51, 52, 34, 34, 34, 53, 54, 55, 54, 56, 54, 57, 54, 54, 54, 54, 54, 54, 54, 54, 58, 54, 54, 54, 54, 54, 54, 59, 60, 53, 54, 55, 54, 56, 54, 57, 54, 54, 54, 54, 54, 54, 54, 58, 54, 54, 54, 54, 54, 54, 34, 61, 62, 63, 64, 35, 568, 530, 35, 35, 260, 171, 35, 1860, 261, 165, 165, 165, 165, 172, 173, 65, 337, 66, 322, 67, 68, 69, 166, 70, 41, 530, 71, 260, 41, 171, 72, 261, 73, 74, 75, 569, 568, 172, 173, 65, 1071, 66, 171, 67, 68, 69, 1071, 70, 41, 71, 172, 173, 41, 72, 568, 73, 74, 75, 76, 77, 78, 79, 77, 76, 80, 76, 76, 76, 76, 76, 76, 76, 81, 76, 82, 76, 76, 76, 76, 197, 198, 198, 199, 338, 568, 171, 381, 393, 185, 185, 394, 243, 568, 200, 201, 186, 217, 35, 244, 534, 35, 84, 197, 198, 198, 199, 338, 171, 1860, 381, 393, 185, 185, 394, 243, 172, 173, 734, 186, 217, 734, 244, 41, 534, 76, 76, 85, 78, 79, 85, 76, 80, 76, 76, 76, 76, 76, 76, 76, 86, 76, 82, 76, 76, 76, 76, 41, 247, 256, 257, 342, 87, 322, 248, 171, 215, 367, 569, 249, 377, 258, 171, 306, 307, 178, 165, 165, 178, 84, 313, 314, 247, 256, 257, 342, 87, 248, 166, 553, 215, 367, 249, 377, 258, 265, 265, 265, 265, 287, 179, 1860, 76, 34, 35, 36, 37, 35, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 88, 34, 34, 34, 34, 179, 253, 215, 165, 165, 165, 165, 667, 281, 282, 282, 281, 420, 366, 568, 221, 166, 254, 569, 661, 255, 166, 90, 171, 450, 253, 215, 265, 265, 265, 265, 172, 173, 171, 287, 420, 366, 1860, 221, 1860, 254, 266, 267, 255, 1860, 34, 34, 43, 36, 37, 43, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 88, 34, 34, 34, 34, 180, 279, 215, 568, 278, 91, 282, 282, 282, 282, 564, 450, 282, 282, 282, 282, 369, 370, 409, 166, 215, 439, 90, 180, 279, 166, 215, 278, 327, 91, 292, 293, 293, 292, 327, 327, 327, 174, 450, 369, 370, 327, 409, 166, 215, 34, 92, 93, 94, 95, 93, 92, 96, 92, 92, 92, 97, 98, 92, 92, 99, 92, 100, 92, 101, 92, 92, 102, 102, 102, 102, 103, 102, 102, 102, 104, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 105, 102, 102, 102, 102, 102, 103, 102, 102, 102, 104, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 92, 34, 108, 109, 110, 108, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 111, 34, 34, 34, 34, 293, 293, 293, 293, 113, 405, 215, 340, 192, 340, 340, 192, 340, 166, 293, 293, 293, 293, 262, 165, 165, 262, 42, 341, 195, 341, 1541, 166, 113, 405, 215, 263, 1541, 437, 265, 265, 265, 265, 546, 528, 1860, 1860, 1860, 179, 1860, 34, 34, 114, 109, 110, 114, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 111, 34, 34, 34, 34, 179, 272, 180, 180, 113, 115, 526, 339, 411, 215, 164, 165, 165, 164, 165, 165, 165, 165, 290, 282, 282, 290, 42, 166, 272, 180, 180, 166, 113, 115, 339, 166, 411, 215, 265, 265, 265, 265, 349, 350, 350, 349, 448, 179, 1860, 34, 34, 116, 117, 118, 116, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 179, 165, 165, 165, 165, 180, 351, 421, 342, 447, 165, 165, 165, 165, 166, 422, 382, 432, 297, 293, 293, 297, 42, 166, 165, 165, 165, 165, 180, 351, 421, 166, 342, 265, 265, 265, 265, 166, 422, 382, 432, 1860, 1860, 298, 445, 34, 34, 120, 117, 118, 120, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 298, 300, 304, 435, 342, 121, 1183, 322, 383, 1183, 164, 165, 165, 164, 165, 165, 165, 165, 178, 165, 165, 178, 42, 166, 300, 304, 435, 166, 342, 121, 283, 166, 383, 418, 265, 265, 418, 439, 288, 288, 1860, 1860, 437, 179, 287, 34, 122, 123, 124, 125, 123, 122, 126, 122, 122, 122, 34, 34, 122, 122, 127, 122, 128, 122, 34, 122, 122, 179, 312, 319, 215, 130, 265, 265, 265, 529, 395, 182, 182, 182, 182, 197, 198, 198, 199, 178, 165, 165, 178, 131, 166, 312, 319, 186, 215, 130, 428, 186, 166, 428, 395, 663, 663, 663, 663, 532, 532, 532, 532, 429, 179, 416, 122, 122, 132, 124, 125, 132, 122, 126, 122, 122, 122, 34, 34, 122, 122, 127, 122, 128, 122, 34, 122, 122, 179, 342, 342, 340, 130, 133, 340, 182, 191, 191, 182, 344, 376, 345, 197, 198, 198, 197, 438, 341, 166, 372, 131, 186, 372, 342, 342, 569, 130, 133, 186, 171, 415, 356, 344, 376, 345, 373, 1860, 306, 307, 438, 335, 287, 333, 122, 134, 135, 136, 137, 135, 134, 138, 134, 134, 134, 34, 34, 134, 134, 139, 134, 140, 134, 34, 134, 134, 198, 198, 198, 198, 142, 197, 198, 198, 199, 197, 198, 198, 199, 440, 215, 1860, 186, 1860, 185, 185, 413, 186, 143, 1860, 352, 186, 171, 170, 142, 1860, 281, 282, 282, 281, 313, 314, 440, 170, 215, 361, 362, 362, 363, 166, 413, 134, 134, 144, 136, 137, 144, 134, 138, 134, 134, 134, 34, 34, 134, 134, 139, 134, 140, 134, 34, 134, 134, 197, 198, 198, 199, 142, 145, 171, 364, 449, 185, 185, 215, 215, 414, 200, 201, 186, 197, 198, 198, 199, 400, 143, 1860, 170, 264, 185, 185, 142, 145, 364, 449, 1860, 186, 170, 215, 215, 414, 663, 663, 663, 663, 1860, 170, 400, 134, 34, 35, 36, 37, 35, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 146, 34, 34, 34, 34, 212, 198, 198, 212, 212, 198, 198, 213, 215, 215, 215, 1860, 342, 456, 410, 1183, 216, 489, 1183, 368, 216, 371, 148, 1860, 265, 265, 265, 265, 282, 282, 282, 282, 215, 215, 215, 342, 456, 1860, 410, 417, 489, 166, 368, 1860, 371, 34, 34, 43, 36, 37, 43, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 146, 34, 34, 34, 34, 342, 342, 342, 215, 215, 149, 1860, 374, 215, 215, 441, 391, 482, 441, 375, 392, 403, 342, 390, 396, 402, 404, 148, 442, 342, 342, 342, 215, 215, 149, 374, 1860, 215, 215, 391, 1860, 482, 375, 392, 403, 342, 390, 396, 402, 404, 34, 34, 35, 36, 37, 35, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 150, 34, 34, 34, 34, 342, 215, 384, 215, 378, 479, 342, 215, 215, 1860, 379, 397, 398, 1860, 502, 380, 344, 401, 385, 407, 340, 386, 152, 340, 342, 215, 384, 215, 378, 479, 342, 215, 215, 379, 397, 398, 341, 502, 380, 344, 401, 385, 407, 1860, 386, 34, 34, 43, 36, 37, 43, 34, 38, 34, 34, 34, 34, 34, 34, 34, 39, 34, 150, 34, 34, 34, 34, 342, 215, 367, 387, 388, 153, 215, 556, 215, 580, 292, 293, 293, 292, 487, 389, 342, 399, 206, 467, 408, 412, 152, 166, 342, 215, 367, 387, 388, 153, 215, 556, 215, 580, 1860, 1860, 1860, 487, 389, 342, 399, 206, 467, 408, 412, 34, 34, 35, 154, 155, 35, 34, 38, 34, 34, 34, 156, 157, 34, 34, 39, 34, 40, 34, 34, 34, 34, 265, 265, 265, 265, 484, 485, 171, 503, 1860, 1860, 293, 293, 293, 293, 266, 267, 1860, 1860, 262, 165, 165, 262, 42, 166, 1860, 1860, 457, 484, 485, 457, 503, 263, 265, 265, 265, 265, 1860, 1860, 424, 424, 424, 424, 458, 179, 1860, 34, 34, 43, 154, 155, 43, 34, 38, 34, 34, 34, 156, 157, 34, 34, 39, 34, 40, 34, 34, 34, 34, 179, 419, 1860, 283, 342, 159, 1860, 425, 327, 483, 507, 288, 288, 1860, 327, 327, 327, 174, 552, 423, 430, 327, 42, 1183, 419, 428, 1183, 342, 428, 159, 425, 1860, 483, 507, 451, 350, 350, 451, 429, 1339, 1860, 552, 1339, 423, 430, 34, 34, 35, 36, 37, 35, 34, 160, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 1860, 1860, 452, 342, 206, 206, 454, 455, 206, 206, 466, 441, 468, 1860, 441, 1860, 626, 434, 436, 476, 215, 1860, 162, 41, 442, 452, 342, 206, 206, 454, 455, 206, 206, 466, 1860, 468, 451, 350, 350, 451, 626, 434, 436, 476, 215, 34, 34, 43, 36, 37, 43, 34, 160, 34, 34, 34, 34, 34, 34, 34, 39, 34, 40, 34, 34, 34, 34, 301, 302, 302, 301, 452, 163, 1860, 342, 1860, 491, 206, 206, 469, 166, 470, 342, 490, 581, 302, 302, 302, 302, 162, 41, 303, 1860, 1860, 452, 1860, 163, 342, 166, 491, 206, 206, 469, 1860, 470, 342, 490, 581, 1860, 303, 509, 215, 34, 167, 1860, 303, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 303, 509, 215, 302, 302, 302, 302, 342, 1860, 342, 342, 499, 486, 488, 342, 494, 166, 283, 305, 302, 302, 305, 167, 167, 627, 288, 288, 303, 1860, 1860, 342, 166, 342, 342, 499, 486, 488, 342, 494, 1860, 1860, 1860, 303, 179, 682, 167, 175, 431, 627, 175, 175, 303, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 303, 179, 682, 327, 431, 227, 240, 240, 227, 327, 327, 327, 174, 622, 681, 215, 327, 1860, 166, 1860, 1860, 186, 177, 175, 1860, 290, 282, 282, 290, 512, 241, 510, 1860, 1860, 444, 1860, 622, 681, 166, 215, 242, 473, 474, 474, 475, 175, 181, 182, 182, 183, 179, 184, 512, 215, 241, 185, 185, 444, 215, 166, 185, 185, 186, 242, 1860, 1860, 215, 227, 240, 240, 227, 477, 188, 1860, 179, 1860, 1860, 215, 1860, 1860, 166, 189, 215, 186, 297, 293, 293, 297, 190, 185, 215, 1860, 241, 1860, 477, 1860, 188, 166, 273, 274, 274, 273, 242, 501, 189, 181, 182, 182, 183, 298, 184, 166, 342, 1860, 185, 185, 241, 215, 166, 185, 185, 186, 275, 1860, 1860, 242, 276, 501, 1860, 1860, 478, 188, 683, 298, 1860, 342, 301, 302, 302, 301, 189, 215, 197, 198, 198, 199, 275, 190, 185, 166, 276, 185, 185, 478, 1860, 188, 683, 352, 186, 1860, 303, 1860, 1860, 189, 192, 1860, 768, 192, 167, 193, 167, 167, 167, 167, 167, 194, 194, 194, 167, 194, 195, 167, 194, 167, 303, 493, 274, 274, 274, 274, 768, 1860, 274, 274, 274, 274, 342, 1860, 715, 166, 353, 354, 354, 355, 1860, 166, 167, 194, 1860, 493, 277, 497, 788, 496, 276, 492, 277, 1860, 342, 342, 276, 715, 206, 500, 206, 1860, 342, 342, 342, 167, 203, 204, 204, 205, 277, 497, 788, 496, 276, 492, 277, 342, 215, 207, 276, 508, 206, 500, 206, 342, 342, 342, 208, 1860, 209, 511, 210, 809, 215, 265, 265, 265, 265, 1860, 327, 211, 215, 1860, 1860, 508, 327, 327, 327, 174, 417, 1860, 208, 327, 209, 511, 210, 809, 215, 510, 353, 354, 354, 355, 211, 212, 198, 198, 213, 332, 214, 572, 1860, 1860, 185, 185, 214, 214, 214, 202, 342, 216, 206, 214, 206, 353, 354, 354, 355, 342, 342, 504, 332, 495, 357, 572, 215, 302, 302, 302, 302, 217, 1860, 342, 1860, 215, 206, 206, 206, 359, 166, 1860, 342, 342, 1860, 504, 495, 357, 1860, 513, 215, 303, 544, 1860, 217, 212, 198, 198, 213, 215, 214, 206, 1860, 359, 185, 185, 214, 214, 214, 202, 1860, 216, 513, 214, 223, 303, 544, 223, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 498, 215, 1860, 1860, 353, 354, 354, 355, 353, 354, 354, 355, 342, 628, 305, 302, 302, 305, 227, 227, 227, 227, 225, 223, 498, 215, 206, 166, 206, 1860, 206, 166, 206, 215, 186, 342, 628, 358, 303, 179, 1860, 519, 360, 241, 1860, 223, 226, 227, 227, 228, 206, 1860, 206, 242, 206, 516, 206, 215, 215, 1860, 358, 1860, 303, 179, 519, 360, 229, 241, 230, 215, 231, 232, 233, 814, 234, 215, 242, 235, 215, 516, 505, 236, 215, 237, 238, 239, 1860, 656, 506, 1860, 229, 1860, 230, 215, 231, 232, 233, 814, 234, 215, 235, 1860, 215, 505, 236, 1860, 237, 238, 239, 167, 656, 506, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 215, 215, 215, 517, 215, 1860, 1860, 515, 215, 575, 1860, 514, 518, 521, 215, 831, 353, 354, 354, 353, 342, 520, 167, 167, 215, 215, 215, 517, 215, 207, 515, 1860, 215, 575, 514, 518, 1860, 521, 215, 831, 1860, 1860, 461, 342, 520, 167, 175, 1860, 1860, 175, 175, 462, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 461, 215, 523, 524, 524, 525, 591, 206, 462, 1860, 1860, 1860, 206, 1860, 522, 531, 532, 532, 531, 1860, 1860, 594, 177, 175, 716, 215, 685, 215, 533, 685, 591, 206, 554, 554, 554, 554, 206, 522, 1860, 686, 283, 1860, 283, 551, 594, 175, 269, 716, 1860, 269, 269, 215, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 1860, 555, 227, 240, 240, 227, 273, 274, 274, 273, 288, 215, 1860, 288, 1860, 166, 1860, 1860, 186, 166, 1860, 604, 271, 269, 555, 1860, 839, 241, 1860, 1860, 275, 1860, 1860, 288, 276, 215, 288, 242, 342, 274, 274, 274, 274, 573, 604, 269, 280, 274, 274, 280, 839, 241, 166, 570, 275, 571, 724, 342, 276, 166, 242, 342, 574, 277, 1860, 206, 573, 276, 590, 215, 275, 179, 595, 450, 276, 327, 570, 1860, 571, 724, 342, 327, 327, 327, 174, 574, 1860, 277, 327, 206, 1860, 276, 590, 215, 275, 179, 595, 1860, 276, 283, 283, 725, 283, 283, 283, 283, 284, 283, 283, 283, 283, 283, 283, 283, 285, 286, 283, 287, 283, 283, 215, 605, 215, 596, 725, 215, 1860, 206, 629, 451, 350, 350, 451, 1860, 657, 658, 658, 657, 1860, 1860, 592, 1860, 283, 1860, 215, 605, 215, 596, 1860, 215, 216, 206, 629, 1860, 1860, 354, 354, 354, 354, 424, 424, 424, 424, 592, 452, 283, 283, 283, 207, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 461, 1860, 283, 287, 283, 283, 452, 342, 1860, 462, 609, 206, 1860, 542, 543, 473, 474, 474, 473, 1860, 1860, 1860, 468, 593, 461, 741, 709, 1860, 283, 709, 342, 216, 462, 609, 1860, 206, 542, 543, 1860, 710, 1860, 353, 354, 354, 355, 468, 593, 1860, 741, 1860, 597, 283, 295, 295, 207, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 210, 1860, 295, 215, 295, 295, 597, 767, 1860, 211, 474, 474, 474, 474, 599, 473, 474, 474, 475, 658, 658, 658, 658, 342, 210, 610, 186, 215, 295, 1860, 767, 216, 211, 1860, 1860, 186, 713, 599, 1860, 713, 1860, 583, 584, 583, 583, 597, 342, 1860, 610, 714, 598, 295, 295, 295, 585, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 586, 597, 295, 608, 295, 295, 598, 342, 696, 587, 697, 611, 612, 613, 614, 1860, 342, 342, 342, 799, 299, 617, 342, 618, 586, 342, 342, 608, 295, 1860, 342, 696, 587, 697, 611, 1860, 612, 613, 614, 342, 342, 342, 799, 299, 617, 342, 618, 1860, 342, 342, 1860, 295, 309, 646, 215, 309, 309, 1860, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 1860, 342, 342, 619, 620, 646, 215, 615, 616, 342, 342, 800, 621, 342, 342, 623, 353, 354, 354, 355, 674, 805, 311, 309, 342, 342, 1860, 619, 620, 207, 615, 616, 342, 342, 800, 621, 342, 342, 623, 1860, 1860, 1860, 210, 674, 805, 309, 316, 1860, 808, 316, 316, 588, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 210, 624, 215, 1860, 342, 808, 215, 215, 588, 625, 342, 630, 600, 601, 601, 602, 1860, 1860, 1860, 631, 632, 603, 318, 316, 1860, 624, 215, 342, 1860, 1860, 215, 215, 625, 342, 630, 1860, 1860, 215, 523, 524, 524, 525, 631, 632, 1860, 316, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 215, 215, 320, 322, 320, 320, 215, 644, 215, 1860, 342, 215, 215, 1860, 641, 770, 642, 206, 633, 634, 634, 635, 643, 653, 215, 215, 1860, 731, 320, 569, 215, 644, 215, 342, 569, 215, 215, 641, 770, 642, 463, 206, 569, 215, 645, 643, 1860, 653, 215, 215, 731, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 215, 645, 320, 322, 320, 320, 215, 654, 657, 658, 658, 659, 215, 206, 215, 1860, 531, 532, 532, 531, 323, 732, 810, 815, 216, 1860, 1860, 1860, 320, 533, 655, 654, 1324, 1324, 1324, 1324, 215, 206, 215, 554, 554, 554, 554, 323, 732, 810, 815, 647, 648, 648, 649, 320, 167, 655, 1860, 167, 167, 324, 167, 167, 167, 167, 167, 325, 325, 325, 167, 325, 167, 167, 325, 167, 650, 1860, 695, 651, 672, 672, 672, 672, 1860, 676, 652, 677, 704, 685, 674, 702, 685, 633, 634, 634, 635, 537, 167, 325, 650, 695, 686, 651, 633, 634, 634, 633, 676, 652, 677, 704, 1860, 674, 702, 1860, 1860, 1860, 215, 1860, 216, 167, 329, 1860, 1860, 329, 329, 1860, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 215, 206, 664, 664, 664, 664, 738, 668, 668, 668, 668, 737, 206, 1860, 547, 548, 547, 547, 1860, 537, 820, 1860, 331, 329, 537, 206, 1860, 665, 769, 1860, 738, 287, 669, 215, 737, 821, 206, 666, 548, 548, 548, 548, 670, 820, 541, 329, 203, 204, 204, 205, 687, 665, 769, 688, 1860, 1860, 669, 215, 821, 207, 666, 700, 700, 700, 700, 670, 1860, 215, 208, 743, 209, 1860, 210, 687, 689, 879, 688, 690, 559, 215, 1860, 211, 634, 634, 634, 634, 600, 601, 601, 600, 746, 215, 208, 743, 209, 744, 210, 689, 186, 879, 690, 1860, 216, 215, 211, 212, 198, 198, 213, 685, 214, 1860, 685, 746, 185, 185, 214, 214, 214, 185, 1860, 216, 686, 214, 212, 198, 198, 213, 685, 214, 1860, 685, 1860, 185, 185, 214, 214, 214, 185, 215, 216, 811, 214, 212, 198, 198, 213, 745, 343, 1860, 1860, 1860, 185, 601, 601, 601, 601, 1860, 600, 601, 601, 602, 744, 215, 1860, 1860, 1860, 603, 287, 186, 745, 1860, 343, 346, 216, 812, 346, 346, 718, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 212, 198, 198, 213, 771, 215, 812, 785, 718, 185, 215, 197, 198, 198, 199, 880, 197, 198, 198, 199, 1860, 1860, 348, 346, 719, 603, 1860, 186, 771, 215, 1860, 785, 186, 1860, 215, 212, 198, 198, 213, 880, 584, 584, 584, 584, 185, 346, 192, 742, 719, 192, 167, 193, 167, 167, 167, 167, 167, 194, 194, 194, 167, 194, 195, 167, 194, 167, 461, 1860, 1860, 1860, 742, 709, 749, 215, 709, 462, 212, 198, 198, 213, 633, 634, 634, 635, 710, 185, 249, 1860, 167, 194, 461, 633, 634, 634, 635, 749, 216, 215, 462, 1860, 185, 1860, 1860, 287, 212, 198, 198, 213, 1860, 249, 751, 167, 192, 185, 924, 192, 167, 193, 167, 167, 167, 167, 167, 194, 194, 194, 167, 194, 195, 167, 194, 167, 750, 751, 535, 535, 535, 535, 924, 1860, 557, 557, 557, 557, 212, 198, 198, 213, 786, 1860, 215, 537, 1860, 185, 167, 194, 750, 559, 1860, 665, 583, 584, 583, 583, 757, 698, 1860, 1860, 1860, 671, 215, 1860, 786, 585, 215, 699, 541, 167, 203, 204, 204, 205, 563, 665, 1860, 772, 586, 215, 757, 698, 287, 207, 671, 1860, 215, 587, 709, 787, 699, 709, 208, 215, 209, 925, 210, 1860, 813, 251, 772, 710, 586, 215, 1860, 211, 212, 198, 198, 213, 587, 926, 787, 702, 825, 185, 208, 215, 209, 925, 210, 813, 251, 830, 733, 734, 734, 735, 211, 212, 198, 198, 213, 1860, 214, 926, 702, 825, 185, 185, 214, 214, 214, 202, 752, 216, 830, 214, 212, 198, 198, 213, 206, 214, 1860, 1860, 736, 185, 185, 214, 214, 214, 202, 1860, 216, 1860, 214, 752, 215, 1860, 365, 633, 634, 634, 635, 709, 206, 795, 709, 736, 212, 198, 198, 213, 212, 198, 198, 213, 828, 185, 1860, 287, 215, 185, 365, 223, 923, 215, 223, 223, 795, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 793, 1860, 753, 215, 923, 215, 754, 636, 637, 637, 636, 212, 198, 198, 213, 583, 584, 583, 583, 840, 185, 225, 223, 640, 793, 753, 1860, 215, 585, 754, 633, 634, 634, 635, 212, 198, 198, 213, 1860, 185, 1860, 586, 840, 185, 223, 223, 1860, 756, 223, 223, 587, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 586, 557, 557, 557, 557, 756, 713, 1860, 587, 713, 765, 859, 212, 198, 198, 213, 1860, 1860, 559, 714, 1860, 185, 225, 223, 1860, 1860, 698, 873, 583, 584, 583, 583, 758, 765, 859, 342, 699, 637, 637, 637, 637, 726, 818, 563, 819, 223, 226, 227, 227, 228, 698, 873, 215, 773, 586, 1860, 758, 794, 342, 699, 1860, 1860, 1860, 587, 1860, 818, 229, 819, 230, 215, 231, 232, 233, 932, 234, 852, 215, 235, 586, 792, 794, 236, 255, 237, 238, 239, 587, 674, 206, 1860, 229, 804, 230, 215, 231, 232, 233, 932, 234, 852, 235, 1860, 792, 1860, 236, 255, 237, 238, 239, 269, 674, 206, 269, 269, 804, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 866, 1860, 881, 212, 198, 198, 213, 1860, 212, 198, 198, 213, 185, 342, 1860, 1860, 1860, 185, 657, 658, 658, 657, 271, 269, 866, 881, 1860, 759, 212, 198, 198, 213, 1860, 1860, 216, 1860, 342, 185, 212, 198, 198, 213, 1860, 755, 1860, 269, 269, 185, 764, 269, 269, 759, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 755, 882, 212, 198, 198, 213, 764, 789, 1860, 766, 215, 185, 633, 634, 634, 635, 215, 647, 648, 648, 647, 746, 271, 269, 1860, 882, 763, 633, 634, 634, 635, 789, 766, 216, 215, 1860, 1860, 342, 215, 215, 834, 903, 241, 939, 746, 269, 280, 274, 274, 280, 763, 1860, 242, 215, 876, 672, 672, 672, 672, 166, 342, 1860, 215, 834, 903, 342, 241, 939, 1860, 854, 275, 179, 537, 1860, 276, 242, 685, 215, 876, 685, 658, 658, 658, 658, 657, 658, 658, 659, 342, 811, 206, 798, 913, 854, 275, 179, 186, 855, 276, 426, 216, 426, 426, 206, 287, 867, 342, 426, 426, 426, 426, 426, 426, 206, 798, 913, 346, 1860, 1860, 1322, 855, 1860, 672, 672, 672, 672, 206, 1860, 867, 342, 426, 426, 426, 426, 426, 426, 426, 283, 283, 537, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1860, 427, 283, 287, 283, 283, 856, 1860, 1860, 797, 672, 672, 672, 672, 672, 672, 672, 672, 806, 672, 672, 806, 863, 206, 215, 342, 878, 537, 283, 1860, 856, 537, 797, 1860, 1860, 807, 1860, 700, 700, 700, 700, 1486, 1486, 1486, 1486, 863, 206, 215, 342, 878, 914, 283, 283, 283, 559, 283, 283, 283, 283, 284, 283, 283, 283, 283, 283, 283, 283, 285, 286, 283, 287, 283, 283, 914, 920, 1860, 822, 700, 700, 700, 700, 700, 700, 700, 700, 921, 648, 648, 648, 648, 700, 700, 700, 700, 559, 283, 1860, 920, 559, 822, 709, 428, 186, 709, 428, 1860, 1860, 559, 921, 1860, 960, 241, 1860, 828, 429, 1860, 1860, 823, 283, 295, 295, 242, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 960, 241, 295, 862, 295, 295, 823, 861, 1860, 215, 242, 922, 826, 700, 700, 826, 1860, 1860, 1009, 647, 648, 648, 649, 342, 215, 872, 862, 929, 295, 827, 1860, 861, 215, 1860, 922, 216, 1860, 1860, 733, 734, 734, 735, 1009, 1860, 790, 1860, 342, 215, 872, 1860, 929, 295, 295, 295, 791, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 868, 790, 295, 736, 295, 295, 342, 1860, 1860, 382, 791, 342, 206, 869, 342, 197, 198, 198, 199, 1860, 871, 1860, 433, 215, 868, 901, 736, 930, 295, 342, 342, 186, 382, 1860, 342, 206, 869, 342, 1860, 1860, 672, 672, 672, 672, 871, 433, 215, 1860, 901, 860, 930, 295, 309, 342, 931, 309, 309, 537, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 860, 883, 801, 938, 802, 931, 1860, 215, 870, 1010, 633, 634, 634, 635, 342, 1860, 353, 354, 354, 355, 947, 1860, 311, 309, 883, 801, 938, 802, 1860, 207, 215, 1860, 870, 1010, 1860, 1860, 1860, 342, 633, 634, 634, 635, 850, 947, 342, 309, 309, 1860, 1860, 309, 309, 211, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 850, 342, 874, 1860, 342, 342, 342, 875, 211, 380, 386, 877, 342, 342, 342, 942, 834, 633, 634, 634, 635, 966, 311, 309, 941, 342, 874, 342, 342, 342, 875, 1860, 380, 386, 877, 342, 342, 342, 942, 834, 884, 885, 885, 886, 966, 309, 316, 941, 342, 316, 316, 342, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 774, 637, 637, 774, 900, 902, 1860, 906, 342, 215, 910, 1860, 215, 215, 977, 342, 773, 1860, 1860, 1860, 215, 965, 318, 316, 215, 215, 1860, 900, 978, 902, 906, 1860, 215, 1860, 910, 215, 215, 977, 342, 907, 908, 908, 909, 215, 965, 316, 316, 215, 215, 316, 316, 978, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 197, 198, 198, 199, 672, 672, 672, 672, 197, 198, 198, 199, 215, 342, 342, 1860, 186, 982, 975, 981, 984, 537, 318, 316, 186, 1163, 1163, 1163, 1163, 633, 634, 634, 635, 1860, 1164, 215, 342, 342, 912, 904, 982, 975, 981, 984, 905, 316, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 912, 904, 320, 322, 320, 320, 905, 215, 919, 1860, 206, 940, 672, 672, 672, 672, 672, 672, 672, 672, 985, 961, 1860, 342, 674, 206, 1017, 1860, 320, 537, 215, 1860, 919, 537, 206, 940, 1676, 1676, 1676, 1676, 1860, 1860, 1860, 985, 961, 911, 342, 674, 206, 1017, 916, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 1860, 911, 320, 322, 320, 320, 916, 959, 206, 206, 1860, 1016, 672, 672, 672, 672, 1860, 700, 700, 700, 700, 963, 443, 206, 206, 1860, 1860, 1860, 320, 537, 1018, 959, 206, 206, 559, 1016, 1860, 1860, 1860, 600, 601, 601, 602, 1860, 963, 443, 206, 206, 603, 915, 933, 320, 167, 1026, 1018, 167, 167, 324, 167, 167, 167, 167, 167, 325, 325, 325, 167, 325, 167, 167, 325, 167, 915, 933, 1860, 976, 206, 1026, 215, 1021, 964, 700, 700, 700, 700, 342, 962, 948, 948, 948, 948, 206, 1860, 1022, 167, 325, 1860, 215, 559, 976, 206, 215, 1021, 1860, 964, 1860, 1860, 1860, 342, 962, 1685, 1686, 1686, 1687, 206, 934, 1022, 167, 167, 853, 215, 167, 167, 324, 167, 167, 167, 167, 167, 325, 325, 325, 167, 325, 167, 167, 325, 167, 934, 342, 1028, 980, 853, 1025, 968, 1860, 979, 197, 198, 198, 199, 342, 986, 215, 583, 584, 583, 583, 1027, 215, 167, 325, 342, 186, 1028, 980, 1025, 585, 968, 979, 969, 970, 970, 971, 342, 986, 215, 1860, 1860, 972, 586, 1027, 215, 167, 329, 967, 1040, 329, 329, 587, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 586, 1860, 1033, 987, 967, 215, 1040, 1034, 587, 215, 884, 885, 885, 886, 983, 1067, 583, 584, 583, 583, 1039, 1860, 331, 329, 342, 1033, 987, 1860, 215, 585, 1034, 1860, 215, 1860, 907, 908, 908, 909, 983, 1067, 1860, 1860, 586, 1039, 342, 329, 329, 342, 1860, 329, 329, 587, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 586, 342, 342, 668, 668, 668, 668, 1058, 587, 988, 215, 884, 885, 885, 884, 1069, 633, 634, 634, 635, 537, 1860, 331, 329, 1860, 342, 1860, 216, 669, 1015, 1058, 215, 988, 215, 1676, 1676, 1676, 1676, 670, 1069, 674, 523, 524, 524, 525, 329, 212, 198, 198, 213, 342, 214, 669, 1015, 215, 185, 185, 214, 214, 214, 185, 670, 216, 674, 214, 212, 198, 198, 213, 1860, 214, 1860, 1860, 342, 185, 185, 214, 214, 214, 185, 215, 216, 1860, 214, 885, 885, 885, 885, 884, 885, 885, 886, 583, 584, 583, 583, 1082, 1038, 453, 1860, 186, 169, 287, 215, 216, 585, 884, 885, 885, 886, 1750, 1750, 1750, 1750, 1754, 1750, 1750, 1754, 586, 1082, 1038, 453, 346, 1020, 169, 346, 346, 587, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 586, 1000, 1001, 215, 1020, 215, 1860, 215, 587, 1860, 1860, 197, 198, 198, 199, 1083, 953, 954, 954, 955, 1087, 1860, 348, 346, 1000, 1001, 215, 186, 215, 207, 215, 907, 908, 908, 907, 1860, 1860, 1860, 1083, 1860, 1860, 1860, 957, 1087, 1002, 346, 346, 216, 1086, 346, 346, 958, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 957, 1002, 1004, 1035, 287, 1005, 1086, 1860, 958, 197, 198, 198, 199, 342, 347, 1107, 1037, 1860, 1111, 215, 1860, 1019, 348, 346, 1860, 186, 1004, 1035, 1005, 633, 634, 634, 635, 1860, 1860, 1860, 342, 1860, 347, 1107, 1037, 1111, 215, 1003, 1019, 346, 349, 350, 350, 349, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1003, 1123, 215, 908, 908, 908, 908, 956, 347, 1860, 1860, 969, 970, 970, 1070, 351, 342, 1057, 1080, 186, 1071, 1036, 167, 167, 1123, 215, 1860, 216, 1860, 1860, 1860, 956, 347, 600, 601, 601, 602, 1860, 351, 342, 1057, 1080, 603, 1005, 1036, 167, 167, 1860, 1860, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1005, 342, 907, 908, 908, 909, 1860, 1860, 664, 664, 664, 664, 1065, 215, 459, 1860, 460, 342, 216, 1860, 1860, 1076, 167, 167, 342, 537, 1860, 1860, 224, 891, 892, 892, 893, 665, 1860, 1065, 215, 459, 1074, 460, 342, 1860, 1006, 666, 1076, 167, 353, 354, 354, 355, 541, 779, 224, 779, 1860, 1101, 1112, 665, 1102, 207, 1119, 1074, 1124, 1860, 890, 1006, 666, 1066, 891, 892, 892, 893, 210, 1860, 1860, 779, 1860, 779, 464, 465, 1112, 211, 1860, 1860, 1119, 1124, 215, 890, 1077, 342, 779, 1066, 897, 1860, 215, 1860, 210, 891, 892, 892, 893, 464, 465, 890, 211, 361, 362, 362, 363, 215, 1860, 1077, 342, 1860, 779, 1860, 897, 215, 207, 779, 1860, 779, 891, 892, 892, 893, 890, 208, 1120, 209, 1130, 210, 970, 970, 970, 1072, 891, 892, 892, 891, 364, 1071, 1860, 779, 779, 779, 779, 1860, 186, 780, 1860, 208, 1120, 209, 1130, 210, 989, 1860, 1129, 1860, 1079, 342, 990, 364, 212, 198, 198, 213, 779, 214, 779, 991, 1860, 185, 185, 214, 214, 214, 202, 989, 216, 1129, 214, 1079, 342, 1860, 990, 892, 892, 892, 892, 471, 1860, 1860, 991, 672, 672, 672, 672, 1147, 780, 969, 970, 970, 971, 1860, 948, 948, 948, 948, 972, 1860, 537, 990, 1860, 471, 212, 198, 198, 213, 287, 214, 991, 1147, 1860, 185, 185, 214, 214, 214, 202, 956, 216, 1011, 214, 342, 1131, 990, 853, 1121, 1172, 472, 1860, 1860, 1860, 991, 672, 672, 672, 672, 1860, 969, 970, 970, 971, 956, 1011, 1860, 342, 1131, 972, 853, 1121, 537, 1172, 472, 372, 216, 1007, 372, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 373, 223, 223, 223, 206, 206, 206, 1860, 342, 206, 1007, 1132, 1078, 1045, 1137, 1063, 1138, 1046, 468, 206, 206, 206, 1064, 206, 206, 1170, 225, 223, 206, 206, 206, 342, 1185, 206, 1132, 1078, 1045, 1137, 1063, 1138, 1046, 468, 206, 206, 206, 1064, 206, 206, 1170, 223, 480, 350, 350, 480, 223, 1185, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 224, 1125, 197, 198, 198, 199, 1860, 197, 198, 198, 1073, 1860, 1860, 1075, 481, 288, 972, 1184, 186, 1085, 215, 225, 223, 186, 224, 1125, 1068, 1860, 633, 634, 634, 635, 523, 524, 524, 525, 1075, 481, 288, 1860, 1860, 1184, 1085, 215, 223, 418, 265, 265, 418, 269, 1068, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 1860, 342, 215, 1206, 891, 892, 892, 893, 891, 892, 892, 893, 672, 672, 672, 672, 672, 672, 672, 672, 1860, 1860, 271, 269, 342, 215, 779, 1206, 779, 537, 779, 1081, 779, 537, 1008, 1860, 1860, 1860, 1012, 1860, 1860, 996, 995, 342, 1084, 269, 535, 535, 535, 535, 779, 536, 779, 1860, 779, 1081, 779, 1860, 1008, 215, 174, 174, 1012, 537, 996, 995, 342, 1860, 1084, 1860, 1860, 539, 1207, 1115, 287, 1186, 884, 885, 885, 886, 674, 540, 215, 1860, 891, 892, 892, 893, 541, 174, 700, 700, 700, 700, 1122, 539, 1207, 1115, 1186, 1860, 1860, 1136, 702, 674, 540, 545, 779, 559, 779, 1860, 342, 426, 1029, 426, 426, 1860, 287, 1122, 999, 426, 426, 426, 426, 426, 426, 1136, 702, 1860, 1202, 1860, 779, 1860, 779, 342, 1860, 1860, 1029, 633, 634, 634, 635, 999, 426, 426, 426, 426, 426, 426, 426, 283, 283, 1202, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1860, 427, 283, 287, 283, 283, 1860, 342, 1116, 674, 1103, 1106, 672, 672, 672, 672, 702, 1860, 1171, 215, 1135, 700, 700, 700, 700, 215, 215, 1860, 283, 537, 342, 1116, 674, 1860, 1103, 1106, 1860, 1860, 559, 1860, 702, 1171, 215, 1030, 1135, 1214, 1860, 1860, 215, 215, 1109, 283, 283, 547, 548, 547, 547, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1030, 1214, 283, 287, 283, 283, 1109, 969, 970, 970, 1070, 347, 672, 672, 672, 672, 1071, 1221, 970, 970, 970, 1072, 549, 216, 1860, 550, 1141, 1071, 283, 537, 197, 198, 198, 199, 186, 347, 1174, 1175, 1175, 1176, 1221, 953, 954, 954, 1047, 549, 186, 1113, 550, 1141, 1108, 283, 295, 295, 207, 295, 553, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 1049, 1216, 295, 1113, 295, 295, 1222, 1108, 215, 1050, 1051, 954, 954, 1052, 953, 954, 954, 955, 700, 700, 700, 700, 1860, 207, 1049, 1216, 1142, 207, 295, 1222, 1860, 215, 1050, 1860, 1860, 559, 1049, 1860, 1860, 169, 957, 733, 734, 734, 735, 1050, 347, 1117, 1860, 958, 1142, 295, 557, 557, 557, 557, 1133, 558, 1140, 674, 1049, 1118, 169, 1860, 957, 206, 174, 174, 1050, 559, 347, 1117, 958, 736, 1139, 1860, 1048, 561, 1229, 1133, 206, 1140, 674, 1048, 1118, 342, 1158, 562, 1860, 206, 197, 198, 198, 1073, 563, 174, 736, 1860, 1139, 972, 1048, 561, 1229, 206, 1223, 1860, 186, 1048, 342, 1158, 562, 320, 320, 320, 320, 565, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 1860, 1223, 320, 322, 320, 320, 1224, 1779, 1779, 1779, 1779, 1860, 956, 1126, 1127, 1126, 1126, 224, 1860, 1210, 674, 1161, 1053, 1054, 1054, 1055, 1177, 1860, 320, 1224, 1128, 197, 198, 198, 199, 207, 956, 1143, 1144, 1144, 1145, 224, 1210, 674, 1161, 1860, 1146, 186, 957, 1177, 288, 320, 457, 1104, 1860, 457, 346, 958, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 458, 346, 346, 346, 957, 288, 169, 956, 1179, 1104, 206, 1241, 958, 342, 1245, 1860, 1246, 1180, 342, 1162, 1089, 1090, 1089, 1089, 1150, 206, 348, 346, 1860, 169, 1860, 956, 1179, 1091, 206, 1241, 342, 582, 1245, 1246, 1180, 342, 1162, 1860, 1860, 1860, 1092, 1150, 206, 346, 576, 350, 350, 576, 346, 1093, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1092, 206, 197, 198, 198, 199, 1165, 1860, 1093, 1860, 1101, 198, 198, 1101, 1255, 577, 206, 1860, 186, 1860, 1860, 206, 348, 346, 1105, 206, 216, 1860, 1860, 1860, 1165, 633, 634, 634, 635, 1860, 1860, 1255, 577, 206, 1043, 1043, 1043, 1043, 206, 346, 167, 1860, 1105, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 461, 224, 1860, 1211, 215, 674, 853, 1048, 1860, 462, 633, 634, 634, 635, 1178, 1267, 1243, 578, 672, 672, 672, 672, 167, 167, 461, 224, 1211, 215, 674, 853, 1860, 1048, 462, 1860, 1860, 537, 1860, 1178, 1267, 1243, 578, 1860, 1110, 1860, 342, 167, 167, 1860, 1860, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1110, 342, 1860, 1048, 891, 892, 892, 893, 891, 892, 892, 893, 1290, 1860, 579, 1244, 1860, 672, 672, 672, 672, 1101, 167, 167, 1102, 287, 779, 1048, 779, 1181, 779, 1215, 779, 1101, 537, 1290, 1102, 579, 1244, 342, 997, 1114, 1860, 1094, 1860, 167, 353, 354, 354, 355, 779, 1182, 779, 1181, 779, 1215, 779, 1860, 789, 207, 215, 342, 342, 997, 1860, 1114, 1094, 342, 674, 1291, 1213, 589, 210, 1860, 215, 1182, 1247, 700, 700, 700, 700, 211, 789, 215, 342, 1860, 1101, 198, 198, 1102, 342, 674, 1291, 1213, 559, 589, 210, 215, 1860, 1860, 1247, 1134, 216, 1262, 211, 480, 350, 350, 480, 223, 1266, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1134, 1151, 1262, 674, 702, 206, 1860, 1212, 1860, 1266, 1166, 1167, 1167, 1168, 1227, 481, 1860, 1860, 1860, 1169, 206, 1860, 225, 223, 1860, 1151, 674, 1286, 702, 206, 1212, 884, 885, 885, 886, 1860, 1860, 1227, 481, 1174, 1175, 1175, 1176, 206, 206, 223, 223, 1860, 1860, 223, 223, 1286, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 702, 206, 1253, 1860, 215, 215, 1294, 342, 674, 1860, 197, 198, 198, 199, 606, 1228, 607, 1126, 1127, 1126, 1126, 1860, 225, 223, 702, 1253, 186, 215, 215, 1294, 342, 674, 1173, 347, 1128, 1860, 1860, 606, 1228, 607, 891, 892, 892, 893, 1231, 223, 569, 636, 637, 637, 638, 569, 569, 569, 569, 569, 1173, 347, 569, 569, 569, 1302, 779, 640, 779, 569, 569, 1231, 1096, 1860, 1309, 891, 892, 892, 893, 891, 892, 892, 893, 1860, 1860, 672, 672, 672, 672, 1302, 779, 1307, 779, 569, 1860, 1860, 1096, 779, 1309, 779, 1095, 779, 537, 1097, 1144, 1144, 1144, 1230, 1205, 1127, 1127, 1127, 1127, 1071, 1307, 1860, 569, 672, 672, 672, 672, 779, 673, 779, 1095, 779, 1217, 1097, 673, 673, 673, 174, 1205, 1860, 537, 673, 672, 672, 672, 672, 1860, 673, 1860, 891, 892, 892, 893, 673, 673, 673, 174, 1308, 1318, 537, 673, 1126, 1127, 1126, 1126, 1048, 1860, 197, 198, 198, 199, 779, 702, 779, 1860, 1242, 1860, 1860, 1128, 1860, 1308, 675, 1318, 186, 1317, 1860, 1860, 1098, 1860, 1048, 197, 198, 198, 199, 1860, 779, 702, 779, 1242, 1090, 1090, 1090, 1090, 1203, 675, 678, 186, 1317, 678, 678, 1098, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 990, 1203, 1330, 1200, 1127, 1127, 1127, 1127, 1335, 991, 1329, 1144, 1144, 1144, 1230, 1333, 672, 672, 672, 672, 1071, 1217, 680, 678, 990, 1330, 1200, 1544, 198, 198, 1544, 1335, 991, 537, 1329, 953, 954, 954, 1047, 1333, 1860, 1860, 1860, 186, 1204, 678, 283, 283, 207, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1049, 347, 283, 287, 283, 283, 702, 1204, 1336, 1050, 691, 1146, 1233, 956, 1860, 1316, 1232, 1146, 1346, 197, 198, 198, 199, 215, 1049, 347, 169, 1248, 283, 1860, 702, 1336, 1050, 1860, 691, 186, 1233, 956, 1316, 1232, 1860, 1346, 1860, 1201, 1860, 169, 215, 1860, 1860, 169, 1248, 283, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1201, 169, 283, 287, 283, 283, 1347, 1254, 1860, 1860, 891, 892, 892, 893, 891, 892, 892, 893, 215, 692, 700, 700, 700, 700, 1163, 1163, 1163, 1163, 283, 1860, 1347, 1254, 1100, 1164, 779, 1364, 779, 559, 1199, 1860, 1860, 215, 692, 1226, 1219, 1219, 1219, 1219, 1860, 1860, 1860, 283, 700, 700, 700, 700, 1100, 701, 779, 1364, 779, 1217, 1199, 701, 701, 701, 174, 1226, 1860, 559, 701, 700, 700, 700, 700, 1860, 701, 206, 891, 892, 892, 893, 701, 701, 701, 174, 1860, 874, 559, 701, 1860, 1238, 206, 1249, 206, 1048, 1860, 1860, 342, 571, 779, 206, 779, 700, 700, 700, 700, 1332, 1860, 206, 703, 874, 674, 1296, 1238, 206, 1099, 1249, 206, 1048, 559, 342, 571, 1860, 779, 1860, 779, 1860, 1860, 1860, 1332, 1225, 206, 703, 705, 674, 1296, 705, 705, 1099, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 347, 1225, 1319, 1152, 1153, 1153, 1154, 1860, 672, 672, 672, 672, 197, 198, 198, 199, 1860, 1051, 954, 954, 1052, 1351, 707, 705, 347, 537, 1319, 1860, 186, 1155, 207, 1143, 1144, 1144, 1145, 1860, 1101, 1860, 1156, 1102, 1146, 1860, 1208, 1049, 1351, 705, 212, 198, 198, 213, 1256, 214, 1050, 1155, 1345, 185, 185, 214, 214, 214, 185, 1156, 216, 1860, 214, 1208, 1860, 1049, 169, 215, 342, 1374, 1048, 1256, 1860, 1050, 1860, 1860, 1345, 1295, 1860, 1331, 717, 1860, 1860, 1860, 1143, 1144, 1144, 1145, 674, 169, 215, 342, 1374, 1146, 1048, 1370, 948, 948, 948, 948, 1860, 1295, 1331, 717, 600, 601, 601, 602, 1860, 214, 1860, 674, 1860, 603, 185, 214, 214, 214, 185, 1370, 216, 169, 214, 576, 350, 350, 576, 346, 853, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1393, 169, 1394, 1219, 1219, 1219, 1219, 1860, 853, 1257, 1175, 1175, 1257, 1860, 1860, 577, 1051, 954, 954, 1052, 1217, 1860, 348, 346, 1393, 216, 1394, 1860, 1860, 207, 1144, 1144, 1144, 1230, 1166, 1167, 1167, 1168, 577, 1071, 1860, 1860, 1049, 1169, 1258, 346, 346, 1860, 1860, 346, 346, 1050, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1049, 1258, 206, 956, 1350, 224, 1860, 1375, 1050, 672, 672, 672, 672, 1860, 720, 1337, 721, 1779, 1779, 1779, 1779, 1860, 348, 346, 1860, 206, 537, 956, 1350, 224, 1375, 1860, 1860, 1323, 1324, 1324, 1323, 720, 1337, 721, 633, 634, 634, 635, 1236, 346, 167, 1237, 1289, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 208, 1860, 206, 1860, 169, 1289, 1048, 1860, 342, 1259, 1175, 1175, 1259, 1395, 1860, 1415, 1416, 206, 722, 1860, 1334, 1860, 167, 167, 208, 186, 206, 169, 1860, 1860, 1048, 342, 1677, 634, 634, 1677, 1860, 1395, 1415, 1416, 206, 722, 1424, 1334, 1258, 167, 167, 1860, 186, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1424, 1258, 723, 1053, 1054, 1054, 1053, 1054, 1054, 1054, 1054, 1265, 891, 892, 892, 893, 207, 1265, 1252, 1438, 207, 1425, 167, 167, 1169, 1860, 723, 1442, 1458, 1159, 1860, 1860, 224, 1159, 779, 1860, 779, 1860, 1160, 206, 1191, 1860, 1160, 1438, 1425, 167, 583, 584, 583, 583, 1459, 1442, 1458, 1159, 206, 1460, 224, 1159, 779, 585, 779, 1160, 1860, 206, 1191, 1160, 1059, 1060, 1060, 1059, 727, 1472, 586, 1459, 1478, 1164, 1383, 206, 1460, 207, 555, 587, 1860, 1860, 1060, 1060, 1060, 1060, 674, 1860, 1860, 1860, 461, 1164, 727, 1472, 586, 207, 1478, 1860, 1383, 462, 1860, 555, 587, 583, 584, 583, 583, 1494, 461, 674, 884, 885, 885, 886, 461, 1487, 585, 462, 1263, 1144, 1144, 1264, 462, 891, 892, 892, 893, 1265, 1480, 586, 1494, 674, 461, 1089, 1090, 1089, 1089, 728, 587, 1487, 462, 1860, 224, 1860, 342, 779, 1091, 779, 1493, 1505, 582, 1480, 1860, 586, 674, 1502, 1860, 1190, 1521, 1092, 728, 587, 353, 354, 354, 355, 224, 342, 1093, 779, 1860, 779, 1493, 1505, 1531, 207, 704, 1481, 1502, 702, 1190, 674, 1521, 1092, 672, 672, 672, 672, 210, 1860, 1860, 1093, 1089, 1090, 1089, 1089, 729, 211, 1531, 704, 1481, 537, 702, 1532, 674, 1091, 1860, 1860, 779, 582, 1860, 1860, 210, 891, 892, 892, 893, 1292, 1092, 729, 211, 353, 354, 354, 355, 1547, 1532, 1093, 1089, 1090, 1089, 1089, 779, 1384, 207, 779, 1564, 779, 1860, 695, 1292, 1187, 1092, 1360, 674, 582, 1536, 210, 1547, 730, 1093, 1192, 1465, 1601, 1092, 1860, 211, 1384, 1860, 779, 1564, 779, 695, 1093, 779, 1557, 1360, 674, 1860, 1536, 1860, 210, 1565, 730, 1192, 1608, 1465, 1601, 1092, 211, 212, 198, 198, 213, 1614, 214, 1093, 779, 1557, 185, 185, 214, 214, 214, 202, 1565, 216, 1615, 214, 1608, 891, 892, 892, 893, 1257, 1175, 1175, 1260, 1614, 197, 198, 198, 199, 1860, 583, 584, 583, 583, 739, 1860, 216, 1615, 779, 1860, 779, 186, 1236, 585, 1860, 1237, 1860, 1152, 1153, 1153, 1152, 1860, 1193, 1284, 1860, 1261, 586, 739, 212, 198, 198, 213, 779, 214, 779, 1235, 206, 185, 185, 214, 214, 214, 202, 1239, 216, 1193, 214, 1284, 1261, 1602, 586, 206, 1240, 1613, 740, 1860, 1622, 1658, 1235, 1860, 206, 197, 198, 198, 199, 1860, 1860, 1239, 1352, 1352, 1352, 1352, 1602, 1860, 206, 1240, 1613, 186, 740, 223, 1622, 1658, 223, 223, 1285, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1280, 1659, 1664, 700, 700, 700, 700, 1860, 1285, 672, 672, 672, 672, 581, 1665, 571, 747, 1450, 1860, 1860, 559, 225, 223, 1280, 1659, 1664, 537, 1598, 1860, 1860, 672, 672, 672, 672, 1860, 1860, 581, 1665, 571, 747, 1860, 1450, 1315, 1288, 223, 223, 1860, 537, 223, 223, 1598, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1315, 1288, 1293, 779, 1194, 1195, 1195, 1196, 891, 892, 892, 893, 1684, 1860, 748, 1860, 672, 672, 672, 672, 1860, 1594, 225, 223, 1860, 1293, 779, 779, 779, 1860, 779, 1860, 779, 537, 1543, 1684, 1197, 748, 779, 1205, 1469, 1539, 1860, 1198, 1594, 223, 647, 648, 648, 649, 779, 779, 779, 1209, 779, 185, 779, 1860, 1860, 1197, 1860, 1860, 779, 1205, 1860, 1539, 1198, 1662, 1682, 1860, 1683, 760, 1860, 1860, 761, 779, 1209, 197, 198, 198, 199, 762, 700, 700, 700, 700, 1860, 1537, 1537, 1537, 1537, 1662, 1682, 186, 1683, 760, 1538, 1371, 761, 559, 1153, 1153, 1153, 1153, 762, 569, 636, 637, 637, 638, 569, 569, 569, 569, 569, 1860, 1314, 569, 569, 569, 1860, 1371, 640, 206, 569, 569, 1239, 1328, 1450, 1306, 1306, 1306, 1306, 779, 1860, 1240, 1048, 1599, 206, 1314, 1703, 1657, 891, 892, 892, 893, 1217, 206, 569, 1860, 1239, 1328, 1450, 1342, 1343, 1343, 1344, 779, 1240, 1048, 1599, 206, 206, 1703, 779, 1657, 779, 1750, 1750, 1750, 1750, 569, 569, 774, 637, 637, 775, 569, 569, 569, 569, 569, 1704, 1278, 569, 569, 569, 206, 779, 773, 779, 569, 569, 1680, 1297, 1297, 1297, 1297, 1688, 1166, 1167, 1167, 1250, 674, 1713, 1704, 1278, 1860, 1071, 1753, 206, 1299, 207, 1860, 1860, 569, 1860, 1680, 1310, 1310, 1310, 1310, 1688, 1311, 1860, 461, 674, 1713, 1320, 1144, 1144, 1321, 174, 174, 462, 1312, 1301, 1322, 569, 569, 776, 777, 777, 778, 569, 569, 569, 569, 569, 461, 347, 569, 569, 780, 1720, 1860, 569, 462, 569, 569, 1301, 174, 781, 1860, 782, 1860, 783, 1194, 1195, 1195, 1196, 1860, 1689, 1236, 347, 784, 1237, 1720, 1537, 1537, 1537, 1537, 569, 1860, 1860, 1860, 781, 1538, 782, 779, 783, 779, 1263, 1144, 1144, 1264, 1689, 206, 784, 1197, 1860, 1265, 1860, 1860, 1860, 569, 672, 672, 672, 672, 1860, 673, 206, 779, 1860, 779, 224, 673, 673, 673, 174, 206, 1197, 537, 673, 672, 672, 672, 672, 1860, 673, 197, 198, 198, 199, 206, 673, 673, 673, 174, 224, 1735, 537, 673, 1743, 1860, 1860, 186, 1623, 1623, 1623, 1623, 1167, 1167, 1167, 1251, 1748, 1624, 803, 1287, 1592, 1071, 1860, 1593, 1735, 207, 1860, 1743, 1257, 1175, 1175, 1257, 1860, 1860, 1413, 1324, 1324, 1413, 461, 1748, 779, 803, 678, 1287, 216, 678, 678, 462, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 461, 1258, 779, 1305, 1306, 1305, 1305, 1258, 462, 1860, 1860, 1860, 1259, 1175, 1175, 1259, 1166, 1167, 1167, 1250, 1128, 1765, 680, 678, 1258, 1071, 1860, 1860, 186, 207, 1258, 1860, 197, 198, 198, 199, 1413, 1324, 1324, 1413, 1860, 1860, 461, 1579, 1765, 678, 678, 1258, 186, 678, 678, 462, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 461, 1579, 1349, 1252, 1258, 1258, 1705, 1712, 462, 1169, 1860, 1722, 1724, 197, 198, 198, 199, 1306, 1306, 1306, 1306, 1860, 680, 678, 206, 1349, 1860, 1543, 1258, 186, 1705, 1712, 1860, 1469, 1217, 1722, 1724, 1348, 1860, 206, 1352, 1352, 1352, 1352, 779, 678, 283, 283, 206, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1348, 206, 283, 287, 283, 283, 1734, 779, 816, 1860, 1666, 1280, 1360, 1450, 1860, 1257, 1175, 1175, 1260, 672, 672, 672, 672, 1860, 1860, 1600, 1773, 1860, 283, 1860, 1734, 216, 816, 1666, 1280, 1360, 537, 1450, 1466, 1467, 1467, 1468, 1860, 1338, 1339, 1339, 1340, 1469, 1600, 1773, 1261, 283, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 956, 1746, 283, 287, 283, 283, 1261, 779, 1341, 1860, 891, 892, 892, 893, 817, 1450, 1385, 1385, 1385, 1385, 1263, 1144, 1144, 1264, 956, 1746, 1860, 1661, 283, 1265, 779, 1341, 779, 1299, 779, 1770, 1277, 1450, 817, 1450, 1623, 1623, 1623, 1623, 224, 1310, 1310, 1310, 1310, 1624, 1661, 283, 700, 700, 700, 700, 779, 701, 779, 1770, 1277, 1450, 1312, 701, 701, 701, 174, 1772, 224, 559, 701, 700, 700, 700, 700, 1860, 701, 891, 892, 892, 893, 1860, 701, 701, 701, 174, 1778, 1301, 559, 701, 1360, 1772, 197, 198, 198, 199, 1860, 1860, 1796, 779, 1860, 779, 1860, 1860, 824, 1279, 1860, 1860, 186, 1860, 1778, 1860, 1860, 1360, 197, 198, 198, 199, 1194, 1195, 1195, 1196, 1796, 779, 1450, 779, 1368, 824, 705, 1279, 186, 705, 705, 1660, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 1450, 1368, 1197, 1829, 1860, 1369, 779, 1833, 1660, 1860, 672, 672, 672, 672, 1714, 1797, 1804, 1807, 1396, 1396, 1396, 1396, 707, 705, 1360, 1197, 1829, 537, 1369, 779, 1833, 672, 672, 672, 672, 1312, 1860, 1860, 1714, 1797, 1804, 1807, 1860, 1372, 1860, 705, 705, 1360, 537, 705, 705, 1860, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 1372, 1373, 1310, 1310, 1310, 1310, 891, 892, 892, 893, 700, 700, 700, 700, 700, 700, 700, 700, 1860, 1312, 1860, 1860, 707, 705, 1373, 1860, 1281, 559, 779, 1860, 779, 559, 1860, 1053, 1054, 1054, 1055, 1860, 1860, 891, 892, 892, 893, 1401, 1301, 705, 212, 198, 198, 213, 1281, 214, 779, 1428, 779, 185, 185, 214, 214, 214, 185, 779, 216, 779, 214, 956, 1401, 1828, 891, 892, 892, 893, 1834, 1282, 832, 1860, 1860, 1428, 1860, 1860, 672, 672, 672, 672, 1844, 779, 1860, 779, 956, 1860, 779, 1828, 779, 1860, 1450, 1834, 1282, 537, 832, 212, 198, 198, 213, 1479, 214, 1283, 1860, 1844, 185, 185, 214, 214, 214, 185, 779, 216, 779, 214, 1450, 700, 700, 700, 700, 1809, 1809, 1809, 1809, 1479, 1283, 672, 672, 672, 672, 833, 1860, 1860, 559, 1377, 1377, 1377, 1377, 1513, 1513, 1513, 1513, 1860, 537, 1860, 1503, 1503, 1503, 1503, 1860, 1376, 1379, 1402, 833, 346, 1514, 1860, 346, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1376, 1402, 541, 1427, 197, 198, 198, 199, 1515, 1516, 1516, 1517, 1860, 197, 198, 198, 199, 835, 1860, 1860, 186, 1860, 348, 346, 186, 1514, 1427, 1439, 1860, 186, 1860, 1403, 1403, 1403, 1403, 1570, 1570, 1570, 1570, 1860, 835, 1152, 1153, 1153, 1154, 346, 346, 1440, 1405, 346, 346, 1439, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1681, 1155, 1860, 1572, 1440, 1860, 1860, 563, 1860, 1087, 1156, 1717, 674, 1418, 836, 197, 198, 198, 199, 1860, 1860, 1860, 348, 346, 1681, 1155, 1572, 1477, 1477, 1477, 1477, 186, 1087, 1156, 1717, 674, 1418, 836, 1860, 1860, 1152, 1153, 1153, 1154, 537, 346, 167, 1860, 1470, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1155, 1434, 1435, 1435, 1434, 1470, 1719, 1716, 1860, 1156, 1419, 1544, 198, 198, 1545, 837, 674, 216, 1544, 198, 198, 1545, 167, 167, 1155, 1360, 1860, 186, 1860, 1860, 1719, 1716, 1156, 1419, 186, 1860, 1860, 1860, 837, 674, 1860, 1860, 1860, 1508, 1860, 167, 167, 1860, 1360, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1167, 1167, 1167, 1251, 838, 1326, 1326, 1326, 1326, 1071, 1117, 1860, 1592, 207, 1164, 1593, 1089, 1090, 1089, 1089, 1846, 674, 167, 167, 1860, 1860, 461, 1860, 838, 1091, 1450, 461, 779, 582, 1117, 462, 1477, 1477, 1477, 1477, 462, 1771, 1092, 1846, 674, 167, 842, 843, 842, 842, 461, 1093, 582, 537, 1450, 461, 779, 582, 462, 844, 1847, 669, 1860, 462, 1771, 582, 1092, 1089, 1090, 1089, 1089, 670, 845, 1860, 1093, 1860, 891, 892, 892, 893, 1091, 846, 1860, 1847, 582, 669, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1092, 670, 1860, 845, 1860, 779, 1091, 1355, 1860, 1093, 582, 846, 583, 584, 583, 583, 1860, 1860, 1860, 1092, 672, 672, 672, 672, 1092, 585, 1450, 1860, 1093, 779, 1741, 1355, 1093, 891, 892, 892, 893, 537, 586, 891, 892, 892, 893, 1092, 1860, 847, 1860, 587, 1860, 1860, 1450, 1093, 1742, 1860, 1741, 1363, 1450, 779, 1860, 797, 1860, 779, 586, 897, 891, 892, 892, 893, 847, 1860, 587, 583, 584, 583, 583, 1860, 1742, 1860, 1356, 1363, 1450, 779, 797, 1860, 585, 779, 779, 897, 779, 891, 892, 892, 893, 197, 198, 198, 199, 586, 1860, 1365, 1860, 1356, 1570, 1570, 1570, 1570, 587, 848, 1860, 186, 779, 779, 779, 779, 1473, 1325, 1326, 1325, 1325, 1860, 1860, 586, 1365, 1860, 1327, 1860, 1367, 1860, 585, 587, 848, 353, 354, 354, 355, 779, 1625, 779, 1473, 1860, 1860, 586, 1860, 1860, 207, 583, 584, 583, 583, 1367, 587, 1152, 1153, 1153, 1154, 1860, 1860, 210, 585, 1625, 197, 198, 198, 199, 849, 586, 211, 468, 1860, 1860, 1860, 586, 1860, 587, 1450, 1417, 186, 1155, 1768, 1860, 587, 210, 1558, 1558, 1558, 1558, 1156, 849, 1860, 211, 468, 353, 354, 354, 355, 586, 1471, 1860, 1450, 1417, 1860, 1155, 1768, 587, 207, 1435, 1435, 1435, 1435, 1156, 1420, 1421, 1421, 1422, 1559, 1860, 1860, 210, 1860, 1471, 1450, 186, 672, 672, 672, 672, 211, 1429, 1343, 1343, 1429, 1799, 851, 1860, 1860, 1860, 1155, 1559, 1860, 537, 207, 210, 1423, 1860, 1450, 1156, 1476, 1508, 779, 211, 1860, 1860, 1860, 461, 1799, 851, 733, 734, 734, 733, 1155, 1733, 1430, 1747, 1860, 1423, 1360, 1860, 1156, 207, 1476, 1860, 779, 672, 672, 672, 672, 461, 1486, 1486, 1486, 1486, 461, 1860, 1733, 1430, 1747, 1860, 853, 1360, 537, 462, 1860, 1860, 1860, 1431, 1343, 1343, 1431, 1554, 1860, 1860, 1605, 1606, 1606, 1607, 461, 1860, 207, 798, 1860, 853, 1860, 1860, 462, 212, 198, 198, 213, 1860, 214, 461, 779, 1554, 185, 185, 214, 214, 214, 202, 1430, 216, 798, 214, 1860, 1429, 1343, 1343, 1432, 857, 1860, 1434, 1435, 1435, 1436, 461, 779, 1860, 207, 1860, 185, 185, 1860, 1430, 1860, 185, 1860, 216, 1860, 1860, 1450, 210, 1860, 857, 212, 198, 198, 213, 1860, 214, 1433, 1860, 1707, 185, 185, 214, 214, 214, 202, 1860, 216, 1860, 214, 1508, 1450, 210, 1860, 1860, 1461, 1462, 1462, 1463, 1860, 1433, 1860, 1707, 674, 1464, 1860, 1118, 1860, 1860, 1860, 858, 700, 700, 700, 700, 779, 1466, 1467, 1467, 1468, 1860, 1461, 1462, 1462, 1463, 1469, 674, 1860, 559, 1118, 1464, 1860, 1860, 858, 223, 1490, 779, 223, 223, 779, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 989, 1860, 779, 1860, 1490, 779, 1860, 1642, 1642, 1642, 1642, 1721, 1721, 1721, 1721, 1860, 1860, 864, 1860, 1860, 1624, 225, 223, 989, 1514, 779, 197, 198, 198, 199, 700, 700, 700, 700, 1810, 1779, 1779, 1810, 1860, 1860, 864, 1860, 186, 1860, 223, 223, 1860, 559, 223, 223, 1546, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 823, 865, 672, 672, 672, 672, 1860, 1860, 1546, 1860, 197, 198, 198, 199, 1544, 198, 198, 1545, 1860, 537, 1860, 225, 223, 823, 1860, 865, 186, 1860, 1860, 1860, 186, 1860, 1518, 1839, 1840, 1840, 1839, 1549, 1860, 1745, 1152, 1153, 1153, 1154, 223, 569, 887, 888, 888, 889, 569, 569, 569, 569, 569, 1360, 1518, 569, 569, 780, 1549, 1860, 569, 1745, 569, 569, 1155, 1450, 781, 1769, 782, 1860, 783, 1450, 1860, 1156, 1495, 1860, 1360, 1736, 1860, 890, 1860, 700, 700, 700, 700, 1860, 569, 1860, 1155, 1450, 781, 1769, 782, 1860, 783, 1450, 1156, 1495, 559, 1860, 1736, 1860, 890, 1860, 1860, 1496, 1497, 1497, 1498, 569, 569, 774, 637, 637, 775, 569, 569, 569, 569, 569, 822, 1860, 569, 569, 569, 1860, 1860, 773, 1860, 569, 569, 1155, 1860, 197, 198, 198, 199, 1499, 1860, 1860, 1156, 1860, 1860, 822, 1860, 197, 198, 198, 199, 186, 1860, 1860, 1860, 569, 1860, 1155, 1503, 1503, 1503, 1503, 1499, 186, 1860, 1156, 1548, 1570, 1570, 1570, 1570, 1589, 1779, 1779, 1779, 1779, 1860, 1860, 569, 569, 776, 777, 777, 778, 569, 569, 569, 569, 569, 1548, 1427, 569, 569, 780, 1860, 1589, 569, 1450, 569, 569, 1860, 1572, 781, 1798, 782, 1450, 783, 1152, 1153, 1153, 1154, 1663, 1860, 1427, 1860, 784, 1860, 1152, 1153, 1153, 1154, 1450, 569, 1860, 1572, 1860, 781, 1798, 782, 1450, 783, 1860, 1860, 1155, 1663, 1500, 1860, 1860, 784, 1860, 1860, 1860, 1156, 1155, 1860, 569, 891, 892, 892, 893, 1860, 1860, 1563, 1510, 1511, 1511, 1510, 1155, 1860, 1500, 1860, 1420, 1421, 1421, 1420, 1156, 1860, 1155, 779, 216, 779, 1642, 1642, 1642, 1642, 1563, 1627, 1570, 1570, 1627, 895, 890, 1511, 1511, 1511, 1511, 1860, 1239, 1514, 1860, 1860, 1860, 779, 1427, 779, 1582, 1240, 1860, 186, 1421, 1421, 1421, 1421, 895, 890, 891, 892, 892, 893, 1860, 1628, 1239, 1860, 1860, 1236, 1860, 1427, 1237, 1860, 1240, 1420, 1421, 1421, 1422, 1582, 1239, 1860, 779, 1860, 779, 1860, 1427, 1860, 1628, 1240, 1860, 208, 1860, 896, 1860, 890, 1860, 1352, 1352, 1352, 1352, 1155, 1860, 206, 1239, 206, 779, 1423, 779, 1427, 1156, 1860, 1240, 1860, 1860, 208, 896, 1860, 890, 891, 892, 892, 893, 1860, 1860, 1155, 206, 1860, 206, 1280, 1423, 1860, 779, 1156, 1860, 1860, 1860, 1726, 1727, 1727, 1728, 779, 1860, 779, 1860, 1860, 1702, 1860, 1152, 1153, 1153, 1154, 1280, 898, 890, 899, 779, 1860, 1053, 1054, 1054, 1055, 1640, 1860, 1860, 779, 1860, 779, 1501, 1702, 1860, 207, 1860, 1860, 1155, 1860, 898, 890, 899, 647, 648, 648, 649, 1156, 957, 1860, 1640, 1860, 1513, 1513, 1513, 1513, 1501, 1506, 1515, 1516, 1516, 1515, 1155, 1429, 1343, 1343, 1429, 1450, 650, 1514, 1156, 651, 957, 1585, 186, 1514, 207, 1860, 652, 1585, 1506, 1706, 215, 1860, 1860, 1642, 1642, 1642, 1642, 461, 1860, 1450, 650, 1860, 1586, 651, 1860, 1585, 1430, 1860, 1586, 652, 1514, 1585, 1706, 215, 672, 672, 672, 672, 1860, 673, 1860, 461, 1860, 1860, 1860, 673, 673, 673, 174, 1430, 1860, 537, 673, 1860, 1860, 1860, 917, 1576, 1577, 1577, 1578, 1860, 1431, 1343, 1343, 1431, 185, 185, 1860, 346, 1860, 1860, 346, 186, 1860, 207, 1429, 1343, 1343, 1432, 917, 672, 672, 672, 672, 1860, 673, 1592, 461, 207, 1593, 1580, 673, 673, 673, 174, 1860, 1430, 537, 673, 1860, 1860, 210, 1860, 347, 721, 1860, 779, 1860, 781, 1860, 1433, 461, 1860, 1580, 1698, 1642, 1642, 1698, 918, 1430, 1721, 1721, 1721, 1721, 1860, 210, 347, 721, 1860, 1624, 779, 1699, 781, 1433, 1860, 1860, 1445, 1445, 1445, 1445, 1860, 918, 806, 672, 672, 806, 678, 1860, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 807, 678, 678, 990, 1805, 1805, 1805, 1805, 1860, 1280, 1860, 1860, 991, 1806, 1805, 1805, 1805, 1805, 1860, 1152, 1153, 1153, 1154, 1806, 1860, 680, 678, 990, 1510, 1511, 1511, 1512, 1280, 1860, 1860, 991, 1860, 185, 185, 1860, 1860, 1860, 185, 1860, 216, 1155, 1860, 1560, 678, 678, 1860, 1860, 678, 678, 1156, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 1155, 1582, 1560, 1648, 1649, 1649, 1650, 1860, 1156, 1860, 1860, 1860, 185, 185, 1677, 634, 634, 1678, 1860, 186, 1514, 1860, 680, 678, 1731, 970, 970, 1764, 1860, 1860, 186, 1860, 1860, 1071, 1860, 1453, 1358, 1358, 1454, 1860, 186, 1496, 1497, 1497, 1496, 678, 283, 283, 780, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1451, 1860, 283, 287, 283, 283, 1239, 779, 1860, 1452, 1860, 1860, 1559, 1860, 1860, 1240, 1631, 1631, 1631, 1631, 927, 989, 1860, 899, 1451, 1860, 1860, 1860, 283, 1860, 1239, 779, 1452, 1860, 1860, 1559, 1860, 1860, 1240, 1843, 1843, 1843, 1843, 927, 989, 1860, 899, 1860, 1806, 1860, 1633, 283, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1860, 1860, 283, 287, 283, 283, 1633, 1860, 1860, 1453, 1358, 1358, 1454, 1558, 1558, 1558, 1558, 1860, 1566, 1567, 1567, 1568, 780, 1860, 928, 1860, 1860, 1569, 283, 1698, 1642, 1642, 1698, 1860, 1860, 1451, 1455, 1456, 1456, 1455, 1053, 1054, 1054, 1055, 1452, 1559, 1699, 928, 1860, 780, 956, 283, 700, 700, 700, 700, 1860, 701, 1860, 1451, 1860, 1860, 1533, 701, 701, 701, 174, 1452, 1559, 559, 701, 1534, 956, 956, 935, 1566, 1567, 1567, 1568, 1456, 1456, 1456, 1456, 1860, 1569, 1860, 1533, 1788, 1789, 1789, 1790, 1860, 780, 1860, 1534, 956, 185, 185, 935, 700, 700, 700, 700, 186, 701, 1533, 1860, 956, 1860, 1057, 701, 701, 701, 174, 1534, 1860, 559, 701, 1860, 1860, 1860, 936, 1648, 1649, 1649, 1648, 1860, 1860, 1860, 1533, 956, 1860, 1057, 1839, 1840, 1840, 1839, 1534, 186, 1514, 1526, 1527, 1527, 1526, 1860, 936, 826, 700, 700, 826, 705, 1860, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 827, 705, 705, 1595, 1860, 1860, 1860, 1649, 1649, 1649, 1649, 1860, 1596, 1576, 1577, 1577, 1576, 1860, 1860, 1461, 1462, 1462, 1461, 186, 1514, 707, 705, 1595, 1538, 186, 1860, 1860, 780, 1860, 1860, 1596, 1860, 1779, 1779, 1779, 1779, 1503, 1503, 1503, 1503, 990, 1860, 1625, 705, 705, 1860, 1860, 705, 705, 991, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 990, 1625, 1860, 1860, 1427, 1845, 1860, 1860, 991, 1860, 1577, 1577, 1577, 1577, 1860, 1860, 1462, 1462, 1462, 1462, 1860, 1860, 707, 705, 1860, 1538, 186, 1427, 1845, 780, 1860, 197, 198, 198, 199, 1860, 1860, 1667, 1668, 1668, 1669, 1860, 990, 1860, 1625, 705, 346, 186, 1860, 346, 346, 991, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 990, 1625, 1653, 1670, 1648, 1649, 1649, 1650, 991, 1360, 1860, 1860, 1860, 1570, 1570, 1570, 1570, 1860, 943, 1860, 186, 1514, 348, 346, 1860, 1653, 1670, 1516, 1516, 1516, 1516, 1860, 1360, 1152, 1153, 1153, 1154, 1627, 1570, 1570, 1627, 943, 1048, 186, 1514, 346, 346, 1572, 1585, 346, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1048, 944, 1586, 1572, 1628, 1585, 1860, 1760, 1760, 1760, 1760, 1860, 1576, 1577, 1577, 1578, 1860, 1843, 1843, 1843, 1843, 348, 346, 1048, 1514, 944, 1806, 1628, 186, 1860, 1860, 1860, 1860, 1631, 1631, 1631, 1631, 1860, 1860, 1497, 1497, 1497, 1497, 1860, 346, 167, 1629, 1860, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1239, 1860, 1691, 1860, 1629, 1860, 1559, 1860, 1860, 1240, 1648, 1649, 1649, 1650, 945, 1860, 1860, 1860, 1860, 185, 185, 1860, 167, 167, 1239, 1691, 186, 1514, 1860, 1559, 1860, 1860, 1240, 1851, 1851, 1851, 1852, 945, 1774, 1775, 1775, 1776, 1541, 1860, 1860, 167, 167, 1777, 1860, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1466, 1467, 1467, 1540, 1527, 1527, 1527, 1527, 1860, 1541, 1360, 1860, 1860, 780, 1860, 1860, 1860, 946, 1467, 1467, 1467, 1542, 167, 167, 1860, 1860, 990, 1541, 1860, 1860, 1595, 780, 1860, 1360, 1860, 991, 1860, 1860, 1860, 1596, 946, 1860, 1860, 1860, 990, 167, 842, 843, 842, 842, 990, 1860, 582, 991, 1595, 1860, 1860, 582, 991, 844, 1860, 1860, 1596, 1860, 1860, 582, 1860, 1860, 990, 1860, 1860, 1860, 845, 1860, 1860, 1860, 991, 1477, 1477, 1477, 1477, 846, 1860, 1860, 1496, 1497, 1497, 1498, 1152, 1153, 1153, 1154, 1860, 1860, 537, 1860, 845, 1860, 1152, 1153, 1153, 1154, 669, 1860, 846, 583, 584, 583, 583, 1860, 1155, 1860, 670, 1860, 1155, 1860, 1499, 1860, 585, 1156, 1562, 1860, 1860, 1617, 1155, 1860, 669, 1860, 1860, 727, 1860, 586, 1860, 1156, 1155, 670, 1860, 1860, 1155, 1499, 587, 1860, 1156, 1860, 1562, 1860, 1617, 1860, 1155, 1631, 1631, 1631, 1631, 727, 1860, 586, 1156, 1860, 1152, 1153, 1153, 1154, 1860, 587, 583, 584, 583, 583, 1860, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 585, 1561, 1860, 1860, 1860, 1091, 1633, 1155, 1860, 582, 1860, 1860, 1592, 586, 1860, 1593, 1156, 1860, 1092, 1860, 1860, 728, 587, 1860, 1860, 1561, 1860, 1591, 1860, 1633, 1860, 1155, 779, 1860, 781, 1860, 1860, 586, 1860, 1156, 1860, 1860, 1092, 1860, 728, 587, 583, 584, 583, 583, 1591, 1466, 1467, 1467, 1540, 1860, 779, 1860, 781, 585, 1541, 1860, 1860, 1860, 780, 1467, 1467, 1467, 1542, 1860, 949, 1860, 586, 1860, 1541, 1860, 1860, 990, 780, 1860, 1860, 587, 1642, 1642, 1642, 1642, 991, 1693, 1631, 1631, 1693, 990, 1860, 1860, 949, 1860, 586, 1860, 1860, 1514, 991, 990, 1860, 1860, 587, 583, 584, 583, 583, 991, 197, 198, 198, 199, 1860, 990, 1644, 1860, 585, 1860, 1860, 1694, 1860, 991, 1860, 1860, 186, 1860, 1860, 1860, 1860, 586, 1860, 1860, 1609, 1860, 1860, 1860, 1860, 1644, 587, 1860, 1860, 950, 1694, 1860, 1860, 672, 672, 672, 672, 1152, 1153, 1153, 1154, 586, 1860, 1860, 1609, 197, 198, 198, 199, 587, 537, 1860, 950, 353, 354, 354, 355, 1860, 1860, 1616, 1860, 186, 1860, 1155, 1860, 1860, 207, 801, 1860, 1610, 1690, 1860, 1156, 1420, 1421, 1421, 1422, 951, 1860, 210, 1860, 1860, 1860, 1616, 1860, 1860, 1860, 1155, 211, 1860, 801, 1860, 1610, 1860, 1690, 1156, 1860, 1860, 1860, 1155, 1860, 951, 1860, 210, 1860, 1423, 1860, 1860, 1156, 1860, 1860, 211, 353, 354, 354, 355, 1570, 1570, 1570, 1570, 1860, 1860, 1860, 1155, 1860, 207, 1860, 1860, 1423, 1860, 1860, 1156, 1677, 634, 634, 1678, 359, 1860, 210, 1860, 1860, 1626, 1860, 1576, 1577, 1577, 1578, 211, 186, 1860, 1572, 952, 185, 185, 1860, 197, 198, 198, 199, 186, 359, 1860, 210, 1860, 1860, 1626, 1558, 1558, 1558, 1558, 211, 186, 1860, 1572, 952, 223, 1860, 1580, 223, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1860, 1860, 1559, 1860, 1580, 1860, 1860, 1860, 1860, 672, 672, 672, 672, 1860, 973, 1566, 1567, 1567, 1566, 1860, 1860, 225, 223, 1860, 1624, 1559, 537, 1860, 207, 1860, 197, 198, 198, 199, 1860, 1860, 1860, 973, 1860, 1860, 1860, 1159, 1860, 1679, 223, 223, 186, 1860, 223, 223, 1160, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1159, 1679, 1701, 1860, 974, 1860, 1860, 1860, 1160, 1860, 672, 672, 672, 672, 1860, 1860, 1860, 1567, 1567, 1567, 1567, 1860, 225, 223, 1860, 1701, 1624, 537, 974, 1860, 207, 1860, 1718, 1671, 1606, 1606, 1674, 1642, 1642, 1642, 1642, 1860, 1860, 1159, 1860, 223, 647, 648, 648, 649, 1860, 1860, 1160, 779, 1514, 1860, 1718, 1860, 1860, 1860, 1697, 1860, 1860, 1637, 1638, 1638, 1639, 1159, 1675, 1860, 1860, 760, 185, 185, 761, 1160, 1860, 779, 1860, 186, 342, 762, 1860, 1860, 1697, 1860, 1860, 1685, 1686, 1686, 1687, 1675, 1860, 1860, 1860, 760, 1860, 1641, 761, 1642, 1642, 1642, 1642, 342, 762, 569, 887, 888, 888, 889, 569, 569, 569, 569, 569, 1860, 1514, 569, 569, 780, 1641, 1048, 569, 1860, 569, 569, 1860, 1860, 781, 1860, 782, 1860, 783, 1648, 1649, 1649, 1650, 1860, 1860, 1860, 1729, 890, 185, 185, 1048, 1860, 1860, 1860, 569, 186, 1514, 1860, 781, 1860, 782, 1860, 783, 1860, 1860, 1723, 1723, 1723, 1723, 1729, 890, 1860, 1860, 1652, 1860, 1860, 1860, 569, 569, 887, 888, 888, 889, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1652, 569, 569, 1633, 1860, 781, 1860, 782, 1860, 783, 1671, 1606, 1606, 1671, 1744, 1744, 1744, 1744, 890, 1755, 1756, 1756, 1755, 780, 1860, 569, 1633, 1860, 1860, 781, 1860, 782, 1860, 783, 1860, 186, 990, 1860, 1860, 1860, 1860, 890, 1860, 1860, 1860, 1672, 1715, 1860, 569, 891, 892, 892, 893, 1673, 1606, 1606, 1673, 1860, 1860, 1860, 990, 1753, 1637, 1638, 1638, 1637, 780, 1860, 1672, 1715, 1860, 779, 1860, 779, 1755, 1756, 1756, 1757, 186, 990, 1860, 993, 994, 1496, 1497, 1497, 1498, 1860, 1672, 1860, 186, 1860, 1048, 1860, 1860, 779, 1691, 779, 1631, 1631, 1631, 1631, 1860, 990, 993, 994, 891, 892, 892, 893, 1860, 1672, 1860, 1860, 1860, 1499, 1860, 1048, 1860, 1691, 1860, 1860, 1860, 1692, 1618, 1619, 1619, 1618, 779, 1860, 779, 1860, 1633, 1624, 1860, 1860, 1860, 1860, 1499, 1860, 1048, 1860, 997, 998, 1860, 1860, 1860, 1692, 1860, 1860, 1239, 1860, 779, 1860, 779, 1633, 1860, 1860, 1860, 1240, 1638, 1638, 1638, 1638, 1860, 997, 998, 672, 672, 672, 672, 1860, 673, 1860, 1239, 1860, 186, 1860, 673, 673, 673, 174, 1240, 1860, 537, 673, 1619, 1619, 1619, 1619, 1708, 1709, 1709, 1710, 1691, 1624, 1860, 1860, 1860, 1637, 1638, 1638, 1639, 1860, 1860, 1013, 1860, 1756, 1756, 1756, 1756, 1860, 1239, 1860, 1450, 186, 1860, 1691, 1860, 1860, 1860, 1240, 1711, 186, 1860, 1860, 1860, 1860, 1013, 672, 672, 672, 672, 1695, 673, 1860, 1239, 1860, 1450, 1860, 673, 673, 673, 174, 1240, 1711, 537, 673, 1860, 1753, 1860, 1860, 1637, 1638, 1638, 1639, 1695, 1648, 1649, 1649, 1650, 185, 185, 1860, 1014, 1860, 185, 185, 186, 1693, 1631, 1631, 1693, 186, 1514, 1860, 1723, 1723, 1723, 1723, 1700, 1667, 1668, 1668, 1669, 1860, 1641, 1014, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1694, 1700, 283, 287, 283, 283, 1641, 1752, 1860, 1860, 1670, 1860, 1860, 1860, 1860, 1753, 1360, 1860, 1731, 970, 970, 1732, 1023, 1694, 1860, 1860, 1860, 972, 283, 1860, 1752, 1860, 1860, 1670, 186, 1860, 1860, 1860, 1860, 1360, 1860, 1655, 1655, 1655, 1655, 1023, 1860, 1860, 1860, 1860, 1538, 283, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 990, 1860, 283, 287, 283, 283, 1860, 1860, 1860, 991, 1685, 1686, 1686, 1685, 672, 672, 672, 672, 1860, 1624, 1860, 1860, 1860, 1024, 990, 1860, 1860, 1860, 283, 1860, 1860, 537, 991, 1860, 1860, 1860, 1239, 1860, 1749, 1760, 1760, 1760, 1760, 1860, 1860, 1240, 1024, 1671, 1606, 1606, 1674, 283, 700, 700, 700, 700, 1514, 701, 1860, 1860, 1239, 1860, 1749, 701, 701, 701, 174, 779, 1240, 559, 701, 1089, 1090, 1089, 1089, 1766, 1766, 1766, 1766, 1860, 1860, 1794, 1675, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1031, 779, 1860, 197, 198, 198, 199, 1092, 1671, 1606, 1606, 1671, 1860, 1860, 1860, 1675, 1093, 1767, 1860, 186, 1860, 780, 1860, 1031, 700, 700, 700, 700, 1725, 701, 1860, 1092, 1860, 1860, 990, 701, 701, 701, 174, 1093, 1767, 559, 701, 1672, 1673, 1606, 1606, 1673, 1032, 1860, 1860, 1860, 1725, 1726, 1727, 1727, 1726, 780, 990, 1860, 1860, 1860, 1686, 1686, 1686, 1686, 1672, 1860, 1860, 186, 990, 1624, 1032, 583, 584, 583, 583, 1860, 1860, 1672, 1860, 1860, 1737, 1738, 1738, 1739, 585, 1752, 1239, 1744, 1744, 1744, 1744, 1860, 990, 1753, 1860, 1240, 1860, 586, 1860, 1860, 1672, 1860, 1860, 1860, 1450, 1860, 587, 1041, 1752, 1860, 1239, 1860, 1740, 1779, 1779, 1779, 1779, 1860, 1240, 1715, 1860, 586, 1860, 1860, 1708, 1709, 1709, 1708, 1450, 587, 1041, 1042, 1043, 1042, 1042, 1740, 1648, 1649, 1649, 1650, 1860, 1808, 1715, 1860, 585, 185, 185, 1860, 1860, 1860, 1595, 1860, 186, 1514, 1860, 1860, 1715, 586, 1860, 1596, 1860, 1860, 1860, 1044, 1860, 1808, 587, 1860, 1860, 1709, 1709, 1709, 1709, 1860, 1595, 1860, 1860, 1730, 1860, 1715, 1860, 586, 1596, 1860, 1860, 1860, 1044, 1860, 1860, 587, 1053, 1054, 1054, 1055, 1860, 1595, 1860, 1860, 1860, 1860, 1730, 1715, 1860, 207, 1596, 1708, 1709, 1709, 1710, 1766, 1766, 1766, 1766, 1860, 1056, 1860, 957, 1860, 1860, 1595, 1727, 1727, 1727, 1727, 1715, 958, 1860, 1596, 1860, 1450, 1731, 970, 970, 1732, 1860, 1860, 186, 1711, 1056, 972, 957, 1767, 672, 672, 672, 672, 186, 1860, 958, 1059, 1060, 1060, 1061, 1450, 1752, 1860, 1860, 1860, 1062, 537, 1711, 1860, 1753, 1860, 1767, 1761, 1762, 1762, 1763, 1737, 1738, 1738, 1737, 206, 185, 185, 1860, 1752, 1860, 1209, 1860, 186, 1514, 360, 1737, 1738, 1738, 1739, 206, 1860, 1860, 1738, 1738, 1738, 1738, 1595, 1860, 206, 1860, 1860, 1860, 1767, 1209, 1860, 1596, 1860, 360, 1860, 1450, 1860, 1860, 206, 583, 584, 583, 583, 1740, 1595, 1860, 1595, 1860, 1860, 1860, 1767, 1767, 585, 1596, 1596, 1667, 1668, 1668, 1669, 1450, 1779, 1779, 1779, 1779, 1860, 586, 1740, 1148, 1595, 1851, 1851, 1851, 1852, 1767, 587, 1860, 1596, 1860, 1541, 1774, 1775, 1775, 1776, 1860, 1860, 1781, 1860, 1670, 1777, 586, 1860, 1148, 1860, 1360, 1860, 1860, 1860, 587, 1042, 1043, 1042, 1042, 1860, 1860, 1860, 1755, 1756, 1756, 1757, 1781, 1670, 585, 1860, 1459, 185, 185, 1360, 1360, 1860, 185, 1860, 186, 1860, 1860, 586, 1788, 1789, 1789, 1790, 1860, 1044, 1860, 1860, 587, 185, 185, 1459, 1860, 1860, 1860, 1360, 186, 1860, 1809, 1809, 1809, 1809, 1753, 586, 1860, 1792, 1860, 1860, 1044, 1860, 1860, 587, 583, 584, 583, 583, 1860, 1761, 1762, 1762, 1761, 1731, 970, 970, 1764, 585, 1835, 1860, 1860, 1792, 1071, 1860, 1149, 186, 1514, 1860, 1860, 186, 586, 1860, 1753, 1762, 1762, 1762, 1762, 1860, 1860, 587, 1860, 1860, 1835, 1761, 1762, 1762, 1763, 1860, 1149, 186, 1514, 1794, 185, 185, 586, 1860, 1860, 185, 1860, 186, 1514, 1860, 587, 1152, 1153, 1153, 1154, 1860, 1860, 1860, 1860, 1708, 1709, 1709, 1710, 1794, 1860, 1851, 1851, 1851, 1852, 1800, 1801, 1801, 1802, 1794, 1541, 1157, 1860, 1155, 1803, 1788, 1789, 1789, 1790, 1450, 1860, 1860, 1156, 1860, 185, 185, 1860, 1711, 1860, 1450, 1860, 186, 1860, 1860, 1860, 1157, 1860, 1155, 1860, 1598, 1860, 1860, 1860, 1450, 1860, 1156, 1089, 1090, 1089, 1089, 1711, 1860, 1860, 1450, 1860, 1800, 1801, 1801, 1802, 1091, 1860, 1860, 1598, 582, 1803, 1774, 1775, 1775, 1774, 1860, 1188, 1860, 1092, 1860, 1806, 1860, 1860, 1860, 780, 1450, 1860, 1093, 1860, 1860, 1775, 1775, 1775, 1775, 1860, 1860, 1860, 1533, 1860, 1806, 1188, 1860, 1092, 780, 1860, 1860, 1534, 1860, 1860, 1450, 1093, 1089, 1090, 1089, 1089, 1860, 1533, 1820, 1821, 1821, 1822, 1533, 1860, 1860, 1091, 1534, 185, 185, 582, 1534, 1860, 1860, 1860, 186, 1860, 1860, 1860, 1092, 1860, 1860, 1533, 197, 198, 198, 199, 1189, 1093, 1860, 1534, 1860, 185, 185, 1815, 1860, 1860, 1815, 1860, 186, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1189, 1093, 283, 1218, 1219, 1218, 1218, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 1816, 283, 1128, 283, 283, 1788, 1789, 1789, 1788, 1789, 1789, 1789, 1789, 1788, 1789, 1789, 1790, 1860, 1860, 1860, 1860, 186, 1860, 1816, 1860, 186, 1860, 283, 1860, 186, 1860, 1860, 1860, 1808, 1860, 1860, 1860, 1808, 1860, 1860, 1860, 1819, 1860, 1737, 1738, 1738, 1739, 1860, 1860, 1860, 283, 583, 584, 583, 583, 1860, 1860, 1808, 1860, 1860, 1860, 1808, 1860, 1860, 585, 1819, 1860, 1450, 1860, 1830, 1831, 1831, 1832, 1234, 1860, 1740, 1860, 586, 1803, 1860, 1800, 1801, 1801, 1800, 1860, 1860, 587, 1860, 1860, 1806, 1860, 1450, 1860, 1450, 1860, 1860, 1860, 1234, 1740, 1860, 1860, 586, 1860, 1598, 1860, 1860, 1595, 1860, 1860, 587, 1269, 1270, 1269, 1269, 1860, 1596, 1088, 1450, 1860, 1860, 1860, 1088, 1860, 1271, 1860, 1860, 1598, 841, 1860, 1088, 1595, 1801, 1801, 1801, 1801, 1860, 1272, 1860, 1596, 1860, 1806, 1744, 1744, 1744, 1744, 1273, 1810, 1779, 1779, 1810, 1860, 1811, 1779, 1779, 1811, 1860, 1860, 1595, 1860, 1860, 1272, 1860, 1766, 1766, 1766, 1766, 1596, 1860, 1273, 1089, 1090, 1089, 1089, 1715, 1836, 1815, 1860, 1860, 1815, 1837, 1860, 1595, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1596, 1815, 1860, 1860, 1815, 1767, 1092, 1715, 1860, 1836, 1860, 1860, 1860, 1274, 1837, 1093, 197, 198, 198, 199, 1816, 1820, 1821, 1821, 1820, 1860, 1838, 1860, 1767, 1860, 1092, 1860, 186, 1860, 1860, 1816, 1274, 186, 1093, 1089, 1090, 1089, 1089, 1816, 1821, 1821, 1821, 1821, 1860, 1835, 1838, 1860, 1091, 1841, 1860, 1860, 582, 1860, 1816, 1860, 186, 1860, 1860, 1753, 1860, 1092, 1860, 1860, 197, 198, 198, 199, 1835, 1835, 1093, 1275, 1841, 185, 185, 1830, 1831, 1831, 1830, 1860, 186, 1860, 1753, 1860, 1806, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1835, 1093, 1275, 891, 892, 892, 893, 1860, 1860, 1595, 1860, 1831, 1831, 1831, 1831, 1860, 1860, 1860, 1596, 1860, 1806, 1848, 1750, 1750, 1848, 779, 1860, 779, 1860, 1830, 1831, 1831, 1832, 1595, 1860, 1860, 1276, 1595, 1803, 997, 1860, 1596, 1839, 1840, 1840, 1839, 1596, 1860, 1860, 779, 1860, 779, 1860, 1450, 1860, 1816, 1860, 1860, 1860, 1276, 1860, 1595, 997, 1194, 1195, 1195, 1194, 1860, 1860, 1596, 1849, 197, 198, 198, 199, 1860, 780, 1450, 1816, 1860, 1840, 1840, 1840, 1840, 1860, 1860, 1860, 186, 1860, 990, 1788, 1789, 1789, 1790, 1849, 1280, 1860, 1860, 991, 185, 185, 1860, 1815, 1860, 1860, 1815, 186, 1860, 1808, 1860, 1860, 1860, 1860, 990, 1691, 1860, 1860, 1860, 1280, 1860, 1860, 991, 1195, 1195, 1195, 1195, 1860, 1850, 1860, 1860, 1860, 1860, 1808, 1860, 1860, 780, 1816, 1691, 1860, 1856, 1860, 1860, 1788, 1789, 1789, 1790, 1860, 1860, 990, 1860, 1850, 185, 185, 1860, 1280, 1860, 1860, 991, 186, 1816, 1860, 1860, 1856, 1815, 1860, 1860, 1815, 1860, 1860, 1860, 1860, 1860, 990, 1860, 1860, 1860, 1860, 1280, 1860, 1860, 991, 1297, 1297, 1297, 1297, 1860, 1298, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 674, 1816, 1299, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1857, 1779, 1779, 1857, 1860, 1860, 1860, 1816, 1860, 1860, 1301, 674, 283, 1218, 1219, 1218, 1218, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1849, 283, 1128, 283, 283, 1860, 1816, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1849, 1860, 1860, 283, 1860, 1816, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 283, 1218, 1219, 1218, 1218, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1860, 283, 1128, 283, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 283, 1305, 1306, 1305, 1305, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 1860, 283, 1128, 283, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 1042, 1043, 1042, 1042, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 585, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 586, 1860, 1860, 1860, 1860, 1860, 1044, 1860, 1860, 587, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 586, 1860, 1860, 1860, 1860, 1044, 1860, 1860, 587, 1325, 1326, 1325, 1325, 1860, 1860, 1860, 1860, 1860, 1327, 1860, 1860, 1860, 585, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 586, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 728, 587, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 586, 1860, 1860, 1860, 1860, 1860, 1860, 728, 587, 1269, 1270, 1269, 1269, 1860, 1860, 1088, 1860, 1860, 1860, 1860, 1088, 1860, 1271, 1860, 1860, 1860, 841, 1860, 1088, 1860, 1860, 1860, 1860, 1860, 1860, 1272, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1273, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1272, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1273, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1188, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1188, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1189, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1189, 1093, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1353, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1353, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1354, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1354, 569, 1357, 1358, 1358, 1359, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 891, 892, 892, 893, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 779, 1860, 779, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1366, 1860, 1860, 997, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 779, 1860, 779, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1366, 1860, 1860, 997, 1297, 1297, 1297, 1297, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 1299, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 673, 1377, 1377, 1377, 1377, 1860, 1378, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 674, 1860, 1379, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1381, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1382, 1860, 1860, 1860, 1860, 1860, 1860, 541, 674, 1860, 1860, 1860, 1860, 1860, 1381, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1382, 1385, 1385, 1385, 1385, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 1860, 1387, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1387, 1385, 1385, 1385, 1385, 1860, 1386, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 174, 1388, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1388, 1390, 1860, 1860, 1390, 1390, 1860, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1392, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 283, 1305, 1306, 1305, 1305, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 1860, 283, 1128, 283, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 283, 1396, 1396, 1396, 1396, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 1860, 1398, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1398, 1396, 1396, 1396, 1396, 1860, 1397, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 174, 1399, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1399, 1403, 1403, 1403, 1403, 1860, 1404, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 174, 702, 1860, 1405, 701, 1860, 1860, 1860, 1860, 1860, 1860, 1407, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1408, 1860, 1860, 1860, 1860, 1860, 1860, 563, 702, 1860, 1860, 1860, 1860, 1860, 1407, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1408, 700, 700, 700, 700, 1860, 701, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 174, 1860, 1860, 559, 701, 1860, 1860, 1860, 1860, 1860, 1409, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1409, 346, 1860, 1860, 346, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1860, 1860, 1410, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 348, 346, 1860, 1860, 1860, 1410, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 346, 1320, 1144, 1144, 1321, 346, 1860, 346, 346, 346, 1322, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 348, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 346, 1411, 1324, 1324, 1411, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1412, 1860, 1860, 1860, 1860, 1860, 1860, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1412, 1860, 1860, 1860, 1860, 1860, 1860, 167, 353, 354, 354, 355, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1414, 211, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1860, 1414, 211, 1053, 1054, 1054, 1055, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1426, 1860, 1860, 1860, 1860, 1860, 1860, 958, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1426, 1860, 1860, 1860, 1860, 1860, 958, 1338, 1339, 1339, 1338, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1159, 1860, 1860, 1860, 1860, 1860, 1427, 1860, 1860, 1160, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1159, 1860, 1860, 1860, 1860, 1427, 1860, 1860, 1160, 1338, 1339, 1339, 1340, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1860, 1341, 1860, 1860, 958, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1341, 1860, 1860, 958, 1434, 1435, 1435, 1436, 1860, 214, 1860, 1860, 1860, 185, 185, 214, 214, 214, 202, 1860, 216, 1860, 214, 212, 198, 198, 213, 1860, 214, 1860, 1860, 1860, 185, 185, 214, 214, 214, 202, 1860, 216, 1860, 214, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1437, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1437, 1441, 1324, 1324, 1441, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 225, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 223, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1443, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1443, 1444, 1445, 1444, 1444, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 569, 891, 892, 892, 893, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1447, 1860, 890, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1447, 1860, 890, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 891, 892, 892, 893, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1448, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1448, 1860, 1860, 1860, 1860, 1860, 569, 569, 1357, 1358, 1358, 1449, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1453, 1358, 1358, 1454, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1357, 1358, 1358, 1359, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1455, 1456, 1456, 1457, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1377, 1377, 1377, 1377, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 1379, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1474, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1475, 1860, 1860, 1860, 1860, 1860, 1860, 541, 673, 1860, 1860, 1860, 1860, 1860, 1474, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1475, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 675, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 675, 1377, 1377, 1377, 1377, 1860, 1378, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 674, 1860, 1379, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1381, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1382, 1860, 1860, 1860, 1860, 1860, 1860, 541, 674, 1860, 1860, 1860, 1860, 1860, 1381, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1382, 1385, 1385, 1385, 1385, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 1860, 1387, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1387, 1385, 1385, 1385, 1385, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 1860, 1387, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1387, 1385, 1385, 1385, 1385, 1860, 1386, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 174, 1388, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1388, 1385, 1385, 1385, 1385, 1860, 1386, 1860, 1860, 1860, 1860, 1860, 1387, 1387, 1387, 174, 1388, 1860, 1299, 1387, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1388, 1390, 1860, 1860, 1390, 1390, 1860, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1392, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1390, 1860, 1860, 1390, 1390, 1860, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1392, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1482, 1396, 1396, 1482, 1390, 1311, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1483, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1485, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1396, 1396, 1396, 1396, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 1860, 1398, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1398, 1396, 1396, 1396, 1396, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 1860, 1398, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1398, 1396, 1396, 1396, 1396, 1860, 1397, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 174, 1399, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1399, 1396, 1396, 1396, 1396, 1860, 1397, 1860, 1860, 1860, 1860, 1860, 1398, 1398, 1398, 174, 1399, 1860, 1312, 1398, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1301, 1399, 1403, 1403, 1403, 1403, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 1405, 701, 1860, 1860, 1860, 1860, 1860, 1860, 1488, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1489, 1860, 1860, 1860, 1860, 1860, 1860, 563, 701, 1860, 1860, 1860, 1860, 1860, 1488, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1489, 700, 700, 700, 700, 1860, 701, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 174, 1860, 1860, 559, 701, 700, 700, 700, 700, 1860, 701, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 174, 1860, 1860, 559, 701, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 703, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 703, 1403, 1403, 1403, 1403, 1860, 1404, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 174, 702, 1860, 1405, 701, 1860, 1860, 1860, 1860, 1860, 1860, 1407, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1408, 1860, 1860, 1860, 1860, 1860, 1860, 563, 702, 1860, 1860, 1860, 1860, 1860, 1407, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1408, 1491, 1324, 1324, 1491, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 348, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 346, 1411, 1324, 1324, 1411, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1412, 1860, 1860, 1860, 1860, 1860, 1860, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1412, 1860, 1860, 1860, 1860, 1860, 1860, 167, 167, 1860, 1860, 167, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 460, 1860, 1860, 1860, 1860, 1860, 167, 167, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 460, 1860, 1860, 1860, 1860, 1860, 167, 353, 354, 354, 355, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1860, 1492, 1860, 211, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1492, 1860, 211, 1053, 1054, 1054, 1055, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1504, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 958, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1504, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 958, 353, 354, 354, 355, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 360, 211, 470, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 210, 1860, 1860, 1860, 1860, 1860, 1860, 360, 211, 470, 1510, 1511, 1511, 1512, 1860, 214, 1860, 1860, 1860, 185, 185, 214, 214, 214, 202, 1860, 216, 1860, 214, 1519, 1324, 1324, 1519, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1520, 1860, 1860, 1860, 1860, 1860, 1860, 225, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1520, 1860, 1860, 1860, 1860, 1860, 1860, 223, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1522, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1522, 1860, 1860, 1860, 1860, 1860, 1093, 1444, 1445, 1444, 1444, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1523, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1523, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 569, 891, 892, 892, 893, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1860, 1860, 1524, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1860, 1860, 1524, 1860, 1860, 1860, 569, 569, 891, 892, 892, 893, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1525, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1525, 1860, 1860, 1860, 1860, 1860, 783, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 890, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1357, 1358, 1358, 1449, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1451, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1452, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1526, 1527, 1527, 1528, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 569, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1455, 1456, 1456, 1457, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1455, 1456, 1456, 1457, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1535, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1535, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1377, 1377, 1377, 1377, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 1379, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1474, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1475, 1860, 1860, 1860, 1860, 1860, 1860, 541, 673, 1860, 1860, 1860, 1860, 1860, 1474, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1475, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1550, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1550, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 676, 1860, 1551, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 676, 1860, 1551, 1482, 1396, 1396, 1482, 1390, 1860, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1483, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1392, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1390, 1860, 1860, 1390, 1390, 1860, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1392, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1482, 1396, 1396, 1482, 1390, 1397, 1390, 1390, 1390, 1390, 1390, 1552, 1552, 1552, 1390, 1552, 1390, 1483, 1552, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1485, 1552, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1482, 1396, 1396, 1482, 1390, 1311, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1483, 1390, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1485, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1403, 1403, 1403, 1403, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 1405, 701, 1860, 1860, 1860, 1860, 1860, 1860, 1488, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1489, 1860, 1860, 1860, 1860, 1860, 1860, 563, 701, 1860, 1860, 1860, 1860, 1860, 1488, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1489, 1555, 1324, 1324, 1555, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1556, 1860, 1860, 1860, 1860, 1860, 1860, 348, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1556, 1860, 1860, 1860, 1860, 1860, 1860, 346, 1338, 1339, 1339, 1340, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 207, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1860, 1341, 1860, 1860, 958, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 957, 1860, 1860, 1860, 1860, 1341, 1860, 1860, 958, 1573, 1860, 1860, 1573, 1573, 1860, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1575, 1573, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1573, 1515, 1516, 1516, 1517, 1860, 1860, 1860, 1860, 1860, 185, 185, 1860, 1860, 1860, 185, 1860, 186, 1514, 1860, 1860, 1860, 1588, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1586, 1860, 1860, 1588, 1519, 1324, 1324, 1519, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1520, 1860, 1860, 1860, 1860, 1860, 1860, 225, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1520, 1860, 1860, 1860, 1860, 1860, 1860, 223, 223, 1860, 1860, 223, 223, 1860, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 607, 1860, 1860, 1860, 1860, 1860, 225, 223, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 607, 1860, 1860, 1860, 1860, 1860, 223, 1089, 1090, 1089, 1089, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1590, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1590, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 569, 1526, 1527, 1527, 1528, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 569, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1526, 1527, 1527, 1528, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 569, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1597, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1597, 1860, 1529, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1530, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1455, 1456, 1456, 1457, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1603, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1603, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1860, 1860, 1860, 1860, 569, 569, 1455, 1456, 1456, 1457, 569, 569, 569, 569, 569, 1860, 1860, 569, 569, 780, 1860, 1860, 569, 1860, 569, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1604, 1860, 1860, 1860, 569, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1361, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1362, 1860, 1860, 1604, 1860, 1860, 1860, 569, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 1860, 1860, 1860, 1611, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1611, 672, 672, 672, 672, 1860, 673, 1860, 1860, 1860, 1860, 1860, 673, 673, 673, 174, 1860, 1860, 537, 673, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1612, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1612, 1482, 1396, 1396, 1482, 1390, 1397, 1390, 1390, 1390, 1390, 1390, 1552, 1552, 1552, 1390, 1552, 1390, 1483, 1552, 1390, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1485, 1552, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1390, 1555, 1324, 1324, 1555, 346, 1860, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1556, 1860, 1860, 1860, 1860, 1860, 1860, 348, 346, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1556, 1860, 1860, 1860, 1860, 1860, 1860, 346, 1618, 1619, 1619, 1620, 1860, 1860, 1860, 1860, 1860, 1621, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1155, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1242, 1156, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1155, 1860, 1860, 1860, 1860, 1860, 1860, 1242, 1156, 1573, 1860, 1860, 1573, 1573, 1860, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1575, 1573, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1573, 1576, 1577, 1577, 1578, 1860, 1860, 1860, 1860, 1860, 185, 185, 1860, 1860, 1860, 1860, 1860, 186, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1630, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1580, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1630, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1580, 1634, 1860, 1860, 1634, 1634, 1860, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1636, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1634, 1645, 1860, 1860, 1645, 1645, 1860, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1647, 1645, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1645, 1444, 1445, 1444, 1444, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1446, 1860, 1860, 1093, 1654, 1655, 1654, 1654, 1860, 1860, 1860, 1860, 1860, 1656, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1189, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1189, 1093, 1634, 1860, 1860, 1634, 1634, 1860, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1636, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1634, 1637, 1638, 1638, 1639, 1860, 1860, 1860, 1860, 1860, 185, 185, 1860, 1860, 1860, 1860, 1860, 186, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1696, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1641, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1696, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1641, 1645, 1860, 1860, 1645, 1645, 1860, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1647, 1645, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1645, 1654, 1655, 1654, 1654, 1860, 1860, 1860, 1860, 1860, 1656, 1860, 1860, 1860, 1091, 1860, 1860, 1860, 582, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1092, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1093, 1667, 1668, 1668, 1667, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 780, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1533, 1860, 1860, 1860, 1860, 1860, 1715, 1860, 1860, 1534, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1533, 1860, 1860, 1860, 1860, 1715, 1860, 1860, 1534, 1668, 1668, 1668, 1668, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 780, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1533, 1860, 1860, 1860, 1860, 1860, 1715, 1860, 1860, 1534, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1533, 1860, 1860, 1860, 1860, 1715, 1860, 1860, 1534, 1726, 1727, 1727, 1728, 1860, 1860, 1860, 1860, 1860, 185, 185, 1860, 1860, 1860, 185, 1860, 186, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1759, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1753, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1759, 1782, 1860, 1860, 1782, 1782, 1860, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1784, 1782, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1782, 1754, 1750, 1750, 1754, 1634, 1860, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1785, 1634, 1634, 1634, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1787, 1785, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1634, 1782, 1860, 1860, 1782, 1782, 1860, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1784, 1782, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1782, 1811, 1779, 1779, 1811, 1634, 1860, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1812, 1812, 1634, 1634, 1634, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1636, 1812, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1634, 1811, 1779, 1779, 1811, 1634, 1860, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1812, 1812, 1634, 1634, 1634, 1634, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1636, 1812, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1634, 1814, 1631, 1631, 1814, 1815, 1860, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1817, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1818, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1817, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1815, 1824, 1860, 1860, 1824, 1824, 1860, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1826, 1824, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1824, 1814, 1631, 1631, 1814, 1815, 1860, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1817, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1818, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1817, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1815, 1820, 1821, 1821, 1822, 1860, 1860, 1860, 1860, 1860, 185, 185, 1860, 1860, 1860, 185, 1860, 186, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1842, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1753, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1842, 1824, 1860, 1860, 1824, 1824, 1860, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1826, 1824, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1824, 1848, 1750, 1750, 1848, 1815, 1860, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1853, 1815, 1815, 1815, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1855, 1853, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1815, 1857, 1779, 1779, 1857, 1815, 1860, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1858, 1858, 1815, 1815, 1815, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1818, 1858, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1815, 1857, 1779, 1779, 1857, 1815, 1860, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1858, 1858, 1815, 1815, 1815, 1815, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1818, 1858, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1815, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 169, 1860, 1860, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 176, 1860, 1860, 176, 176, 1860, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 187, 187, 187, 187, 1860, 187, 1860, 187, 1860, 1860, 187, 187, 187, 187, 1860, 1860, 1860, 187, 187, 187, 187, 196, 1860, 1860, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 1860, 1860, 1860, 185, 185, 1860, 185, 202, 202, 202, 202, 1860, 1860, 202, 202, 1860, 1860, 1860, 202, 202, 202, 1860, 1860, 1860, 202, 202, 1860, 202, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 268, 268, 268, 268, 1860, 1860, 268, 1860, 1860, 1860, 1860, 268, 268, 1860, 1860, 1860, 1860, 268, 268, 1860, 268, 270, 1860, 1860, 270, 270, 1860, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 294, 294, 294, 294, 1860, 1860, 1860, 1860, 1860, 1860, 294, 1860, 1860, 1860, 1860, 1860, 1860, 294, 294, 1860, 294, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 308, 1860, 1860, 1860, 1860, 308, 308, 1860, 1860, 1860, 1860, 308, 308, 1860, 308, 310, 1860, 1860, 310, 310, 1860, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 315, 1860, 1860, 1860, 1860, 315, 315, 1860, 1860, 1860, 1860, 315, 315, 1860, 315, 317, 1860, 1860, 317, 317, 1860, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 326, 1860, 1860, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 328, 1860, 1860, 328, 328, 328, 328, 328, 1860, 1860, 328, 1860, 328, 328, 1860, 328, 330, 1860, 1860, 330, 330, 1860, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 334, 334, 1860, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 336, 1860, 336, 336, 1860, 1860, 1860, 1860, 336, 1860, 1860, 336, 214, 1860, 1860, 214, 1860, 214, 1860, 1860, 214, 214, 214, 1860, 214, 214, 1860, 214, 1860, 214, 214, 1860, 214, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 1860, 1860, 1860, 185, 185, 1860, 185, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 342, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 1860, 342, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 196, 1860, 1860, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 202, 202, 202, 202, 1860, 1860, 1860, 202, 1860, 1860, 1860, 202, 202, 202, 1860, 1860, 1860, 202, 202, 1860, 202, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 268, 268, 268, 268, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 268, 268, 1860, 1860, 1860, 1860, 268, 268, 1860, 268, 270, 1860, 1860, 270, 270, 1860, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 294, 294, 294, 294, 1860, 1860, 1860, 1860, 1860, 1860, 294, 1860, 1860, 1860, 1860, 1860, 1860, 294, 294, 1860, 294, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 308, 308, 1860, 1860, 1860, 1860, 308, 308, 1860, 308, 310, 1860, 1860, 310, 310, 1860, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 315, 315, 1860, 1860, 1860, 1860, 315, 315, 1860, 315, 317, 1860, 1860, 317, 317, 1860, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 327, 1860, 1860, 327, 327, 327, 1860, 327, 1860, 1860, 327, 1860, 327, 327, 1860, 327, 326, 1860, 1860, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 328, 1860, 1860, 328, 328, 328, 328, 328, 1860, 1860, 328, 1860, 328, 328, 1860, 328, 330, 1860, 1860, 330, 330, 1860, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 446, 446, 1860, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, 336, 1860, 1860, 336, 1860, 336, 336, 1860, 1860, 1860, 1860, 336, 1860, 1860, 336, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 342, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 1860, 342, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 202, 202, 202, 202, 1860, 1860, 1860, 202, 1860, 1860, 1860, 202, 202, 202, 1860, 1860, 1860, 202, 202, 1860, 202, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 463, 463, 463, 463, 463, 463, 463, 1860, 463, 1860, 463, 463, 463, 463, 463, 463, 463, 1860, 463, 463, 463, 463, 463, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 527, 527, 1860, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 268, 268, 268, 268, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 268, 268, 1860, 1860, 1860, 1860, 268, 268, 1860, 268, 270, 270, 270, 270, 270, 1860, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 538, 538, 538, 538, 1860, 538, 1860, 1860, 1860, 1860, 1860, 538, 538, 1860, 538, 1860, 1860, 538, 538, 538, 538, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 1860, 296, 296, 296, 296, 296, 296, 296, 560, 560, 560, 560, 1860, 560, 1860, 1860, 1860, 1860, 1860, 560, 560, 1860, 560, 1860, 1860, 560, 560, 560, 560, 308, 308, 1860, 1860, 1860, 1860, 308, 308, 1860, 308, 315, 315, 1860, 1860, 1860, 1860, 315, 315, 1860, 315, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 328, 1860, 328, 1860, 1860, 328, 328, 328, 328, 328, 1860, 1860, 328, 1860, 328, 328, 1860, 328, 566, 566, 1860, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 447, 447, 1860, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 1860, 569, 569, 569, 569, 569, 569, 569, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 1860, 1860, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 1860, 1860, 1860, 185, 185, 1860, 185, 224, 224, 224, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 1860, 639, 639, 639, 639, 639, 639, 639, 660, 660, 1860, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 528, 528, 1860, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 536, 536, 536, 536, 1860, 536, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 536, 1860, 1860, 536, 536, 536, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 679, 1860, 1860, 679, 679, 1860, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 684, 684, 1860, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 1860, 295, 295, 295, 295, 295, 295, 295, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 1860, 694, 694, 694, 694, 694, 694, 694, 558, 558, 558, 558, 1860, 558, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 558, 1860, 1860, 558, 558, 558, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 706, 1860, 1860, 706, 706, 1860, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 708, 708, 1860, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 342, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 1860, 342, 347, 347, 347, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 1860, 1860, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 1860, 1860, 1860, 185, 185, 1860, 185, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 1860, 639, 639, 639, 639, 639, 639, 639, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 1860, 779, 779, 779, 779, 779, 779, 779, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 661, 661, 1860, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 662, 536, 536, 536, 536, 1860, 536, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 536, 1860, 1860, 536, 536, 536, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 679, 1860, 1860, 679, 679, 1860, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 684, 684, 1860, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, 1860, 694, 694, 694, 694, 694, 694, 694, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 706, 1860, 1860, 706, 706, 1860, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 708, 708, 1860, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 342, 342, 342, 342, 342, 1860, 342, 1860, 342, 342, 1860, 342, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 1860, 1860, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 1860, 1860, 1860, 185, 185, 1860, 185, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 1860, 779, 779, 779, 779, 779, 779, 779, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 1860, 569, 569, 569, 569, 569, 569, 569, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 1860, 639, 639, 639, 639, 639, 639, 639, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 679, 679, 679, 679, 679, 1860, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 684, 684, 1860, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 706, 706, 706, 706, 706, 1860, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 708, 708, 1860, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 1860, 1860, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 841, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 956, 956, 956, 956, 1860, 1860, 1860, 956, 1860, 1860, 956, 956, 956, 1860, 1860, 1860, 1860, 956, 956, 1860, 956, 224, 1860, 1860, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 1860, 779, 779, 779, 779, 779, 779, 779, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 1860, 569, 569, 569, 569, 569, 569, 569, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 283, 283, 1860, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 1860, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 1048, 1048, 1048, 1048, 1860, 1860, 1860, 1048, 1860, 1860, 1048, 1048, 1048, 1860, 1860, 1860, 1860, 1048, 1048, 1860, 1048, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1300, 1300, 1300, 1300, 1860, 1300, 1860, 1860, 1300, 1300, 1300, 1300, 1300, 1860, 1300, 1300, 1860, 1300, 1300, 1300, 1300, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1304, 1304, 1304, 1304, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1304, 1860, 1304, 1860, 1860, 1304, 1304, 1860, 1304, 1313, 1313, 1313, 1313, 1860, 1313, 1860, 1860, 1860, 1860, 1860, 1313, 1313, 1860, 1313, 1860, 1860, 1313, 1313, 1313, 1313, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1860, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1298, 1298, 1298, 1298, 1860, 1298, 1860, 1860, 1298, 1298, 1298, 1860, 1298, 1860, 1298, 1298, 1860, 1298, 1298, 1298, 1298, 1380, 1380, 1380, 1380, 1860, 1380, 1860, 1860, 1380, 1380, 1380, 1380, 1380, 1860, 1380, 1380, 1860, 1380, 1380, 1380, 1380, 1311, 1311, 1311, 1311, 1860, 1311, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1311, 1860, 1860, 1311, 1311, 1311, 1386, 1386, 1386, 1386, 1860, 1386, 1860, 1860, 1386, 1386, 1386, 1860, 1386, 1860, 1386, 1386, 1860, 1386, 1386, 1386, 1386, 1389, 1389, 1389, 1389, 1860, 1389, 1860, 1860, 1389, 1389, 1389, 1389, 1389, 1860, 1389, 1389, 1860, 1389, 1389, 1389, 1389, 1391, 1860, 1860, 1391, 1391, 1860, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1304, 1304, 1304, 1304, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1304, 1860, 1304, 1860, 1860, 1304, 1304, 1860, 1304, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 1397, 1397, 1397, 1397, 1860, 1397, 1860, 1860, 1397, 1397, 1397, 1860, 1397, 1860, 1397, 1397, 1860, 1397, 1397, 1397, 1397, 1400, 1400, 1400, 1400, 1860, 1400, 1860, 1860, 1400, 1400, 1400, 1400, 1400, 1860, 1400, 1400, 1860, 1400, 1400, 1400, 1400, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 1406, 1406, 1406, 1406, 1860, 1406, 1860, 1860, 1406, 1406, 1406, 1406, 1406, 1860, 1406, 1406, 1860, 1406, 1406, 1406, 1406, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 347, 1860, 1860, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 1048, 1048, 1048, 1048, 1860, 1860, 1860, 1048, 1860, 1860, 1860, 1048, 1048, 1860, 1860, 1860, 1860, 1048, 1048, 1860, 1048, 956, 956, 956, 956, 1860, 1860, 1860, 956, 1860, 1860, 956, 956, 956, 1860, 1860, 1860, 1860, 956, 956, 1860, 956, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 224, 224, 224, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 1860, 569, 569, 569, 569, 569, 569, 569, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 1860, 779, 779, 779, 779, 779, 779, 779, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1860, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1860, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1378, 1378, 1378, 1378, 1860, 1378, 1860, 1860, 1378, 1378, 1378, 1860, 1378, 1860, 1378, 1378, 1860, 1378, 1378, 1378, 1378, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 536, 536, 536, 536, 1860, 536, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 536, 1860, 1860, 536, 536, 536, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 1380, 1380, 1380, 1380, 1860, 1380, 1860, 1860, 1380, 1380, 1380, 1380, 1380, 1860, 1380, 1380, 1860, 1380, 1380, 1380, 1380, 1386, 1386, 1386, 1386, 1860, 1386, 1860, 1860, 1386, 1386, 1386, 1860, 1386, 1860, 1386, 1386, 1860, 1386, 1386, 1386, 1386, 1389, 1389, 1389, 1389, 1860, 1389, 1860, 1860, 1389, 1389, 1389, 1389, 1389, 1860, 1389, 1389, 1860, 1389, 1389, 1389, 1389, 1391, 1860, 1860, 1391, 1391, 1860, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 174, 174, 1860, 1860, 1860, 1860, 174, 174, 1860, 174, 1397, 1397, 1397, 1397, 1860, 1397, 1860, 1860, 1397, 1397, 1397, 1860, 1397, 1860, 1397, 1397, 1860, 1397, 1397, 1397, 1397, 1400, 1400, 1400, 1400, 1860, 1400, 1860, 1860, 1400, 1400, 1400, 1400, 1400, 1860, 1400, 1400, 1860, 1400, 1400, 1400, 1400, 1404, 1404, 1404, 1404, 1860, 1404, 1860, 1860, 1404, 1404, 1404, 1860, 1404, 1860, 1404, 1404, 1860, 1404, 1404, 1404, 1404, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 558, 558, 558, 558, 1860, 558, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 558, 1860, 1860, 558, 558, 558, 702, 702, 702, 702, 1860, 702, 1860, 1860, 702, 702, 702, 702, 702, 1860, 702, 702, 1860, 702, 702, 1860, 702, 1406, 1406, 1406, 1406, 1860, 1406, 1860, 1860, 1406, 1406, 1406, 1406, 1406, 1860, 1406, 1406, 1860, 1406, 1406, 1406, 1406, 347, 347, 347, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 206, 206, 206, 206, 1860, 1860, 1860, 206, 1860, 1860, 206, 206, 206, 1860, 1860, 1860, 1860, 206, 206, 1860, 206, 1048, 1048, 1048, 1048, 1860, 1860, 1860, 1048, 1860, 1860, 1860, 1048, 1048, 1860, 1860, 1860, 1860, 1048, 1048, 1860, 1048, 956, 956, 956, 956, 1860, 1860, 1860, 956, 1860, 1860, 956, 956, 956, 1860, 1860, 1860, 1860, 956, 956, 1860, 956, 1507, 1507, 1507, 1507, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1507, 1507, 1860, 1860, 1860, 1507, 1507, 1507, 1507, 1509, 1509, 1509, 1509, 1860, 1860, 1860, 1509, 1860, 1860, 1860, 1509, 1509, 1509, 1860, 1860, 1860, 1509, 1509, 1509, 1509, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 215, 215, 215, 215, 215, 1860, 215, 1860, 215, 215, 1860, 215, 185, 185, 185, 185, 1860, 1860, 1860, 185, 1860, 1860, 1860, 185, 185, 185, 185, 1860, 1860, 185, 185, 1860, 185, 224, 224, 224, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, 1860, 569, 569, 569, 569, 569, 569, 569, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, 1860, 779, 779, 779, 779, 779, 779, 779, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1860, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1860, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 1378, 1378, 1378, 1378, 1860, 1378, 1860, 1860, 1378, 1378, 1378, 1860, 1378, 1860, 1378, 1378, 1860, 1378, 1378, 1378, 1378, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 1391, 1391, 1391, 1391, 1391, 1860, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 701, 701, 701, 701, 1860, 701, 1860, 1860, 701, 701, 701, 1860, 701, 1860, 701, 701, 1860, 701, 701, 1860, 701, 1404, 1404, 1404, 1404, 1860, 1404, 1860, 1860, 1404, 1404, 1404, 1860, 1404, 1860, 1404, 1404, 1860, 1404, 1404, 1404, 1404, 347, 347, 347, 347, 347, 1860, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 1571, 1571, 1571, 1571, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1571, 1571, 1860, 1860, 1860, 1860, 1571, 1571, 1860, 1571, 1574, 1860, 1860, 1574, 1574, 1860, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1579, 1579, 1579, 1579, 1860, 1860, 1860, 1579, 1860, 1860, 1860, 1579, 1579, 1579, 1860, 1860, 1860, 1579, 1579, 1860, 1579, 1581, 1581, 1581, 1581, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1581, 1581, 1860, 1860, 1860, 1581, 1581, 1581, 1581, 1583, 1583, 1583, 1583, 1860, 1860, 1860, 1583, 1860, 1860, 1860, 1583, 1583, 1583, 1860, 1860, 1860, 1583, 1583, 1583, 1583, 1584, 1584, 1584, 1584, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1584, 1860, 1584, 1860, 1860, 1584, 1584, 1584, 1584, 1587, 1587, 1587, 1587, 1860, 1860, 1860, 1587, 1860, 1860, 1860, 1587, 1587, 1587, 1587, 1860, 1860, 1587, 1587, 1587, 1587, 224, 224, 224, 224, 224, 1860, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1860, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1860, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 673, 673, 673, 673, 1860, 673, 1860, 1860, 673, 673, 673, 1860, 673, 1860, 673, 673, 1860, 673, 673, 1860, 673, 674, 674, 674, 674, 1860, 674, 1860, 1860, 674, 674, 674, 674, 674, 1860, 674, 674, 1860, 674, 674, 1860, 674, 1632, 1632, 1632, 1632, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1632, 1632, 1860, 1860, 1860, 1860, 1632, 1632, 1860, 1632, 1635, 1860, 1860, 1635, 1635, 1860, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1640, 1640, 1640, 1640, 1860, 1860, 1860, 1640, 1860, 1860, 1860, 1640, 1640, 1640, 1860, 1860, 1860, 1640, 1640, 1860, 1640, 1643, 1643, 1643, 1643, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1643, 1643, 1860, 1643, 1860, 1860, 1643, 1643, 1860, 1643, 1646, 1860, 1860, 1646, 1646, 1860, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1651, 1651, 1651, 1651, 1860, 1860, 1860, 1651, 1860, 1860, 1860, 1651, 1651, 1651, 1651, 1860, 1860, 1651, 1651, 1860, 1651, 1751, 1751, 1751, 1751, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1751, 1860, 1860, 1860, 1860, 1751, 1751, 1751, 1751, 1758, 1758, 1758, 1758, 1860, 1860, 1860, 1758, 1860, 1860, 1860, 1758, 1758, 1758, 1860, 1860, 1860, 1758, 1758, 1758, 1758, 1780, 1780, 1780, 1780, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1780, 1780, 1860, 1860, 1860, 1860, 1780, 1780, 1860, 1780, 1783, 1860, 1860, 1783, 1783, 1860, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1786, 1786, 1786, 1786, 1786, 1860, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1791, 1791, 1791, 1791, 1860, 1860, 1860, 1791, 1860, 1860, 1860, 1791, 1791, 1791, 1860, 1860, 1860, 1791, 1791, 1860, 1791, 1793, 1793, 1793, 1793, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1793, 1860, 1793, 1860, 1860, 1793, 1793, 1793, 1793, 1795, 1795, 1795, 1795, 1860, 1860, 1860, 1795, 1860, 1860, 1860, 1795, 1795, 1795, 1795, 1860, 1860, 1795, 1795, 1795, 1795, 1813, 1813, 1813, 1813, 1813, 1860, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1816, 1816, 1816, 1816, 1816, 1860, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1823, 1823, 1860, 1860, 1860, 1860, 1823, 1823, 1860, 1823, 1825, 1860, 1860, 1825, 1825, 1860, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1825, 1827, 1827, 1827, 1827, 1860, 1860, 1860, 1827, 1860, 1860, 1860, 1827, 1827, 1827, 1860, 1860, 1860, 1827, 1827, 1860, 1827, 1854, 1854, 1854, 1854, 1854, 1860, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1859, 1859, 1859, 1859, 1859, 1860, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 1859, 33, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860 } ; static yyconst flex_int16_t yy_chk[27311] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 35, 35, 35, 36, 36, 36, 36, 57, 71, 253, 40, 70, 35, 55, 56, 66, 36, 10, 40, 40, 10, 1, 37, 37, 37, 37, 829, 46, 46, 46, 46, 57, 71, 253, 70, 37, 55, 56, 66, 44, 46, 796, 10, 46, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 44, 67, 74, 69, 2, 780, 47, 47, 47, 47, 50, 50, 50, 50, 58, 69, 58, 113, 115, 47, 744, 2, 47, 44, 67, 74, 50, 69, 2, 77, 77, 77, 77, 339, 172, 714, 339, 58, 69, 58, 113, 115, 77, 172, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 23, 712, 420, 23, 25, 75, 82, 25, 337, 75, 78, 78, 78, 78, 82, 82, 4, 337, 4, 711, 4, 4, 4, 78, 4, 23, 420, 4, 75, 25, 100, 4, 75, 4, 4, 4, 694, 662, 100, 100, 4, 1071, 4, 128, 4, 4, 4, 1071, 4, 23, 4, 128, 128, 25, 4, 660, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 51, 51, 51, 51, 179, 567, 51, 233, 241, 51, 51, 242, 65, 566, 51, 51, 51, 65, 31, 65, 422, 31, 5, 60, 60, 60, 60, 179, 140, 60, 233, 241, 60, 60, 242, 65, 140, 140, 734, 60, 65, 734, 65, 31, 422, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 31, 68, 73, 73, 231, 6, 565, 68, 146, 219, 219, 553, 68, 231, 73, 150, 146, 146, 43, 43, 43, 43, 6, 150, 150, 68, 73, 73, 231, 6, 68, 43, 552, 219, 219, 68, 231, 73, 89, 89, 89, 89, 545, 43, 89, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 43, 72, 218, 79, 79, 79, 79, 533, 108, 108, 108, 108, 275, 218, 527, 72, 79, 72, 551, 526, 72, 108, 7, 173, 449, 72, 218, 88, 88, 88, 88, 173, 173, 88, 551, 275, 218, 104, 72, 87, 72, 88, 88, 72, 103, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 87, 104, 221, 446, 103, 8, 109, 109, 109, 109, 442, 440, 110, 110, 110, 110, 221, 221, 256, 109, 256, 439, 8, 87, 104, 110, 221, 103, 161, 8, 116, 116, 116, 116, 161, 161, 161, 161, 438, 221, 221, 161, 256, 116, 256, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 117, 117, 117, 117, 11, 252, 252, 184, 192, 193, 184, 192, 193, 117, 118, 118, 118, 118, 85, 85, 85, 85, 11, 184, 192, 193, 1541, 118, 11, 252, 252, 85, 1541, 437, 91, 91, 91, 91, 429, 416, 91, 107, 133, 85, 180, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 85, 91, 107, 133, 12, 12, 415, 180, 258, 258, 123, 123, 123, 123, 124, 124, 124, 124, 114, 114, 114, 114, 12, 123, 91, 107, 133, 124, 12, 12, 180, 114, 258, 258, 265, 265, 265, 265, 195, 195, 195, 195, 336, 114, 145, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 114, 125, 125, 125, 125, 145, 195, 276, 234, 335, 154, 154, 154, 154, 125, 277, 234, 298, 120, 120, 120, 120, 13, 154, 155, 155, 155, 155, 145, 195, 276, 120, 234, 268, 268, 268, 268, 155, 277, 234, 298, 130, 142, 120, 333, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 120, 130, 142, 303, 235, 14, 1082, 320, 235, 1082, 164, 164, 164, 164, 165, 165, 165, 165, 132, 132, 132, 132, 14, 164, 130, 142, 303, 165, 235, 14, 288, 132, 235, 271, 271, 271, 271, 313, 288, 288, 149, 153, 306, 132, 283, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 132, 149, 153, 243, 15, 419, 419, 419, 419, 243, 182, 182, 182, 182, 185, 185, 185, 185, 178, 178, 178, 178, 15, 182, 149, 153, 182, 243, 15, 287, 185, 178, 287, 243, 529, 529, 529, 529, 532, 532, 532, 532, 287, 178, 264, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 178, 189, 230, 214, 16, 16, 214, 191, 191, 191, 191, 189, 230, 189, 197, 197, 197, 197, 312, 214, 191, 225, 16, 191, 225, 189, 230, 693, 16, 16, 197, 307, 263, 207, 189, 230, 189, 225, 174, 307, 307, 312, 170, 693, 166, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 198, 198, 198, 198, 17, 199, 199, 199, 199, 200, 200, 200, 200, 319, 260, 151, 198, 147, 200, 200, 260, 199, 17, 141, 200, 200, 314, 139, 17, 129, 281, 281, 281, 281, 314, 314, 319, 127, 260, 216, 216, 216, 216, 281, 260, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 201, 201, 201, 201, 18, 18, 201, 216, 338, 201, 201, 261, 247, 261, 201, 201, 201, 202, 202, 202, 202, 247, 18, 102, 99, 86, 202, 202, 18, 18, 216, 338, 83, 202, 81, 261, 247, 261, 663, 663, 663, 663, 41, 39, 247, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 212, 212, 212, 212, 213, 213, 213, 213, 220, 222, 257, 33, 345, 345, 257, 1183, 212, 380, 1183, 220, 213, 222, 19, 0, 266, 266, 266, 266, 282, 282, 282, 282, 220, 222, 257, 345, 345, 0, 257, 266, 380, 282, 220, 0, 222, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 229, 238, 239, 244, 250, 20, 0, 229, 251, 249, 322, 239, 374, 322, 229, 239, 250, 374, 238, 244, 249, 251, 20, 322, 229, 238, 239, 244, 250, 20, 229, 0, 251, 249, 239, 0, 374, 229, 239, 250, 374, 238, 244, 249, 251, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 232, 245, 236, 248, 232, 371, 236, 254, 371, 0, 232, 245, 245, 0, 393, 232, 236, 248, 236, 254, 340, 236, 21, 340, 232, 245, 236, 248, 232, 371, 236, 254, 371, 232, 245, 245, 340, 393, 232, 236, 248, 236, 254, 0, 236, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 237, 246, 246, 237, 237, 22, 255, 435, 259, 461, 292, 292, 292, 292, 378, 237, 378, 246, 359, 359, 255, 259, 22, 292, 237, 246, 246, 237, 237, 22, 255, 435, 259, 461, 0, 0, 0, 378, 237, 378, 246, 359, 359, 255, 259, 22, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 267, 267, 267, 267, 376, 376, 267, 394, 0, 0, 293, 293, 293, 293, 267, 267, 0, 0, 262, 262, 262, 262, 27, 293, 0, 0, 348, 376, 376, 348, 394, 262, 272, 272, 272, 272, 0, 0, 279, 279, 279, 279, 348, 262, 279, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 262, 272, 278, 289, 375, 28, 0, 279, 328, 375, 398, 289, 289, 0, 328, 328, 328, 328, 432, 278, 289, 328, 28, 1184, 272, 428, 1184, 375, 428, 28, 279, 0, 375, 398, 341, 341, 341, 341, 428, 1339, 0, 432, 1339, 278, 289, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 300, 304, 341, 344, 358, 358, 344, 344, 360, 360, 358, 441, 360, 0, 441, 0, 502, 300, 304, 368, 368, 0, 29, 29, 441, 341, 344, 358, 358, 344, 344, 360, 360, 358, 0, 360, 350, 350, 350, 350, 502, 300, 304, 368, 368, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 135, 135, 135, 135, 350, 30, 0, 382, 0, 382, 364, 364, 364, 135, 364, 381, 381, 462, 136, 136, 136, 136, 30, 30, 135, 0, 0, 350, 0, 30, 382, 136, 382, 364, 364, 364, 0, 364, 381, 381, 462, 0, 136, 400, 400, 30, 38, 0, 135, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 136, 400, 400, 137, 137, 137, 137, 377, 0, 390, 379, 390, 377, 379, 385, 385, 137, 291, 144, 144, 144, 144, 38, 38, 503, 291, 291, 137, 0, 0, 377, 144, 390, 379, 390, 377, 379, 385, 385, 0, 0, 0, 144, 144, 543, 38, 42, 291, 503, 42, 42, 137, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 144, 144, 543, 332, 291, 62, 62, 62, 62, 332, 332, 332, 332, 497, 542, 403, 332, 0, 62, 0, 0, 62, 42, 42, 0, 290, 290, 290, 290, 403, 62, 401, 0, 0, 332, 0, 497, 542, 290, 403, 62, 367, 367, 367, 367, 42, 45, 45, 45, 45, 290, 45, 403, 401, 62, 45, 45, 332, 369, 45, 45, 45, 45, 62, 0, 0, 367, 63, 63, 63, 63, 369, 45, 0, 290, 0, 0, 401, 0, 0, 63, 45, 369, 63, 297, 297, 297, 297, 45, 45, 367, 0, 63, 0, 369, 0, 45, 297, 93, 93, 93, 93, 63, 392, 45, 48, 48, 48, 48, 297, 48, 93, 392, 0, 48, 48, 63, 370, 48, 48, 48, 48, 93, 0, 0, 63, 93, 392, 0, 0, 370, 48, 544, 297, 0, 392, 301, 301, 301, 301, 48, 370, 352, 352, 352, 352, 93, 48, 48, 301, 93, 352, 352, 370, 0, 48, 544, 352, 352, 0, 301, 0, 0, 48, 49, 0, 627, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 301, 384, 94, 94, 94, 94, 627, 0, 95, 95, 95, 95, 384, 0, 570, 94, 206, 206, 206, 206, 0, 95, 49, 49, 0, 384, 94, 388, 645, 387, 94, 383, 95, 0, 388, 384, 95, 570, 206, 391, 206, 0, 387, 383, 391, 49, 52, 52, 52, 52, 94, 388, 645, 387, 94, 383, 95, 388, 399, 52, 95, 399, 206, 391, 206, 387, 383, 391, 52, 0, 52, 402, 52, 682, 402, 417, 417, 417, 417, 0, 163, 52, 399, 0, 0, 399, 163, 163, 163, 163, 417, 0, 52, 163, 52, 402, 52, 682, 402, 488, 208, 208, 208, 208, 52, 53, 53, 53, 53, 163, 53, 453, 0, 0, 53, 53, 53, 53, 53, 53, 453, 53, 208, 53, 208, 210, 210, 210, 210, 488, 386, 395, 163, 386, 208, 453, 395, 302, 302, 302, 302, 53, 0, 453, 425, 404, 208, 210, 208, 210, 302, 0, 488, 386, 0, 395, 386, 208, 0, 404, 395, 302, 425, 0, 53, 54, 54, 54, 54, 404, 54, 210, 0, 210, 54, 54, 54, 54, 54, 54, 0, 54, 404, 54, 59, 302, 425, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 389, 504, 0, 0, 209, 209, 209, 209, 211, 211, 211, 211, 389, 504, 305, 305, 305, 305, 227, 227, 227, 227, 59, 59, 389, 504, 209, 305, 209, 0, 211, 227, 211, 410, 227, 389, 504, 209, 305, 305, 0, 410, 211, 227, 0, 59, 61, 61, 61, 61, 209, 0, 209, 227, 211, 407, 211, 410, 407, 0, 209, 0, 305, 305, 410, 211, 61, 227, 61, 396, 61, 61, 61, 689, 61, 522, 227, 61, 397, 407, 396, 61, 407, 61, 61, 61, 0, 522, 397, 0, 61, 0, 61, 396, 61, 61, 61, 689, 61, 522, 61, 0, 397, 396, 61, 0, 61, 61, 61, 80, 522, 397, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 405, 409, 406, 408, 408, 0, 0, 406, 411, 456, 0, 405, 409, 412, 412, 716, 353, 353, 353, 353, 456, 411, 80, 80, 405, 409, 406, 408, 408, 353, 406, 0, 411, 456, 405, 409, 0, 412, 412, 716, 0, 0, 353, 456, 411, 80, 84, 0, 0, 84, 84, 353, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 353, 413, 414, 414, 414, 414, 467, 467, 353, 0, 0, 0, 470, 0, 413, 421, 421, 421, 421, 0, 0, 470, 84, 84, 571, 413, 546, 414, 421, 546, 467, 467, 434, 434, 434, 434, 470, 413, 434, 546, 431, 431, 431, 431, 470, 84, 90, 571, 0, 90, 90, 414, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 0, 434, 240, 240, 240, 240, 273, 273, 273, 273, 431, 478, 0, 431, 0, 240, 0, 0, 240, 273, 0, 478, 90, 90, 434, 0, 724, 240, 0, 0, 273, 0, 0, 431, 273, 478, 431, 240, 454, 274, 274, 274, 274, 454, 478, 90, 106, 106, 106, 106, 724, 240, 274, 452, 273, 452, 580, 455, 273, 106, 240, 454, 455, 274, 0, 466, 454, 274, 466, 471, 106, 106, 471, 444, 106, 444, 452, 0, 452, 580, 455, 444, 444, 444, 444, 455, 0, 274, 444, 466, 0, 274, 466, 471, 106, 106, 471, 0, 106, 111, 111, 581, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 472, 479, 479, 472, 581, 505, 0, 468, 505, 451, 451, 451, 451, 0, 523, 523, 523, 523, 0, 0, 468, 0, 111, 0, 472, 479, 479, 472, 0, 505, 523, 468, 505, 0, 0, 354, 354, 354, 354, 424, 424, 424, 424, 468, 451, 111, 112, 112, 354, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 354, 0, 112, 112, 112, 112, 451, 483, 0, 354, 483, 469, 0, 424, 424, 473, 473, 473, 473, 0, 0, 0, 469, 469, 354, 597, 564, 0, 112, 564, 483, 473, 354, 483, 0, 469, 424, 424, 0, 564, 0, 355, 355, 355, 355, 469, 469, 0, 597, 0, 473, 112, 119, 119, 355, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 355, 0, 119, 476, 119, 119, 473, 626, 0, 355, 474, 474, 474, 474, 476, 475, 475, 475, 475, 524, 524, 524, 524, 484, 355, 484, 474, 476, 119, 0, 626, 475, 355, 0, 0, 524, 568, 476, 0, 568, 0, 463, 463, 463, 463, 474, 484, 0, 484, 568, 475, 119, 121, 121, 463, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 463, 474, 121, 482, 121, 121, 475, 485, 555, 463, 555, 485, 486, 487, 489, 0, 482, 486, 492, 669, 121, 492, 487, 493, 463, 489, 493, 482, 121, 0, 485, 555, 463, 555, 485, 0, 486, 487, 489, 482, 486, 492, 669, 121, 492, 487, 493, 0, 489, 493, 0, 121, 148, 516, 516, 148, 148, 0, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 0, 490, 491, 494, 495, 516, 516, 490, 491, 496, 498, 670, 496, 495, 494, 498, 464, 464, 464, 464, 677, 677, 148, 148, 490, 491, 0, 494, 495, 464, 490, 491, 496, 498, 670, 496, 495, 494, 498, 0, 0, 0, 464, 677, 677, 148, 152, 0, 681, 152, 152, 464, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 464, 499, 506, 0, 500, 681, 507, 508, 464, 500, 499, 506, 477, 477, 477, 477, 0, 0, 0, 507, 508, 477, 152, 152, 0, 499, 506, 500, 0, 0, 507, 508, 500, 499, 506, 0, 0, 477, 501, 501, 501, 501, 507, 508, 0, 152, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 477, 511, 158, 158, 158, 158, 512, 514, 630, 0, 501, 513, 514, 0, 511, 630, 512, 590, 509, 509, 509, 509, 513, 518, 518, 511, 0, 590, 158, 894, 512, 514, 630, 501, 894, 513, 514, 511, 630, 512, 894, 590, 894, 509, 515, 513, 0, 518, 518, 515, 590, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 509, 515, 159, 159, 159, 159, 515, 519, 525, 525, 525, 525, 519, 591, 520, 0, 531, 531, 531, 531, 159, 591, 683, 690, 525, 0, 0, 0, 159, 531, 520, 519, 1318, 1318, 1318, 1318, 519, 591, 520, 554, 554, 554, 554, 159, 591, 683, 690, 517, 517, 517, 517, 159, 160, 520, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 517, 0, 554, 517, 536, 536, 536, 536, 0, 540, 517, 540, 562, 684, 540, 562, 684, 521, 521, 521, 521, 536, 160, 160, 517, 554, 684, 517, 633, 633, 633, 633, 540, 517, 540, 562, 0, 540, 562, 0, 0, 0, 521, 0, 633, 160, 162, 0, 0, 162, 162, 0, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 521, 593, 530, 530, 530, 530, 594, 534, 534, 534, 534, 593, 594, 0, 547, 547, 547, 547, 0, 530, 696, 0, 162, 162, 534, 593, 0, 530, 629, 0, 594, 547, 534, 629, 593, 697, 594, 530, 548, 548, 548, 548, 534, 696, 530, 162, 186, 186, 186, 186, 547, 530, 629, 547, 0, 0, 534, 629, 697, 186, 530, 558, 558, 558, 558, 534, 0, 599, 186, 599, 186, 0, 186, 547, 548, 767, 547, 548, 558, 605, 0, 186, 634, 634, 634, 634, 600, 600, 600, 600, 605, 599, 186, 599, 186, 600, 186, 548, 634, 767, 548, 0, 600, 605, 186, 187, 187, 187, 187, 685, 187, 0, 685, 605, 187, 187, 187, 187, 187, 187, 0, 187, 685, 187, 188, 188, 188, 188, 686, 188, 0, 686, 0, 188, 188, 188, 188, 188, 188, 604, 188, 686, 188, 574, 574, 574, 574, 604, 188, 0, 0, 0, 574, 601, 601, 601, 601, 0, 602, 602, 602, 602, 601, 604, 0, 0, 0, 602, 687, 601, 604, 0, 188, 190, 602, 687, 190, 190, 574, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 575, 575, 575, 575, 631, 641, 687, 641, 574, 575, 631, 598, 598, 598, 598, 768, 603, 603, 603, 603, 0, 0, 190, 190, 575, 603, 0, 598, 631, 641, 0, 641, 603, 0, 631, 608, 608, 608, 608, 768, 584, 584, 584, 584, 608, 190, 194, 598, 575, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 584, 0, 0, 0, 598, 708, 608, 650, 708, 584, 610, 610, 610, 610, 635, 635, 635, 635, 708, 610, 650, 0, 194, 194, 584, 613, 613, 613, 613, 608, 635, 650, 584, 0, 613, 0, 0, 813, 609, 609, 609, 609, 0, 650, 610, 194, 196, 609, 813, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 609, 610, 535, 535, 535, 535, 813, 0, 556, 556, 556, 556, 617, 617, 617, 617, 643, 0, 643, 535, 0, 617, 196, 196, 609, 556, 0, 535, 582, 582, 582, 582, 617, 556, 0, 0, 0, 535, 632, 0, 643, 582, 643, 556, 535, 196, 203, 203, 203, 203, 556, 535, 0, 632, 582, 644, 617, 556, 688, 203, 535, 0, 632, 582, 709, 644, 556, 709, 203, 651, 203, 814, 203, 0, 688, 651, 632, 709, 582, 644, 0, 203, 611, 611, 611, 611, 582, 815, 644, 704, 704, 611, 203, 651, 203, 814, 203, 688, 651, 715, 592, 592, 592, 592, 203, 215, 215, 215, 215, 0, 215, 815, 704, 704, 215, 215, 215, 215, 215, 215, 611, 215, 715, 215, 217, 217, 217, 217, 592, 217, 0, 0, 592, 217, 217, 217, 217, 217, 217, 0, 217, 0, 217, 611, 655, 0, 217, 628, 628, 628, 628, 710, 592, 655, 710, 592, 612, 612, 612, 612, 614, 614, 614, 614, 710, 612, 0, 812, 655, 614, 217, 223, 812, 628, 223, 223, 655, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 0, 653, 0, 612, 653, 812, 628, 614, 636, 636, 636, 636, 616, 616, 616, 616, 583, 583, 583, 583, 725, 616, 223, 223, 636, 653, 612, 0, 653, 583, 614, 624, 624, 624, 624, 623, 623, 623, 623, 0, 624, 0, 583, 725, 623, 223, 224, 0, 616, 224, 224, 583, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 583, 557, 557, 557, 557, 616, 713, 0, 583, 713, 623, 741, 618, 618, 618, 618, 0, 0, 557, 713, 0, 618, 224, 224, 0, 0, 557, 758, 585, 585, 585, 585, 618, 623, 741, 758, 557, 637, 637, 637, 637, 585, 695, 557, 695, 224, 226, 226, 226, 226, 557, 758, 654, 637, 585, 0, 618, 654, 758, 557, 0, 0, 0, 585, 0, 695, 226, 695, 226, 652, 226, 226, 226, 821, 226, 732, 654, 226, 585, 652, 654, 226, 652, 226, 226, 226, 585, 676, 732, 0, 226, 676, 226, 652, 226, 226, 226, 821, 226, 732, 226, 0, 652, 0, 226, 652, 226, 226, 226, 269, 676, 732, 269, 269, 676, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 750, 0, 769, 619, 619, 619, 619, 0, 615, 615, 615, 615, 619, 750, 0, 0, 0, 615, 657, 657, 657, 657, 269, 269, 750, 769, 0, 619, 622, 622, 622, 622, 0, 0, 657, 0, 750, 622, 625, 625, 625, 625, 0, 615, 0, 269, 270, 625, 622, 270, 270, 619, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 615, 770, 621, 621, 621, 621, 622, 646, 0, 625, 646, 621, 642, 642, 642, 642, 770, 647, 647, 647, 647, 646, 270, 270, 0, 770, 621, 656, 656, 656, 656, 646, 625, 647, 646, 0, 0, 719, 642, 770, 719, 789, 647, 831, 646, 270, 280, 280, 280, 280, 621, 0, 647, 656, 763, 666, 666, 666, 666, 280, 719, 0, 642, 719, 789, 763, 647, 831, 0, 736, 280, 280, 666, 0, 280, 647, 811, 656, 763, 811, 658, 658, 658, 658, 659, 659, 659, 659, 763, 811, 736, 666, 799, 736, 280, 280, 658, 737, 280, 284, 659, 284, 284, 737, 284, 751, 751, 284, 284, 284, 284, 284, 284, 736, 666, 799, 1322, 1322, 1322, 1322, 737, 0, 665, 665, 665, 665, 737, 0, 751, 751, 284, 284, 284, 284, 284, 284, 284, 285, 285, 665, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 0, 285, 285, 285, 285, 285, 738, 0, 0, 665, 672, 672, 672, 672, 673, 673, 673, 673, 680, 680, 680, 680, 746, 738, 746, 765, 765, 672, 285, 0, 738, 673, 665, 0, 0, 680, 0, 698, 698, 698, 698, 1393, 1393, 1393, 1393, 746, 738, 746, 765, 765, 800, 285, 286, 286, 698, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 800, 808, 0, 698, 700, 700, 700, 700, 699, 699, 699, 699, 809, 648, 648, 648, 648, 701, 701, 701, 701, 700, 286, 0, 808, 699, 698, 828, 1128, 648, 828, 1128, 0, 0, 701, 809, 0, 853, 648, 0, 828, 1128, 0, 0, 699, 286, 296, 296, 648, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 853, 648, 296, 745, 296, 296, 699, 743, 0, 745, 648, 810, 707, 707, 707, 707, 0, 0, 913, 649, 649, 649, 649, 757, 743, 757, 745, 818, 296, 707, 0, 743, 745, 0, 810, 649, 0, 0, 735, 735, 735, 735, 913, 0, 649, 0, 757, 743, 757, 0, 818, 296, 299, 299, 649, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 752, 649, 299, 735, 299, 299, 753, 0, 0, 761, 649, 761, 735, 753, 752, 742, 742, 742, 742, 0, 756, 0, 299, 787, 752, 787, 735, 819, 299, 753, 756, 742, 761, 0, 761, 735, 753, 752, 0, 0, 671, 671, 671, 671, 756, 299, 787, 0, 787, 742, 819, 299, 309, 756, 820, 309, 309, 671, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 742, 771, 671, 830, 671, 820, 0, 771, 754, 914, 749, 749, 749, 749, 754, 0, 730, 730, 730, 730, 839, 0, 309, 309, 771, 671, 830, 671, 0, 730, 771, 0, 754, 914, 0, 0, 0, 754, 755, 755, 755, 755, 730, 839, 749, 309, 310, 0, 0, 310, 310, 730, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 730, 749, 759, 0, 760, 762, 755, 762, 730, 760, 762, 764, 834, 759, 764, 834, 759, 766, 766, 766, 766, 859, 310, 310, 833, 833, 759, 760, 762, 755, 762, 0, 760, 762, 764, 834, 759, 764, 834, 759, 772, 772, 772, 772, 859, 310, 316, 833, 833, 316, 316, 766, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, 774, 774, 774, 774, 785, 788, 0, 792, 766, 785, 795, 0, 792, 772, 868, 868, 774, 0, 0, 0, 788, 858, 316, 316, 858, 795, 0, 785, 870, 788, 792, 0, 785, 0, 795, 792, 772, 868, 868, 793, 793, 793, 793, 788, 858, 316, 317, 858, 795, 317, 317, 870, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 790, 790, 790, 790, 798, 798, 798, 798, 791, 791, 791, 791, 793, 866, 874, 0, 790, 875, 866, 874, 879, 798, 317, 317, 791, 1058, 1058, 1058, 1058, 794, 794, 794, 794, 0, 1058, 793, 866, 874, 798, 790, 875, 866, 874, 879, 791, 317, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 798, 790, 321, 321, 321, 321, 791, 794, 805, 0, 854, 832, 797, 797, 797, 797, 802, 802, 802, 802, 880, 854, 0, 832, 805, 854, 921, 0, 321, 797, 794, 0, 805, 802, 854, 832, 1608, 1608, 1608, 1608, 0, 0, 0, 880, 854, 797, 832, 805, 854, 921, 802, 321, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 0, 797, 323, 323, 323, 323, 802, 852, 856, 852, 0, 920, 801, 801, 801, 801, 0, 822, 822, 822, 822, 856, 323, 856, 852, 0, 0, 0, 323, 801, 922, 852, 856, 852, 822, 920, 0, 0, 0, 861, 861, 861, 861, 0, 856, 323, 856, 852, 861, 801, 822, 323, 325, 930, 922, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 801, 822, 0, 867, 855, 930, 861, 925, 857, 823, 823, 823, 823, 867, 855, 840, 840, 840, 840, 855, 0, 926, 325, 325, 0, 857, 823, 867, 855, 861, 925, 0, 857, 0, 0, 0, 867, 855, 1617, 1617, 1617, 1617, 855, 823, 926, 325, 326, 840, 857, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 823, 872, 932, 873, 840, 929, 862, 0, 872, 860, 860, 860, 860, 873, 881, 881, 841, 841, 841, 841, 931, 862, 326, 326, 872, 860, 932, 873, 929, 841, 862, 872, 863, 863, 863, 863, 873, 881, 881, 0, 0, 863, 841, 931, 862, 326, 329, 860, 947, 329, 329, 841, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 841, 0, 938, 882, 860, 863, 947, 939, 841, 882, 869, 869, 869, 869, 878, 966, 842, 842, 842, 842, 946, 0, 329, 329, 878, 938, 882, 0, 863, 842, 939, 0, 882, 0, 876, 876, 876, 876, 878, 966, 0, 0, 842, 946, 869, 329, 330, 878, 0, 330, 330, 842, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 842, 869, 876, 668, 668, 668, 668, 960, 842, 883, 883, 884, 884, 884, 884, 968, 877, 877, 877, 877, 668, 0, 330, 330, 0, 876, 0, 884, 668, 919, 960, 968, 883, 883, 1676, 1676, 1676, 1676, 668, 968, 919, 901, 901, 901, 901, 330, 342, 342, 342, 342, 877, 342, 668, 919, 968, 342, 342, 342, 342, 342, 342, 668, 342, 919, 342, 343, 343, 343, 343, 0, 343, 0, 0, 877, 343, 343, 343, 343, 343, 343, 901, 343, 0, 343, 885, 885, 885, 885, 886, 886, 886, 886, 843, 843, 843, 843, 984, 945, 343, 0, 885, 945, 924, 901, 886, 843, 902, 902, 902, 902, 1722, 1722, 1722, 1722, 1724, 1724, 1724, 1724, 843, 984, 945, 343, 346, 924, 945, 346, 346, 843, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 843, 900, 903, 902, 924, 903, 0, 900, 843, 0, 0, 904, 904, 904, 904, 985, 851, 851, 851, 851, 991, 0, 346, 346, 900, 903, 902, 904, 903, 851, 900, 907, 907, 907, 907, 0, 0, 0, 985, 0, 0, 0, 851, 991, 904, 346, 347, 907, 990, 347, 347, 851, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 851, 904, 906, 941, 923, 907, 990, 0, 851, 905, 905, 905, 905, 941, 944, 1005, 944, 0, 1009, 906, 0, 923, 347, 347, 0, 905, 906, 941, 907, 910, 910, 910, 910, 0, 0, 0, 941, 0, 944, 1005, 944, 1009, 906, 905, 923, 347, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, 905, 1021, 910, 908, 908, 908, 908, 958, 943, 0, 0, 969, 969, 969, 969, 349, 981, 958, 981, 908, 969, 943, 349, 349, 1021, 910, 0, 969, 0, 0, 0, 958, 943, 940, 940, 940, 940, 0, 349, 981, 958, 981, 940, 908, 943, 349, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 908, 940, 909, 909, 909, 909, 0, 0, 664, 664, 664, 664, 964, 964, 351, 0, 351, 975, 909, 0, 0, 975, 351, 351, 940, 664, 0, 0, 973, 779, 779, 779, 779, 664, 0, 964, 964, 351, 973, 351, 975, 0, 909, 664, 975, 351, 357, 357, 357, 357, 664, 779, 973, 779, 0, 1000, 1010, 664, 1000, 357, 1016, 973, 1022, 0, 779, 909, 664, 965, 783, 783, 783, 783, 357, 0, 0, 779, 0, 779, 357, 357, 1010, 357, 0, 0, 1016, 1022, 965, 779, 976, 976, 783, 965, 783, 0, 1000, 0, 357, 893, 893, 893, 893, 357, 357, 783, 357, 361, 361, 361, 361, 965, 0, 976, 976, 0, 783, 0, 783, 1000, 361, 893, 0, 893, 890, 890, 890, 890, 783, 361, 1017, 361, 1026, 361, 970, 970, 970, 970, 891, 891, 891, 891, 361, 970, 0, 893, 890, 893, 890, 0, 970, 891, 0, 361, 1017, 361, 1026, 361, 890, 0, 1025, 0, 978, 978, 891, 361, 365, 365, 365, 365, 890, 365, 890, 891, 0, 365, 365, 365, 365, 365, 365, 890, 365, 1025, 365, 978, 978, 0, 891, 892, 892, 892, 892, 365, 0, 0, 891, 915, 915, 915, 915, 1040, 892, 942, 942, 942, 942, 0, 948, 948, 948, 948, 942, 0, 915, 892, 0, 365, 366, 366, 366, 366, 1019, 366, 892, 1040, 0, 366, 366, 366, 366, 366, 366, 1055, 366, 915, 366, 942, 1027, 892, 948, 1019, 1067, 366, 0, 0, 0, 892, 911, 911, 911, 911, 0, 971, 971, 971, 971, 1055, 915, 0, 942, 1027, 971, 948, 1019, 911, 1067, 366, 372, 971, 911, 372, 372, 0, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, 951, 952, 962, 0, 977, 963, 911, 1028, 977, 951, 1033, 962, 1034, 952, 962, 951, 952, 962, 963, 1061, 963, 1065, 372, 372, 951, 952, 962, 977, 1086, 963, 1028, 977, 951, 1033, 962, 1034, 952, 962, 951, 952, 962, 963, 1061, 963, 1065, 372, 373, 373, 373, 373, 373, 1086, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 0, 974, 1023, 967, 967, 967, 967, 0, 972, 972, 972, 972, 0, 0, 974, 373, 1023, 972, 1083, 967, 987, 987, 373, 373, 972, 974, 1023, 967, 0, 988, 988, 988, 988, 979, 979, 979, 979, 974, 373, 1023, 0, 0, 1083, 987, 987, 373, 418, 418, 418, 418, 418, 967, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 0, 979, 988, 1111, 896, 896, 896, 896, 897, 897, 897, 897, 912, 912, 912, 912, 916, 916, 916, 916, 0, 0, 418, 418, 979, 988, 896, 1111, 896, 912, 897, 982, 897, 916, 912, 0, 0, 0, 916, 0, 0, 897, 896, 982, 986, 418, 423, 423, 423, 423, 896, 423, 896, 0, 897, 982, 897, 0, 912, 986, 423, 423, 916, 423, 897, 896, 982, 0, 986, 0, 0, 423, 1112, 1013, 1020, 1087, 980, 980, 980, 980, 1013, 423, 986, 0, 899, 899, 899, 899, 423, 423, 933, 933, 933, 933, 1020, 423, 1112, 1013, 1087, 0, 0, 1032, 1032, 1013, 423, 426, 899, 933, 899, 0, 980, 426, 933, 426, 426, 0, 426, 1020, 899, 426, 426, 426, 426, 426, 426, 1032, 1032, 0, 1107, 0, 899, 0, 899, 980, 0, 0, 933, 983, 983, 983, 983, 899, 426, 426, 426, 426, 426, 426, 426, 427, 427, 1107, 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, 0, 427, 427, 427, 427, 427, 0, 983, 1014, 1014, 1001, 1004, 1007, 1007, 1007, 1007, 1031, 0, 1066, 1066, 1031, 934, 934, 934, 934, 1001, 1004, 0, 427, 1007, 983, 1014, 1014, 0, 1001, 1004, 0, 0, 934, 0, 1031, 1066, 1066, 934, 1031, 1119, 0, 0, 1001, 1004, 1007, 427, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 934, 1119, 430, 430, 430, 430, 1007, 1070, 1070, 1070, 1070, 1037, 1011, 1011, 1011, 1011, 1070, 1129, 1072, 1072, 1072, 1072, 430, 1070, 0, 430, 1037, 1072, 430, 1011, 1006, 1006, 1006, 1006, 1072, 1037, 1069, 1069, 1069, 1069, 1129, 953, 953, 953, 953, 430, 1006, 1011, 430, 1037, 1006, 430, 433, 433, 953, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 953, 1123, 433, 1011, 433, 433, 1130, 1006, 1069, 953, 954, 954, 954, 954, 955, 955, 955, 955, 1029, 1029, 1029, 1029, 0, 954, 953, 1123, 1038, 955, 433, 1130, 0, 1069, 953, 0, 0, 1029, 954, 0, 0, 1038, 955, 959, 959, 959, 959, 954, 1036, 1015, 0, 955, 1038, 433, 436, 436, 436, 436, 1029, 436, 1036, 1015, 954, 1015, 1038, 0, 955, 959, 436, 436, 954, 436, 1036, 1015, 955, 959, 1035, 0, 1050, 436, 1137, 1029, 959, 1036, 1015, 1154, 1015, 1035, 1050, 436, 0, 959, 1073, 1073, 1073, 1073, 436, 436, 959, 0, 1035, 1073, 1050, 436, 1137, 959, 1131, 0, 1073, 1154, 1035, 1050, 436, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 0, 1131, 443, 443, 443, 443, 1132, 1751, 1751, 1751, 1751, 0, 1056, 1024, 1024, 1024, 1024, 1074, 0, 1115, 1115, 1056, 956, 956, 956, 956, 1074, 0, 443, 1132, 1024, 1002, 1002, 1002, 1002, 956, 1056, 1039, 1039, 1039, 1039, 1074, 1115, 1115, 1056, 0, 1039, 1002, 956, 1074, 1024, 443, 457, 1002, 0, 457, 457, 956, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 956, 1024, 1039, 1057, 1076, 1002, 1045, 1155, 956, 1077, 1159, 0, 1160, 1077, 1076, 1057, 992, 992, 992, 992, 1045, 1045, 457, 457, 0, 1039, 0, 1057, 1076, 992, 1045, 1155, 1077, 992, 1159, 1160, 1077, 1076, 1057, 0, 0, 0, 992, 1045, 1045, 457, 458, 458, 458, 458, 458, 992, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 992, 1062, 1003, 1003, 1003, 1003, 1063, 0, 992, 0, 1101, 1101, 1101, 1101, 1172, 458, 1062, 0, 1003, 0, 0, 1063, 458, 458, 1003, 1062, 1101, 0, 0, 0, 1063, 1084, 1084, 1084, 1084, 0, 0, 1172, 458, 1062, 1043, 1043, 1043, 1043, 1063, 458, 459, 0, 1003, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 1043, 1075, 0, 1116, 1084, 1116, 1043, 1157, 0, 1043, 1078, 1078, 1078, 1078, 1075, 1186, 1157, 459, 1008, 1008, 1008, 1008, 459, 459, 1043, 1075, 1116, 1084, 1116, 1043, 0, 1157, 1043, 0, 0, 1008, 0, 1075, 1186, 1157, 459, 0, 1008, 0, 1078, 459, 460, 0, 0, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 1008, 1078, 0, 1158, 989, 989, 989, 989, 993, 993, 993, 993, 1206, 0, 460, 1158, 0, 1012, 1012, 1012, 1012, 1103, 460, 460, 1103, 1121, 989, 1158, 989, 1080, 993, 1121, 993, 1079, 1012, 1206, 1079, 460, 1158, 1080, 989, 1012, 0, 993, 0, 460, 465, 465, 465, 465, 989, 1081, 989, 1080, 993, 1121, 993, 0, 1106, 465, 1103, 1081, 1080, 989, 0, 1012, 993, 1079, 1118, 1207, 1118, 465, 465, 0, 1106, 1081, 1161, 1030, 1030, 1030, 1030, 465, 1106, 1103, 1081, 0, 1102, 1102, 1102, 1102, 1079, 1118, 1207, 1118, 1030, 465, 465, 1106, 0, 0, 1161, 1030, 1102, 1177, 465, 480, 480, 480, 480, 480, 1185, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 1030, 1046, 1177, 1117, 1135, 1046, 0, 1117, 0, 1185, 1064, 1064, 1064, 1064, 1135, 480, 0, 0, 0, 1064, 1046, 0, 480, 480, 0, 1046, 1117, 1202, 1135, 1046, 1117, 1085, 1085, 1085, 1085, 0, 0, 1135, 480, 1139, 1139, 1139, 1139, 1046, 1064, 480, 481, 481, 481, 481, 481, 1202, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 1136, 1064, 1170, 0, 1085, 1170, 1210, 1139, 1210, 0, 1068, 1068, 1068, 1068, 481, 1136, 481, 1122, 1122, 1122, 1122, 0, 481, 481, 1136, 1170, 1068, 1085, 1170, 1210, 1139, 1210, 1068, 1140, 1122, 0, 0, 481, 1136, 481, 995, 995, 995, 995, 1140, 481, 510, 510, 510, 510, 510, 510, 510, 510, 510, 510, 1068, 1140, 510, 510, 510, 1214, 995, 510, 995, 510, 510, 1140, 995, 0, 1223, 994, 994, 994, 994, 996, 996, 996, 996, 0, 0, 1110, 1110, 1110, 1110, 1214, 995, 1221, 995, 510, 0, 0, 995, 994, 1223, 994, 994, 996, 1110, 996, 1138, 1138, 1138, 1138, 1110, 1124, 1124, 1124, 1124, 1138, 1221, 0, 510, 538, 538, 538, 538, 994, 538, 994, 994, 996, 1124, 996, 538, 538, 538, 538, 1110, 0, 538, 538, 539, 539, 539, 539, 0, 539, 0, 997, 997, 997, 997, 539, 539, 539, 539, 1222, 1229, 539, 539, 1126, 1126, 1126, 1126, 1156, 0, 1108, 1108, 1108, 1108, 997, 1228, 997, 0, 1156, 0, 0, 1126, 0, 1222, 539, 1229, 1108, 1228, 0, 0, 997, 0, 1156, 1104, 1104, 1104, 1104, 0, 997, 1228, 997, 1156, 1090, 1090, 1090, 1090, 1108, 539, 541, 1104, 1228, 541, 541, 997, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 1090, 1108, 1240, 1104, 1127, 1127, 1127, 1127, 1245, 1090, 1239, 1144, 1144, 1144, 1144, 1243, 1109, 1109, 1109, 1109, 1144, 1127, 541, 541, 1090, 1240, 1104, 1544, 1544, 1544, 1544, 1245, 1090, 1109, 1239, 1047, 1047, 1047, 1047, 1243, 0, 0, 0, 1544, 1109, 541, 549, 549, 1047, 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, 1047, 1141, 549, 549, 549, 549, 1227, 1109, 1246, 1047, 549, 1146, 1142, 1162, 0, 1227, 1141, 1146, 1254, 1105, 1105, 1105, 1105, 1254, 1047, 1141, 1142, 1162, 549, 0, 1227, 1246, 1047, 0, 549, 1105, 1142, 1162, 1227, 1141, 0, 1254, 0, 1105, 0, 1146, 1254, 0, 0, 1142, 1162, 549, 550, 550, 0, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, 1105, 1146, 550, 550, 550, 550, 1255, 1171, 0, 0, 999, 999, 999, 999, 1100, 1100, 1100, 1100, 1171, 550, 1134, 1134, 1134, 1134, 1163, 1163, 1163, 1163, 550, 0, 1255, 1171, 999, 1163, 999, 1280, 1100, 1134, 1100, 0, 0, 1171, 550, 1134, 1216, 1216, 1216, 1216, 0, 0, 0, 550, 560, 560, 560, 560, 999, 560, 999, 1280, 1100, 1216, 1100, 560, 560, 560, 560, 1134, 0, 560, 560, 561, 561, 561, 561, 0, 561, 1151, 998, 998, 998, 998, 561, 561, 561, 561, 0, 1182, 561, 561, 0, 1151, 1151, 1165, 1165, 1242, 0, 0, 1182, 1258, 998, 1151, 998, 1133, 1133, 1133, 1133, 1242, 0, 1165, 561, 1182, 1212, 1212, 1151, 1151, 998, 1165, 1165, 1242, 1133, 1182, 1258, 0, 998, 0, 998, 0, 0, 0, 1242, 1133, 1165, 561, 563, 1212, 1212, 563, 563, 998, 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, 1231, 1133, 1231, 1048, 1048, 1048, 1048, 0, 1113, 1113, 1113, 1113, 1173, 1173, 1173, 1173, 1048, 1051, 1051, 1051, 1051, 1266, 563, 563, 1231, 1113, 1231, 0, 1173, 1048, 1051, 1143, 1143, 1143, 1143, 0, 1181, 0, 1048, 1181, 1143, 0, 1113, 1051, 1266, 563, 572, 572, 572, 572, 1173, 572, 1051, 1048, 1253, 572, 572, 572, 572, 572, 572, 1048, 572, 0, 572, 1113, 0, 1051, 1143, 1253, 1181, 1290, 1241, 1173, 0, 1051, 0, 0, 1253, 1211, 0, 1241, 572, 0, 0, 0, 1145, 1145, 1145, 1145, 1211, 1143, 1253, 1181, 1290, 1145, 1241, 1286, 1147, 1147, 1147, 1147, 0, 1211, 1241, 572, 573, 573, 573, 573, 0, 573, 0, 1211, 0, 573, 573, 573, 573, 573, 573, 1286, 573, 1145, 573, 576, 576, 576, 576, 576, 1147, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 1302, 1145, 1307, 1219, 1219, 1219, 1219, 0, 1147, 1174, 1174, 1174, 1174, 0, 0, 576, 1052, 1052, 1052, 1052, 1219, 0, 576, 576, 1302, 1174, 1307, 0, 0, 1052, 1230, 1230, 1230, 1230, 1168, 1168, 1168, 1168, 576, 1230, 0, 0, 1052, 1168, 1174, 576, 577, 577, 577, 577, 577, 1052, 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, 577, 1052, 1174, 1168, 1247, 1262, 1262, 0, 1291, 1052, 1205, 1205, 1205, 1205, 0, 577, 1247, 577, 1780, 1780, 1780, 1780, 0, 577, 577, 0, 1168, 1205, 1247, 1262, 1262, 1291, 0, 0, 1233, 1233, 1233, 1233, 577, 1247, 577, 1179, 1179, 1179, 1179, 1150, 577, 578, 1150, 1205, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, 1150, 0, 1150, 0, 1233, 1205, 1244, 0, 1179, 1175, 1175, 1175, 1175, 1309, 0, 1329, 1330, 1150, 578, 0, 1244, 0, 578, 578, 1150, 1175, 1150, 1233, 0, 0, 1244, 1179, 1677, 1677, 1677, 1677, 0, 1309, 1329, 1330, 1150, 578, 1335, 1244, 1175, 578, 579, 0, 1677, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 1335, 1175, 579, 1053, 1053, 1053, 1053, 1054, 1054, 1054, 1054, 1265, 1095, 1095, 1095, 1095, 1053, 1265, 1169, 1347, 1054, 1336, 579, 579, 1169, 0, 579, 1351, 1361, 1053, 0, 0, 1265, 1054, 1095, 0, 1095, 0, 1053, 1169, 1095, 0, 1054, 1347, 1336, 579, 586, 586, 586, 586, 1362, 1351, 1361, 1053, 1169, 1364, 1265, 1054, 1095, 586, 1095, 1053, 0, 1169, 1095, 1054, 1059, 1059, 1059, 1059, 586, 1370, 586, 1362, 1375, 1059, 1295, 1169, 1364, 1059, 1395, 586, 0, 0, 1060, 1060, 1060, 1060, 1295, 0, 0, 0, 1059, 1060, 586, 1370, 586, 1060, 1375, 0, 1295, 1059, 0, 1395, 586, 587, 587, 587, 587, 1416, 1060, 1295, 1180, 1180, 1180, 1180, 1059, 1394, 587, 1060, 1178, 1178, 1178, 1178, 1059, 1094, 1094, 1094, 1094, 1178, 1382, 587, 1416, 1382, 1060, 1088, 1088, 1088, 1088, 587, 587, 1394, 1060, 0, 1178, 0, 1180, 1094, 1088, 1094, 1415, 1427, 1088, 1382, 0, 587, 1382, 1424, 0, 1094, 1442, 1088, 587, 587, 588, 588, 588, 588, 1178, 1180, 1088, 1094, 0, 1094, 1415, 1427, 1451, 588, 1408, 1383, 1424, 1408, 1094, 1383, 1442, 1088, 1208, 1208, 1208, 1208, 588, 0, 0, 1088, 1089, 1089, 1089, 1089, 588, 588, 1451, 1408, 1383, 1208, 1408, 1452, 1383, 1089, 0, 0, 1464, 1089, 0, 0, 588, 1096, 1096, 1096, 1096, 1208, 1089, 588, 588, 589, 589, 589, 589, 1472, 1452, 1089, 1091, 1091, 1091, 1091, 1464, 1296, 589, 1096, 1502, 1096, 0, 1487, 1208, 1091, 1089, 1459, 1296, 1091, 1459, 589, 1472, 589, 1089, 1096, 1366, 1533, 1091, 0, 589, 1296, 0, 1096, 1502, 1096, 1487, 1091, 1366, 1493, 1459, 1296, 0, 1459, 0, 589, 1505, 589, 1096, 1547, 1366, 1533, 1091, 589, 595, 595, 595, 595, 1557, 595, 1091, 1366, 1493, 595, 595, 595, 595, 595, 595, 1505, 595, 1559, 595, 1547, 1097, 1097, 1097, 1097, 1176, 1176, 1176, 1176, 1557, 1200, 1200, 1200, 1200, 0, 1149, 1149, 1149, 1149, 595, 0, 1176, 1559, 1097, 0, 1097, 1200, 1236, 1149, 0, 1236, 0, 1152, 1152, 1152, 1152, 0, 1097, 1200, 0, 1176, 1149, 595, 596, 596, 596, 596, 1097, 596, 1097, 1149, 1236, 596, 596, 596, 596, 596, 596, 1152, 596, 1097, 596, 1200, 1176, 1534, 1149, 1236, 1152, 1554, 596, 0, 1564, 1595, 1149, 0, 1236, 1201, 1201, 1201, 1201, 0, 0, 1152, 1267, 1267, 1267, 1267, 1534, 0, 1236, 1152, 1554, 1201, 596, 606, 1564, 1595, 606, 606, 1201, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 0, 1267, 1596, 1601, 1226, 1226, 1226, 1226, 0, 1201, 1204, 1204, 1204, 1204, 1430, 1602, 1430, 606, 1530, 0, 0, 1226, 606, 606, 1267, 1596, 1601, 1204, 1530, 0, 0, 1209, 1209, 1209, 1209, 0, 0, 1430, 1602, 1430, 606, 0, 1530, 1226, 1204, 606, 607, 0, 1209, 607, 607, 1530, 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, 1226, 1204, 1209, 1525, 1098, 1098, 1098, 1098, 1099, 1099, 1099, 1099, 1615, 0, 607, 0, 1114, 1114, 1114, 1114, 0, 1525, 607, 607, 0, 1209, 1098, 1525, 1098, 0, 1099, 0, 1099, 1114, 1469, 1615, 1098, 607, 1465, 1114, 1469, 1465, 0, 1099, 1525, 607, 620, 620, 620, 620, 1098, 1469, 1098, 1114, 1099, 620, 1099, 0, 0, 1098, 0, 0, 1465, 1114, 0, 1465, 1099, 1599, 1613, 0, 1614, 620, 0, 0, 620, 1469, 1114, 1287, 1287, 1287, 1287, 620, 1225, 1225, 1225, 1225, 0, 1460, 1460, 1460, 1460, 1599, 1613, 1287, 1614, 620, 1460, 1287, 620, 1225, 1153, 1153, 1153, 1153, 620, 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, 0, 1225, 638, 638, 638, 0, 1287, 638, 1238, 638, 638, 1153, 1238, 1531, 1304, 1304, 1304, 1304, 1594, 0, 1153, 1620, 1531, 1238, 1225, 1658, 1594, 1192, 1192, 1192, 1192, 1304, 1238, 638, 0, 1153, 1238, 1531, 1249, 1249, 1249, 1249, 1594, 1153, 1620, 1531, 1238, 1249, 1658, 1192, 1594, 1192, 1750, 1750, 1750, 1750, 638, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 1659, 1192, 639, 639, 639, 1249, 1192, 639, 1192, 639, 639, 1611, 1297, 1297, 1297, 1297, 1625, 1166, 1166, 1166, 1166, 1611, 1665, 1659, 1192, 0, 1166, 1750, 1249, 1297, 1166, 0, 0, 639, 0, 1611, 1224, 1224, 1224, 1224, 1625, 1224, 0, 1166, 1611, 1665, 1232, 1232, 1232, 1232, 1224, 1224, 1166, 1224, 1297, 1232, 639, 640, 640, 640, 640, 640, 640, 640, 640, 640, 640, 1166, 1232, 640, 640, 640, 1682, 0, 640, 1166, 640, 640, 1224, 1224, 640, 0, 640, 0, 640, 1196, 1196, 1196, 1196, 0, 1628, 1237, 1232, 640, 1237, 1682, 1537, 1537, 1537, 1537, 640, 0, 0, 0, 640, 1537, 640, 1196, 640, 1196, 1263, 1263, 1263, 1263, 1628, 1237, 640, 1196, 0, 1263, 0, 0, 0, 640, 674, 674, 674, 674, 0, 674, 1237, 1196, 0, 1196, 1263, 674, 674, 674, 674, 1237, 1196, 674, 674, 675, 675, 675, 675, 0, 675, 1203, 1203, 1203, 1203, 1237, 675, 675, 675, 675, 1263, 1704, 675, 675, 1712, 0, 0, 1203, 1565, 1565, 1565, 1565, 1167, 1167, 1167, 1167, 1717, 1565, 675, 1203, 1592, 1167, 0, 1592, 1704, 1167, 0, 1712, 1257, 1257, 1257, 1257, 0, 0, 1324, 1324, 1324, 1324, 1167, 1717, 1592, 675, 678, 1203, 1257, 678, 678, 1167, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, 1167, 1257, 1592, 1305, 1305, 1305, 1305, 1324, 1167, 0, 0, 0, 1259, 1259, 1259, 1259, 1250, 1250, 1250, 1250, 1305, 1734, 678, 678, 1257, 1250, 0, 0, 1259, 1250, 1324, 0, 1261, 1261, 1261, 1261, 1413, 1413, 1413, 1413, 0, 0, 1250, 1630, 1734, 678, 679, 1259, 1261, 679, 679, 1250, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, 1250, 1630, 1261, 1252, 1259, 1413, 1660, 1664, 1250, 1252, 0, 1691, 1694, 1256, 1256, 1256, 1256, 1306, 1306, 1306, 1306, 0, 679, 679, 1252, 1261, 0, 1543, 1413, 1256, 1660, 1664, 0, 1543, 1306, 1691, 1694, 1256, 0, 1252, 1352, 1352, 1352, 1352, 1543, 679, 691, 691, 1252, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 1256, 1252, 691, 691, 691, 691, 1703, 1543, 691, 0, 1603, 1352, 1603, 1532, 0, 1260, 1260, 1260, 1260, 1378, 1378, 1378, 1378, 0, 0, 1532, 1746, 0, 691, 0, 1703, 1260, 691, 1603, 1352, 1603, 1378, 1532, 1367, 1367, 1367, 1367, 0, 1248, 1248, 1248, 1248, 1367, 1532, 1746, 1260, 691, 692, 692, 0, 692, 692, 692, 692, 692, 692, 692, 692, 692, 692, 692, 692, 1248, 1715, 692, 692, 692, 692, 1260, 1367, 1248, 0, 1191, 1191, 1191, 1191, 692, 1598, 1385, 1385, 1385, 1385, 1264, 1264, 1264, 1264, 1248, 1715, 0, 1598, 692, 1264, 1367, 1248, 1191, 1385, 1191, 1741, 1191, 1741, 692, 1598, 1623, 1623, 1623, 1623, 1264, 1308, 1308, 1308, 1308, 1623, 1598, 692, 702, 702, 702, 702, 1191, 702, 1191, 1741, 1191, 1741, 1308, 702, 702, 702, 702, 1743, 1264, 702, 702, 703, 703, 703, 703, 0, 703, 1193, 1193, 1193, 1193, 0, 703, 703, 703, 703, 1748, 1308, 703, 703, 1777, 1743, 1284, 1284, 1284, 1284, 0, 0, 1765, 1193, 0, 1193, 0, 0, 703, 1193, 0, 0, 1284, 0, 1748, 0, 0, 1777, 1285, 1285, 1285, 1285, 1363, 1363, 1363, 1363, 1765, 1193, 1597, 1193, 1284, 703, 705, 1193, 1285, 705, 705, 1597, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 1597, 1284, 1363, 1797, 0, 1285, 1363, 1807, 1597, 0, 1288, 1288, 1288, 1288, 1666, 1767, 1772, 1778, 1396, 1396, 1396, 1396, 705, 705, 1666, 1363, 1797, 1288, 1285, 1363, 1807, 1289, 1289, 1289, 1289, 1396, 0, 0, 1666, 1767, 1772, 1778, 0, 1288, 0, 705, 706, 1666, 1289, 706, 706, 0, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 1288, 1289, 1310, 1310, 1310, 1310, 1197, 1197, 1197, 1197, 1314, 1314, 1314, 1314, 1404, 1404, 1404, 1404, 0, 1310, 0, 0, 706, 706, 1289, 0, 1197, 1314, 1197, 0, 1197, 1404, 0, 1341, 1341, 1341, 1341, 0, 0, 1198, 1198, 1198, 1198, 1314, 1310, 706, 717, 717, 717, 717, 1197, 717, 1197, 1341, 1197, 717, 717, 717, 717, 717, 717, 1198, 717, 1198, 717, 1341, 1314, 1796, 1199, 1199, 1199, 1199, 1808, 1198, 717, 0, 0, 1341, 0, 0, 1376, 1376, 1376, 1376, 1833, 1198, 0, 1198, 1341, 0, 1199, 1796, 1199, 0, 1803, 1808, 1198, 1376, 717, 718, 718, 718, 718, 1376, 718, 1199, 0, 1833, 718, 718, 718, 718, 718, 718, 1199, 718, 1199, 718, 1803, 1315, 1315, 1315, 1315, 1781, 1781, 1781, 1781, 1376, 1199, 1292, 1292, 1292, 1292, 718, 0, 0, 1315, 1377, 1377, 1377, 1377, 1438, 1438, 1438, 1438, 0, 1292, 0, 1425, 1425, 1425, 1425, 0, 1292, 1377, 1315, 718, 720, 1438, 0, 720, 720, 0, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 1292, 1315, 1377, 1425, 1348, 1348, 1348, 1348, 1439, 1439, 1439, 1439, 0, 1349, 1349, 1349, 1349, 720, 0, 0, 1348, 0, 720, 720, 1439, 1439, 1425, 1348, 0, 1349, 0, 1403, 1403, 1403, 1403, 1507, 1507, 1507, 1507, 0, 720, 1332, 1332, 1332, 1332, 720, 721, 1349, 1403, 721, 721, 1348, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 1612, 1332, 0, 1507, 1349, 0, 0, 1403, 0, 1672, 1332, 1672, 1612, 1332, 721, 1368, 1368, 1368, 1368, 0, 0, 0, 721, 721, 1612, 1332, 1507, 1477, 1477, 1477, 1477, 1368, 1672, 1332, 1672, 1612, 1332, 721, 0, 0, 1333, 1333, 1333, 1333, 1477, 721, 722, 0, 1368, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 1333, 1434, 1434, 1434, 1434, 1368, 1681, 1670, 0, 1333, 1333, 1470, 1470, 1470, 1470, 722, 1681, 1434, 1545, 1545, 1545, 1545, 722, 722, 1333, 1670, 0, 1470, 1470, 0, 1681, 1670, 1333, 1333, 1545, 1545, 0, 0, 722, 1681, 0, 0, 0, 1434, 0, 722, 723, 0, 1670, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 1251, 1251, 1251, 1251, 723, 1326, 1326, 1326, 1326, 1251, 1680, 0, 1593, 1251, 1326, 1593, 1268, 1268, 1268, 1268, 1836, 1680, 723, 723, 0, 0, 1251, 0, 723, 1268, 1742, 1326, 1593, 1268, 1680, 1251, 1374, 1374, 1374, 1374, 1326, 1742, 1268, 1836, 1680, 723, 726, 726, 726, 726, 1251, 1268, 726, 1374, 1742, 1326, 1593, 726, 1251, 726, 1837, 1374, 0, 1326, 1742, 726, 1268, 1269, 1269, 1269, 1269, 1374, 726, 0, 1268, 0, 1276, 1276, 1276, 1276, 1269, 726, 0, 1837, 1269, 1374, 1270, 1270, 1270, 1270, 0, 0, 0, 1269, 1374, 0, 726, 0, 1276, 1270, 1276, 0, 1269, 1270, 726, 727, 727, 727, 727, 0, 0, 0, 1270, 1474, 1474, 1474, 1474, 1269, 727, 1707, 0, 1270, 1276, 1707, 1276, 1269, 1279, 1279, 1279, 1279, 1474, 727, 1277, 1277, 1277, 1277, 1270, 0, 727, 0, 727, 0, 0, 1707, 1270, 1711, 0, 1707, 1279, 1711, 1279, 0, 1474, 0, 1277, 727, 1277, 1281, 1281, 1281, 1281, 727, 0, 727, 728, 728, 728, 728, 0, 1711, 0, 1277, 1279, 1711, 1279, 1474, 0, 728, 1277, 1281, 1277, 1281, 1283, 1283, 1283, 1283, 1371, 1371, 1371, 1371, 728, 0, 1281, 0, 1277, 1570, 1570, 1570, 1570, 728, 728, 0, 1371, 1281, 1283, 1281, 1283, 1371, 1325, 1325, 1325, 1325, 0, 0, 728, 1281, 0, 1325, 0, 1283, 0, 1325, 728, 728, 729, 729, 729, 729, 1283, 1570, 1283, 1371, 0, 0, 1325, 0, 0, 729, 1327, 1327, 1327, 1327, 1283, 1325, 1331, 1331, 1331, 1331, 0, 0, 729, 1327, 1570, 1369, 1369, 1369, 1369, 729, 1325, 729, 729, 0, 0, 0, 1327, 0, 1325, 1736, 1331, 1369, 1331, 1736, 0, 1327, 729, 1494, 1494, 1494, 1494, 1331, 729, 0, 729, 729, 731, 731, 731, 731, 1327, 1369, 0, 1736, 1331, 0, 1331, 1736, 1327, 731, 1435, 1435, 1435, 1435, 1331, 1334, 1334, 1334, 1334, 1494, 0, 0, 731, 0, 1369, 1769, 1435, 1373, 1373, 1373, 1373, 731, 1342, 1342, 1342, 1342, 1769, 731, 0, 0, 0, 1334, 1494, 0, 1373, 1342, 731, 1334, 0, 1769, 1334, 1373, 1435, 1702, 731, 0, 0, 0, 1342, 1769, 731, 733, 733, 733, 733, 1334, 1702, 1342, 1716, 0, 1334, 1716, 0, 1334, 733, 1373, 0, 1702, 1475, 1475, 1475, 1475, 1342, 1486, 1486, 1486, 1486, 733, 0, 1702, 1342, 1716, 0, 733, 1716, 1475, 733, 0, 0, 0, 1343, 1343, 1343, 1343, 1486, 0, 0, 1539, 1539, 1539, 1539, 733, 0, 1343, 1475, 0, 733, 0, 0, 733, 739, 739, 739, 739, 0, 739, 1343, 1539, 1486, 739, 739, 739, 739, 739, 739, 1343, 739, 1475, 739, 0, 1344, 1344, 1344, 1344, 739, 0, 1436, 1436, 1436, 1436, 1343, 1539, 0, 1344, 0, 1436, 1436, 0, 1343, 0, 1436, 0, 1436, 0, 0, 1662, 1344, 0, 739, 740, 740, 740, 740, 0, 740, 1344, 0, 1662, 740, 740, 740, 740, 740, 740, 0, 740, 0, 740, 1436, 1662, 1344, 0, 0, 1463, 1463, 1463, 1463, 0, 1344, 0, 1662, 1719, 1463, 0, 1719, 0, 0, 0, 740, 1402, 1402, 1402, 1402, 1463, 1468, 1468, 1468, 1468, 0, 1365, 1365, 1365, 1365, 1468, 1719, 0, 1402, 1719, 1365, 0, 0, 740, 747, 1402, 1468, 747, 747, 1463, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 0, 1365, 0, 1365, 0, 1402, 1468, 0, 1584, 1584, 1584, 1584, 1684, 1684, 1684, 1684, 0, 0, 747, 0, 0, 1684, 747, 747, 1365, 1584, 1365, 1471, 1471, 1471, 1471, 1489, 1489, 1489, 1489, 1784, 1784, 1784, 1784, 0, 0, 747, 0, 1471, 1471, 747, 748, 0, 1489, 748, 748, 1471, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, 0, 1489, 748, 1479, 1479, 1479, 1479, 0, 0, 1471, 0, 1440, 1440, 1440, 1440, 1546, 1546, 1546, 1546, 0, 1479, 0, 748, 748, 1489, 0, 748, 1440, 1440, 0, 0, 1546, 1546, 1440, 1818, 1818, 1818, 1818, 1479, 0, 1714, 1417, 1417, 1417, 1417, 748, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 1714, 1440, 773, 773, 773, 1479, 0, 773, 1714, 773, 773, 1417, 1705, 773, 1740, 773, 0, 773, 1740, 0, 1417, 1417, 0, 1714, 1705, 0, 773, 0, 1488, 1488, 1488, 1488, 0, 773, 0, 1417, 1705, 773, 1740, 773, 0, 773, 1740, 1417, 1417, 1488, 0, 1705, 0, 773, 0, 0, 1418, 1418, 1418, 1418, 773, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 1488, 0, 775, 775, 775, 0, 0, 775, 0, 775, 775, 1418, 0, 1473, 1473, 1473, 1473, 1418, 0, 0, 1418, 0, 0, 1488, 0, 1518, 1518, 1518, 1518, 1473, 1473, 0, 0, 775, 0, 1418, 1503, 1503, 1503, 1503, 1418, 1518, 1518, 1418, 1473, 1571, 1571, 1571, 1571, 1518, 1845, 1845, 1845, 1845, 0, 0, 775, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 1473, 1503, 776, 776, 776, 0, 1518, 776, 1600, 776, 776, 0, 1571, 776, 1768, 776, 1768, 776, 1419, 1419, 1419, 1419, 1600, 0, 1503, 0, 776, 0, 1501, 1501, 1501, 1501, 1600, 776, 0, 1571, 0, 776, 1768, 776, 1768, 776, 0, 0, 1419, 1600, 1419, 0, 0, 776, 0, 0, 0, 1419, 1501, 0, 776, 781, 781, 781, 781, 0, 0, 1501, 1510, 1510, 1510, 1510, 1419, 0, 1419, 0, 1420, 1420, 1420, 1420, 1419, 0, 1501, 781, 1510, 781, 1642, 1642, 1642, 1642, 1501, 1575, 1575, 1575, 1575, 781, 781, 1511, 1511, 1511, 1511, 0, 1420, 1642, 0, 0, 0, 781, 1420, 781, 1510, 1420, 0, 1511, 1421, 1421, 1421, 1421, 781, 781, 782, 782, 782, 782, 0, 1575, 1420, 0, 0, 1492, 0, 1420, 1492, 0, 1420, 1422, 1422, 1422, 1422, 1511, 1421, 0, 782, 0, 782, 0, 1421, 0, 1575, 1421, 0, 1492, 0, 782, 0, 782, 0, 1521, 1521, 1521, 1521, 1422, 0, 1492, 1421, 1492, 782, 1422, 782, 1421, 1422, 0, 1421, 0, 0, 1492, 782, 0, 782, 784, 784, 784, 784, 0, 0, 1422, 1492, 0, 1492, 1521, 1422, 0, 1657, 1422, 0, 0, 0, 1696, 1696, 1696, 1696, 784, 0, 784, 0, 0, 1657, 0, 1423, 1423, 1423, 1423, 1521, 784, 784, 784, 1657, 0, 1428, 1428, 1428, 1428, 1696, 0, 0, 784, 0, 784, 1423, 1657, 0, 1428, 0, 0, 1423, 0, 784, 784, 784, 786, 786, 786, 786, 1423, 1428, 0, 1696, 0, 1513, 1513, 1513, 1513, 1423, 1428, 1515, 1515, 1515, 1515, 1423, 1429, 1429, 1429, 1429, 1661, 786, 1513, 1423, 786, 1428, 1513, 1515, 1515, 1429, 0, 786, 1515, 1428, 1661, 786, 0, 0, 1643, 1643, 1643, 1643, 1429, 0, 1661, 786, 0, 1513, 786, 0, 1513, 1429, 0, 1515, 786, 1643, 1515, 1661, 786, 803, 803, 803, 803, 0, 803, 0, 1429, 0, 0, 0, 803, 803, 803, 803, 1429, 0, 803, 803, 0, 0, 0, 803, 1509, 1509, 1509, 1509, 0, 1431, 1431, 1431, 1431, 1509, 1509, 0, 1556, 1556, 1556, 1556, 1509, 0, 1431, 1432, 1432, 1432, 1432, 803, 804, 804, 804, 804, 0, 804, 1524, 1431, 1432, 1524, 1509, 804, 804, 804, 804, 0, 1431, 804, 804, 0, 0, 1432, 0, 1556, 1556, 0, 1524, 0, 1524, 0, 1432, 1431, 0, 1509, 1647, 1647, 1647, 1647, 804, 1431, 1721, 1721, 1721, 1721, 0, 1432, 1556, 1556, 0, 1721, 1524, 1647, 1524, 1432, 0, 0, 1445, 1445, 1445, 1445, 0, 804, 806, 806, 806, 806, 806, 0, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 806, 1445, 1773, 1773, 1773, 1773, 0, 1445, 0, 0, 1445, 1773, 1805, 1805, 1805, 1805, 0, 1495, 1495, 1495, 1495, 1805, 0, 806, 806, 1445, 1512, 1512, 1512, 1512, 1445, 0, 0, 1445, 0, 1512, 1512, 0, 0, 0, 1512, 0, 1512, 1495, 0, 1495, 806, 807, 807, 807, 807, 807, 1495, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 1495, 1512, 1495, 1587, 1587, 1587, 1587, 0, 1495, 0, 0, 0, 1587, 1587, 1609, 1609, 1609, 1609, 0, 1587, 1587, 0, 807, 807, 1731, 1731, 1731, 1731, 0, 0, 1609, 1609, 0, 1731, 0, 1453, 1453, 1453, 1453, 0, 1731, 1496, 1496, 1496, 1496, 807, 816, 816, 1453, 816, 816, 816, 816, 816, 816, 816, 816, 816, 816, 816, 816, 1453, 0, 816, 816, 816, 816, 1496, 1675, 0, 1453, 0, 0, 1496, 0, 0, 1496, 1581, 1581, 1581, 1581, 816, 1675, 0, 1675, 1453, 0, 0, 0, 816, 0, 1496, 1675, 1453, 0, 0, 1496, 0, 0, 1496, 1829, 1829, 1829, 1829, 816, 1675, 0, 1675, 0, 1829, 0, 1581, 816, 817, 817, 0, 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, 0, 0, 817, 817, 817, 817, 1581, 0, 0, 1454, 1454, 1454, 1454, 1558, 1558, 1558, 1558, 0, 1568, 1568, 1568, 1568, 1454, 0, 817, 0, 0, 1568, 817, 1698, 1698, 1698, 1698, 0, 0, 1454, 1455, 1455, 1455, 1455, 1569, 1569, 1569, 1569, 1454, 1558, 1698, 817, 0, 1455, 1568, 817, 824, 824, 824, 824, 0, 824, 0, 1454, 0, 0, 1455, 824, 824, 824, 824, 1454, 1558, 824, 824, 1455, 1569, 1568, 824, 1506, 1506, 1506, 1506, 1456, 1456, 1456, 1456, 0, 1506, 0, 1455, 1758, 1758, 1758, 1758, 0, 1456, 0, 1455, 1569, 1758, 1758, 824, 825, 825, 825, 825, 1758, 825, 1456, 0, 1506, 0, 1506, 825, 825, 825, 825, 1456, 0, 825, 825, 0, 0, 0, 825, 1648, 1648, 1648, 1648, 0, 0, 0, 1456, 1506, 0, 1506, 1855, 1855, 1855, 1855, 1456, 1648, 1648, 1526, 1526, 1526, 1526, 0, 825, 826, 826, 826, 826, 826, 0, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 1526, 0, 0, 0, 1649, 1649, 1649, 1649, 0, 1526, 1576, 1576, 1576, 1576, 0, 0, 1461, 1461, 1461, 1461, 1649, 1649, 826, 826, 1526, 1461, 1576, 0, 0, 1461, 0, 0, 1526, 0, 1835, 1835, 1835, 1835, 1622, 1622, 1622, 1622, 1461, 0, 1576, 826, 827, 827, 827, 827, 827, 1461, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 1461, 1576, 0, 0, 1622, 1835, 0, 0, 1461, 0, 1577, 1577, 1577, 1577, 0, 0, 1462, 1462, 1462, 1462, 0, 0, 827, 827, 0, 1462, 1577, 1622, 1835, 1462, 0, 1589, 1589, 1589, 1589, 0, 0, 1604, 1604, 1604, 1604, 0, 1462, 0, 1577, 827, 835, 1589, 1589, 835, 835, 1462, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 1462, 1577, 1589, 1604, 1650, 1650, 1650, 1650, 1462, 1604, 0, 0, 0, 1626, 1626, 1626, 1626, 0, 835, 0, 1650, 1650, 835, 835, 0, 1589, 1604, 1516, 1516, 1516, 1516, 0, 1604, 1621, 1621, 1621, 1621, 1627, 1627, 1627, 1627, 835, 1621, 1516, 1516, 835, 836, 1626, 1516, 836, 836, 0, 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, 0, 1621, 836, 1516, 1626, 1627, 1516, 0, 1729, 1729, 1729, 1729, 0, 1578, 1578, 1578, 1578, 0, 1843, 1843, 1843, 1843, 836, 836, 1621, 1729, 836, 1843, 1627, 1578, 1578, 0, 0, 0, 1631, 1631, 1631, 1631, 0, 0, 1497, 1497, 1497, 1497, 0, 836, 837, 1578, 0, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 1497, 0, 1631, 0, 1578, 0, 1497, 0, 0, 1497, 1651, 1651, 1651, 1651, 837, 0, 0, 0, 0, 1651, 1651, 0, 837, 837, 1497, 1631, 1651, 1651, 0, 1497, 0, 0, 1497, 1844, 1844, 1844, 1844, 837, 1776, 1776, 1776, 1776, 1844, 0, 0, 837, 838, 1776, 0, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 1466, 1466, 1466, 1466, 1527, 1527, 1527, 1527, 0, 1466, 1776, 0, 0, 1466, 0, 0, 0, 838, 1467, 1467, 1467, 1467, 838, 838, 0, 0, 1466, 1467, 0, 0, 1527, 1467, 0, 1776, 0, 1466, 0, 0, 0, 1527, 838, 0, 0, 0, 1467, 838, 844, 844, 844, 844, 1466, 0, 844, 1467, 1527, 0, 0, 844, 1466, 844, 0, 0, 1527, 0, 0, 844, 0, 0, 1467, 0, 0, 0, 844, 0, 0, 0, 1467, 1478, 1478, 1478, 1478, 844, 0, 0, 1498, 1498, 1498, 1498, 1561, 1561, 1561, 1561, 0, 0, 1478, 0, 844, 0, 1500, 1500, 1500, 1500, 1478, 0, 844, 845, 845, 845, 845, 0, 1498, 0, 1478, 0, 1561, 0, 1498, 0, 845, 1498, 1500, 0, 0, 1561, 1500, 0, 1478, 0, 0, 845, 0, 845, 0, 1500, 1498, 1478, 0, 0, 1561, 1498, 845, 0, 1498, 0, 1500, 0, 1561, 0, 1500, 1632, 1632, 1632, 1632, 845, 0, 845, 1500, 0, 1499, 1499, 1499, 1499, 0, 845, 846, 846, 846, 846, 0, 1523, 1523, 1523, 1523, 0, 0, 0, 0, 846, 1499, 0, 0, 0, 1523, 1632, 1499, 0, 1523, 0, 0, 1733, 846, 0, 1733, 1499, 0, 1523, 0, 0, 846, 846, 0, 0, 1499, 0, 1523, 0, 1632, 0, 1499, 1733, 0, 1733, 0, 0, 846, 0, 1499, 0, 0, 1523, 0, 846, 846, 847, 847, 847, 847, 1523, 1540, 1540, 1540, 1540, 0, 1733, 0, 1733, 847, 1540, 0, 0, 0, 1540, 1542, 1542, 1542, 1542, 0, 847, 0, 847, 0, 1542, 0, 0, 1540, 1542, 0, 0, 847, 1585, 1585, 1585, 1585, 1540, 1636, 1636, 1636, 1636, 1542, 0, 0, 847, 0, 847, 0, 0, 1585, 1542, 1540, 0, 0, 847, 848, 848, 848, 848, 1540, 1548, 1548, 1548, 1548, 0, 1542, 1585, 0, 848, 0, 0, 1636, 0, 1542, 0, 0, 1548, 1548, 0, 0, 0, 848, 0, 0, 1548, 0, 0, 0, 0, 1585, 848, 0, 0, 848, 1636, 0, 0, 1549, 1549, 1549, 1549, 1560, 1560, 1560, 1560, 848, 0, 0, 1548, 1629, 1629, 1629, 1629, 848, 1549, 0, 848, 849, 849, 849, 849, 0, 0, 1560, 0, 1629, 1629, 1560, 0, 0, 849, 1549, 0, 1549, 1629, 0, 1560, 1562, 1562, 1562, 1562, 849, 0, 849, 0, 0, 0, 1560, 0, 0, 0, 1560, 849, 0, 1549, 0, 1549, 0, 1629, 1560, 0, 0, 0, 1562, 0, 849, 0, 849, 0, 1562, 0, 0, 1562, 0, 0, 849, 850, 850, 850, 850, 1572, 1572, 1572, 1572, 0, 0, 0, 1562, 0, 850, 0, 0, 1562, 0, 0, 1562, 1678, 1678, 1678, 1678, 850, 0, 850, 0, 0, 1572, 0, 1579, 1579, 1579, 1579, 850, 1678, 1678, 1572, 850, 1579, 1579, 0, 1690, 1690, 1690, 1690, 1579, 850, 0, 850, 0, 0, 1572, 1683, 1683, 1683, 1683, 850, 1690, 1690, 1572, 850, 864, 0, 1579, 864, 864, 0, 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, 0, 0, 0, 1683, 0, 1579, 0, 0, 0, 0, 1610, 1610, 1610, 1610, 0, 864, 1566, 1566, 1566, 1566, 0, 0, 864, 864, 0, 1566, 1683, 1610, 0, 1566, 0, 1653, 1653, 1653, 1653, 0, 0, 0, 864, 0, 0, 0, 1566, 0, 1610, 864, 865, 1653, 1653, 865, 865, 1566, 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, 1566, 1610, 1653, 0, 865, 0, 0, 0, 1566, 0, 1679, 1679, 1679, 1679, 0, 0, 0, 1567, 1567, 1567, 1567, 0, 865, 865, 0, 1653, 1567, 1679, 865, 0, 1567, 0, 1679, 1607, 1607, 1607, 1607, 1644, 1644, 1644, 1644, 0, 0, 1567, 0, 865, 871, 871, 871, 871, 0, 0, 1567, 1607, 1644, 0, 1679, 0, 0, 0, 1644, 0, 0, 1583, 1583, 1583, 1583, 1567, 1607, 0, 0, 871, 1583, 1583, 871, 1567, 0, 1607, 0, 1583, 871, 871, 0, 0, 1644, 0, 0, 1687, 1687, 1687, 1687, 1607, 0, 0, 0, 871, 0, 1583, 871, 1697, 1697, 1697, 1697, 871, 871, 887, 887, 887, 887, 887, 887, 887, 887, 887, 887, 0, 1697, 887, 887, 887, 1583, 1687, 887, 0, 887, 887, 0, 0, 887, 0, 887, 0, 887, 1588, 1588, 1588, 1588, 0, 0, 0, 1697, 887, 1588, 1588, 1687, 0, 0, 0, 887, 1588, 1588, 0, 887, 0, 887, 0, 887, 0, 0, 1692, 1692, 1692, 1692, 1697, 887, 0, 0, 1588, 0, 0, 0, 887, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 0, 0, 888, 888, 888, 0, 0, 888, 1588, 888, 888, 1692, 0, 888, 0, 888, 0, 888, 1605, 1605, 1605, 1605, 1713, 1713, 1713, 1713, 888, 1755, 1755, 1755, 1755, 1605, 0, 888, 1692, 0, 0, 888, 0, 888, 0, 888, 0, 1755, 1605, 0, 0, 0, 0, 888, 0, 0, 0, 1605, 1713, 0, 888, 895, 895, 895, 895, 1606, 1606, 1606, 1606, 0, 0, 0, 1605, 1755, 1637, 1637, 1637, 1637, 1606, 0, 1605, 1713, 0, 895, 0, 895, 1725, 1725, 1725, 1725, 1637, 1606, 0, 895, 895, 1616, 1616, 1616, 1616, 0, 1606, 0, 1725, 1725, 1616, 0, 0, 895, 1637, 895, 1633, 1633, 1633, 1633, 0, 1606, 895, 895, 898, 898, 898, 898, 0, 1606, 0, 0, 0, 1616, 0, 1616, 0, 1637, 0, 0, 0, 1633, 1618, 1618, 1618, 1618, 898, 0, 898, 0, 1633, 1618, 0, 0, 0, 0, 1616, 0, 1616, 0, 898, 898, 0, 0, 0, 1633, 0, 0, 1618, 0, 898, 0, 898, 1633, 0, 0, 0, 1618, 1638, 1638, 1638, 1638, 0, 898, 898, 917, 917, 917, 917, 0, 917, 0, 1618, 0, 1638, 0, 917, 917, 917, 917, 1618, 0, 917, 917, 1619, 1619, 1619, 1619, 1663, 1663, 1663, 1663, 1638, 1619, 0, 0, 0, 1639, 1639, 1639, 1639, 0, 0, 917, 0, 1756, 1756, 1756, 1756, 0, 1619, 0, 1663, 1639, 1639, 1638, 0, 0, 0, 1619, 1663, 1756, 0, 0, 0, 0, 917, 918, 918, 918, 918, 1639, 918, 0, 1619, 0, 1663, 0, 918, 918, 918, 918, 1619, 1663, 918, 918, 0, 1756, 0, 0, 1640, 1640, 1640, 1640, 1639, 1652, 1652, 1652, 1652, 1640, 1640, 0, 918, 0, 1652, 1652, 1640, 1693, 1693, 1693, 1693, 1652, 1652, 0, 1723, 1723, 1723, 1723, 1652, 1669, 1669, 1669, 1669, 0, 1640, 918, 927, 927, 0, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, 1693, 1652, 927, 927, 927, 927, 1640, 1723, 0, 0, 1669, 0, 0, 0, 0, 1723, 1669, 0, 1701, 1701, 1701, 1701, 927, 1693, 0, 0, 0, 1701, 927, 0, 1723, 0, 0, 1669, 1701, 1701, 0, 0, 0, 1669, 0, 1655, 1655, 1655, 1655, 927, 0, 0, 0, 0, 1655, 927, 928, 928, 0, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, 1655, 0, 928, 928, 928, 928, 0, 0, 0, 1655, 1685, 1685, 1685, 1685, 1718, 1718, 1718, 1718, 0, 1685, 0, 0, 0, 928, 1655, 0, 0, 0, 928, 0, 0, 1718, 1655, 0, 0, 0, 1685, 0, 1718, 1760, 1760, 1760, 1760, 0, 0, 1685, 928, 1674, 1674, 1674, 1674, 928, 935, 935, 935, 935, 1760, 935, 0, 0, 1685, 0, 1718, 935, 935, 935, 935, 1674, 1685, 935, 935, 1656, 1656, 1656, 1656, 1735, 1735, 1735, 1735, 0, 0, 1760, 1674, 0, 1656, 0, 0, 0, 1656, 0, 935, 1674, 0, 1695, 1695, 1695, 1695, 1656, 1671, 1671, 1671, 1671, 0, 0, 0, 1674, 1656, 1735, 0, 1695, 1695, 1671, 0, 935, 936, 936, 936, 936, 1695, 936, 0, 1656, 0, 0, 1671, 936, 936, 936, 936, 1656, 1735, 936, 936, 1671, 1673, 1673, 1673, 1673, 936, 0, 0, 0, 1695, 1726, 1726, 1726, 1726, 1673, 1671, 0, 0, 0, 1686, 1686, 1686, 1686, 1671, 0, 0, 1726, 1673, 1686, 936, 949, 949, 949, 949, 0, 0, 1673, 0, 0, 1706, 1706, 1706, 1706, 949, 1726, 1686, 1744, 1744, 1744, 1744, 0, 1673, 1726, 0, 1686, 0, 949, 0, 0, 1673, 0, 0, 0, 1706, 0, 949, 949, 1726, 0, 1686, 0, 1706, 1779, 1779, 1779, 1779, 0, 1686, 1744, 0, 949, 0, 0, 1708, 1708, 1708, 1708, 1706, 949, 949, 950, 950, 950, 950, 1706, 1700, 1700, 1700, 1700, 0, 1779, 1744, 0, 950, 1700, 1700, 0, 0, 0, 1708, 0, 1700, 1700, 0, 0, 1708, 950, 0, 1708, 0, 0, 0, 950, 0, 1779, 950, 0, 0, 1709, 1709, 1709, 1709, 0, 1708, 0, 0, 1700, 0, 1708, 0, 950, 1708, 0, 0, 0, 950, 0, 0, 950, 957, 957, 957, 957, 0, 1709, 0, 0, 0, 0, 1700, 1709, 0, 957, 1709, 1710, 1710, 1710, 1710, 1766, 1766, 1766, 1766, 0, 957, 0, 957, 0, 0, 1709, 1727, 1727, 1727, 1727, 1709, 957, 0, 1709, 0, 1710, 1732, 1732, 1732, 1732, 0, 0, 1727, 1710, 957, 1732, 957, 1766, 1749, 1749, 1749, 1749, 1732, 1732, 957, 961, 961, 961, 961, 1710, 1727, 0, 0, 0, 961, 1749, 1710, 0, 1727, 0, 1766, 1730, 1730, 1730, 1730, 1737, 1737, 1737, 1737, 961, 1730, 1730, 0, 1727, 0, 1749, 0, 1730, 1730, 961, 1739, 1739, 1739, 1739, 961, 0, 0, 1738, 1738, 1738, 1738, 1737, 0, 961, 0, 0, 0, 1737, 1749, 0, 1737, 0, 961, 0, 1739, 0, 0, 961, 1041, 1041, 1041, 1041, 1739, 1738, 0, 1737, 0, 0, 0, 1738, 1737, 1041, 1738, 1737, 1745, 1745, 1745, 1745, 1739, 1752, 1752, 1752, 1752, 0, 1041, 1739, 1041, 1738, 1851, 1851, 1851, 1851, 1738, 1041, 0, 1738, 0, 1851, 1747, 1747, 1747, 1747, 0, 0, 1752, 0, 1745, 1747, 1041, 0, 1041, 0, 1745, 0, 0, 0, 1041, 1042, 1042, 1042, 1042, 0, 0, 0, 1757, 1757, 1757, 1757, 1752, 1745, 1042, 0, 1747, 1757, 1757, 1745, 1747, 0, 1757, 0, 1757, 0, 0, 1042, 1759, 1759, 1759, 1759, 0, 1042, 0, 0, 1042, 1759, 1759, 1747, 0, 0, 0, 1747, 1759, 0, 1809, 1809, 1809, 1809, 1757, 1042, 0, 1759, 0, 0, 1042, 0, 0, 1042, 1044, 1044, 1044, 1044, 0, 1761, 1761, 1761, 1761, 1764, 1764, 1764, 1764, 1044, 1809, 0, 0, 1759, 1764, 0, 1044, 1761, 1761, 0, 0, 1764, 1044, 0, 1809, 1762, 1762, 1762, 1762, 0, 0, 1044, 0, 0, 1809, 1763, 1763, 1763, 1763, 0, 1044, 1762, 1762, 1761, 1763, 1763, 1044, 0, 0, 1763, 0, 1763, 1763, 0, 1044, 1049, 1049, 1049, 1049, 0, 0, 0, 0, 1770, 1770, 1770, 1770, 1762, 1049, 1852, 1852, 1852, 1852, 1771, 1771, 1771, 1771, 1763, 1852, 1049, 0, 1049, 1771, 1791, 1791, 1791, 1791, 1770, 0, 0, 1049, 0, 1791, 1791, 0, 1770, 0, 1771, 0, 1791, 0, 0, 0, 1049, 0, 1049, 0, 1771, 0, 0, 0, 1770, 0, 1049, 1092, 1092, 1092, 1092, 1770, 0, 0, 1771, 0, 1802, 1802, 1802, 1802, 1092, 0, 0, 1771, 1092, 1802, 1774, 1774, 1774, 1774, 0, 1092, 0, 1092, 0, 1774, 0, 0, 0, 1774, 1802, 0, 1092, 0, 0, 1775, 1775, 1775, 1775, 0, 0, 0, 1774, 0, 1775, 1092, 0, 1092, 1775, 0, 0, 1774, 0, 0, 1802, 1092, 1093, 1093, 1093, 1093, 0, 1775, 1792, 1792, 1792, 1792, 1774, 0, 0, 1093, 1775, 1792, 1792, 1093, 1774, 0, 0, 0, 1792, 0, 0, 0, 1093, 0, 0, 1775, 1795, 1795, 1795, 1795, 1093, 1093, 0, 1775, 0, 1795, 1795, 1815, 1815, 1815, 1815, 0, 1795, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 1093, 1093, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1815, 1125, 1125, 1125, 1125, 1788, 1788, 1788, 1788, 1789, 1789, 1789, 1789, 1790, 1790, 1790, 1790, 0, 0, 0, 0, 1788, 0, 1815, 0, 1789, 0, 1125, 0, 1790, 1790, 0, 0, 1788, 0, 0, 0, 1789, 0, 0, 0, 1790, 0, 1798, 1798, 1798, 1798, 0, 0, 0, 1125, 1148, 1148, 1148, 1148, 0, 0, 1788, 0, 0, 0, 1789, 0, 0, 1148, 1790, 0, 1798, 0, 1799, 1799, 1799, 1799, 1148, 0, 1798, 0, 1148, 1799, 0, 1800, 1800, 1800, 1800, 0, 0, 1148, 0, 0, 1800, 0, 1798, 0, 1799, 0, 0, 0, 1148, 1798, 0, 0, 1148, 0, 1799, 0, 0, 1800, 0, 0, 1148, 1187, 1187, 1187, 1187, 0, 1800, 1187, 1799, 0, 0, 0, 1187, 0, 1187, 0, 0, 1799, 1187, 0, 1187, 1800, 1801, 1801, 1801, 1801, 0, 1187, 0, 1800, 0, 1801, 1804, 1804, 1804, 1804, 1187, 1810, 1810, 1810, 1810, 0, 1811, 1811, 1811, 1811, 0, 0, 1801, 0, 0, 1187, 0, 1828, 1828, 1828, 1828, 1801, 0, 1187, 1188, 1188, 1188, 1188, 1804, 1810, 1816, 1816, 1816, 1816, 1811, 0, 1801, 1188, 0, 0, 0, 1188, 0, 0, 1801, 1817, 1817, 1817, 1817, 1828, 1188, 1804, 0, 1810, 0, 0, 0, 1188, 1811, 1188, 1819, 1819, 1819, 1819, 1816, 1820, 1820, 1820, 1820, 0, 1817, 0, 1828, 0, 1188, 0, 1819, 1819, 0, 1817, 1188, 1820, 1188, 1189, 1189, 1189, 1189, 1816, 1821, 1821, 1821, 1821, 0, 1820, 1817, 0, 1189, 1819, 0, 0, 1189, 0, 1817, 0, 1821, 0, 0, 1820, 0, 1189, 0, 0, 1827, 1827, 1827, 1827, 1821, 1820, 1189, 1189, 1819, 1827, 1827, 1830, 1830, 1830, 1830, 0, 1827, 0, 1821, 0, 1830, 1189, 0, 0, 0, 0, 0, 0, 1821, 1189, 1189, 1190, 1190, 1190, 1190, 0, 0, 1830, 0, 1831, 1831, 1831, 1831, 0, 0, 0, 1830, 0, 1831, 1838, 1838, 1838, 1838, 1190, 0, 1190, 0, 1832, 1832, 1832, 1832, 1830, 0, 0, 1190, 1831, 1832, 1190, 0, 1830, 1839, 1839, 1839, 1839, 1831, 0, 0, 1190, 0, 1190, 0, 1832, 0, 1838, 0, 0, 0, 1190, 0, 1831, 1190, 1194, 1194, 1194, 1194, 0, 0, 1831, 1839, 1841, 1841, 1841, 1841, 0, 1194, 1832, 1838, 0, 1840, 1840, 1840, 1840, 0, 0, 0, 1841, 1841, 1194, 1842, 1842, 1842, 1842, 1839, 1194, 0, 0, 1194, 1842, 1842, 0, 1849, 1849, 1849, 1849, 1842, 0, 1840, 0, 0, 0, 0, 1194, 1840, 0, 0, 0, 1194, 0, 0, 1194, 1195, 1195, 1195, 1195, 0, 1842, 0, 0, 0, 0, 1840, 0, 0, 1195, 1849, 1840, 0, 1849, 0, 0, 1850, 1850, 1850, 1850, 0, 0, 1195, 0, 1842, 1850, 1850, 0, 1195, 0, 0, 1195, 1850, 1849, 0, 0, 1849, 1856, 1856, 1856, 1856, 0, 0, 0, 0, 0, 1195, 0, 0, 0, 0, 1195, 0, 0, 1195, 1213, 1213, 1213, 1213, 0, 1213, 0, 0, 0, 0, 0, 1213, 1213, 1213, 1213, 1213, 1856, 1213, 1213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1857, 1857, 1857, 1857, 0, 0, 0, 1856, 0, 0, 1213, 1213, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1857, 1215, 1215, 1215, 1215, 0, 1857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1857, 0, 0, 1215, 0, 1857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1215, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 0, 1218, 1218, 1218, 1218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1218, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 0, 1220, 1220, 1220, 1220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1220, 1234, 1234, 1234, 1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234, 0, 0, 0, 0, 0, 1234, 0, 0, 1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234, 0, 0, 0, 0, 1234, 0, 0, 1234, 1235, 1235, 1235, 1235, 0, 0, 0, 0, 0, 1235, 0, 0, 0, 1235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1235, 0, 0, 0, 0, 0, 0, 0, 1235, 1235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1235, 0, 0, 0, 0, 0, 0, 1235, 1235, 1271, 1271, 1271, 1271, 0, 0, 1271, 0, 0, 0, 0, 1271, 0, 1271, 0, 0, 0, 1271, 0, 1271, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1271, 0, 0, 0, 0, 0, 0, 0, 1271, 1272, 1272, 1272, 1272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 0, 1272, 0, 1272, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 1272, 0, 0, 0, 0, 0, 0, 0, 1272, 1273, 1273, 1273, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 0, 0, 0, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 0, 0, 0, 0, 0, 0, 0, 1273, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1273, 0, 0, 0, 0, 0, 0, 1273, 1273, 1274, 1274, 1274, 1274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1274, 0, 0, 0, 1274, 0, 0, 0, 0, 0, 0, 1274, 0, 1274, 0, 0, 0, 0, 0, 0, 0, 0, 1274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1274, 0, 1274, 0, 0, 0, 0, 0, 0, 0, 1274, 1275, 1275, 1275, 1275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1275, 0, 0, 0, 1275, 0, 0, 0, 0, 0, 0, 0, 0, 1275, 0, 0, 0, 0, 0, 0, 0, 0, 1275, 0, 0, 1275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1275, 0, 0, 0, 0, 0, 0, 0, 1275, 0, 0, 1275, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 0, 0, 1278, 1278, 1278, 0, 0, 1278, 0, 1278, 1278, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 0, 1278, 0, 0, 0, 0, 0, 0, 1278, 1282, 1282, 1282, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1282, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 1282, 0, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1282, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 1282, 0, 0, 1282, 1293, 1293, 1293, 1293, 0, 0, 0, 0, 0, 0, 0, 1293, 1293, 1293, 0, 1293, 0, 1293, 1293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1293, 1293, 1294, 1294, 1294, 1294, 0, 1294, 0, 0, 0, 0, 0, 1294, 1294, 1294, 1294, 1294, 0, 1294, 1294, 0, 0, 0, 0, 0, 0, 1294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1294, 0, 0, 0, 0, 0, 0, 1294, 1294, 0, 0, 0, 0, 0, 1294, 0, 0, 0, 0, 0, 0, 0, 0, 1294, 1298, 1298, 1298, 1298, 0, 0, 0, 0, 0, 0, 0, 1298, 1298, 1298, 0, 1298, 0, 1298, 1298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1298, 1298, 1300, 1300, 1300, 1300, 0, 1300, 0, 0, 0, 0, 0, 1300, 1300, 1300, 1300, 1300, 0, 1300, 1300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1300, 1300, 1301, 0, 0, 1301, 1301, 0, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1301, 1301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1301, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 0, 1303, 1303, 1303, 1303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1303, 1311, 1311, 1311, 1311, 0, 0, 0, 0, 0, 0, 0, 1311, 1311, 1311, 0, 1311, 0, 1311, 1311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1311, 1311, 1313, 1313, 1313, 1313, 0, 1313, 0, 0, 0, 0, 0, 1313, 1313, 1313, 1313, 1313, 0, 1313, 1313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1313, 1313, 1316, 1316, 1316, 1316, 0, 1316, 0, 0, 0, 0, 0, 1316, 1316, 1316, 1316, 1316, 0, 1316, 1316, 0, 0, 0, 0, 0, 0, 1316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1316, 0, 0, 0, 0, 0, 0, 1316, 1316, 0, 0, 0, 0, 0, 1316, 0, 0, 0, 0, 0, 0, 0, 0, 1316, 1317, 1317, 1317, 1317, 0, 1317, 0, 0, 0, 0, 0, 1317, 1317, 1317, 1317, 0, 0, 1317, 1317, 0, 0, 0, 0, 0, 1317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1317, 1319, 0, 0, 1319, 1319, 0, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 0, 0, 0, 1319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1319, 1319, 0, 0, 0, 1319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1319, 1320, 1320, 1320, 1320, 1320, 0, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1320, 1320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1320, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1323, 0, 0, 0, 0, 0, 0, 1323, 1323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1323, 0, 0, 0, 0, 0, 0, 1323, 1328, 1328, 1328, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1328, 0, 0, 0, 0, 0, 0, 0, 1328, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1328, 0, 0, 0, 0, 0, 0, 1328, 1328, 1337, 1337, 1337, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1337, 0, 1337, 0, 0, 0, 0, 0, 0, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1337, 0, 1337, 0, 0, 0, 0, 0, 1337, 1338, 1338, 1338, 1338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1338, 0, 0, 0, 0, 0, 1338, 0, 0, 1338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1338, 0, 0, 0, 0, 1338, 0, 0, 1338, 1340, 1340, 1340, 1340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1340, 0, 0, 0, 0, 0, 1340, 0, 0, 1340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1340, 0, 0, 0, 0, 1340, 0, 0, 1340, 1345, 1345, 1345, 1345, 0, 1345, 0, 0, 0, 1345, 1345, 1345, 1345, 1345, 1345, 0, 1345, 0, 1345, 1346, 1346, 1346, 1346, 0, 1346, 0, 0, 0, 1346, 1346, 1346, 1346, 1346, 1346, 0, 1346, 0, 1346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1346, 1350, 1350, 1350, 1350, 1350, 0, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1350, 1350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1350, 1353, 1353, 1353, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 0, 0, 0, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 1353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 0, 0, 0, 1353, 1353, 1354, 1354, 1354, 1354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1354, 0, 0, 0, 1354, 0, 0, 0, 0, 0, 0, 0, 0, 1354, 0, 0, 0, 0, 0, 1354, 0, 0, 1354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1354, 0, 0, 0, 0, 1354, 0, 0, 1354, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 0, 0, 1355, 1355, 1355, 0, 0, 1355, 0, 1355, 1355, 0, 0, 0, 0, 0, 0, 1355, 0, 0, 0, 0, 0, 0, 1355, 0, 1355, 0, 0, 0, 0, 0, 0, 1355, 0, 0, 0, 0, 0, 0, 0, 1355, 0, 0, 0, 0, 0, 1355, 0, 1355, 0, 0, 0, 0, 0, 0, 1355, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 0, 0, 1356, 1356, 1356, 0, 0, 1356, 0, 1356, 1356, 0, 0, 0, 0, 0, 0, 1356, 0, 0, 0, 0, 0, 0, 0, 0, 1356, 1356, 0, 0, 0, 0, 0, 1356, 0, 0, 0, 0, 0, 0, 0, 1356, 0, 0, 0, 0, 0, 0, 0, 1356, 1356, 0, 0, 0, 0, 0, 1356, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 0, 0, 1357, 1357, 1357, 0, 0, 1357, 0, 1357, 1357, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0, 1357, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 0, 0, 1358, 1358, 1358, 0, 0, 1358, 0, 1358, 1358, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 0, 0, 0, 1358, 0, 0, 0, 0, 0, 0, 1358, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 0, 0, 1359, 1359, 1359, 0, 0, 1359, 0, 1359, 1359, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 1359, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 0, 0, 1360, 1360, 1360, 0, 0, 1360, 0, 1360, 1360, 0, 0, 0, 0, 0, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 0, 1360, 0, 0, 0, 0, 0, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 1360, 0, 0, 0, 0, 0, 0, 1360, 1372, 1372, 1372, 1372, 0, 0, 0, 0, 0, 0, 0, 1372, 1372, 1372, 0, 1372, 0, 1372, 1372, 0, 0, 0, 0, 0, 0, 1372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1372, 0, 0, 0, 0, 0, 0, 1372, 1372, 0, 0, 0, 0, 0, 1372, 0, 0, 0, 0, 0, 0, 0, 0, 1372, 1380, 1380, 1380, 1380, 0, 1380, 0, 0, 0, 0, 0, 1380, 1380, 1380, 1380, 0, 0, 1380, 1380, 1381, 1381, 1381, 1381, 0, 1381, 0, 0, 0, 0, 0, 1381, 1381, 1381, 1381, 0, 0, 1381, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1381, 1384, 1384, 1384, 1384, 0, 1384, 0, 0, 0, 0, 0, 1384, 1384, 1384, 1384, 1384, 0, 1384, 1384, 0, 0, 0, 0, 0, 0, 1384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1384, 0, 0, 0, 0, 0, 0, 1384, 1384, 0, 0, 0, 0, 0, 1384, 0, 0, 0, 0, 0, 0, 0, 0, 1384, 1386, 1386, 1386, 1386, 0, 0, 0, 0, 0, 0, 0, 1386, 1386, 1386, 0, 1386, 0, 1386, 1386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1386, 1386, 1387, 1387, 1387, 1387, 0, 0, 0, 0, 0, 0, 0, 1387, 1387, 1387, 0, 1387, 0, 1387, 1387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1387, 1387, 1388, 1388, 1388, 1388, 0, 1388, 0, 0, 0, 0, 0, 1388, 1388, 1388, 1388, 1388, 0, 1388, 1388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1388, 1388, 1389, 1389, 1389, 1389, 0, 1389, 0, 0, 0, 0, 0, 1389, 1389, 1389, 1389, 1389, 0, 1389, 1389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1389, 1389, 1390, 0, 0, 1390, 1390, 0, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1390, 1390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1390, 1391, 0, 0, 1391, 1391, 0, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1391, 1391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1391, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1392, 1392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1392, 1397, 1397, 1397, 1397, 0, 0, 0, 0, 0, 0, 0, 1397, 1397, 1397, 0, 1397, 0, 1397, 1397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1397, 1397, 1398, 1398, 1398, 1398, 0, 0, 0, 0, 0, 0, 0, 1398, 1398, 1398, 0, 1398, 0, 1398, 1398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1398, 1398, 1399, 1399, 1399, 1399, 0, 1399, 0, 0, 0, 0, 0, 1399, 1399, 1399, 1399, 1399, 0, 1399, 1399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1399, 1399, 1400, 1400, 1400, 1400, 0, 1400, 0, 0, 0, 0, 0, 1400, 1400, 1400, 1400, 1400, 0, 1400, 1400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1400, 1400, 1401, 1401, 1401, 1401, 0, 0, 0, 0, 0, 0, 0, 1401, 1401, 1401, 0, 1401, 0, 1401, 1401, 0, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 1401, 1401, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 0, 0, 1401, 1406, 1406, 1406, 1406, 0, 1406, 0, 0, 0, 0, 0, 1406, 1406, 1406, 1406, 0, 0, 1406, 1406, 1407, 1407, 1407, 1407, 0, 1407, 0, 0, 0, 0, 0, 1407, 1407, 1407, 1407, 0, 0, 1407, 1407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1407, 1409, 1409, 1409, 1409, 0, 1409, 0, 0, 0, 0, 0, 1409, 1409, 1409, 1409, 1409, 0, 1409, 1409, 0, 0, 0, 0, 0, 0, 1409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 0, 0, 0, 0, 0, 0, 1409, 1409, 0, 0, 0, 0, 0, 1409, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 1410, 1410, 1410, 1410, 1410, 0, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1410, 1410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1410, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1411, 0, 0, 0, 0, 0, 0, 1411, 1411, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1411, 0, 0, 0, 0, 0, 0, 1411, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 1412, 1412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1412, 0, 0, 0, 0, 0, 1412, 1414, 1414, 1414, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 0, 1414, 0, 1414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1414, 0, 0, 0, 0, 0, 1414, 0, 1414, 1426, 1426, 1426, 1426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 1426, 1433, 1433, 1433, 1433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1433, 0, 0, 0, 0, 0, 0, 0, 1433, 1433, 1433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1433, 0, 0, 0, 0, 0, 0, 1433, 1433, 1433, 1437, 1437, 1437, 1437, 0, 1437, 0, 0, 0, 1437, 1437, 1437, 1437, 1437, 1437, 0, 1437, 0, 1437, 1441, 1441, 1441, 1441, 1441, 0, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1441, 0, 0, 0, 0, 0, 0, 1441, 1441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1441, 0, 0, 0, 0, 0, 0, 1441, 1443, 1443, 1443, 1443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1443, 0, 0, 0, 1443, 0, 0, 0, 0, 0, 0, 0, 0, 1443, 0, 1443, 0, 0, 0, 0, 0, 0, 1443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1443, 0, 1443, 0, 0, 0, 0, 0, 1443, 1444, 1444, 1444, 1444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1444, 0, 0, 0, 1444, 0, 0, 0, 0, 0, 0, 0, 0, 1444, 0, 0, 0, 0, 0, 1444, 0, 0, 1444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1444, 0, 0, 0, 0, 1444, 0, 0, 1444, 1446, 1446, 1446, 1446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 1446, 0, 0, 1446, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 0, 0, 1446, 0, 0, 0, 0, 0, 0, 0, 1446, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 0, 0, 1447, 1447, 1447, 0, 0, 1447, 0, 1447, 1447, 0, 0, 0, 0, 0, 0, 1447, 0, 0, 0, 0, 0, 0, 0, 0, 1447, 0, 0, 1447, 0, 0, 0, 1447, 0, 0, 0, 0, 0, 0, 0, 1447, 0, 0, 0, 0, 0, 0, 0, 1447, 0, 0, 1447, 0, 0, 0, 1447, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 0, 0, 1448, 1448, 1448, 0, 0, 1448, 0, 1448, 1448, 1448, 0, 0, 0, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 1448, 0, 1448, 0, 0, 0, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 1448, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 0, 0, 1449, 1449, 1449, 0, 0, 1449, 0, 1449, 1449, 0, 0, 0, 0, 0, 0, 1449, 0, 0, 0, 0, 0, 0, 0, 0, 1449, 0, 0, 0, 0, 0, 0, 1449, 0, 0, 0, 0, 0, 0, 0, 1449, 0, 0, 0, 0, 0, 0, 0, 1449, 0, 0, 0, 0, 0, 0, 1449, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 0, 0, 1450, 1450, 1450, 0, 0, 1450, 0, 1450, 1450, 0, 0, 0, 0, 0, 0, 1450, 0, 0, 0, 0, 0, 0, 0, 0, 1450, 0, 0, 0, 0, 0, 0, 1450, 0, 0, 0, 0, 0, 0, 0, 1450, 0, 0, 0, 0, 0, 0, 0, 1450, 0, 0, 0, 0, 0, 0, 1450, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 0, 0, 1457, 1457, 1457, 0, 0, 1457, 0, 1457, 1457, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 0, 0, 0, 0, 1457, 0, 0, 0, 0, 0, 0, 1457, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 0, 0, 1458, 1458, 1458, 0, 0, 1458, 0, 1458, 1458, 0, 0, 0, 0, 0, 0, 1458, 0, 0, 0, 0, 0, 0, 1458, 0, 1458, 0, 0, 0, 0, 0, 0, 1458, 0, 0, 0, 0, 0, 0, 0, 1458, 0, 0, 0, 0, 0, 1458, 0, 1458, 0, 0, 0, 0, 0, 0, 1458, 1476, 1476, 1476, 1476, 0, 0, 0, 0, 0, 0, 0, 1476, 1476, 1476, 0, 1476, 0, 1476, 1476, 0, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 0, 0, 1476, 1476, 0, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 0, 0, 0, 0, 1476, 1480, 1480, 1480, 1480, 0, 1480, 0, 0, 0, 0, 0, 1480, 1480, 1480, 1480, 0, 0, 1480, 1480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1480, 1481, 1481, 1481, 1481, 0, 1481, 0, 0, 0, 0, 0, 1481, 1481, 1481, 1481, 0, 0, 1481, 1481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1481, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1481, 0, 1481, 1482, 1482, 1482, 1482, 1482, 0, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1482, 1482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1482, 1483, 1483, 1483, 1483, 1483, 0, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1483, 1483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1483, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1484, 1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1484, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1485, 1485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1485, 1490, 1490, 1490, 1490, 0, 0, 0, 0, 0, 0, 0, 1490, 1490, 1490, 0, 1490, 0, 1490, 1490, 0, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 1490, 1490, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 1491, 1491, 1491, 1491, 1491, 0, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1491, 0, 0, 0, 0, 0, 0, 1491, 1491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1491, 0, 0, 0, 0, 0, 0, 1491, 1504, 1504, 1504, 1504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1504, 0, 0, 0, 0, 0, 1504, 0, 0, 1504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1504, 0, 0, 0, 0, 1504, 0, 0, 1504, 1508, 0, 0, 1508, 1508, 0, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1508, 1508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1508, 1517, 1517, 1517, 1517, 0, 0, 0, 0, 0, 1517, 1517, 0, 0, 0, 1517, 0, 1517, 1517, 0, 0, 0, 1517, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1517, 0, 0, 1517, 1519, 1519, 1519, 1519, 1519, 0, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1519, 0, 0, 0, 0, 0, 0, 1519, 1519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1519, 0, 0, 0, 0, 0, 0, 1519, 1520, 1520, 1520, 1520, 1520, 0, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1520, 0, 0, 0, 0, 0, 1520, 1520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1520, 0, 0, 0, 0, 0, 1520, 1522, 1522, 1522, 1522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1522, 0, 0, 0, 1522, 0, 0, 0, 0, 1522, 0, 0, 0, 1522, 0, 0, 0, 0, 0, 0, 0, 0, 1522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1522, 0, 0, 0, 1522, 0, 0, 0, 0, 0, 0, 0, 1522, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 0, 0, 1528, 1528, 1528, 0, 0, 1528, 0, 1528, 1528, 0, 0, 0, 0, 0, 0, 1528, 0, 0, 0, 0, 0, 0, 0, 0, 1528, 0, 0, 0, 0, 0, 0, 1528, 0, 0, 0, 0, 0, 0, 0, 1528, 0, 0, 0, 0, 0, 0, 0, 1528, 0, 0, 0, 0, 0, 0, 1528, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 0, 0, 1529, 1529, 1529, 0, 0, 1529, 0, 1529, 1529, 0, 0, 0, 0, 1529, 0, 1529, 0, 0, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 1529, 0, 1529, 0, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 0, 1529, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 0, 0, 1535, 1535, 1535, 0, 0, 1535, 0, 1535, 1535, 0, 0, 0, 0, 1535, 0, 1535, 0, 0, 0, 0, 0, 0, 0, 0, 1535, 0, 0, 0, 0, 0, 0, 1535, 0, 0, 0, 0, 0, 1535, 0, 1535, 0, 0, 0, 0, 0, 0, 0, 1535, 0, 0, 0, 0, 0, 0, 1535, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 0, 0, 1536, 1536, 1536, 0, 0, 1536, 0, 1536, 1536, 0, 0, 0, 0, 0, 0, 1536, 0, 0, 0, 0, 0, 0, 0, 0, 1536, 0, 0, 1536, 0, 0, 0, 1536, 0, 0, 0, 0, 0, 0, 0, 1536, 0, 0, 0, 0, 0, 0, 0, 1536, 0, 0, 1536, 0, 0, 0, 1536, 1550, 1550, 1550, 1550, 0, 1550, 0, 0, 0, 0, 0, 1550, 1550, 1550, 1550, 0, 0, 1550, 1550, 0, 0, 0, 1550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1550, 1551, 1551, 1551, 1551, 0, 1551, 0, 0, 0, 0, 0, 1551, 1551, 1551, 1551, 0, 0, 1551, 1551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1551, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1552, 1552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1552, 1555, 1555, 1555, 1555, 1555, 0, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1555, 0, 0, 0, 0, 0, 0, 1555, 1555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1555, 0, 0, 0, 0, 0, 0, 1555, 1563, 1563, 1563, 1563, 0, 0, 0, 0, 0, 1563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1563, 0, 0, 0, 0, 0, 0, 0, 1563, 1563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1563, 0, 0, 0, 0, 0, 0, 1563, 1563, 1573, 0, 0, 1573, 1573, 0, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1573, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1573, 1580, 1580, 1580, 1580, 0, 0, 0, 0, 0, 1580, 1580, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, 0, 0, 0, 0, 1580, 1582, 0, 0, 1582, 1582, 0, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1582, 1582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1582, 1586, 0, 0, 1586, 1586, 0, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1586, 1586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1586, 1590, 1590, 1590, 1590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1590, 0, 0, 0, 1590, 0, 0, 0, 0, 0, 0, 0, 0, 1590, 0, 0, 0, 0, 0, 1590, 0, 0, 1590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1590, 0, 0, 0, 0, 1590, 0, 0, 1590, 1591, 1591, 1591, 1591, 0, 0, 0, 0, 0, 1591, 0, 0, 0, 1591, 0, 0, 0, 1591, 0, 0, 0, 0, 0, 0, 0, 0, 1591, 0, 0, 0, 0, 0, 0, 0, 1591, 1591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1591, 0, 0, 0, 0, 0, 0, 1591, 1591, 1634, 0, 0, 1634, 1634, 0, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1634, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1634, 1641, 1641, 1641, 1641, 0, 0, 0, 0, 0, 1641, 1641, 0, 0, 0, 0, 0, 1641, 0, 0, 0, 0, 0, 0, 0, 0, 1641, 0, 0, 0, 0, 0, 0, 0, 0, 1641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1641, 0, 0, 0, 0, 0, 0, 0, 1641, 1645, 0, 0, 1645, 1645, 0, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1645, 1645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1645, 1654, 1654, 1654, 1654, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 1654, 0, 0, 0, 1654, 0, 0, 0, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 0, 0, 0, 0, 1654, 1667, 1667, 1667, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 0, 1667, 0, 0, 1667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1667, 0, 0, 0, 0, 1667, 0, 0, 1667, 1668, 1668, 1668, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 0, 1668, 0, 0, 1668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1668, 0, 0, 0, 0, 1668, 0, 0, 1668, 1728, 1728, 1728, 1728, 0, 0, 0, 0, 0, 1728, 1728, 0, 0, 0, 1728, 0, 1728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1728, 0, 0, 0, 0, 0, 0, 0, 1728, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1728, 1753, 0, 0, 1753, 1753, 0, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1753, 1753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1753, 1754, 1754, 1754, 1754, 1754, 0, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1754, 1754, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1754, 1782, 0, 0, 1782, 1782, 0, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1782, 1782, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1782, 1785, 1785, 1785, 1785, 1785, 0, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 1785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1785, 1785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1785, 1786, 1786, 1786, 1786, 1786, 0, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 1786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1786, 1786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1786, 1787, 1787, 1787, 1787, 1787, 0, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1787, 0, 0, 0, 0, 0, 0, 0, 1787, 1787, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1787, 0, 0, 0, 0, 0, 0, 0, 1787, 1794, 0, 0, 1794, 1794, 0, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1794, 1794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1794, 1814, 1814, 1814, 1814, 1814, 0, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 1814, 1814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1814, 0, 0, 0, 0, 0, 0, 0, 1814, 1822, 1822, 1822, 1822, 0, 0, 0, 0, 0, 1822, 1822, 0, 0, 0, 1822, 0, 1822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1822, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1822, 1824, 0, 0, 1824, 1824, 0, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1824, 1824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1824, 1848, 1848, 1848, 1848, 1848, 0, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1848, 1848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1848, 1853, 1853, 1853, 1853, 1853, 0, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1853, 1853, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1853, 1854, 1854, 1854, 1854, 1854, 0, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 1854, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1854, 1854, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1854, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1869, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1870, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1872, 0, 0, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1872, 1873, 0, 0, 0, 0, 1873, 1873, 0, 0, 0, 0, 1873, 1873, 0, 1873, 1874, 0, 0, 1874, 1874, 0, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1874, 1875, 1875, 1875, 1875, 0, 1875, 0, 1875, 0, 0, 1875, 1875, 1875, 1875, 0, 0, 0, 1875, 1875, 1875, 1875, 1876, 0, 0, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1877, 1877, 1877, 1877, 0, 0, 0, 1877, 0, 0, 0, 1877, 1877, 1877, 0, 0, 0, 1877, 1877, 0, 1877, 1878, 1878, 1878, 1878, 0, 0, 1878, 1878, 0, 0, 0, 1878, 1878, 1878, 0, 0, 0, 1878, 1878, 0, 1878, 1879, 1879, 1879, 1879, 0, 0, 0, 1879, 0, 0, 1879, 1879, 1879, 0, 0, 0, 0, 1879, 1879, 0, 1879, 1880, 1880, 1880, 1880, 0, 1880, 0, 1880, 1880, 1880, 1880, 1880, 1880, 1880, 0, 1880, 0, 1880, 1880, 0, 1880, 1881, 0, 0, 1881, 1881, 0, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1882, 1882, 1882, 1882, 0, 0, 1882, 0, 0, 0, 0, 1882, 1882, 0, 0, 0, 0, 1882, 1882, 0, 1882, 1883, 0, 0, 1883, 1883, 0, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1884, 1884, 0, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1885, 1885, 1885, 1885, 0, 0, 0, 0, 0, 0, 1885, 0, 0, 0, 0, 0, 0, 1885, 1885, 0, 1885, 1886, 1886, 0, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 0, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1887, 0, 0, 0, 0, 1887, 1887, 0, 0, 0, 0, 1887, 1887, 0, 1887, 1888, 0, 0, 1888, 1888, 0, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1889, 0, 0, 0, 0, 1889, 1889, 0, 0, 0, 0, 1889, 1889, 0, 1889, 1890, 0, 0, 1890, 1890, 0, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1892, 0, 0, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1892, 1893, 0, 0, 1893, 1893, 1893, 1893, 1893, 0, 0, 1893, 0, 1893, 1893, 0, 1893, 1894, 0, 0, 1894, 1894, 0, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1894, 1895, 1895, 0, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1896, 0, 1896, 1896, 0, 0, 0, 0, 1896, 0, 0, 1896, 1897, 0, 0, 1897, 0, 1897, 0, 0, 1897, 1897, 1897, 0, 1897, 1897, 0, 1897, 0, 1897, 1897, 0, 1897, 1898, 1898, 1898, 1898, 0, 0, 0, 1898, 0, 0, 0, 1898, 1898, 1898, 0, 0, 0, 1898, 1898, 0, 1898, 1899, 1899, 1899, 1899, 0, 0, 0, 1899, 0, 0, 1899, 1899, 1899, 0, 0, 0, 0, 1899, 1899, 0, 1899, 1900, 1900, 1900, 1900, 0, 1900, 0, 1900, 1900, 1900, 1900, 1900, 1900, 1900, 0, 1900, 0, 1900, 1900, 0, 1900, 1901, 0, 0, 1901, 1901, 0, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1902, 0, 0, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1903, 1903, 1903, 1903, 0, 0, 0, 1903, 0, 0, 0, 1903, 1903, 1903, 0, 0, 0, 1903, 1903, 0, 1903, 1904, 1904, 1904, 1904, 0, 1904, 0, 1904, 1904, 1904, 1904, 1904, 1904, 1904, 0, 1904, 0, 1904, 1904, 0, 1904, 1905, 0, 0, 1905, 1905, 0, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1905, 1906, 1906, 1906, 1906, 0, 0, 0, 0, 0, 0, 0, 1906, 1906, 0, 0, 0, 0, 1906, 1906, 0, 1906, 1907, 0, 0, 1907, 1907, 0, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1908, 1908, 0, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1908, 1909, 1909, 0, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1910, 1910, 1910, 1910, 0, 0, 0, 0, 0, 0, 1910, 0, 0, 0, 0, 0, 0, 1910, 1910, 0, 1910, 1911, 1911, 0, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 0, 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1912, 1912, 0, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 0, 1912, 1912, 1912, 1912, 1912, 1912, 1912, 1913, 1913, 0, 0, 0, 0, 1913, 1913, 0, 1913, 1914, 0, 0, 1914, 1914, 0, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1915, 1915, 0, 0, 0, 0, 1915, 1915, 0, 1915, 1916, 0, 0, 1916, 1916, 0, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1916, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1918, 1919, 0, 0, 1919, 1919, 1919, 0, 1919, 0, 0, 1919, 0, 1919, 1919, 0, 1919, 1920, 0, 0, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1921, 0, 0, 1921, 1921, 1921, 1921, 1921, 0, 0, 1921, 0, 1921, 1921, 0, 1921, 1922, 0, 0, 1922, 1922, 0, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1923, 1923, 0, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1924, 0, 0, 1924, 0, 1924, 1924, 0, 0, 0, 0, 1924, 0, 0, 1924, 1925, 1925, 1925, 1925, 0, 1925, 0, 1925, 1925, 1925, 1925, 1925, 1925, 1925, 0, 1925, 0, 1925, 1925, 0, 1925, 1926, 0, 0, 1926, 1926, 0, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1928, 1928, 1928, 1928, 0, 0, 0, 1928, 0, 0, 0, 1928, 1928, 1928, 0, 0, 0, 1928, 1928, 0, 1928, 1929, 1929, 1929, 1929, 0, 0, 0, 1929, 0, 0, 1929, 1929, 1929, 0, 0, 0, 0, 1929, 1929, 0, 1929, 1930, 1930, 1930, 1930, 1930, 1930, 1930, 0, 1930, 0, 1930, 1930, 1930, 1930, 1930, 1930, 1930, 0, 1930, 1930, 1930, 1930, 1930, 1931, 1931, 1931, 1931, 0, 1931, 0, 1931, 1931, 1931, 1931, 1931, 1931, 1931, 0, 1931, 0, 1931, 1931, 0, 1931, 1932, 0, 0, 1932, 1932, 0, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1933, 1933, 0, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1934, 1934, 1934, 1934, 0, 0, 0, 0, 0, 0, 0, 1934, 1934, 0, 0, 0, 0, 1934, 1934, 0, 1934, 1935, 1935, 1935, 1935, 1935, 0, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1936, 1936, 1936, 1936, 0, 1936, 0, 0, 0, 0, 0, 1936, 1936, 0, 1936, 0, 0, 1936, 1936, 1936, 1936, 1937, 1937, 0, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1938, 1938, 0, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1938, 1939, 1939, 0, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 0, 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1940, 1940, 0, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 0, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1941, 1941, 1941, 1941, 0, 1941, 0, 0, 0, 0, 0, 1941, 1941, 0, 1941, 0, 0, 1941, 1941, 1941, 1941, 1942, 1942, 0, 0, 0, 0, 1942, 1942, 0, 1942, 1943, 1943, 0, 0, 0, 0, 1943, 1943, 0, 1943, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1945, 0, 1945, 0, 0, 1945, 1945, 1945, 1945, 1945, 0, 0, 1945, 0, 1945, 1945, 0, 1945, 1946, 1946, 0, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1948, 1948, 0, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 0, 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1950, 0, 0, 1950, 1950, 0, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1951, 0, 0, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1953, 1953, 1953, 1953, 0, 0, 0, 1953, 0, 0, 1953, 1953, 1953, 0, 0, 0, 0, 1953, 1953, 0, 1953, 1954, 1954, 1954, 1954, 0, 0, 0, 1954, 0, 0, 0, 1954, 1954, 1954, 0, 0, 0, 1954, 1954, 0, 1954, 1955, 1955, 1955, 1955, 1955, 0, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 0, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1957, 1957, 0, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1957, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1959, 1959, 0, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1959, 1960, 1960, 1960, 1960, 0, 1960, 0, 0, 0, 0, 0, 0, 0, 0, 1960, 0, 0, 1960, 1960, 1960, 1961, 1961, 1961, 1961, 0, 1961, 0, 0, 1961, 1961, 1961, 0, 1961, 0, 1961, 1961, 0, 1961, 1961, 0, 1961, 1962, 1962, 1962, 1962, 0, 1962, 0, 0, 1962, 1962, 1962, 1962, 1962, 0, 1962, 1962, 0, 1962, 1962, 0, 1962, 1963, 0, 0, 1963, 1963, 0, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1963, 1964, 1964, 0, 0, 0, 0, 1964, 1964, 0, 1964, 1965, 1965, 0, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1965, 1966, 1966, 0, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1966, 1967, 1967, 0, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1967, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1969, 1969, 0, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 0, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 0, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1971, 1971, 1971, 1971, 0, 1971, 0, 0, 0, 0, 0, 0, 0, 0, 1971, 0, 0, 1971, 1971, 1971, 1972, 1972, 1972, 1972, 0, 1972, 0, 0, 1972, 1972, 1972, 0, 1972, 0, 1972, 1972, 0, 1972, 1972, 0, 1972, 1973, 1973, 1973, 1973, 0, 1973, 0, 0, 1973, 1973, 1973, 1973, 1973, 0, 1973, 1973, 0, 1973, 1973, 0, 1973, 1974, 0, 0, 1974, 1974, 0, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1974, 1975, 1975, 0, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1979, 1979, 1979, 1979, 0, 1979, 0, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 0, 1979, 0, 1979, 1979, 0, 1979, 1980, 1980, 1980, 1980, 1980, 0, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1981, 0, 0, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1982, 1983, 1983, 1983, 1983, 0, 0, 0, 1983, 0, 0, 1983, 1983, 1983, 0, 0, 0, 0, 1983, 1983, 0, 1983, 1984, 1984, 1984, 1984, 0, 1984, 0, 1984, 1984, 1984, 1984, 1984, 1984, 1984, 0, 1984, 0, 1984, 1984, 0, 1984, 1985, 1985, 1985, 1985, 0, 0, 0, 1985, 0, 0, 0, 1985, 1985, 1985, 0, 0, 0, 1985, 1985, 0, 1985, 1986, 0, 0, 1986, 1986, 0, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 0, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 0, 1988, 1988, 1988, 1988, 1988, 1988, 1988, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1990, 1990, 0, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1990, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1992, 1992, 1992, 1992, 0, 1992, 0, 0, 0, 0, 0, 0, 0, 0, 1992, 0, 0, 1992, 1992, 1992, 1993, 1993, 1993, 1993, 0, 1993, 0, 0, 1993, 1993, 1993, 0, 1993, 0, 1993, 1993, 0, 1993, 1993, 0, 1993, 1994, 1994, 1994, 1994, 0, 1994, 0, 0, 1994, 1994, 1994, 1994, 1994, 0, 1994, 1994, 0, 1994, 1994, 0, 1994, 1995, 0, 0, 1995, 1995, 0, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1996, 1996, 0, 0, 0, 0, 1996, 1996, 0, 1996, 1997, 1997, 0, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, 1998, 0, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1999, 1999, 0, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 1999, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 0, 2001, 2001, 2001, 2001, 2001, 2001, 2001, 2002, 2002, 2002, 2002, 0, 2002, 0, 0, 2002, 2002, 2002, 0, 2002, 0, 2002, 2002, 0, 2002, 2002, 0, 2002, 2003, 2003, 2003, 2003, 0, 2003, 0, 0, 2003, 2003, 2003, 2003, 2003, 0, 2003, 2003, 0, 2003, 2003, 0, 2003, 2004, 0, 0, 2004, 2004, 0, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2005, 2005, 0, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2008, 2008, 2008, 2008, 0, 2008, 0, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 0, 2008, 0, 2008, 2008, 0, 2008, 2009, 0, 0, 2009, 2009, 0, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2010, 0, 0, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2013, 2013, 2013, 2013, 0, 0, 0, 2013, 0, 0, 2013, 2013, 2013, 0, 0, 0, 0, 2013, 2013, 0, 2013, 2014, 2014, 2014, 2014, 0, 2014, 0, 2014, 2014, 2014, 2014, 2014, 2014, 2014, 0, 2014, 0, 2014, 2014, 0, 2014, 2015, 2015, 2015, 2015, 0, 0, 0, 2015, 0, 0, 0, 2015, 2015, 2015, 0, 0, 0, 2015, 2015, 0, 2015, 2016, 0, 0, 2016, 2016, 0, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 0, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 0, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 0, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2021, 2021, 2021, 2021, 0, 2021, 0, 0, 2021, 2021, 2021, 0, 2021, 0, 2021, 2021, 0, 2021, 2021, 0, 2021, 2022, 2022, 2022, 2022, 0, 2022, 0, 0, 2022, 2022, 2022, 2022, 2022, 0, 2022, 2022, 0, 2022, 2022, 0, 2022, 2023, 2023, 2023, 2023, 2023, 0, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2024, 2024, 0, 0, 0, 0, 2024, 2024, 0, 2024, 2025, 2025, 0, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2026, 2026, 0, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2027, 2027, 0, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2028, 2028, 2028, 2028, 0, 2028, 0, 0, 2028, 2028, 2028, 0, 2028, 0, 2028, 2028, 0, 2028, 2028, 0, 2028, 2029, 2029, 2029, 2029, 0, 2029, 0, 0, 2029, 2029, 2029, 2029, 2029, 0, 2029, 2029, 0, 2029, 2029, 0, 2029, 2030, 2030, 2030, 2030, 2030, 0, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2030, 2031, 2031, 0, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2032, 0, 0, 2032, 2032, 0, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2032, 2033, 0, 0, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2034, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2036, 2036, 2036, 2036, 0, 0, 0, 2036, 0, 0, 2036, 2036, 2036, 0, 0, 0, 0, 2036, 2036, 0, 2036, 2037, 2037, 2037, 2037, 0, 0, 0, 2037, 0, 0, 2037, 2037, 2037, 0, 0, 0, 0, 2037, 2037, 0, 2037, 2038, 0, 0, 2038, 2038, 0, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2038, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 0, 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 0, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2041, 2042, 2042, 2042, 2042, 0, 2042, 0, 0, 2042, 2042, 2042, 0, 2042, 0, 2042, 2042, 0, 2042, 2042, 0, 2042, 2043, 2043, 2043, 2043, 0, 2043, 0, 0, 2043, 2043, 2043, 2043, 2043, 0, 2043, 2043, 0, 2043, 2043, 0, 2043, 2044, 2044, 0, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2045, 2045, 0, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2046, 2046, 2046, 2046, 0, 2046, 0, 0, 2046, 2046, 2046, 0, 2046, 0, 2046, 2046, 0, 2046, 2046, 0, 2046, 2047, 2047, 2047, 2047, 0, 2047, 0, 0, 2047, 2047, 2047, 2047, 2047, 0, 2047, 2047, 0, 2047, 2047, 0, 2047, 2048, 2048, 2048, 2048, 0, 0, 0, 2048, 0, 0, 2048, 2048, 2048, 0, 0, 0, 0, 2048, 2048, 0, 2048, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2052, 2052, 2052, 2052, 0, 2052, 0, 0, 2052, 2052, 2052, 2052, 2052, 0, 2052, 2052, 0, 2052, 2052, 2052, 2052, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2054, 2054, 2054, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 2054, 0, 0, 2054, 2054, 0, 2054, 2055, 2055, 2055, 2055, 0, 2055, 0, 0, 0, 0, 0, 2055, 2055, 0, 2055, 0, 0, 2055, 2055, 2055, 2055, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 0, 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2057, 2057, 2057, 2057, 0, 2057, 0, 0, 2057, 2057, 2057, 0, 2057, 0, 2057, 2057, 0, 2057, 2057, 2057, 2057, 2058, 2058, 2058, 2058, 0, 2058, 0, 0, 2058, 2058, 2058, 2058, 2058, 0, 2058, 2058, 0, 2058, 2058, 2058, 2058, 2059, 2059, 2059, 2059, 0, 2059, 0, 0, 0, 0, 0, 0, 0, 0, 2059, 0, 0, 2059, 2059, 2059, 2060, 2060, 2060, 2060, 0, 2060, 0, 0, 2060, 2060, 2060, 0, 2060, 0, 2060, 2060, 0, 2060, 2060, 2060, 2060, 2061, 2061, 2061, 2061, 0, 2061, 0, 0, 2061, 2061, 2061, 2061, 2061, 0, 2061, 2061, 0, 2061, 2061, 2061, 2061, 2062, 0, 0, 2062, 2062, 0, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2062, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2064, 2064, 2064, 2064, 0, 0, 0, 0, 0, 0, 0, 0, 2064, 0, 2064, 0, 0, 2064, 2064, 0, 2064, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2066, 2066, 0, 0, 0, 0, 2066, 2066, 0, 2066, 2067, 2067, 2067, 2067, 0, 2067, 0, 0, 2067, 2067, 2067, 0, 2067, 0, 2067, 2067, 0, 2067, 2067, 2067, 2067, 2068, 2068, 2068, 2068, 0, 2068, 0, 0, 2068, 2068, 2068, 2068, 2068, 0, 2068, 2068, 0, 2068, 2068, 2068, 2068, 2069, 2069, 2069, 2069, 0, 2069, 0, 0, 2069, 2069, 2069, 0, 2069, 0, 2069, 2069, 0, 2069, 2069, 0, 2069, 2070, 2070, 2070, 2070, 0, 2070, 0, 0, 2070, 2070, 2070, 2070, 2070, 0, 2070, 2070, 0, 2070, 2070, 2070, 2070, 2071, 2071, 2071, 2071, 0, 2071, 0, 0, 2071, 2071, 2071, 2071, 2071, 0, 2071, 2071, 0, 2071, 2071, 0, 2071, 2072, 0, 0, 2072, 2072, 0, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2072, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2073, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2075, 2075, 2075, 2075, 0, 0, 0, 2075, 0, 0, 2075, 2075, 2075, 0, 0, 0, 0, 2075, 2075, 0, 2075, 2076, 2076, 2076, 2076, 0, 0, 0, 2076, 0, 0, 0, 2076, 2076, 0, 0, 0, 0, 2076, 2076, 0, 2076, 2077, 2077, 2077, 2077, 0, 0, 0, 2077, 0, 0, 2077, 2077, 2077, 0, 0, 0, 0, 2077, 2077, 0, 2077, 2078, 2078, 2078, 2078, 0, 2078, 0, 2078, 2078, 2078, 2078, 2078, 2078, 2078, 0, 2078, 0, 2078, 2078, 0, 2078, 2079, 2079, 2079, 2079, 2079, 0, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 0, 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 0, 2082, 2082, 2082, 2082, 2082, 2082, 2082, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 0, 2083, 2083, 2083, 2083, 2083, 2083, 2083, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 0, 2084, 2084, 2084, 2084, 2084, 2084, 2084, 2085, 2085, 2085, 2085, 0, 2085, 0, 0, 2085, 2085, 2085, 0, 2085, 0, 2085, 2085, 0, 2085, 2085, 2085, 2085, 2086, 2086, 2086, 2086, 0, 2086, 0, 0, 2086, 2086, 2086, 0, 2086, 0, 2086, 2086, 0, 2086, 2086, 0, 2086, 2087, 2087, 2087, 2087, 0, 2087, 0, 0, 0, 0, 0, 0, 0, 0, 2087, 0, 0, 2087, 2087, 2087, 2088, 2088, 2088, 2088, 0, 2088, 0, 0, 2088, 2088, 2088, 2088, 2088, 0, 2088, 2088, 0, 2088, 2088, 0, 2088, 2089, 2089, 2089, 2089, 0, 2089, 0, 0, 2089, 2089, 2089, 2089, 2089, 0, 2089, 2089, 0, 2089, 2089, 2089, 2089, 2090, 2090, 2090, 2090, 0, 2090, 0, 0, 2090, 2090, 2090, 0, 2090, 0, 2090, 2090, 0, 2090, 2090, 2090, 2090, 2091, 2091, 2091, 2091, 0, 2091, 0, 0, 2091, 2091, 2091, 2091, 2091, 0, 2091, 2091, 0, 2091, 2091, 2091, 2091, 2092, 0, 0, 2092, 2092, 0, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2093, 2094, 2094, 0, 0, 0, 0, 2094, 2094, 0, 2094, 2095, 2095, 2095, 2095, 0, 2095, 0, 0, 2095, 2095, 2095, 0, 2095, 0, 2095, 2095, 0, 2095, 2095, 2095, 2095, 2096, 2096, 2096, 2096, 0, 2096, 0, 0, 2096, 2096, 2096, 2096, 2096, 0, 2096, 2096, 0, 2096, 2096, 2096, 2096, 2097, 2097, 2097, 2097, 0, 2097, 0, 0, 2097, 2097, 2097, 0, 2097, 0, 2097, 2097, 0, 2097, 2097, 2097, 2097, 2098, 2098, 2098, 2098, 0, 2098, 0, 0, 2098, 2098, 2098, 0, 2098, 0, 2098, 2098, 0, 2098, 2098, 0, 2098, 2099, 2099, 2099, 2099, 0, 2099, 0, 0, 0, 0, 0, 0, 0, 0, 2099, 0, 0, 2099, 2099, 2099, 2100, 2100, 2100, 2100, 0, 2100, 0, 0, 2100, 2100, 2100, 2100, 2100, 0, 2100, 2100, 0, 2100, 2100, 0, 2100, 2101, 2101, 2101, 2101, 0, 2101, 0, 0, 2101, 2101, 2101, 2101, 2101, 0, 2101, 2101, 0, 2101, 2101, 2101, 2101, 2102, 2102, 2102, 2102, 2102, 0, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2102, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2103, 2104, 2104, 2104, 2104, 0, 0, 0, 2104, 0, 0, 2104, 2104, 2104, 0, 0, 0, 0, 2104, 2104, 0, 2104, 2105, 2105, 2105, 2105, 0, 0, 0, 2105, 0, 0, 0, 2105, 2105, 0, 0, 0, 0, 2105, 2105, 0, 2105, 2106, 2106, 2106, 2106, 0, 0, 0, 2106, 0, 0, 2106, 2106, 2106, 0, 0, 0, 0, 2106, 2106, 0, 2106, 2107, 2107, 2107, 2107, 0, 0, 0, 0, 0, 0, 0, 0, 2107, 2107, 0, 0, 0, 2107, 2107, 2107, 2107, 2108, 2108, 2108, 2108, 0, 0, 0, 2108, 0, 0, 0, 2108, 2108, 2108, 0, 0, 0, 2108, 2108, 2108, 2108, 2109, 2109, 2109, 2109, 0, 2109, 0, 2109, 2109, 2109, 2109, 2109, 2109, 2109, 0, 2109, 0, 2109, 2109, 0, 2109, 2110, 2110, 2110, 2110, 0, 0, 0, 2110, 0, 0, 0, 2110, 2110, 2110, 2110, 0, 0, 2110, 2110, 0, 2110, 2111, 2111, 2111, 2111, 2111, 0, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2111, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 0, 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 0, 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 0, 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 0, 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2117, 2117, 2117, 2117, 0, 2117, 0, 0, 2117, 2117, 2117, 0, 2117, 0, 2117, 2117, 0, 2117, 2117, 0, 2117, 2118, 2118, 2118, 2118, 0, 2118, 0, 0, 2118, 2118, 2118, 0, 2118, 0, 2118, 2118, 0, 2118, 2118, 2118, 2118, 2119, 2119, 2119, 2119, 0, 2119, 0, 0, 2119, 2119, 2119, 2119, 2119, 0, 2119, 2119, 0, 2119, 2119, 0, 2119, 2120, 2120, 2120, 2120, 2120, 0, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2121, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2123, 2123, 2123, 2123, 0, 2123, 0, 0, 2123, 2123, 2123, 0, 2123, 0, 2123, 2123, 0, 2123, 2123, 0, 2123, 2124, 2124, 2124, 2124, 0, 2124, 0, 0, 2124, 2124, 2124, 0, 2124, 0, 2124, 2124, 0, 2124, 2124, 2124, 2124, 2125, 2125, 2125, 2125, 2125, 0, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2125, 2126, 2126, 2126, 2126, 0, 0, 0, 0, 0, 0, 0, 2126, 2126, 0, 0, 0, 0, 2126, 2126, 0, 2126, 2127, 0, 0, 2127, 2127, 0, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2127, 2128, 2128, 2128, 2128, 0, 0, 0, 2128, 0, 0, 0, 2128, 2128, 2128, 0, 0, 0, 2128, 2128, 0, 2128, 2129, 2129, 2129, 2129, 0, 0, 0, 0, 0, 0, 0, 0, 2129, 2129, 0, 0, 0, 2129, 2129, 2129, 2129, 2130, 2130, 2130, 2130, 0, 0, 0, 2130, 0, 0, 0, 2130, 2130, 2130, 0, 0, 0, 2130, 2130, 2130, 2130, 2131, 2131, 2131, 2131, 0, 0, 0, 0, 0, 0, 0, 0, 2131, 0, 2131, 0, 0, 2131, 2131, 2131, 2131, 2132, 2132, 2132, 2132, 0, 0, 0, 2132, 0, 0, 0, 2132, 2132, 2132, 2132, 0, 0, 2132, 2132, 2132, 2132, 2133, 2133, 2133, 2133, 2133, 0, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2133, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 0, 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 0, 2136, 2136, 2136, 2136, 2136, 2136, 2136, 2137, 2137, 2137, 2137, 0, 2137, 0, 0, 2137, 2137, 2137, 0, 2137, 0, 2137, 2137, 0, 2137, 2137, 0, 2137, 2138, 2138, 2138, 2138, 0, 2138, 0, 0, 2138, 2138, 2138, 2138, 2138, 0, 2138, 2138, 0, 2138, 2138, 0, 2138, 2139, 2139, 2139, 2139, 0, 0, 0, 0, 0, 0, 0, 2139, 2139, 0, 0, 0, 0, 2139, 2139, 0, 2139, 2140, 0, 0, 2140, 2140, 0, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2140, 2141, 2141, 2141, 2141, 0, 0, 0, 2141, 0, 0, 0, 2141, 2141, 2141, 0, 0, 0, 2141, 2141, 0, 2141, 2142, 2142, 2142, 2142, 0, 0, 0, 0, 0, 0, 0, 2142, 2142, 0, 2142, 0, 0, 2142, 2142, 0, 2142, 2143, 0, 0, 2143, 2143, 0, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2143, 2144, 2144, 2144, 2144, 0, 0, 0, 2144, 0, 0, 0, 2144, 2144, 2144, 2144, 0, 0, 2144, 2144, 0, 2144, 2145, 2145, 2145, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 0, 0, 0, 0, 2145, 2145, 2145, 2145, 2146, 2146, 2146, 2146, 0, 0, 0, 2146, 0, 0, 0, 2146, 2146, 2146, 0, 0, 0, 2146, 2146, 2146, 2146, 2147, 2147, 2147, 2147, 0, 0, 0, 0, 0, 0, 0, 2147, 2147, 0, 0, 0, 0, 2147, 2147, 0, 2147, 2148, 0, 0, 2148, 2148, 0, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2149, 2149, 2149, 2149, 2149, 0, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2149, 2150, 2150, 2150, 2150, 0, 0, 0, 2150, 0, 0, 0, 2150, 2150, 2150, 0, 0, 0, 2150, 2150, 0, 2150, 2151, 2151, 2151, 2151, 0, 0, 0, 0, 0, 0, 0, 0, 2151, 0, 2151, 0, 0, 2151, 2151, 2151, 2151, 2152, 2152, 2152, 2152, 0, 0, 0, 2152, 0, 0, 0, 2152, 2152, 2152, 2152, 0, 0, 2152, 2152, 2152, 2152, 2153, 2153, 2153, 2153, 2153, 0, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2153, 2154, 2154, 2154, 2154, 2154, 0, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2154, 2155, 2155, 0, 0, 0, 0, 2155, 2155, 0, 2155, 2156, 0, 0, 2156, 2156, 0, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2157, 2157, 2157, 2157, 0, 0, 0, 2157, 0, 0, 0, 2157, 2157, 2157, 0, 0, 0, 2157, 2157, 0, 2157, 2158, 2158, 2158, 2158, 2158, 0, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2159, 2159, 2159, 2159, 2159, 0, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 2159, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860 } ; extern int vhdlscanYY_flex_debug; int vhdlscanYY_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up vhdlscanYYtext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *vhdlscanYYtext; #line 1 "vhdlscanner.l" /****************************************************************************** * * Copyright (C) 1997-2011 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * * Documents produced by Doxygen are derivative works derived from the * input used in their production; they are not affected by this license. * */ /****************************************************************************** * Parser for VHDL subset * written by M. Kreis * supports VHDL-87/93 * does not support VHDL-AMS ******************************************************************************/ #line 22 "vhdlscanner.l" // global includes #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> #include <qcstring.h> #include <qfileinfo.h> #include <qstringlist.h> /* --------------------------------------------------------------- */ // local includes #include "vhdlscanner.h" #include "vhdlcode.h" #include "vhdldocgen.h" #include "message.h" #include "config.h" #include "doxygen.h" #include "util.h" #include "language.h" #include "commentscan.h" #include "index.h" #include "definition.h" #include "searchindex.h" #include "outputlist.h" /* --------------------------------------------------------------- */ //#define theTranslator_vhdlType theTranslator->trVhdlType #define theTranslator_vhdlType VhdlDocGen::getVhdlType static QStringList qrl; static int openGroups; static ParserInterface *g_thisParser; static const char * inputString; static int inputPosition; static int inputLen; static int startComment = 0; static QFile inputFile; static QCString inbuf; static Entry* global_root = 0; static Entry* current_root = 0; static Entry* current = 0; static Entry* previous = 0; static Entry* functionEntry = 0; static Entry* lastEntity = 0; static Entry* lastCompound = 0; static int genPort = 0; static QCString yyFileName; static int iFuncLine = 1; static bool g_inputFromFile ; static bool g_lexInit = FALSE; static int isBody=0; static int isFunc=0; static int yyLineNr = 1; static char * g_buf = 0; static uint g_bufSize = 0; static int iTextCounter = 0; static int iCounter = 0; static int bropen = 0; static int scantype = 0; static int g_lastCommentContext = 0; static bool docBlockAutoBrief; static char docBlockTerm; static int iDocLine = -1; static Entry gBlock; static int num_chars; //#define YY_A_INTERACTIVE 1 #define YY_NEVER_INTERACTIVE 1 //----------------------------------------------------------------------------- #define YY_USER_ACTION num_chars += vhdlscanYYleng; static void parserInit(); static void deleteSpecChars(char* str,char *buf); static void handleCommentBlock(const QCString &doc,bool brief); static void newEntry(); static void initEntry(Entry *e); static int iCodeLen; static void makeInline() { int diff=num_chars-iCodeLen; assert(inputLen>iCodeLen+diff); QCString par(&inputString[iCodeLen],diff); int index=par.findRev("\\endcode"); int tt=par.length()-par.find("\n",index); QCString qc(&inputString[iCodeLen-tt],diff); index=qc.findRev("--!"); if (index<=0) return; par=qc.left(index); /* fprintf(stderr,"\n-------------------------------------------------------------------------------- "); fprintf(stderr,"\n bytes since %d %d \n %s",num_chars,iCodeLen,par.data()); fprintf(stderr,"\n-------------------------------------------------------------------------------- "); */ gBlock.doc=par; gBlock.section=Entry::VARIABLE_SEC; gBlock.spec=VhdlDocGen::MISCELLANEOUS; gBlock.fileName = yyFileName; gBlock.endBodyLine=yyLineNr-1; Entry *temp=new Entry(gBlock); if (lastCompound) lastCompound->addSubEntry(temp); else if (lastEntity) lastEntity->addSubEntry(temp); else { temp->type="misc"; // global code current_root->addSubEntry(temp); } gBlock.reset(); }// makeInline static void addSubEntry(Entry* root, Entry* e) { if (e==0 || root==0) return; //if (isPrevDoc) //{ // e->brief=prevDocEntry.brief; // e->briefLine=prevDocEntry.briefLine; // prevDocEntry.reset(); // isPrevDoc=FALSE; //} root->addSubEntry(e); } static void bufferClear() { int j; for (j=0;j<iCounter+1;j++) { g_buf[j]=0; } iCounter=0; } static void addText (char *word, int llen) { if ((uint)(iCounter + llen) > g_bufSize) { char *pTmp = (char*)realloc(g_buf,iCounter+llen+2048); if (pTmp) { g_buf = pTmp; } else { fprintf(stderr,"\n not enough memory for realloc\n"); return; } } while (llen>0) { g_buf[iCounter]=*word++; iCounter++; llen--; } g_buf[iCounter]='\0'; } static void getBufText(QCString& qc,int start) { while (start < iCounter) { qc+=(g_buf[start]); start++; } } static void lineCount() { for ( const char* c = vhdlscanYYtext ; *c ; ++c ) { yyLineNr += (*c == '\n') ; } } static void deleteSpecChars(char* str,char *buf) { while (*str) { if ((*str == '\t') || (*str == '\n') || (*str == '\r') || (*str == ' ')) { *str++; } else { *buf++ = *str++; } } *buf='\0'; } static void getType(Entry* p,char* text) { QCString name(text); name=name.stripWhiteSpace(); if (stricmp(name.data(),"signal" )==0) { p->spec=VhdlDocGen::SIGNAL; } else if (stricmp(name.data(),"type" )==0) { p->spec=VhdlDocGen::TYPE; } else if (stricmp(name.data(),"subtype" )==0) { p->spec=VhdlDocGen::SUBTYPE; } else if (stricmp(name.data(),"constant" )==0) { p->spec=VhdlDocGen::CONSTANT; } else if (stricmp(name.data(),"attribute" )==0) { p->spec=VhdlDocGen::ATTRIBUTE; } else if (stricmp(name.data(),"function" )==0) { p->spec=VhdlDocGen::FUNCTION; } else if (stricmp(name.data(),"procedure" )==0) { p->spec=VhdlDocGen::PROCEDURE; } else if (stricmp(name.data(),"units" )==0) { p->spec=VhdlDocGen::UNITS; } else if (name.contains("shared",false) && name.contains("variable",false)) { p->spec=VhdlDocGen::SHAREDVARIABLE; } else if (stricmp(name.data(),"file" )==0) { p->spec=VhdlDocGen::VFILE; } else if (stricmp(name.data(),"group" )==0) { p->spec=VhdlDocGen::GROUP; } else if (stricmp(name.data(),"alias" )==0) { p->spec=VhdlDocGen::ALIAS; } else { err("wrong type"); } p->section=Entry::VARIABLE_SEC; } //------------------------------------------------------------------------- /* * adds signals found in entities|records|units */ static void addSignals(const char* str,int line, Entry *e,const char *comment=0) { //printf("===> addSignals (%s) comment='%s'\n",str,comment); QList<QCString> ql; QCString bufio; ql.setAutoDelete(TRUE); VhdlDocGen::getSigName(ql,str,bufio); int count = ql.count(); QCString brief = current->brief; QCString doc = current->doc; Entry *tmpEntry = current; current = new Entry; initEntry(current); handleCommentBlock(comment,TRUE); if (!current->brief.isEmpty()) { if (doc.isEmpty()) { doc = brief; } else if (!brief.isEmpty()) { doc = brief + "<p>" + doc; } brief = current->brief; } delete current; current = tmpEntry; current->brief.resize(0); current->doc.resize(0); if (genPort!=3) // not a unit { for (int k=1;k<count;k++) { //printf("adding '%s' '%s'\n",ql.at(0)->data(),ql.at(k)->data()); Entry *pTemp=new Entry; initEntry(pTemp); pTemp->startLine = line; pTemp->bodyLine = line; pTemp->name = ql.at(k)->data(); pTemp->section = Entry::VARIABLE_SEC; pTemp->brief = brief; pTemp->doc = doc; pTemp->mGrpId = current->mGrpId; // copy member group id QCString stSpec = ql.at(0)->data(); if (genPort==1) // found port { pTemp->spec = VhdlDocGen::PORT; stSpec.stripPrefix(bufio.data()); stSpec=stSpec.stripWhiteSpace(); pTemp->args = stSpec; pTemp->type = bufio; addSubEntry(e,pTemp); } else if (genPort==2) // found record { pTemp->spec = VhdlDocGen::RECORD; pTemp->type = stSpec; pTemp->name.prepend(VhdlDocGen::getRecordNumber()); delete current; current = new Entry(*pTemp); // make a deep copy of pTemp newEntry(); // add it to lastCompound and make a new current delete pTemp; } else { pTemp->spec = VhdlDocGen::GENERIC; pTemp->type = stSpec; addSubEntry(e,pTemp); } }// for } else // found a unit { Entry *pTemp=new Entry; initEntry(pTemp); QCString tt(str); QStringList ql=QStringList::split("=",tt,FALSE); pTemp->spec = VhdlDocGen::UNITS; pTemp->section = Entry::VARIABLE_SEC; pTemp->startLine = line; pTemp->bodyLine = line; pTemp->brief = brief; // adds brief description to the unit member pTemp->doc = doc; // adds doc to the unit member pTemp->type = ql[1]; pTemp->name = ql[0].stripWhiteSpace(); pTemp->name.prepend(VhdlDocGen::getRecordNumber()); delete current; current = new Entry(*pTemp); // make a deep copy newEntry(); // add it to lastCompound delete pTemp; } } /* * this function parses a process prototype * and adds the signal to the process */ static void parseProcessProto() { QStringList ql; QCString qcs; bool sem=FALSE; //Entry* ppEntry=new Entry; //ppEntry->fileName=yyFileName; //processEntry=ppEntry; QCString name; scantype=0; getBufText(qcs,0); if (qcs.contains('(') != qcs.contains(')')) return; VhdlDocGen::deleteAllChars(qcs,'\n'); VhdlDocGen::parseProcessProto(qcs,name,ql); current->section=Entry::FUNCTION_SEC; //current->stat=TRUE; current->spec=VhdlDocGen::PROCESS; current->startLine=iFuncLine; current->bodyLine=iFuncLine; current->fileName=yyFileName; if (!name.isEmpty()) { current->name=name.stripWhiteSpace(); } else // found an anonymous process, so we add a generated name { current->name=VhdlDocGen::getProcessNumber(); } current->args+=" ( "; if (!ql.isEmpty()) { QValueList<QString>::Iterator iter = ql.begin(); for ( ; iter != ql.end(); ++iter) { if (sem) { current->args+=','; } Argument *arg=new Argument; arg->name=((QCString)*iter).stripWhiteSpace(); current->argList->append(arg); current->args+=(QCString)*iter; sem = TRUE; } } current->args+=" ) "; bufferClear(); }//parseProcessProto /* * parses a function|procedure protoype */ static void parseFunctionProto() { QCString name,ret,qcs,temp; bool sem=FALSE; QList<Argument> ql; ql.setAutoDelete(TRUE); getBufText(qcs,0); if (qcs.contains('(') != qcs.contains(')')) return; // function without a prototype if (qcs.contains("function",FALSE)==0 && qcs.contains("procedure",FALSE)==0) return; qcs=qcs.stripWhiteSpace(); temp=qcs.lower(); if (temp.stripPrefix("impure")) { current->exception="impure"; qcs=qcs.remove(0,6); } else if (temp.stripPrefix("pure")) { current->exception="pure"; qcs=qcs.remove(0,4); } VhdlDocGen::parseFuncProto(qcs.data(),ql,name,ret); //printf("parseFuncProto(%s)=%s,%s\n",qcs.data(),name.data(),ret.data()); VhdlDocGen::deleteAllChars(name,';'); current->name=name; current->startLine=iFuncLine; current->bodyLine=iFuncLine; int count = ql.count(); current->args+" ( "; for (int k=0;k<count;k++) { if (sem) { current->args+=","; } Argument *arg=new Argument; Argument *hh=(Argument*)ql.at(k); arg->name=hh->name; arg->type=hh->type; arg->defval=hh->defval; arg->attrib=hh->attrib; current->argList->append(arg); current->args+=hh->name; sem=TRUE; } current->args+" )"; if (!ret.isEmpty()) current->spec=VhdlDocGen::FUNCTION; else current->spec=VhdlDocGen::PROCEDURE; current->section=Entry::FUNCTION_SEC; current->type=ret; //addSubEntry(ee,ppEntry); if (lastCompound) { lastCompound->addSubEntry(current); current = new Entry; initEntry(current); } else { newEntry(); } bufferClear(); }//parseFunctionProto static Entry* getEntryAtLine(const Entry* ce,int line) { EntryListIterator eli(*ce->children()); Entry *found=0; Entry *rt; for (;(rt=eli.current());++eli) { if (rt->bodyLine==line) { found=rt; } // if if (!found) { found=getEntryAtLine(rt,line); } } return found; }// getEntryAtLine //------------------------------------------------------------------------- static void parserInit() { iCounter=0; iTextCounter=0; yyLineNr=1; current=0; previous=0; isFunc=0; isBody=0; scantype=0; lastCompound=0; lastEntity=0; bropen=0; openGroups=0; iDocLine=-1; qrl.clear(); num_chars=0; if (!g_lexInit) { VhdlDocGen::init(); } g_bufSize=inputFile.size()+1024; if (g_buf==0) free(g_buf); g_buf=(char*)(calloc(g_bufSize,sizeof(char))); if (g_buf==0) { fprintf(stderr,"\n not enough memory"); return; } g_buf[g_bufSize-1]='\0'; } bool VHDLLanguageScanner::needsPreprocessing(const QCString &) { return FALSE; } void VHDLLanguageScanner::resetCodeParserState() { } #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); static int yyread(char *buf,int max_size) { int c=0; if (g_inputFromFile) { c = inputFile.readBlock(buf,max_size); if (c==-1) yy_fatal_error("input in flex scanner failed"); } else { while ( c < max_size && inputString[inputPosition] ) { *buf = inputString[inputPosition++] ; c++; buf++; } } return c; } /* start command character */ /* -------------- VHDL SECTION -----------------------------------*/ /* Removed due to bug 538239 POST "postponed" PROCESS ({BR}*{FUNCNAME}{B}*[:]{BR}*({POST}{BR}+)?("process"){BR}*{PROTO})|("process"){BR}*("("){BR}*{PROTO}|[^a-zA-Z]("process"){CR}|[^a-zA-Z]("process"){BR}+("is") */ /* VHDL 2001 */ /* language parsing states */ #line 7950 "<stdout>" #define INITIAL 0 #define Start 1 #define Comment 2 #define FindTypeName 3 #define ParseType 4 #define ParseRecord 5 #define ParseUnits 6 #define ParseProcess 7 #define ParseFunc 8 #define FindName 9 #define FindEntityName 10 #define FindGenPort 11 #define FindTypes 12 #define FindSigName 13 #define FindFuncName 14 #define FindBegin 15 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include <unistd.h> #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int vhdlscanYYlex_destroy (void ); int vhdlscanYYget_debug (void ); void vhdlscanYYset_debug (int debug_flag ); YY_EXTRA_TYPE vhdlscanYYget_extra (void ); void vhdlscanYYset_extra (YY_EXTRA_TYPE user_defined ); FILE *vhdlscanYYget_in (void ); void vhdlscanYYset_in (FILE * in_str ); FILE *vhdlscanYYget_out (void ); void vhdlscanYYset_out (FILE * out_str ); yy_size_t vhdlscanYYget_leng (void ); char *vhdlscanYYget_text (void ); int vhdlscanYYget_lineno (void ); void vhdlscanYYset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int vhdlscanYYwrap (void ); #else extern int vhdlscanYYwrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 262144 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( vhdlscanYYtext, vhdlscanYYleng, 1, vhdlscanYYout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( vhdlscanYYin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( vhdlscanYYin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, vhdlscanYYin))==0 && ferror(vhdlscanYYin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(vhdlscanYYin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int vhdlscanYYlex (void); #define YY_DECL int vhdlscanYYlex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after vhdlscanYYtext and vhdlscanYYleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( vhdlscanYYleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (vhdlscanYYtext[vhdlscanYYleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 691 "vhdlscanner.l" #line 8153 "<stdout>" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)vhdlscanYYalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYYlex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! vhdlscanYYin ) vhdlscanYYin = stdin; if ( ! vhdlscanYYout ) vhdlscanYYout = stdout; if ( ! YY_CURRENT_BUFFER ) { vhdlscanYYensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = vhdlscanYY_create_buffer(vhdlscanYYin,YY_BUF_SIZE ); } vhdlscanYY_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of vhdlscanYYtext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1861 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 27243 ); yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; goto find_rule; /* Shut up GCC warning -Wall */ find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; if ( yy_act & YY_TRAILING_HEAD_MASK || (yy_looking_for_trail_begin) ) { if ( yy_act == (yy_looking_for_trail_begin) ) { (yy_looking_for_trail_begin) = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; } else { (yy_full_match) = yy_cp; (yy_full_state) = (yy_state_ptr); (yy_full_lp) = (yy_lp); break; } ++(yy_lp); goto find_rule; } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 693 "vhdlscanner.l" { lineCount(); } YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 699 "vhdlscanner.l" { // found configuration QCString qcs(vhdlscanYYtext); current->name=VhdlDocGen::getIndexWord(qcs,1); current->type=VhdlDocGen::getIndexWord(qcs,3); current->startLine=yyLineNr; current->bodyLine=yyLineNr; current->section=Entry::VARIABLE_SEC; current->spec=VhdlDocGen::CONFIG; current->args="configuration"; newEntry(); BEGIN(Start); } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP #line 713 "vhdlscanner.l" { // found type constant|type|attribute and so on.. bropen=0; lineCount(); bufferClear(); //pEntry=current; getType(current,vhdlscanYYtext); current->bodyLine=yyLineNr; if (current->spec==VhdlDocGen::UNITS) { //addSubEntry(current,pEntry); current->startLine=yyLineNr; current->bodyLine=yyLineNr; newEntry(); // adds the unit to the lastCompound genPort=3; BEGIN(ParseRecord); } else { BEGIN(FindTypeName); } } YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP #line 736 "vhdlscanner.l" { //found architecure lineCount(); bropen=0; bufferClear(); isBody=0; lastCompound = current; QCString curName=VhdlDocGen::getIndexWord(vhdlscanYYtext,1); current->section=Entry::CLASS_SEC; //Entry::CLASS_SEC; current->spec=VhdlDocGen::ARCHITECTURE; current->protection=Private; current->name=curName; current->fileName=yyFileName; current->startLine=yyLineNr; current->bodyLine=yyLineNr; //printf("-> Architecture at line %d\n",yyLineNr); BEGIN(FindName); } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP #line 755 "vhdlscanner.l" { //found process lineCount(); iFuncLine=yyLineNr; bropen=0; //printf("--> Process: line=%d\n",yyLineNr); bufferClear(); addText(vhdlscanYYtext,vhdlscanYYleng); QCString qcs(vhdlscanYYtext); if (qcs.contains('(')) { bropen=1; scantype=2; BEGIN(ParseType); } else { // iFuncLine--; parseProcessProto(); BEGIN(ParseProcess); } } YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP #line 777 "vhdlscanner.l" { // found library or package bropen=0; bufferClear(); isBody=0; QCString qcs=QCString(vhdlscanYYtext); // lowerString(qcs); qcs=qcs.stripWhiteSpace(); if (stricmp(qcs.data(),"use")==0) { current->spec=VhdlDocGen::USE; current->type="package"; } else { current->spec=VhdlDocGen::LIBRARY; current->type="library"; } current->section=Entry::VARIABLE_SEC; current->bodyLine=yyLineNr; lineCount(); BEGIN(FindName); } YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP #line 800 "vhdlscanner.l" { // found a new function|procedure lineCount(); iFuncLine=yyLineNr; bropen=0; bufferClear(); isFunc=1; addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(FindFuncName); } YY_BREAK case 8: /* rule 8 can match eol */ YY_RULE_SETUP #line 810 "vhdlscanner.l" { // found entity|component|package lineCount(); //printf("--> Entity at line %d\n",yyLineNr); bropen=0; bufferClear(); QCString word(vhdlscanYYtext); word=word.lower(); word=word.stripWhiteSpace(); if (strcmp(word.data(),"entity")==0) { isBody=0; scantype=0; lastCompound=0; current->section=Entry::CLASS_SEC; current->spec=VhdlDocGen::ENTITY; current->protection=Public; current->bodyLine=yyLineNr; current->fileName=yyFileName; lastEntity = current; } else if (strcmp(word.data(),"component")==0) { current->section=Entry::VARIABLE_SEC; // current->stat=TRUE; current->spec=VhdlDocGen::COMPONENT; current->bodyLine=yyLineNr; scantype=1; } else if (strcmp(word,"package")==0) { isBody=0; scantype=0; lastCompound = current; current->section=Entry::CLASS_SEC; current->spec=VhdlDocGen::PACKAGE; current->protection=Package; //VhdlDocGen::PACKAGE; current->bodyLine=yyLineNr; current->fileName=yyFileName; } else err("\n found wrong component at line [%d]",yyLineNr); BEGIN(FindEntityName); } YY_BREAK case 9: /* rule 9 can match eol */ YY_RULE_SETUP #line 857 "vhdlscanner.l" { // found component instantiation // lineCount(); QCString type; QCString tt(vhdlscanYYtext); QRegExp regg("[\\s:.()-]"); QStringList qsl=QStringList::split(regg,tt,false); // consider upper/lower-case letters QStringList qsltemp=QStringList::split(regg,tt.lower(),false); int index=qsltemp.findIndex(QCString("entity"))+1; index+=qsltemp.findIndex(QCString("component"))+1; index+=qsltemp.findIndex(QCString("configuration"))+1; int len=qsltemp.count(); current->spec=VhdlDocGen::COMPONENT_INST; current->section=Entry::VARIABLE_SEC; current->startLine=yyLineNr; current->bodyLine=yyLineNr; if (index!=0 && tt.contains(')')==0) // found component instantiation xxx: configuration/component/entity yyy { current->type=(QCString)qsl[len-3]; } else if (index!=0 && tt.contains(')')) // found component instantiation xxx: entity www.yyy(zzz) { current->type=(QCString)qsl[len-4]; } else { current->type=(QCString)qsl[1]; // found component instantiation xxx:yyy } current->name=QCString(qsl[0]); if (lastCompound) { if (!VhdlDocGen::foundInsertedComponent(current->type,lastCompound)) { BaseInfo *bb=new BaseInfo(current->type,Public,Normal); lastCompound->extends->append(bb); } lastCompound->addSubEntry(current); current = new Entry; initEntry(current); } else { newEntry(); } lineCount(); } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP #line 910 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(Start); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP #line 916 "vhdlscanner.l" { // eat process body lineCount(); BEGIN(ParseProcess); } YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP #line 922 "vhdlscanner.l" { // find end of process lineCount(); current->endBodyLine=yyLineNr; //printf("Process: start=%d end=%d\n",current->bodyLine,current->endBodyLine); if (lastCompound) { lastCompound->addSubEntry(current); current = new Entry; initEntry(current); } else { newEntry(); } BEGIN(Start); } YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP #line 940 "vhdlscanner.l" { lineCount(); } YY_BREAK case 14: YY_RULE_SETUP #line 944 "vhdlscanner.l" { // parse record|unit body lineCount(); QCString zz(vhdlscanYYtext); addSignals(zz.data(),yyLineNr,current); BEGIN(ParseUnits); } YY_BREAK case 15: YY_RULE_SETUP #line 951 "vhdlscanner.l" { // found entity|architecture|component name lineCount(); QCString qcs(vhdlscanYYtext); qcs=qcs.stripWhiteSpace(); if (current->spec==VhdlDocGen::USE || current->spec==VhdlDocGen::LIBRARY) { int j=qcs.length(); int i=qcs.find("."); if (i>0) qcs=qcs.right(j-i-1); i=qcs.find("."); if (i>0) qcs=qcs.left(i); /* -- Consider the case we have more than one entity in one file.Each entity has its own package/library -- declaration. In this case package yyy will be added [with newEntry()] to architecture aaa !! instead to entity -- bbb. We must place these constructs to current_root and the function mapLibPackage() will finish the rest. -- package xxx; -- entity aaa -- .... -- end entity aaa; -- architecture aaa -- ... -- end architecture aaa; -- package yyy; -- entity bbb; */ current->name=qcs; Entry *copy=new Entry(*current); current->reset(); addSubEntry(current_root,copy); // insert into entry list with mapLibPackage() } else if (current->spec==VhdlDocGen::ARCHITECTURE) { //current->name+=qcs.lower(); current->name.prepend(qcs+"::"); //if (lastEntity) //{ // inherit private inheritance relation between entity and architecture //if (!VhdlDocGen::foundInsertedComponent(current->name,lastEntity)) //{ // BaseInfo *bb=new BaseInfo(current->name,Private,Normal); // lastEntity->extends->append(bb); //} //} } else if (current->spec==VhdlDocGen::PACKAGE_BODY) { current->name+=qcs; } else { current->name+=qcs; } if (!(current->spec==VhdlDocGen::USE || current->spec==VhdlDocGen::LIBRARY)) newEntry(); BEGIN(Start); } YY_BREAK case 16: YY_RULE_SETUP #line 1016 "vhdlscanner.l" { // found name of a process|function|procedure lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(ParseType); } YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 1023 "vhdlscanner.l" { lineCount(); current->name=QCString(vhdlscanYYtext); BEGIN(ParseType); } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 1030 "vhdlscanner.l" {lineCount(); BEGIN(Start); } YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 1032 "vhdlscanner.l" { lineCount(); current->section=Entry::VARIABLE_SEC; current->spec=VhdlDocGen::TYPE; current->type="protected"; newEntry(); BEGIN(Start); } YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP #line 1044 "vhdlscanner.l" { // find record lineCount(); if (isFunc) { BEGIN(Start); } genPort=2; current->section=Entry::VARIABLE_SEC; current->spec=VhdlDocGen::RECORD; addText(vhdlscanYYtext,vhdlscanYYleng); newEntry(); // adds the record to the last compound BEGIN(ParseRecord); } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 1059 "vhdlscanner.l" { lineCount(); } YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP #line 1063 "vhdlscanner.l" { lineCount(); genPort=0; bufferClear(); BEGIN(Start); } YY_BREAK case 23: YY_RULE_SETUP #line 1070 "vhdlscanner.l" { // parse record body lineCount(); QCString comment; QCString zz(vhdlscanYYtext); VhdlDocGen::deleteAllChars(zz,';'); //delete ; in unit construct if (zz.contains("--!")) { QStringList ql=QStringList::split("--!",zz,FALSE); comment = ql[1]; zz = ql[0]; } else if (zz.contains("--")) { QStringList ql=QStringList::split("--",zz,FALSE); zz = ql[0]; } initEntry(current); addSignals(zz,yyLineNr,current,comment); addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(ParseRecord); } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP #line 1092 "vhdlscanner.l" { // found a new function in an architecture ? addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); QCString ttt; bool bb=TRUE; getBufText(ttt,0); if (ttt.contains("--")) { unput('-');unput('-'); VhdlDocGen::deleteCharRev(ttt,'-'); VhdlDocGen::deleteCharRev(ttt,'-'); } if (ttt.contains('(') != ttt.contains(')')) { bb=FALSE; } bool ss = VhdlDocGen::isFunctionProto(ttt); //printf("VhdlDocGen::isFunctionProto(%s)=%d\n",ttt.data(),ss); if (ss && bb) { bufferClear(); addText(ttt.data(),ttt.length()); functionEntry=0; //eFuncBody=new Entry; ::parseFunctionProto(); } bufferClear(); BEGIN(ParseType); } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP #line 1123 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(ParseType); } YY_BREAK case 26: YY_RULE_SETUP #line 1129 "vhdlscanner.l" { lineCount(); bropen++; addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(ParseType); } YY_BREAK case 27: YY_RULE_SETUP #line 1136 "vhdlscanner.l" { lineCount(); bropen--; addText(vhdlscanYYtext,vhdlscanYYleng); if (bropen==0 && scantype==2) // process { ::parseProcessProto(); BEGIN(ParseProcess); } // if else { BEGIN(ParseType); } } YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP #line 1152 "vhdlscanner.l" { // found end of function|process QRegExp regg("[\\s;]"); lineCount(); QCString tt(vhdlscanYYtext); tt=tt.lower(); QStringList ql=QStringList::split(regg,tt,FALSE); int index=ql.findIndex(QCString("if"))+1; index+=ql.findIndex(QCString("case"))+1; index+=ql.findIndex(QCString("loop"))+1; index+=ql.findIndex(QCString("generate"))+1; bufferClear(); if (index==0) { if (isFunc) { Entry* pFunc=getEntryAtLine(current_root,iFuncLine); if (pFunc && pFunc->section==Entry::FUNCTION_SEC) { pFunc->endBodyLine=yyLineNr; } isFunc=0; BEGIN(Start); } } } YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP #line 1178 "vhdlscanner.l" { // eat process body lineCount(); BEGIN(ParseFunc); } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP #line 1184 "vhdlscanner.l" { QRegExp regg("[\\s;]"); lineCount(); QCString tt(vhdlscanYYtext); tt=tt.lower(); QStringList ql=QStringList::split(regg,tt,FALSE); int index=ql.findIndex(QCString("if"))+1; index+=ql.findIndex(QCString("case"))+1; index+=ql.findIndex(QCString("loop"))+1; index+=ql.findIndex(QCString("generate"))+1; bufferClear(); if (index==0 && isFunc) { Entry* pFunc=getEntryAtLine(current_root,iFuncLine); if (pFunc && pFunc->section==Entry::FUNCTION_SEC) { pFunc->endBodyLine=yyLineNr; } isFunc=0; BEGIN(Start); } } YY_BREAK case 31: YY_RULE_SETUP #line 1207 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); if (bropen==0 && !(isFunc==1 && isBody==1) ) { if (isFunc) { parseFunctionProto(); bufferClear(); if (lastCompound && lastCompound->spec==VhdlDocGen::PACKAGE) { isFunc=0; BEGIN(Start); } else { BEGIN(ParseFunc); } }//if else { QCString qcs; getBufText(qcs,0); qcs=qcs.stripWhiteSpace(); current->section=Entry::VARIABLE_SEC; current->type+=qcs.data(); if ((current->spec==VhdlDocGen::SIGNAL || current->spec==VhdlDocGen::CONSTANT || current->spec==VhdlDocGen::TYPE || current->spec==VhdlDocGen::SUBTYPE || current->spec==VhdlDocGen::SHAREDVARIABLE ) && qcs.stripPrefix(",")) { QList<QCString> ql; ql.setAutoDelete(TRUE); QCString buffer; if (current->spec==VhdlDocGen::SUBTYPE || current->spec==VhdlDocGen::TYPE ) { VhdlDocGen::getSigTypeName(ql,qcs.data(),buffer); } else { VhdlDocGen::getSigName(ql,qcs.data(),buffer); } QCString doc = current->doc; QCString brief = current->brief; if (ql.count()>0) { for (uint j=1;j<ql.count();j++) { Entry *ppt = new Entry; initEntry(ppt); ppt->type += ql.at(0)->data(); ppt->section = Entry::VARIABLE_SEC; ppt->spec = current->spec; ppt->name += ql.at(j)->data(); ppt->bodyLine = yyLineNr; ppt->startLine = yyLineNr; ppt->brief = brief; ppt->doc = doc; if (lastCompound) { lastCompound->addSubEntry(ppt); } else { current->addSubEntry(ppt); } } current->type=ql.at(0)->data(); ql.clear(); } } if (lastCompound) { lastCompound->addSubEntry(current); current = new Entry; initEntry(current); } else { newEntry(); } isFunc=0; bufferClear(); BEGIN(Start); } } else { BEGIN(ParseType); } } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP #line 1305 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); BEGIN(ParseType); } YY_BREAK case 33: YY_RULE_SETUP #line 1311 "vhdlscanner.l" { // found name of an entity/architecture/package lineCount(); QCString qcs(vhdlscanYYtext); qcs=qcs.stripWhiteSpace(); qcs=qcs.lower(); if (strcmp(qcs.data(),"body")==0) // found package body { current->spec=VhdlDocGen::PACKAGE_BODY; current->section=Entry::CLASS_SEC; current->protection=Protected; current->name+=QCString("_"); isBody=1; BEGIN(FindName); } else if (scantype==1) // found a component { QCString qq(vhdlscanYYtext); qq=qq.stripWhiteSpace(); //qq=qq.lower(); current->name=qq; qq=qq.lower(); if (lastCompound) { if (lastCompound->spec==VhdlDocGen::PACKAGE) { if (!VhdlDocGen::foundInsertedComponent(qq,lastCompound)) { BaseInfo *bb=new BaseInfo(qq,Private,Normal); lastCompound->extends->append(bb); } } lastCompound->addSubEntry(current); current = new Entry; initEntry(current); } else { newEntry(); } BEGIN(Start); } else { QCString qq(vhdlscanYYtext); qq=qq.stripWhiteSpace(); current->name=qq; newEntry(); //QCString qreal=QCString(vhdlscanYYtext); BEGIN(Start); } } YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP #line 1365 "vhdlscanner.l" { // found generic|port in entity QCString genp(vhdlscanYYleng+1); deleteSpecChars(vhdlscanYYtext,genp.data()); VhdlDocGen::deleteCharRev(genp,'('); if (stricmp(genp.data(),"port" )==0) { genPort=1; } else { genPort=0; } bropen=1; bufferClear(); lineCount(); BEGIN(FindSigName); } YY_BREAK case 35: YY_RULE_SETUP #line 1385 "vhdlscanner.l" { lineCount(); bropen--; addText(vhdlscanYYtext,vhdlscanYYleng); if (bropen==0) { bufferClear(); BEGIN(Start); } else { BEGIN(FindSigName); } } YY_BREAK case 36: /* rule 36 can match eol */ YY_RULE_SETUP #line 1400 "vhdlscanner.l" { // found signals in entity QCString line(vhdlscanYYtext); // note that line can be something like: // "var1, var2, var3 : in std_logic_vector(8 downto 0); --! Some comment" // but also // "var4 --! Some comment // );" // which marks the end of a port // and also // "-- Some comment // var1 : in std_logic;" //printf("--> labelid='%s'\n",line.data()); QStringList ql; QCString comment; int openCount=line.contains('('); int closeCount=line.contains(')'); int semi = line.find(';'); int pos = line.find("--"); int pos1 = line.find("--!"); if (pos!=-1 && pos<pos1) // strip normal comment before special one { line = line.remove(pos,pos1-pos); } //printf("=> signal: line='%s'\n",line.data()); if (semi!=-1 && pos!=-1) { int eol = line.findRev('\n'); //printf("pos=%d eol=%d\n",pos,eol); if (eol>=pos+2) { QRegExp re("\\n[\\s]*--!"); // comment continuation comment=line.mid(pos+2,eol-pos-2); //printf("Comment: '%s'\n",comment.data()); int p,l; while ((p=re.match(comment,0,&l))!=-1) { comment.remove(p,l); } line=line.left(pos)+line.right(line.length()-eol); } else { comment=line.mid(pos+2); line=line.left(pos); } comment.stripWhiteSpace(); // must subtract "(" and ")" in comments because they are used for determining the // end of a port/generic construct openCount-=comment.contains('('); closeCount-=comment.contains(')'); if (!comment.stripPrefix("!")) // not a special comment { comment.resize(0); } } else { //printf("no ; or --: pos=%d semi=%d\n",pos,semi); } int diff=openCount-closeCount; if (diff<0) { VhdlDocGen::deleteCharRev(line,')'); } if (scantype!=1) // not a component { addText(vhdlscanYYtext,vhdlscanYYleng); addSignals(line,yyLineNr,lastEntity,comment); } lineCount(); if ((bropen+openCount-closeCount)==0) { bufferClear(); BEGIN(Start); } } YY_BREAK case 37: YY_RULE_SETUP #line 1485 "vhdlscanner.l" { lineCount(); bropen++; addText(vhdlscanYYtext,vhdlscanYYleng); } YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP #line 1492 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); //BEGIN(FindSigName); } YY_BREAK case 39: /* rule 39 can match eol */ YY_RULE_SETUP #line 1499 "vhdlscanner.l" { //printf("\n found for[%s] [%d]",vhdlscanYYtext,yyLineNr); lineCount(); } YY_BREAK case 40: YY_RULE_SETUP #line 1504 "vhdlscanner.l" { // found digit addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); } YY_BREAK case 41: YY_RULE_SETUP #line 1509 "vhdlscanner.l" { // Make sure string literals get transfered to the output // We have to match these because the comment characters (--) // can exist inside a string literal. // We shouldn't have to call lineCount because newlines // are not allowed inside string literals addText(vhdlscanYYtext,vhdlscanYYleng); } YY_BREAK /* <*>{BR}*"--!"{B}*"@}" { // end group if (current) { Entry *pg=new Entry; addSubEntry(current,pg); pg->startLine=yyLineNr; pg->name="endgroup"; } lineCount(); } <*>{BR}*"--!"{B}*"@{" { // start group if (current) { Entry *pg=new Entry; addSubEntry(current,pg); pg->startLine=yyLineNr; pg->name="startgroup"; } lineCount(); } */ case 42: /* rule 42 can match eol */ YY_RULE_SETUP #line 1542 "vhdlscanner.l" { // multi line comment if (iDocLine==-1) iDocLine=yyLineNr; // signal clk :in std_logic; --!@brief global clock // --!@brief global reset // signal reset:in std_logic; // these two comments are detected as a multi line comment QCString qc(vhdlscanYYtext); int len=qc.contains('\n')+yyLineNr-1; if (YY_START!=Comment) // Start of the comment block { bufferClear(); iTextCounter=0; startComment=yyLineNr; g_lastCommentContext=YY_START; } Entry* pTemp=getEntryAtLine(current_root,len); if (pTemp) { // found one line comment, add it to the entry on this line pTemp->briefLine=yyLineNr; pTemp->brief+=vhdlscanYYtext; VhdlDocGen::prepareComment(pTemp->brief); } else { addText(vhdlscanYYtext,vhdlscanYYleng); } lineCount(); BEGIN(Comment); } YY_BREAK case 43: YY_RULE_SETUP #line 1574 "vhdlscanner.l" { if (iDocLine==-1) iDocLine=yyLineNr; addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); } YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP #line 1580 "vhdlscanner.l" { // found end of comment block QCString qcs; getBufText(qcs,iTextCounter); VhdlDocGen::prepareComment(qcs); int ii =qcs.find("\\code"); if (ii>0) { iCodeLen=num_chars; gBlock.reset(); int len=qcs.length(); QCString name=qcs.right(len-ii); name=VhdlDocGen::getIndexWord(name.data(),1); if (!name) gBlock.name="misc"+ VhdlDocGen::getRecordNumber(); else gBlock.name=name; qcs=qcs.left(ii); gBlock.startLine=yyLineNr+1; gBlock.bodyLine=yyLineNr+1; gBlock.brief+=qcs; iTextCounter=0; } if (ii==-1) { handleCommentBlock(qcs,FALSE); } bufferClear(); unput(*vhdlscanYYtext); BEGIN(g_lastCommentContext); } YY_BREAK case 45: YY_RULE_SETUP #line 1614 "vhdlscanner.l" { // one line comment if (iDocLine==-1) iDocLine=yyLineNr; QCString qcs(vhdlscanYYtext); int j=qcs.find("--!"); qcs=qcs.right(qcs.length()-3-j); bool isEndCode=qcs.contains("\\endcode"); if (isEndCode) makeInline(); //printf("--> handleCommentBlock line %d\n",yyLineNr); Entry* pTemp=getEntryAtLine(current_root,yyLineNr); if (!isEndCode) { if (pTemp) { pTemp->briefLine=yyLineNr; pTemp->brief+=qcs; iDocLine=-1; } else { handleCommentBlock(qcs,TRUE); } } bufferClear(); }// one line YY_BREAK case 46: YY_RULE_SETUP #line 1644 "vhdlscanner.l" { } YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP #line 1647 "vhdlscanner.l" { lineCount(); addText(vhdlscanYYtext,vhdlscanYYleng); // printf("\n new-line [%d]",yyLineNr); BEGIN(Start); } YY_BREAK case 48: YY_RULE_SETUP #line 1654 "vhdlscanner.l" { addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); } YY_BREAK case 49: YY_RULE_SETUP #line 1659 "vhdlscanner.l" { addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); } YY_BREAK case 50: YY_RULE_SETUP #line 1664 "vhdlscanner.l" { addText(vhdlscanYYtext,vhdlscanYYleng); lineCount(); } YY_BREAK case 51: YY_RULE_SETUP #line 1670 "vhdlscanner.l" ECHO; YY_BREAK #line 9415 "<stdout>" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Start): case YY_STATE_EOF(Comment): case YY_STATE_EOF(FindTypeName): case YY_STATE_EOF(ParseType): case YY_STATE_EOF(ParseRecord): case YY_STATE_EOF(ParseUnits): case YY_STATE_EOF(ParseProcess): case YY_STATE_EOF(ParseFunc): case YY_STATE_EOF(FindName): case YY_STATE_EOF(FindEntityName): case YY_STATE_EOF(FindGenPort): case YY_STATE_EOF(FindTypes): case YY_STATE_EOF(FindSigName): case YY_STATE_EOF(FindFuncName): case YY_STATE_EOF(FindBegin): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed vhdlscanYYin at a new source and called * vhdlscanYYlex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = vhdlscanYYin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( vhdlscanYYwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * vhdlscanYYtext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of vhdlscanYYlex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; vhdlscanYYrestart(vhdlscanYYin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) vhdlscanYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1861 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1861 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 1860); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up vhdlscanYYtext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ vhdlscanYYrestart(vhdlscanYYin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( vhdlscanYYwrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve vhdlscanYYtext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void vhdlscanYYrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ vhdlscanYYensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = vhdlscanYY_create_buffer(vhdlscanYYin,YY_BUF_SIZE ); } vhdlscanYY_init_buffer(YY_CURRENT_BUFFER,input_file ); vhdlscanYY_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void vhdlscanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * vhdlscanYYpop_buffer_state(); * vhdlscanYYpush_buffer_state(new_buffer); */ vhdlscanYYensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; vhdlscanYY_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (vhdlscanYYwrap()) processing, but the only time this flag * is looked at is after vhdlscanYYwrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void vhdlscanYY_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; vhdlscanYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE vhdlscanYY_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) vhdlscanYYalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYY_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) vhdlscanYYalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYY_create_buffer()" ); b->yy_is_our_buffer = 1; vhdlscanYY_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with vhdlscanYY_create_buffer() * */ void vhdlscanYY_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) vhdlscanYYfree((void *) b->yy_ch_buf ); vhdlscanYYfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a vhdlscanYYrestart() or at EOF. */ static void vhdlscanYY_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; vhdlscanYY_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then vhdlscanYY_init_buffer was _probably_ * called from vhdlscanYYrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void vhdlscanYY_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) vhdlscanYY_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void vhdlscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; vhdlscanYYensure_buffer_stack(); /* This block is copied from vhdlscanYY_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from vhdlscanYY_switch_to_buffer. */ vhdlscanYY_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void vhdlscanYYpop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; vhdlscanYY_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { vhdlscanYY_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void vhdlscanYYensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)vhdlscanYYalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYYensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)vhdlscanYYrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYYensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE vhdlscanYY_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) vhdlscanYYalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYY_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; vhdlscanYY_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to vhdlscanYYlex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * vhdlscanYY_scan_bytes() instead. */ YY_BUFFER_STATE vhdlscanYY_scan_string (yyconst char * yystr ) { return vhdlscanYY_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to vhdlscanYYlex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE vhdlscanYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) vhdlscanYYalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscanYY_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = vhdlscanYY_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in vhdlscanYY_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up vhdlscanYYtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ vhdlscanYYtext[vhdlscanYYleng] = (yy_hold_char); \ (yy_c_buf_p) = vhdlscanYYtext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ vhdlscanYYleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int vhdlscanYYget_lineno (void) { return vhdlscanYYlineno; } /** Get the input stream. * */ FILE *vhdlscanYYget_in (void) { return vhdlscanYYin; } /** Get the output stream. * */ FILE *vhdlscanYYget_out (void) { return vhdlscanYYout; } /** Get the length of the current token. * */ yy_size_t vhdlscanYYget_leng (void) { return vhdlscanYYleng; } /** Get the current token. * */ char *vhdlscanYYget_text (void) { return vhdlscanYYtext; } /** Set the current line number. * @param line_number * */ void vhdlscanYYset_lineno (int line_number ) { vhdlscanYYlineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see vhdlscanYY_switch_to_buffer */ void vhdlscanYYset_in (FILE * in_str ) { vhdlscanYYin = in_str ; } void vhdlscanYYset_out (FILE * out_str ) { vhdlscanYYout = out_str ; } int vhdlscanYYget_debug (void) { return vhdlscanYY_flex_debug; } void vhdlscanYYset_debug (int bdebug ) { vhdlscanYY_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from vhdlscanYYlex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT vhdlscanYYin = stdin; vhdlscanYYout = stdout; #else vhdlscanYYin = (FILE *) 0; vhdlscanYYout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * vhdlscanYYlex_init() */ return 0; } /* vhdlscanYYlex_destroy is for both reentrant and non-reentrant scanners. */ int vhdlscanYYlex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ vhdlscanYY_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; vhdlscanYYpop_buffer_state(); } /* Destroy the stack itself. */ vhdlscanYYfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; vhdlscanYYfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * vhdlscanYYlex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *vhdlscanYYalloc (yy_size_t size ) { return (void *) malloc( size ); } void *vhdlscanYYrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void vhdlscanYYfree (void * ptr ) { free( (char *) ptr ); /* see vhdlscanYYrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 1670 "vhdlscanner.l" static void initEntry(Entry *e) { e->fileName = yyFileName; initGroupInfo(e); } static void newEntry() { // Add only enties/architectures/packages to root // and signals to classes where they were found // ENTITY dlatch_93 IS -- VHDL'93-Syntax !!! // PORT (d, clk : IN bit; // q, qbar : OUT bit); // GROUP path IS (SIGNAL, SIGNAL); // GROUP d_to_q : path (d, q); // ATTRIBUTE propagation : time; // END dlatch_93; if (current->spec==VhdlDocGen::ENTITY || current->spec==VhdlDocGen::PACKAGE || current->spec==VhdlDocGen::ARCHITECTURE || current->spec==VhdlDocGen::PACKAGE_BODY) { current_root->addSubEntry(current); } else { if (lastCompound) { lastCompound->addSubEntry(current); } else { if (lastEntity) { lastEntity->addSubEntry(current); } else { current_root->addSubEntry(current); // should not happen! } } } previous = current; current = new Entry ; initEntry(current); } static void handleCommentBlock(const QCString &doc,bool brief) { int position=0; bool needsEntry=FALSE; Protection protection=Public; int lineNr = iDocLine; if (brief) current->briefLine = iDocLine; else current->docLine = iDocLine; //printf("parseCommentBlock %p [%s]\n",current,doc.data()); while (parseCommentBlock( g_thisParser, current, doc, // text yyFileName, // file lineNr, // line of block start brief, docBlockAutoBrief, FALSE, protection, position, needsEntry ) ) { //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position); if (needsEntry) newEntry(); } if (needsEntry) { newEntry(); } if (docBlockTerm) { unput(docBlockTerm); docBlockTerm=0; } iDocLine=-1; } #if 0 /*! * adds grouping to the entries */ static void mergeGrouping(const Entry* ce,int) { EntryListIterator eli(*ce->children()); Entry *rt; for (;(rt=eli.current());++eli) { if (rt->section==Entry::GROUPDOC_SEC) { if (openGroups) { QCString tt=(QCString)qrl.last(); if (!tt.isEmpty()) { rt->groups->append(new Grouping(tt.data(),Grouping::GROUPING_LOWEST)); } } qrl.append(rt->name); } if ((strcmp(rt->name.data(),"endgroup")==0) && !qrl.isEmpty()) { qrl.remove((QCString)qrl.last()); openGroups--; } if ((strcmp(rt->name.data(),"startgroup")==0)) { openGroups++; } if (rt->section!=Entry::GROUPDOC_SEC && openGroups && !qrl.isEmpty()) { rt->groups->append(new Grouping(qrl.last().data(),Grouping::GROUPING_LOWEST)); } mergeGrouping(rt,openGroups); } } #endif /* * adds the library|use statements to the next class (entity|package|architecture|package body * library ieee * entity xxx * ..... * library * package * enity zzz * ..... * and so on.. */ static void mapLibPackage(const Entry* ce) { Entry *lastComp=0; while (TRUE) { bool found = FALSE; Entry *rt=0; //const QList<Entry> *epp=ce->children(); EntryListIterator eli(*ce->children()); EntryListIterator eli1=eli; for (;(rt=eli.current()),eli1=eli;++eli) { if (rt->spec==VhdlDocGen::LIBRARY || rt->spec==VhdlDocGen::USE) // top level library or use statement { Entry *temp=0; for (;(temp=eli1.current());++eli1) // find next entity { if (temp->spec==VhdlDocGen::ENTITY || temp->spec==VhdlDocGen::PACKAGE || temp->spec==VhdlDocGen::ARCHITECTURE || temp->spec==VhdlDocGen::PACKAGE_BODY) { Entry *ee=new Entry(*rt); //append a copy to entries sublist temp->addSubEntry(ee); found=TRUE; rt->spec=-1; //nullify entry rt->section=0; lastComp=temp; break; } }//for if (lastComp && rt->spec!=-1) { Entry *ee=new Entry(*rt); //append a copy to entries sublist lastComp->addSubEntry(ee); found=TRUE; rt->spec=-1; //nullify entry rt->section=0; } }//if }//for if (!found) // nothing left to do { return; } }//while }//MapLib #if 0 /*! * merges a brief descriptions to the next entry */ void mergeBrief(const Entry* ce) { EntryListIterator eli(*ce->children()); Entry *rt; for (;(rt=eli.current());++eli) { if (found && (!eMerge.brief.isEmpty() || !eMerge.doc.isEmpty())) { rt->doc+=eMerge.doc.data(); rt->docLine=eMerge.docLine; rt->brief+=eMerge.brief.data(); rt->briefLine=eMerge.briefLine; found=FALSE; } if ((strcmp(rt->name.data(),"string")==0)) { eMerge.reset(); eMerge.doc+=rt->doc.data(); eMerge.docLine=rt->docLine; eMerge.brief+=rt->brief.data(); eMerge.briefLine=rt->briefLine; found=TRUE; } MergeBrief(rt); } } #endif void vhdlscanFreeScanner() { #if defined(YY_FLEX_SUBMINOR_VERSION) if (g_lexInit) { vhdlscanYYlex_destroy(); } if (g_buf) { free(g_buf); } g_buf=0; #endif } void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root) { inputFile.setName(fileName); //uint jfile=inputFile.size(); ::parserInit(); yyFileName=QCString(fileName); groupEnterFile(fileName,yyLineNr); g_thisParser = this; g_inputFromFile = FALSE; inputPosition = 0; assert(root!=0); inputString=fileBuf; inputLen=strlen(fileBuf); current_root = root; global_root = root; current=new Entry; initEntry(current); //current_root->name=QCString("XXX"); // dummy name for root if (!inputFile.open(IO_ReadOnly)) { err("\n\n could not open file: %s !!\n\n",yyFileName.data()); return ; } if (g_lexInit) { vhdlscanYYrestart(vhdlscanYYin); unput(' '); BEGIN(Start); } vhdlscanYYlex(); g_lexInit=TRUE; free(g_buf); g_buf=0; delete current; current=0; groupLeaveFile(yyFileName,yyLineNr); inputFile.close(); //mergeBrief(current_root); //mergeGrouping(current_root,0); mapLibPackage(current_root); } void VHDLLanguageScanner::parsePrototype(const char *text) { // will be called when a \fn command is found in a comment block QCString ss,ret; bool sem=FALSE; bool func=FALSE; QList<Argument> qs; qs.setAutoDelete(TRUE); VhdlDocGen::parseFuncProto(text,qs,ss,ret,TRUE); int count=qs.count(); if (stricmp(ret.data(),"function")==0) { func=TRUE; } if (count<1 && !func) { return; } Entry *pp = new Entry; initEntry(pp); pp->name=ss.stripWhiteSpace(); pp->args+='('; for (int j=0;j<count;j++) { if (sem) { pp->args+=','; } Argument *ars=(Argument*)(qs.at(j)); Argument *arg=new Argument; arg->attrib = ars->attrib; arg->name = ars->name; arg->type = ars->type; pp->args+=ars->name.data(); pp->args+=" "; pp->args+=ars->type.data(); pp->argList->append(arg); sem=TRUE; } pp->args+=')'; if (!ret.isEmpty()) pp->spec=VhdlDocGen::FUNCTION; else pp->spec=VhdlDocGen::PROCEDURE; if (pp->section == Entry::MEMBERDOC_SEC && pp->args.isEmpty()) pp->section = Entry::VARIABLEDOC_SEC; pp->type=ret; current_root->addSubEntry(pp); } void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, bool isExampleBlock, const char *exampleName, FileDef *fileDef, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool showLineNumbers ) { ::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, fileDef,startLine,endLine,inlineFragment,memberDef, showLineNumbers); }
nimbusios/Doxygen
src/vhdlscanner.cpp
C++
gpl-2.0
499,578
<?php namespace wapmorgan\UnifiedArchive; use Exception; use wapmorgan\UnifiedArchive\UnifiedArchive; class CamApplication { /** * @param $file * @return UnifiedArchive * @throws Exception * @throws \Archive7z\Exception */ protected function open($file) { if (!UnifiedArchive::canOpenArchive($file)) throw new Exception('Could not open archive '.$file.'. Try installing suggested packages or run `cam -f` to see formats support.'); $archive = UnifiedArchive::open($file); if ($archive === null) throw new Exception('Could not open archive '.$file); return $archive; } /** * */ public function checkFormats() { $types = [ '.zip' => [UnifiedArchive::canOpenType(UnifiedArchive::ZIP), 'install "zip" extension'], '.rar' => [UnifiedArchive::canOpenType(UnifiedArchive::RAR), 'install "rar" extension'], '.gz' => [UnifiedArchive::canOpenType(UnifiedArchive::GZIP), 'install "zlib" extension'], '.bz2' => [UnifiedArchive::canOpenType(UnifiedArchive::BZIP), 'install "bz2" extension'], '.xz' => [UnifiedArchive::canOpenType(UnifiedArchive::LZMA), 'install "xz" extension'], '.7z' => [UnifiedArchive::canOpenType(UnifiedArchive::SEVEN_ZIP), 'install "gemorroj/archive7z" package'], '.iso' => [UnifiedArchive::canOpenType(UnifiedArchive::ISO), 'install "phpclasses/php-iso-file" package'], '.cab' => [UnifiedArchive::canOpenType(UnifiedArchive::CAB), 'install "wapmorgan/cab-archive" package'], '.tar' => [UnifiedArchive::canOpenType(UnifiedArchive::TAR), 'install "phar" extension or "pear/archive_tar" package'], '.tar.gz' => [UnifiedArchive::canOpenType(UnifiedArchive::TAR_GZIP), 'install "phar" extension or "pear/archive_tar" package and "zlib" extension'], '.tar.bz2' => [UnifiedArchive::canOpenType(UnifiedArchive::TAR_BZIP), 'install "phar" extension or "pear/archive_tar" package and "bz2" extension'], '.tar.xz' => [UnifiedArchive::canOpenType(UnifiedArchive::TAR_LZMA), 'install "pear/archive_tar" package and "xz" extension'], '.tar.Z' => [UnifiedArchive::canOpenType(UnifiedArchive::TAR_LZW), 'install "pear/archive_tar" package and "compress" system utility'], ]; $installed = $not_installed = []; foreach ($types as $extension => $configuration) { if ($configuration[0]) { $installed[] = $extension; } else { $not_installed[$extension] = $configuration[1]; } } if (!empty($installed)) { echo 'Supported archive types: '.implode(', ', $installed).PHP_EOL; } if (!empty($not_installed)) { echo 'Not supported archive types:'.PHP_EOL; array_walk($not_installed, function ($instruction, $extension) { echo '- '.$extension.': '.$instruction.PHP_EOL; }); } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function listArray($args) { $archive = $this->open($args['ARCHIVE']); foreach ($archive->getFileNames() as $file) { echo $file.PHP_EOL; } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function table($args) { $archive = $this->open($args['ARCHIVE']); echo sprintf('%51s | %4s | %-18s'.PHP_EOL, 'File name', 'Size', 'Date'); echo str_repeat('-', 80).PHP_EOL; foreach ($archive->getFileNames() as $file) { $info = $archive->getFileData($file); $size = $this->formatSize($info->uncompressedSize); $file_name = strlen($file) > 51 ? substr($file, 0, 49).'..' : $file; echo sprintf('%-51s | %1.1f%s | %18s'.PHP_EOL, $file_name, $size[0], $size[1], $this->formatDate($info->modificationTime) ); } $size = $this->formatSize($archive->countUncompressedFilesSize()); $packed_size = $this->formatSize($archive->countCompressedFilesSize()); echo str_repeat('-', 80).PHP_EOL; echo sprintf('%51s | %1.1f%s | %1.1f%s'.PHP_EOL, 'Total '.$archive->countFiles().' file(s)', $size[0], $size[1], $packed_size[0], $packed_size[1]); } /** * @param $bytes * @param int $precision * @return array */ public function formatSize($bytes, $precision = 1) { $units = array('b', 'k', 'm', 'g', 't'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); $i = round($bytes, $precision); if ($precision == 1 && $i >= 10) { $i = round($i / 1024, 1); $pow++; } return array($i, $units[$pow]); } /** * @param $unixtime * * @return string * @throws \Exception */ public function formatDate($unixtime) { if (strtotime('today') < $unixtime) return 'Today, '.date('G:m', $unixtime); else if (strtotime('yesterday') < $unixtime) return 'Yesterday, '.date('G:m', $unixtime); else { $datetime = new \DateTime(); $datetime->setTimestamp($unixtime); if ($datetime->format('Y') == date('Y')) return $datetime->format('d M, G:m'); else return $datetime->format('d M Y, G:m'); } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function info($args) { $archive = $this->open($args['ARCHIVE']); echo 'Archive type: '.$archive->getArchiveType().PHP_EOL; echo 'Archive changed: '.$this->formatDate(filemtime($args['ARCHIVE'])).PHP_EOL; echo 'Archive contains: '.$archive->countFiles().' file'.($archive->countFiles() > 1 ? 's' : null).PHP_EOL; echo 'Archive compressed size: '.implode(' ', $this->formatSize($archive->countCompressedFilesSize(), 2)).PHP_EOL; echo 'Archive uncompressed size: '.implode(' ', $this->formatSize($archive->countUncompressedFilesSize(), 2)).PHP_EOL; echo 'Archive compression ratio: '.round($archive->countUncompressedFilesSize() / $archive->countCompressedFilesSize(), 6).'/1 ('.floor($archive->countCompressedFilesSize() / $archive->countUncompressedFilesSize() * 100).'%)'.PHP_EOL; } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function extract($args) { $archive = $this->open($args['ARCHIVE']); $output = getcwd(); if (isset($args['--output'])) { if (!is_dir($args['--output'])) mkdir($args['--output']); $output = realpath($args['--output']); } if (empty($args['FILES_IN_ARCHIVE']) || $args['FILES_IN_ARCHIVE'] == array('/') || $args['FILES_IN_ARCHIVE'] == array('*')) { $result = $archive->extractFiles($output); if ($result === false) echo 'Error occured'.PHP_EOL; else echo 'Extracted '.$result.' file(s) to '.$output.PHP_EOL; } else { $extracted = 0; $errored = []; foreach ($args['FILES_IN_ARCHIVE'] as $file) { $result = $archive->extractFiles($output, $file); if ($result === false) $errored[] = $file; else $extracted += $result; } if (!empty($errored)) echo 'Errored: '.implode(', ', $errored).PHP_EOL; if ($extracted > 0) echo 'Exctracted '.$extracted.' file(s) to '.$output.PHP_EOL; } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function printFile($args) { $archive = $this->open($args['ARCHIVE']); foreach ($args['FILES_IN_ARCHIVE'] as $file) { $info = $archive->getFileData($file); if ($info === false) { echo 'File '.$file.' IS NOT PRESENT'.PHP_EOL; continue; } echo 'File content: '.$file.' (size is '.implode('', $this->formatSize($info->uncompressedSize, 1)).')'.PHP_EOL; echo $archive->getFileContent($file).PHP_EOL; } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function details($args) { $archive = $this->open($args['ARCHIVE']); foreach ($args['FILES_IN_ARCHIVE'] as $file) { $info = $archive->getFileData($file); if ($info === false) { echo 'File '.$file.' IS NOT PRESENT'.PHP_EOL; continue; } echo 'File name : '.$file.PHP_EOL; echo 'Compressed size : '.implode('', $this->formatSize($info->compressedSize, 2)).PHP_EOL; echo 'Uncompressed size: '.implode('', $this->formatSize($info->uncompressedSize, 2)).PHP_EOL; echo 'Is compressed : '.($info->isCompressed ? 'yes' : 'no').PHP_EOL; echo 'Date modification: '.$this->formatDate($info->modificationTime).PHP_EOL; } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function delete($args) { $archive = $this->open($args['ARCHIVE']); $files = $archive->getFileNames(); foreach ($args['FILES_IN_ARCHIVE'] as $file) { if (!in_array($file, $files)) { echo 'File '.$file.' is NOT in archive'.PHP_EOL; continue; } if ($archive->deleteFiles($file) === false) echo 'Error file '.$file.PHP_EOL; } } /** * @param $args * @throws Exception * @throws \Archive7z\Exception */ public function add($args) { $archive = $this->open($args['ARCHIVE']); $added_files = $archive->addFiles($args['FILES_ON_DISK']); if ($added_files === false) echo 'Error'.PHP_EOL; else echo 'Added '.$added_files.' file(s)'.PHP_EOL; } /** * @param $args * @throws Exception */ public function create($args) { if (file_exists($args['ARCHIVE'])) { if (is_dir($args['ARCHIVE'])) echo $args['ARCHIVE'].' is a directory!'.PHP_EOL; else { echo 'File '.$args['ARCHIVE'].' already exists!'.PHP_EOL; } } else { $archived_files = UnifiedArchive::archiveFiles($args['FILES_ON_DISK'], $args['ARCHIVE']); if ($archived_files === false) echo 'Error'.PHP_EOL; else echo 'Created archive ' . $args['ARCHIVE'] . ' with ' . $archived_files . ' file(s) of total size ' . implode('', $this->formatSize(filesize($args['ARCHIVE']))) . PHP_EOL; } } }
smartcitiescommunity/Civikmind
vendor/wapmorgan/unified-archive/src/CamApplication.php
PHP
gpl-2.0
11,211
<?php /** * * @package phpBB Extension - martin customlastpost * @copyright (c) 2014 Martin ( https://github.com/Martin-G- ) * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ namespace martin\customlastpost\acp; class main_info { function module() { return array( 'filename' => '\martin\customlastpost\acp\main_module', 'title' => 'ACP_CUSTOMLASTPOST_TITLE', 'version' => '1.0.0', 'modes' => array( 'settings' => array( 'title' => 'ACP_CUSTOMLASTPOST_SETTINGS', 'auth' => 'ext_martin/customlastpost && acl_a_board', 'cat' => array('ACP_CUSTOMLASTPOST_TITLE'), ), ), ); } }
alhitary/CustomLastPost
acp/main_info.php
PHP
gpl-2.0
661
#include "stdafx.h" #include "HandleException.h" #include <dbghelp.h> #pragma comment ( lib, "dbghelp.lib" ) typedef LONG (WINAPI * UNHANDLEDEXCEPTIONFILTER) ( struct _EXCEPTION_POINTERS *ExceptionInfo ); static HANDLE gEventExit = NULL; static LONG lExceptCode = EXCEPTION_EXECUTE_HANDLER; static CHAR szDumpFile[MAX_PATH]={0}; static BOOL bMakeDumpFile = TRUE; //static LPTOP_LEVEL_EXCEPTION_FILTER defaultExceptionCallBack = NULL; static UNHANDLEDEXCEPTIONFILTER Real_UnhandledExceptionFilter = NULL; static PFN_HandleException fnSEHException = NULL; static LONG WINAPI DeBug_CreateDump(EXCEPTION_POINTERS* pExceptionPointers) { BOOL bMiniDumpSuccessful; //TCHAR szFileName[MAX_PATH]; if (bMakeDumpFile) { HANDLE hDumpFile; MINIDUMP_EXCEPTION_INFORMATION ExpParam; SYSTEMTIME sys_time; GetLocalTime(&sys_time); wsprintfA( szDumpFile,"%04d%02d%02d%02d%02d%02d%03d.dmp", sys_time.wYear,sys_time.wMonth,sys_time.wDay,sys_time.wHour, sys_time.wMinute,sys_time.wSecond,sys_time.wMilliseconds); hDumpFile = CreateFileA(szDumpFile, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); if (hDumpFile != INVALID_HANDLE_VALUE) { ExpParam.ThreadId = GetCurrentThreadId(); ExpParam.ExceptionPointers = pExceptionPointers; ExpParam.ClientPointers = TRUE; bMiniDumpSuccessful = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &ExpParam, NULL, NULL); CloseHandle(hDumpFile); } } if(gEventExit) SetEvent(gEventExit); return lExceptCode; } static LONG WINAPI DeBug_UnHandleCreateDump(EXCEPTION_POINTERS* pExceptionPointers) { DeBug_CreateDump(pExceptionPointers); if (fnSEHException) { fnSEHException(szDumpFile); } if(gEventExit) { WaitForSingleObject(gEventExit,3000); } if(EXCEPTION_EXECUTE_HANDLER == lExceptCode) ExitProcess(0); return lExceptCode; } static BOOL StartHookDebug() { //Kernel32 HMODULE hModule = LoadLibrary(_T("Kernel32.dll")); if (hModule == NULL) { return FALSE; } Real_UnhandledExceptionFilter = (UNHANDLEDEXCEPTIONFILTER)GetProcAddress(hModule,"UnhandledExceptionFilter"); if (Real_UnhandledExceptionFilter == NULL) { return FALSE; } //HOOKµ±Ç°¶þ¸öº¯Êý if (!Mhook_SetHook((PVOID*)&Real_UnhandledExceptionFilter, DeBug_UnHandleCreateDump)) { return FALSE; } return TRUE; } void HandleException::EnableDumpFile( BOOL bMakeDump /*= TRUE*/ ) { bMakeDumpFile = bMakeDump; } void HandleException::SetExceptionCallback( PFN_HandleException fn ,LONG lExceptHandleCode ) { lExceptCode = lExceptHandleCode; fnSEHException = fn; gEventExit = CreateEvent(NULL,FALSE,FALSE,NULL); StartHookDebug(); //defaultExceptionCallBack = SetUnhandledExceptionFilter(&DeBug_CreateDump); }
doublesword/commuse
Source/W201621/CKit-3/CKit/Sources/ToolHelper/HandleException.cpp
C++
gpl-2.0
2,910
package com.nidzo.filetransfer; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextWatcher; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ListView; import android.widget.ProgressBar; public class MainActivity extends AppCompatActivity { private Communicator communicator; private PeerListAdapter peersAdapter; private ListView peerList; private EditText deviceName; private ProgressBar progressIndicator; private FileHandling fileHandling; private String selectedPeerGuid; private Intent fileToSendIntent; private CheckBox enableEncryption; private TextWatcher deviceNameChangedWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { Identification.setName(deviceName.getText().toString(), getApplicationContext()); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); if (intent.getAction().equals(Intent.ACTION_SEND)) { fileToSendIntent = intent; } setContentView(R.layout.activity_main); } @Override protected void onResume() { super.onResume(); peersAdapter = new PeerListAdapter(this); peerList = (ListView) findViewById(R.id.peerList); peerList.setAdapter(peersAdapter); deviceName = (EditText) findViewById(R.id.deviceName); progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator); enableEncryption = (CheckBox)findViewById(R.id.enableEncryptionCheckbox); progressStop(); deviceName.setText(Identification.getName(this)); deviceName.addTextChangedListener(deviceNameChangedWatcher); try { communicator = new Communicator(this); communicator.discoverPeers(); fileHandling = new FileHandling(this); updatePeerList(); } catch (FileTransferException e) { DialogBoxes.showMessageBox("Error", "Failed to start " + e.getMessage(), this); } } @Override protected void onPause() { super.onPause(); communicator.halt(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.refreshPeers) { communicator.discoverPeers(); } return true; } public void updatePeerList() { runOnUiThread(new Runnable() { @Override public void run() { peersAdapter.reset(communicator.getPeers()); } }); } public void progressIndeterminate() { progressIndicator.setVisibility(View.VISIBLE); progressIndicator.setIndeterminate(true); } public void progressReport(double progress) { progressIndicator.setIndeterminate(false); progressIndicator.setVisibility(View.VISIBLE); int progressValue = (int) (progress * 100); progressIndicator.setProgress(progressValue); } public void progressStop() { progressIndicator.setIndeterminate(false); progressIndicator.setVisibility(View.INVISIBLE); progressIndicator.setProgress(0); } public void deletePeer(String guid) { try { communicator.deletePeer(guid); } catch (FileTransferException e) { DialogBoxes.showMessageBox("Error", e.getMessage(), this); } } public void unpairPeer(String guid) { try { communicator.unpairPeer(guid); } catch (FileTransferException e) { DialogBoxes.showMessageBox("Error", e.getMessage(), this); } } public void pair(String guid) { communicator.pair(guid); } public void sendFile(String guid) { selectedPeerGuid = guid; if (fileToSendIntent != null) { communicator.sendFile(guid, fileToSendIntent, enableEncryption.isChecked()); fileToSendIntent = null; } else fileHandling.selectFileToSend(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent result) { if (requestCode == FileHandling.FILE_SELECT_REQUEST_CODE) { if (resultCode == RESULT_OK) { communicator.sendFile(selectedPeerGuid, result, enableEncryption.isChecked()); } } } public void fileReceived(final java.io.File file) { runOnUiThread(new Runnable() { @Override public void run() { fileHandling.offerToOpenFile(file); } }); } }
nidzo732/FileTransfer
Android/FileTransfer/app/src/main/java/com/nidzo/filetransfer/MainActivity.java
Java
gpl-2.0
5,281
<?php /** * 2Moons * Copyright (C) 2012 Jan Kröpke * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @package 2Moons * @author Jan Kröpke <info@2moons.cc> * @copyright 2012 Jan Kröpke <info@2moons.cc> * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License * @version 1.7.3 (2013-05-19) * @info $Id: L18N.php 2749 2013-05-19 11:43:20Z slaver7 $ * @link http://2moons.cc/ */ setlocale(LC_ALL, 'de_DE', 'german'); // http://msdn.microsoft.com/en-us/library/39cwe7zf%28vs.71%29.aspx setlocale(LC_NUMERIC, 'C'); //SERVER GENERALS $LNG['dir'] = 'ltr'; $LNG['week_day'] = array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); # Start with So! $LNG['months'] = array('Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'); $LNG['js_tdformat'] = '[M] [D] [d] [H]:[i]:[s]'; $LNG['php_timeformat'] = 'H:i:s'; $LNG['php_dateformat'] = 'd. M Y'; $LNG['php_tdformat'] = 'd. M Y, H:i:s'; $LNG['short_day'] = 'd'; $LNG['short_hour'] = 'h'; $LNG['short_minute'] = 'm'; $LNG['short_second'] = 's'; //Note for the translators, use the phpBB Translation file (LANG/common.php) instead of your own translations $LNG['timezones'] = array( '-12' => '[UTC - 12] Baker Island Time', '-11' => '[UTC - 11] Niue Time, Samoa Standard Time', '-10' => '[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time', '-9.5' => '[UTC - 9:30] Marquesas Islands Time', '-9' => '[UTC - 9] Alaska Standard Time, Gambier Island Time', '-8' => '[UTC - 8] Pacific Standard Time', '-7' => '[UTC - 7] Mountain Standard Time', '-6' => '[UTC - 6] Central Standard Time', '-5' => '[UTC - 5] Eastern Standard Time', '-4.5' => '[UTC - 4:30] Venezuelan Standard Time', '-4' => '[UTC - 4] Atlantic Standard Time', '-3.5' => '[UTC - 3:30] Newfoundland Standard Time', '-3' => '[UTC - 3] Amazon Standard Time, Central Greenland Time', '-2' => '[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time', '-1' => '[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', '0' => '[UTC] Westeuropäische Zeit, Greenwich Mean Time', '1' => '[UTC + 1] Mitteleuropäische Zeit, West African Time', '2' => '[UTC + 2] Osteuropäische Zeit, Central African Time', '3' => '[UTC + 3] Moscow Standard Time, Eastern African Time', '3.5' => '[UTC + 3:30] Iran Standard Time', '4' => '[UTC + 4] Gulf Standard Time, Samara Standard Time', '4.5' => '[UTC + 4:30] Afghanistan Time', '5' => '[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time', '5.5' => '[UTC + 5:30] Indian Standard Time, Sri Lanka Time', '5.75' => '[UTC + 5:45] Nepal Time', '6' => '[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', '6.5' => '[UTC + 6:30] Cocos Islands Time, Myanmar Time', '7' => '[UTC + 7] Indochina Time, Krasnoyarsk Standard Time', '8' => '[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', '8.75' => '[UTC + 8:45] Southeastern Western Australia Standard Time', '9' => '[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time', '9.5' => '[UTC + 9:30] Australian Central Standard Time', '10' => '[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time', '10.5' => '[UTC + 10:30] Lord Howe Standard Time', '11' => '[UTC + 11] Solomon Island Time, Magadan Standard Time', '11.5' => '[UTC + 11:30] Norfolk Island Time', '12' => '[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time', '12.75' => '[UTC + 12:45] Chatham Islands Time', '13' => '[UTC + 13] Tonga Time, Phoenix Islands Time', '14' => '[UTC + 14] Line Island Time', );
joancefet/StellarWars
1.7.3/language/de/L18N.php
PHP
gpl-2.0
4,226
<?php class FrmProEntriesController{ public static function admin_js() { $frm_settings = FrmAppHelper::get_settings(); add_filter('manage_'. sanitize_title($frm_settings->menu) .'_page_formidable-entries_columns', 'FrmProEntriesController::manage_columns', 25); $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); if ( $page != 'formidable-entries' ) { return; } wp_enqueue_script('jquery-ui-datepicker'); if ( $frm_settings->accordion_js ) { wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-accordion'); } $theme_css = FrmStylesController::get_style_val('theme_css'); if ( $theme_css == -1 ) { return; } wp_enqueue_style($theme_css, FrmStylesHelper::jquery_css_url($theme_css)); } public static function remove_fullscreen($init){ if ( isset( $init['plugins'] ) ) { $init['plugins'] = str_replace('wpfullscreen,', '', $init['plugins']); $init['plugins'] = str_replace('fullscreen,', '', $init['plugins']); } return $init; } public static function register_scripts(){ //if ( FrmAppHelper::is_admin() ) { // return; //} global $wp_scripts; wp_register_script('jquery-frm-rating', FrmAppHelper::plugin_url() . '/pro/js/jquery.rating.min.js', array( 'jquery'), '4.11', true); wp_register_script('jquery-maskedinput', FrmAppHelper::plugin_url() . '/pro/js/jquery.maskedinput.min.js', array( 'jquery'), '1.4', true); wp_register_script('jquery-chosen', FrmAppHelper::plugin_url() .'/pro/js/chosen.jquery.min.js', array( 'jquery'), '1.2.0', true); } public static function add_js(){ if ( FrmAppHelper::is_admin() ) { return; } $frm_settings = FrmAppHelper::get_settings(); global $frm_vars; if ( $frm_settings->jquery_css ) { $frm_vars['datepicker_loaded'][] = true; } if ( $frm_settings->accordion_js ) { wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-accordion'); } } public static function print_ajax_scripts( $keep = '' ) { self::enqueue_footer_js(); if ( $keep != 'all' ) { if ( $keep == 'none' ) { $keep_scripts = $keep_styles = array(); } else { $keep_scripts = array( 'recaptcha-api', 'jquery-frm-rating', 'jquery-chosen', 'flashcanvas', 'jquery-signaturepad', 'frm-signature', // Remove these after add-on update ); $keep_styles = array( 'dashicons', 'jquery-theme' ); if ( is_array( $keep ) ) { $keep_scripts = array_merge( $keep_scripts, $keep ); } } global $wp_scripts, $wp_styles; $keep_scripts = apply_filters( 'frm_ajax_load_scripts', $keep_scripts ); $registered_scripts = (array) $wp_scripts->registered; $registered_scripts = array_diff( array_keys( $registered_scripts ), $keep_scripts ); $wp_scripts->done = array_merge( $wp_scripts->done, $registered_scripts ); $keep_styles = apply_filters( 'frm_ajax_load_styles', $keep_styles ); $registered_styles = (array) $wp_styles->registered; $registered_styles = array_diff( array_keys( $registered_styles ), $keep_styles ); $wp_styles->done = array_merge( $wp_styles->done, $registered_styles ); } wp_print_footer_scripts(); self::footer_js(); } /** * Check if the form is loaded after the wp_footer hook. * If it is, we'll need to make sure the scripts are loaded. */ public static function after_footer_loaded() { global $frm_vars; if ( ! isset( $frm_vars['footer_loaded'] ) || ! $frm_vars['footer_loaded'] ) { return; } self::enqueue_footer_js(); print_late_styles(); print_footer_scripts(); self::footer_js(); } public static function enqueue_footer_js(){ global $frm_vars, $frm_input_masks; if ( empty($frm_vars['forms_loaded']) ) { return; } self::register_scripts(); if ( ! FrmAppHelper::doing_ajax() ) { wp_enqueue_script('formidable' ); } if ( isset($frm_vars['tinymce_loaded']) && $frm_vars['tinymce_loaded'] ) { _WP_Editors::enqueue_scripts(); } // trigger jQuery UI to be loaded on every page self::add_js(); if ( isset($frm_vars['datepicker_loaded']) && ! empty($frm_vars['datepicker_loaded']) ) { if ( is_array($frm_vars['datepicker_loaded']) ) { foreach ( $frm_vars['datepicker_loaded'] as $fid => $o ) { if ( ! $o ) { unset($frm_vars['datepicker_loaded'][$fid]); } unset($fid, $o); } } if ( ! empty($frm_vars['datepicker_loaded']) ) { wp_enqueue_script('jquery-ui-datepicker'); FrmStylesHelper::enqueue_jquery_css(); } } if ( isset($frm_vars['chosen_loaded']) && $frm_vars['chosen_loaded'] ) { wp_enqueue_script('jquery-chosen'); } if ( isset($frm_vars['star_loaded']) && ! empty($frm_vars['star_loaded']) ) { wp_enqueue_script('jquery-frm-rating'); wp_enqueue_style( 'dashicons' ); FrmStylesController::enqueue_style(); } $frm_input_masks = apply_filters('frm_input_masks', $frm_input_masks, $frm_vars['forms_loaded']); foreach ( (array) $frm_input_masks as $fid => $o ) { if ( ! $o ) { unset($frm_input_masks[$fid]); } unset($fid, $o); } if ( ! empty($frm_input_masks) ) { wp_enqueue_script('jquery-maskedinput'); } if ( isset($frm_vars['google_graphs']) && ! empty($frm_vars['google_graphs']) ) { wp_enqueue_script('google_jsapi', 'https://www.google.com/jsapi'); } } public static function footer_js(){ global $frm_vars, $frm_input_masks; $frm_vars['footer_loaded'] = true; if ( empty($frm_vars['forms_loaded']) ) { return; } $trigger_form = ( ! FrmAppHelper::doing_ajax() && ! FrmAppHelper::is_admin_page('formidable-entries') ); include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/footer_js.php'); /** * Add custom scripts after the form scripts are done loading * @since 2.0.6 */ do_action( 'frm_footer_scripts', $frm_vars['forms_loaded'] ); } public static function data_sort($options){ natcasesort($options); //TODO: add sorting options return $options; } public static function register_widgets() { include_once(FrmAppHelper::plugin_path() .'/pro/classes/widgets/FrmListEntries.php'); register_widget('FrmListEntries'); } /* Back End CRUD */ public static function show_comments($entry) { $id = $entry->id; $user_ID = get_current_user_id(); if ( $_POST && isset($_POST['frm_comment']) && ! empty($_POST['frm_comment']) ) { FrmEntryMeta::add_entry_meta($_POST['item_id'], 0, '', array( 'comment' => $_POST['frm_comment'], 'user_id' => $user_ID, )); //send email notifications } $comments = FrmEntryMeta::getAll( array( 'item_id' => $id, 'field_id' => 0), ' ORDER BY it.created_at ASC', '', true); $date_format = get_option( 'date_format' ); $time_format = get_option( 'time_format' ); $to_emails = apply_filters('frm_to_email', array(), $entry, $entry->form_id); include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/show.php'); } public static function add_duplicate_link($entry) { FrmProEntriesHelper::show_duplicate_link($entry); } public static function add_sidebar_links($entry) { include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/_sidebar-shared-pub.php'); } public static function add_edit_link() { FrmProEntriesHelper::edit_button(); } public static function add_new_entry_link($form) { FrmProEntriesHelper::show_new_entry_button($form); } public static function new_entry(){ if ( $form_id = FrmAppHelper::get_param( 'form', '', 'get', 'absint' ) ) { $form = FrmForm::getOne($form_id); self::get_new_vars('', $form); } else { include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/new-selection.php'); } } public static function create(){ if ( ! current_user_can('frm_create_entries') ) { return FrmEntriesController::display_list(); } $params = FrmEntriesHelper::get_admin_params(); $form = $record = false; if ( $params['form'] ) { $form = FrmForm::getOne($params['form']); } if ( ! $form ) { return; } $errors = FrmEntry::validate($_POST); if ( count($errors) > 0 ) { self::get_new_vars($errors, $form); return; } if ( ( isset($_POST['frm_page_order_'. $form->id]) || FrmProFormsHelper::going_to_prev($form->id) ) && ! FrmProFormsHelper::saving_draft() ) { self::get_new_vars('', $form); return; } $_SERVER['REQUEST_URI'] = str_replace( '&frm_action=new', '', FrmAppHelper::get_server_value( 'REQUEST_URI' ) ); global $frm_vars; if ( ! isset($frm_vars['created_entries'][ $form->id ]) || ! $frm_vars['created_entries'][ $form->id ] ) { $frm_vars['created_entries'][$form->id] = array(); } if ( ! isset($frm_vars['created_entries'][ $_POST['form_id'] ]['entry_id']) ) { $record = $frm_vars['created_entries'][$form->id]['entry_id'] = FrmEntry::create( $_POST ); } if ( $record ) { if ( FrmProFormsHelper::saving_draft() ) { $message = __( 'Draft was Successfully Created', 'formidable' ); } else { $message = __( 'Entry was Successfully Created', 'formidable' ); } self::get_edit_vars($record, $errors, $message); } else { self::get_new_vars($errors, $form); } } public static function edit(){ $id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' ); if ( ! current_user_can('frm_edit_entries') ) { return FrmEntriesController::show($id); } return self::get_edit_vars($id); } public static function update(){ $id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' ); if ( ! current_user_can('frm_edit_entries') ) { return FrmEntriesController::show($id); } $message = ''; $errors = FrmEntry::validate($_POST); if ( empty( $errors ) ) { if ( isset($_POST['form_id']) && ( isset($_POST['frm_page_order_'. $_POST['form_id']]) || FrmProFormsHelper::going_to_prev($_POST['form_id']) ) && ! FrmProFormsHelper::saving_draft() ) { return self::get_edit_vars($id); }else{ FrmEntry::update( $id, $_POST ); if ( isset($_POST['form_id']) && FrmProFormsHelper::saving_draft() ) { $message = __( 'Draft was Successfully Updated', 'formidable' ); } else { $message = __( 'Entry was Successfully Updated', 'formidable' ); } $message .= '<br/> <a href="?page=formidable-entries&form='. $_POST['form_id'] .'">&larr; '. __( 'Back to Entries', 'formidable' ) .'</a>'; } } return self::get_edit_vars($id, $errors, $message); } public static function duplicate(){ $params = FrmEntriesHelper::get_admin_params(); if ( ! current_user_can('frm_create_entries') ) { return FrmEntriesController::show($params['id']); } $message = $errors = ''; $record = FrmEntry::duplicate( $params['id'] ); if ( $record ) { $message = __( 'Entry was Successfully Duplicated', 'formidable' ); } else { $errors = __( 'There was a problem duplicating that entry', 'formidable' ); } if ( ! empty( $errors ) ) { return FrmEntriesController::display_list( $message, $errors ); } else { return self::get_edit_vars($record, '', $message); } } public static function bulk_actions( $action = 'list-form' ) { $params = FrmEntriesHelper::get_admin_params(); $errors = array(); $bulkaction = '-1'; if ( $action == 'list-form' ) { if ( $_REQUEST['bulkaction'] != '-1' ) { $bulkaction = sanitize_text_field( $_REQUEST['bulkaction'] ); } else if ( $_POST['bulkaction2'] != '-1' ) { $bulkaction = sanitize_text_field( $_REQUEST['bulkaction2'] ); } } else { $bulkaction = str_replace('bulk_', '', $action); } $items = FrmAppHelper::get_param('item-action', ''); if (empty($items)){ $errors[] = __( 'No entries were specified', 'formidable' ); }else{ $frm_settings = FrmAppHelper::get_settings(); if ( ! is_array($items) ) { $items = explode(',', $items); } if ( $bulkaction == 'delete' ) { if ( ! current_user_can( 'frm_delete_entries' ) ) { $errors[] = $frm_settings->admin_permission; } else { if ( is_array($items) ) { foreach ( $items as $item_id ) { FrmEntry::destroy($item_id); } } } } else if ( $bulkaction == 'csv' ) { FrmAppHelper::permission_check('frm_view_entries'); $form_id = $params['form']; if ( ! $form_id ) { $form = FrmForm::get_published_forms( array(), 1 ); if ( ! empty($form) ) { $form_id = $form->id; } else { $errors[] = __( 'No form was found', 'formidable' ); } } if ( $form_id && is_array($items) ) { echo '<script type="text/javascript">window.onload=function(){location.href="' . esc_url_raw( admin_url( 'admin-ajax.php' ) . '?form=' . $form_id . '&action=frm_entries_csv&item_id=' . implode( ',', $items ) ) . '";}</script>'; } } } FrmEntriesController::display_list( '', $errors ); } /* Front End CRUD */ //Determine if this is a new entry or if we're editing an old one public static function maybe_editing($continue, $form_id, $action = 'new') { $form_submitted = FrmAppHelper::get_param( 'form_id', '', 'get', 'absint' ); if ( $action == 'new' || $action == 'preview' ) { $continue = true; } else { $continue = ( $form_submitted && (int) $form_id != $form_submitted ); } return $continue; } public static function check_draft_status($values, $id) { if ( FrmProEntriesHelper::get_field('is_draft', $id) || $values['is_draft'] ) { //remove update hooks if submitting for the first time or is still draft } //if entry was not previously draft or continues to be draft if ( !FrmProEntriesHelper::get_field('is_draft', $id) || $values['is_draft'] ) { return $values; } //add the create hooks since the entry is switching draft status add_action('frm_after_update_entry', 'FrmProEntriesController::add_published_hooks', 2, 2); //change created timestamp $values['created_at'] = $values['updated_at']; return $values; } public static function remove_draft_hooks($entry_id) { if ( ! FrmProEntriesHelper::get_field('is_draft', $entry_id) ) { return; } // don't let sub entries remove these hooks $entry = FrmEntry::getOne($entry_id); if ( $entry->parent_item_id ) { return; } //remove hooks if saving as draft remove_action('frm_after_create_entry', 'FrmProEntriesController::set_cookie', 20); remove_action('frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20); } //add the create hooks since the entry is switching draft status public static function add_published_hooks($entry_id, $form_id) { do_action('frm_after_create_entry', $entry_id, $form_id); do_action('frm_after_create_entry_'. $form_id, $entry_id); remove_action('frm_after_update_entry', 'FrmProEntriesController::add_published_hooks', 2); } public static function process_update_entry($params, $errors, $form, $args){ global $frm_vars; if ( $params['action'] == 'update' && isset($frm_vars['saved_entries']) && in_array( (int) $params['id'], (array) $frm_vars['saved_entries'] ) ) { return; } if ( $params['action'] == 'create' && isset($frm_vars['created_entries'][$form->id]) && isset($frm_vars['created_entries'][$form->id]['entry_id']) && is_numeric($frm_vars['created_entries'][$form->id]['entry_id']) ) { $entry_id = $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; self::set_cookie($entry_id, $form->id); $conf_method = apply_filters('frm_success_filter', 'message', $form, $form->options, $params['action']); if ($conf_method != 'redirect') return; $success_args = array( 'action' => $params['action']); if ( isset( $args['ajax'] ) ) { $success_args['ajax'] = $args['ajax']; } do_action('frm_success_action', $conf_method, $form, $form->options, $params['id'], $success_args); }else if ($params['action'] == 'update'){ if ( isset($frm_vars['saved_entries']) && in_array((int) $params['id'], (array) $frm_vars['saved_entries']) ) { if ( isset($_POST['item_meta']) ) { unset($_POST['item_meta']); } add_filter('frm_continue_to_new', '__return_false', 15); return; } //don't update if there are validation errors if ( ! empty( $errors ) ) { return; } //check if user is allowed to update if ( ! FrmProEntriesHelper::user_can_edit( (int) $params['id'], $form ) ) { $frm_settings = FrmAppHelper::get_settings(); wp_die(do_shortcode($frm_settings->login_msg)); } //update, but don't check for confirmation if saving draft if ( FrmProFormsHelper::saving_draft() ) { FrmEntry::update( $params['id'], $_POST ); return; } //don't update if going back if ( isset($_POST['frm_page_order_'. $form->id]) || FrmProFormsHelper::going_to_prev($form->id) ) { return; } FrmEntry::update( $params['id'], $_POST ); $success_args = array( 'action' => $params['action']); if ( $params['action'] != 'create' && FrmProEntriesHelper::is_new_entry($params['id']) ) { $success_args['action'] = 'create'; } //check confirmation method $conf_method = apply_filters('frm_success_filter', 'message', $form, $success_args['action']); if ( $conf_method != 'redirect' ) { return; } if ( isset( $args['ajax'] ) ) { $success_args['ajax'] = $args['ajax']; } do_action('frm_success_action', $conf_method, $form, $form->options, $params['id'], $success_args); } else if ( $params['action'] == 'destroy' ) { //if the user who created the entry is deleting it self::ajax_destroy($form->id, false, false); } } public static function edit_update_form($params, $fields, $form, $title, $description){ global $frm_vars; $continue = true; if ( 'edit' == $params['action'] ) { self::front_edit_entry($form, $fields, $title, $description, $continue); } else if ( 'update' == $params['action'] && $params['posted_form_id'] == $form->id ) { self::front_update_entry($form, $fields, $title, $description, $continue, $params); } else if ( 'destroy' == $params['action'] ) { self::front_destroy_entry($form); } else if ( isset($frm_vars['editing_entry']) && $frm_vars['editing_entry'] ) { self::front_auto_edit_entry($form, $fields, $title, $description, $continue); } else { self::allow_front_create_entry($form, $continue); } remove_filter('frm_continue_to_new', '__return_'. ( $continue ? 'false' : 'true' ), 15); // remove the opposite filter add_filter('frm_continue_to_new', '__return_'. ($continue ? 'true' : 'false'), 15); } /** * Load form for editing */ private static function front_edit_entry( $form, $fields, $title, $description, &$continue ) { global $wpdb; $entry_key = FrmAppHelper::get_param( 'entry', '', 'get', 'sanitize_title' ); $query = array( 'it.form_id' => $form->id ); if ( $entry_key ) { $query[1] = array( 'or' => 1, 'it.id' => $entry_key, 'it.item_key' => $entry_key ); $in_form = FrmDb::get_var( $wpdb->prefix .'frm_items it', $query ); if ( ! $in_form ) { $entry_key = false; unset( $query[1] ); } unset($in_form); } $entry = FrmProEntriesHelper::user_can_edit( $entry_key, $form ); if ( ! $entry ) { return; } if ( ! is_array($entry) ){ $entry = FrmEntry::getAll( $query, '', 1, true ); } if ( ! empty( $entry ) ) { global $frm_vars; $entry = reset($entry); $frm_vars['editing_entry'] = $entry->id; self::show_responses($entry, $fields, $form, $title, $description); $continue = false; } } /** * Automatically load the form for editing when a draft exists * or the form is limited to one per user */ private static function front_auto_edit_entry( $form, $fields, $title, $description, &$continue ) { global $frm_vars, $wpdb; $user_ID = get_current_user_id(); if ( is_numeric($frm_vars['editing_entry']) ) { //get entry from shortcode $entry_id = $frm_vars['editing_entry']; } else { // get all entry ids for this user $entry_ids = FrmDb::get_col( 'frm_items', array( 'user_id' => $user_ID, 'form_id' => $form->id) ); if ( empty($entry_ids) ) { return; } //$where_options = $frm_vars['editing_entry']; // Is is possible the entry_id parameter in the shortcode is sql? $get_meta = FrmEntryMeta::getAll( array( 'it.item_id' => $entry_ids ), ' ORDER BY it.created_at DESC', ' LIMIT 1'); $entry_id = $get_meta ? $get_meta->item_id : false; } if ( ! $entry_id ) { return; } if ( ! FrmProEntriesHelper::user_can_edit( $entry_id, $form ) ) { return; } $frm_vars['editing_entry'] = $entry_id; self::show_responses($entry_id, $fields, $form, $title, $description); $continue = false; } private static function front_destroy_entry( $form ) { //if the user who created the entry is deleting it self::ajax_destroy($form->id, false); } private static function front_update_entry($form, $fields, $title, $description, &$continue, $params ) { global $frm_vars; $message = ''; $errors = isset($frm_vars['created_entries'][$form->id]) ? $frm_vars['created_entries'][$form->id]['errors'] : false; if ( empty($errors) ) { $saving_draft = FrmProFormsHelper::saving_draft(); if ( ( ! isset($_POST['frm_page_order_'. $form->id]) && ! FrmProFormsHelper::going_to_prev($form->id) ) || $saving_draft ) { $success_args = array( 'action' => $params['action']); if ( FrmProEntriesHelper::is_new_entry($params['id']) ) { $success_args['action'] = 'create'; } //check confirmation method $conf_method = apply_filters('frm_success_filter', 'message', $form, $success_args['action']); if ( $conf_method == 'message' ) { $message = self::confirmation($conf_method, $form, $form->options, $params['id'], $success_args); } else { do_action('frm_success_action', $conf_method, $form, $form->options, $params['id'], $success_args); add_filter('frm_continue_to_new', '__return_false', 16); return; } } } else { $fields = FrmFieldsHelper::get_form_fields( $form->id, true ); } self::show_responses($params['id'], $fields, $form, $title, $description, $message, $errors); $continue = false; } /** * check to see if user is allowed to create another entry */ private static function allow_front_create_entry( $form, &$continue ) { if ( ! isset( $form->options['single_entry'] ) || ! $form->options['single_entry'] ) { return; } if ( ! FrmProFormsHelper::user_can_submit_form( $form ) ) { $frmpro_settings = new FrmProSettings(); echo $frmpro_settings->already_submitted; $continue = false; } } public static function show_responses( $id, $fields, $form, $title = false, $description = false, $message = '', $errors = array() ) { global $frm_vars; if ( is_object( $id ) ) { $item = $id; $id = $item->id; } else { $item = FrmEntry::getOne($id, true); } $frm_vars['editing_entry'] = $item->id; $values = FrmAppHelper::setup_edit_vars($item, 'entries', $fields); if ( $values['custom_style'] ) { $frm_vars['load_css'] = true; } $show_form = true; if ( $item->is_draft ) { if ( isset($values['submit_value']) ) { $edit_create = $values['submit_value']; } else { $frmpro_settings = new FrmProSettings(); $edit_create = $frmpro_settings->submit_value; } } else { if ( isset($values['edit_value']) ) { $edit_create = $values['edit_value']; } else { $frmpro_settings = new FrmProSettings(); $edit_create = $frmpro_settings->update_value; } } $submit = (isset($frm_vars['next_page'][$form->id])) ? $frm_vars['next_page'][$form->id] : $edit_create; unset($edit_create); if ( is_object( $submit ) ) { $submit = $submit->name; } if ( ! isset( $frm_vars['prev_page'][ $form->id ] ) && isset( $_POST['item_meta'] ) && empty( $errors ) && $form->id == FrmAppHelper::get_param( 'form_id', '', 'get', 'absint' ) ) { $show_form = (isset($form->options['show_form'])) ? $form->options['show_form'] : true; if ( FrmProFormsHelper::saving_draft() || FrmProFormsHelper::going_to_prev($form->id) ) { $show_form = true; }else{ $show_form = apply_filters('frm_show_form_after_edit', $show_form, $form); $success_args = array( 'action' => 'update'); if ( FrmProEntriesHelper::is_new_entry($id) ) { $success_args['action'] = 'create'; } $conf_method = apply_filters('frm_success_filter', 'message', $form, $success_args['action']); if ( $conf_method != 'message' ) { do_action('frm_success_action', $conf_method, $form, $form->options, $id, $success_args); // End now so the form isn't shown when "Show Page Content" is selected return; } } } else if ( isset($frm_vars['prev_page'][$form->id]) || ! empty($errors) ) { $jump_to_form = true; } $user_ID = get_current_user_id(); if ( isset($form->options['show_form']) && $form->options['show_form'] ) { //Do nothing because JavaScript is already loaded } else { //Load JavaScript here $frm_vars['forms_loaded'][] = true; } $frm_settings = FrmAppHelper::get_settings(); require(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/edit-front.php'); add_filter('frm_continue_to_new', 'FrmProEntriesController::maybe_editing', 10, 3); } public static function ajax_submit_button() { global $frm_vars; if ( isset($frm_vars['novalidate']) && $frm_vars['novalidate'] ) { echo ' formnovalidate="formnovalidate"'; } } public static function get_confirmation_method($method, $form, $action = 'create') { $opt = ( $action == 'update' ) ? 'edit_action' : 'success_action'; $method = ( isset( $form->options[ $opt ] ) && ! empty( $form->options[ $opt ] ) ) ? $form->options[ $opt ] : $method; if ( $method != 'message' && FrmProFormsHelper::saving_draft() ) { $method = 'message'; } return $method; } public static function confirmation( $method, $form, $form_options, $entry_id, $args = array() ) { $opt = ( ! isset($args['action']) || $args['action'] == 'create' ) ? 'success' : 'edit'; if ( $method == 'page' && is_numeric($form_options[$opt .'_page_id']) ) { global $post; if ( ! $post || $form_options[$opt .'_page_id'] != $post->ID ) { $page = get_post($form_options[$opt .'_page_id']); $old_post = $post; $post = $page; $content = apply_filters('frm_content', $page->post_content, $form, $entry_id); echo apply_filters('the_content', $content); $post = $old_post; } } else if ( $method == 'redirect' ) { global $frm_vars; add_filter('frm_use_wpautop', '__return_false'); $success_url = apply_filters('frm_content', trim($form_options[$opt .'_url']), $form, $entry_id); $success_msg = isset($form_options[$opt .'_msg']) ? $form_options[$opt .'_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); $redirect_msg = '<div class="' . esc_attr( FrmFormsHelper::get_form_style_class( $form ) ) . '"><div class="frm-redirect-msg frm_message">' . $success_msg . '<br/>' . sprintf(__( '%1$sClick here%2$s if you are not automatically redirected.', 'formidable' ), '<a href="'. esc_url($success_url) .'">', '</a>') . '</div></div>'; $redirect_msg = apply_filters('frm_redirect_msg', $redirect_msg, array( 'entry_id' => $entry_id, 'form_id' => $form->id, 'form' => $form )); $args['id'] = $entry_id; add_filter('frm_redirect_url', 'FrmProEntriesController::redirect_url'); //delete the entry on frm_redirect_url hook $success_url = apply_filters('frm_redirect_url', $success_url, $form, $args); $doing_ajax = FrmAppHelper::doing_ajax(); if ( isset($args['ajax']) && $args['ajax'] && $doing_ajax ) { echo json_encode( array( 'redirect' => $success_url)); die(); } else if ( ! $doing_ajax && ! headers_sent() ) { wp_redirect( esc_url_raw( $success_url ) ); die(); } add_filter('frm_use_wpautop', '__return_true'); $response = $redirect_msg; $response .= "<script type='text/javascript'>jQuery(document).ready(function(){ setTimeout(window.location='" . esc_url_raw( $success_url ) . "', 8000); });</script>"; if ( headers_sent() ) { echo $response; } else { wp_redirect( esc_url_raw( $success_url ) ); die(); } } else { $frm_settings = FrmAppHelper::get_settings(); $frmpro_settings = FrmProAppHelper::get_settings(); $msg = ( $opt == 'edit' ) ? $frmpro_settings->edit_msg : $frm_settings->success_msg; $message = isset( $form->options[ $opt .'_msg' ] ) ? $form->options[ $opt .'_msg' ] : $msg; // Filter shortcodes in success message $message = apply_filters('frm_content', $message, $form, $entry_id); $message = wpautop( $message ); // Replace $message with save draft message if we are saving a draft FrmProFormsHelper::save_draft_msg( $message, $form ); $message = '<div class="frm_message" id="message">'. $message .'</div>'; return $message; } } public static function delete_entry($post_id){ global $wpdb; $entry = FrmDb::get_row( 'frm_items', array( 'post_id' => $post_id), 'id'); self::maybe_delete_entry($entry); } public static function trashed_post($post_id){ $form_id = get_post_meta($post_id, 'frm_form_id', true); if ( ! $form_id ) { return; } $display = FrmProDisplay::get_auto_custom_display( array( 'form_id' => $form_id)); if ( $display ) { update_post_meta($post_id, 'frm_display_id', $display->ID); } else { delete_post_meta($post_id, 'frm_display_id'); } } public static function create_entry_from_post_box( $post_type, $post = false ) { if ( ! $post || ! isset($post->ID) || $post_type == 'attachment' || $post_type == 'link' ) { return; } global $wpdb, $frm_vars; //don't show the meta box if there is already an entry for this post $post_entry = FrmDb::get_var( $wpdb->prefix .'frm_items', array( 'post_id' => $post->ID) ); if ( $post_entry ) { return; } //don't show meta box if no forms are set up to create this post type $actions = FrmFormActionsHelper::get_action_for_form(0, 'wppost'); if ( ! $actions ) { return; } $form_ids = array(); foreach ( $actions as $action ) { if ( $action->post_content['post_type'] == $post_type && $action->menu_order ) { $form_ids[] = $action->menu_order; } } if ( empty($form_ids) ) { return; } $forms = FrmDb::get_results( 'frm_forms', array( 'id' => $form_ids ), 'id, name' ); $frm_vars['post_forms'] = $forms; if ( current_user_can('frm_create_entries') ) { add_meta_box( 'frm_create_entry', __( 'Create Entry in Form', 'formidable' ), 'FrmProEntriesController::render_meta_box_content', null, 'side' ); } } public static function render_meta_box_content($post){ global $frm_vars; $i = 1; echo '<p>'; foreach ( (array) $frm_vars['post_forms'] as $form ) { if ( $i != 1 ) { echo ' | '; } $i++; echo '<a href="javascript:frmCreatePostEntry('. (int) $form->id .','. (int) $post->ID .')">'. esc_html( FrmAppHelper::truncate($form->name, 15) ) .'</a>'; unset($form); } echo '</p>'; } public static function create_post_entry( $id = false, $post_id = false ) { if ( FrmAppHelper::doing_ajax() ) { check_ajax_referer( 'frm_ajax', 'nonce' ); } if ( ! $id ) { $id = (int) $_POST['id']; } if ( ! $post_id ) { $post_id = (int) $_POST['post_id']; } if ( ! is_numeric($id) || ! is_numeric($post_id) ) { return; } $post = get_post($post_id); global $wpdb; $values = array( 'description' => __( 'Copied from Post', 'formidable' ), 'form_id' => $id, 'created_at' => $post->post_date_gmt, 'name' => $post->post_title, 'item_key' => FrmAppHelper::get_unique_key($post->post_name, $wpdb->prefix .'frm_items', 'item_key'), 'user_id' => $post->post_author, 'post_id' => $post->ID ); $results = $wpdb->insert( $wpdb->prefix .'frm_items', $values ); unset($values); if ( ! $results ) { wp_die(); } $entry_id = $wpdb->insert_id; $user_id_field = FrmField::get_all_types_in_form($id, 'user_id', 1); if ( $user_id_field ) { $new_values = array( 'meta_value' => $post->post_author, 'item_id' => $entry_id, 'field_id' => $user_id_field->id, 'created_at' => current_time('mysql', 1) ); $wpdb->insert( $wpdb->prefix .'frm_item_metas', $new_values ); } $display = FrmProDisplay::get_auto_custom_display( array( 'form_id' => $id, 'entry_id' => $entry_id)); if ( $display ) { update_post_meta($post->ID, 'frm_display_id', $display->ID); } wp_die(); } /* Export to CSV */ public static function csv( $form_id = false, $search = '', $fid = '' ) { FrmAppHelper::permission_check( 'frm_view_entries' ); if ( ! $form_id ) { $form_id = FrmAppHelper::get_param( 'form', '', 'get', 'absint' ); $search = FrmAppHelper::get_param( ( isset( $_REQUEST['s'] ) ? 's' : 'search' ), '', 'get', 'sanitize_text_field' ); $fid = FrmAppHelper::get_param( 'fid', '', 'get', 'sanitize_text_field' ); } if ( ! ini_get('safe_mode') ) { set_time_limit(0); //Remove time limit to execute this function $mem_limit = str_replace('M', '', ini_get('memory_limit')); if ( (int) $mem_limit < 256 ) { ini_set('memory_limit', '256M'); } } global $wpdb; $form = FrmForm::getOne($form_id); $form_id = $form->id; $where = array( 'fi.type not' => FrmFieldsHelper::no_save_fields() ); $where[] = array( 'or' => 1, 'fi.form_id' => $form->id, 'fr.parent_form_id' => $form->id ); $csv_fields = apply_filters('frm_csv_field_ids', '', $form_id, array( 'form' => $form)); if ( $csv_fields ) { if ( ! is_array( $csv_fields ) ) { $csv_fields = explode(',', $csv_fields); } if ( ! empty($csv_fields) ) { $where['fi.id'] = $csv_fields; } } $form_cols = FrmField::getAll( $where, 'field_order' ); $item_id = FrmAppHelper::get_param( 'item_id', false, 'get', 'sanitize_text_field' ); if ( ! empty( $item_id ) ) { $item_id = explode( ',', $item_id ); } $query = array( 'form_id' => $form_id ); if ( $item_id ) { $query['id'] = $item_id; } if ( ! empty($search) && ! $item_id ) { $query = FrmProEntriesHelper::get_search_str( $query, $search, $form_id, $fid ); } /** * Allows the query to be changed for fetching the entry ids to include in the export * * $query is the array of options to be filtered. It includes form_id, and maybe id (array of entry ids), * and the search query. This should return an array, but it can be handled as a string as well. */ $query = apply_filters('frm_csv_where', $query, compact('form_id')); $entry_ids = FrmDb::get_col( $wpdb->prefix .'frm_items it', $query ); unset($query); if ( empty( $entry_ids ) ) { esc_html_e( 'There are no entries for that form.', 'formidable' ); } else { FrmProCSVExportHelper::generate_csv( compact( 'form', 'entry_ids', 'form_cols' ) ); } wp_die(); } public static function get_search_str( $where_clause = '', $search_str, $form_id = false, $fid = false ) { _deprecated_function( __FUNCTION__, '2.0', 'FrmProEntriesHelper::get_search_str' ); return FrmProEntriesHelper::get_search_str($where_clause, $search_str, $form_id, $fid); } public static function get_new_vars($errors = array(), $form = false, $message = ''){ global $frm_vars; $description = true; $title = false; $form = apply_filters('frm_pre_display_form', $form); if ( ! $form ) { wp_die( __( 'You are trying to access an entry that does not exist.', 'formidable' ) ); return; } $fields = FrmFieldsHelper::get_form_fields( $form->id, ! empty( $errors ) ); $values = $fields ? FrmEntriesHelper::setup_new_vars($fields, $form) : array(); $frm_settings = FrmAppHelper::get_settings(); $submit = (isset($frm_vars['next_page'][$form->id])) ? $frm_vars['next_page'][$form->id] : (isset($values['submit_value']) ? $values['submit_value'] : $frm_settings->submit_value); if ( is_object( $submit ) ) { $submit = $submit->name; } require(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/new.php'); } private static function get_edit_vars($id, $errors = '', $message= ''){ global $frm_vars; $description = true; $title = false; $record = FrmEntry::getOne( $id, true ); if ( ! $record ) { wp_die( __( 'You are trying to access an entry that does not exist.', 'formidable' ) ); return; } $frm_vars['editing_entry'] = $id; $form = FrmForm::getOne($record->form_id); $form = apply_filters('frm_pre_display_form', $form); $fields = FrmFieldsHelper::get_form_fields( $form->id, ! empty( $errors ) ); $values = FrmAppHelper::setup_edit_vars($record, 'entries', $fields); $frmpro_settings = new FrmProSettings(); $edit_create = ($record->is_draft) ? (isset($values['submit_value']) ? $values['submit_value'] : $frmpro_settings->submit_value) : (isset($values['edit_value']) ? $values['edit_value'] : $frmpro_settings->update_value); $submit = (isset($frm_vars['next_page'][$form->id])) ? $frm_vars['next_page'][$form->id] : $edit_create; unset($edit_create); if ( is_object( $submit ) ) { $submit = $submit->name; } require(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/edit.php'); } public static function &filter_shortcode_value($value, $tag, $atts){ if ( isset($atts['striphtml']) && $atts['striphtml'] ) { $allowed_tags = apply_filters('frm_striphtml_allowed_tags', array(), $atts); $value = wp_kses($value, $allowed_tags); } if ( ! isset($atts['keepjs']) || ! $atts['keepjs'] ) { if ( is_array($value) ) { foreach ( $value as $k => $v ) { $value[$k] = wp_kses_post($v); unset($k, $v); } } else { $value = wp_kses_post($value); } } return $value; } /** * Trigger from the frm_display_value_atts hook * @since 2.0 */ public static function display_value_atts( $atts, $field ) { if ( $field->type == 'file' ) { $atts['truncate'] = false; $atts['html'] = true; } return $atts; } public static function &filter_display_value( $value, $field, $atts = array() ) { switch ( $atts['type'] ) { case 'user_id': $value = FrmProFieldsHelper::get_display_name($value); break; case 'date': $value = FrmProFieldsHelper::get_date($value); break; case 'file': $old_value = $value; if ( $atts['html'] ) { $value = '<div class="frm_file_container">'; } else { $value = ''; } foreach ( (array) $old_value as $mid ) { if ( $atts['html'] ){ $img = FrmProFieldsHelper::get_file_icon($mid); $value .= $img; if ( $atts['show_filename'] && $img && preg_match( '/wp-includes\/images\/(crystal|media)/', $img ) ) { //prevent two filenames $atts['show_filename'] = $show_filename = false; } unset($img); if ( $atts['html'] && $atts['show_filename'] ) { $value .= '<br/>' . FrmProFieldsHelper::get_file_name($mid) . '<br/>'; } if ( isset( $show_filename ) ) { //if skipped filename, show it for the next file $atts['show_filename'] = true; unset($show_filename); } } else if ( $mid ) { $value .= FrmProFieldsHelper::get_file_name($mid) . $atts['sep']; } } $value = rtrim($value, $atts['sep']); if ( $atts['html'] ) { $value .= '</div>'; } break; case 'data': if ( ! is_numeric($value) ) { if ( ! is_array($value) ) { $value = explode($atts['sep'], $value); } if ( is_array($value) ) { $new_value = ''; foreach ( $value as $entry_id ) { if ( ! empty( $new_value ) ) { $new_value .= $atts['sep']; } if ( is_numeric($entry_id) ) { $new_value .= FrmProFieldsHelper::get_data_value($entry_id, $field, $atts); } else { $new_value .= $entry_id; } } $value = $new_value; } } else { //replace item id with specified field $new_value = FrmProFieldsHelper::get_data_value($value, $field, $atts); if ( $field->field_options['data_type'] == 'data' || $field->field_options['data_type'] == '' ) { $linked_field = FrmField::getOne($field->field_options['form_select']); if ( $linked_field && $linked_field->type == 'file' ) { $old_value = explode(', ', $new_value); $new_value = ''; foreach ( $old_value as $v ) { $new_value .= '<img src="' . esc_url( $v ) . '" height="50px" alt="" />'; if ( $atts['show_filename'] ) { $new_value .= '<br/>'. $v; } unset($v); } } else { $new_value = $value; } } $value = $new_value; } break; case 'image': $value = '<img src="' . esc_url( $value ) . '" height="50px" alt="" />'; break; } if ( ! $atts['keepjs'] ) { $value = wp_kses_post($value); } return FrmEntriesController::filter_display_value($value, $field, $atts); } public static function route($action) { add_filter('frm_entry_stop_action_route', '__return_true'); add_action('frm_load_form_hooks', 'FrmFormsController::trigger_load_form_hooks'); FrmAppHelper::trigger_hook_load( 'form' ); switch ( $action ) { case 'create': return self::create(); case 'edit': return self::edit(); case 'update': return self::update(); case 'duplicate': return self::duplicate(); case 'new': return self::new_entry(); default: $action = FrmAppHelper::get_param( 'action', '', 'get', 'sanitize_text_field' ); if ( $action == -1 ) { $action = FrmAppHelper::get_param( 'action2', '', 'get', 'sanitize_title' ); } if ( strpos($action, 'bulk_') === 0 ) { FrmAppHelper::remove_get_action(); return self::bulk_actions($action); } return FrmEntriesController::display_list(); } } /** * @return string The name of the entry listing class */ public static function list_class(){ return 'FrmProEntriesListHelper'; } public static function manage_columns($columns){ global $frm_vars; $form_id = FrmEntriesHelper::get_current_form_id(); $columns = array( 'cb' => '<input type="checkbox" />') + $columns; $columns[$form_id .'_post_id'] = __( 'Post', 'formidable' ); $columns[$form_id .'_is_draft'] = __( 'Draft', 'formidable' ); $frm_vars['cols'] = $columns; return $columns; } public static function row_actions($actions, $item) { $edit_link = '?page=formidable-entries&frm_action=edit&id='. $item->id; if ( current_user_can('frm_edit_entries') ) { $actions['edit'] = '<a href="' . esc_url( $edit_link ) .'">'. __( 'Edit') .'</a>'; } if ( current_user_can('frm_create_entries') ) { $duplicate_link = '?page=formidable-entries&frm_action=duplicate&id='. $item->id .'&form='. $item->form_id; $actions['duplicate'] = '<a href="' . esc_url( wp_nonce_url( $duplicate_link ) ) . '">' . __( 'Duplicate', 'formidable' ) . '</a>'; } // move delete link to the end of the links if ( isset($actions['delete']) ) { $delete_link = $actions['delete']; unset($actions['delete']); $actions['delete'] = $delete_link; } return $actions; } public static function get_form_results($atts){ $atts = shortcode_atts( array( 'id' => false, 'cols' => 99, 'style' => true, 'fields' => false, 'clickable' => false, 'user_id' => false, 'google' => false, 'pagesize' => 20, 'sort' => true, 'edit_link' => false, 'delete_link' => false, 'page_id' => false, 'no_entries' => __( 'No Entries Found', 'formidable' ), 'confirm' => __( 'Are you sure you want to delete that entry?', 'formidable' ), 'drafts' => '0', ), $atts ); if ( ! $atts['id'] ) { return; } $form = FrmForm::getOne($atts['id']); if ( ! $form ) { return; } $atts['form'] = $form; if ( $atts['fields'] ) { $atts['fields'] = explode( ',', $atts['fields'] ); } $atts['form_cols'] = self::get_field_columns_for_table( $atts ); $contents = ''; self::add_delete_entry_message( $atts, $contents ); $atts['entries'] = self::get_entries_for_table( $atts ); if ( $atts['edit_link'] ) { $atts['anchor'] = ''; if ( ! $atts['page_id'] ) { global $post; $atts['page_id'] = $post->ID; $atts['anchor'] = '#form_'. $form->form_key; } if ( $atts['edit_link'] === '1' ) { $atts['edit_link'] = __( 'Edit', 'formidable' ); } $atts['permalink'] = get_permalink( $atts['page_id'] ); } //If delete_link is set, set the delete link text if ( $atts['delete_link'] === '1' ) { $atts['delete_link'] = __( 'Delete', 'formidable' ); } global $frm_vars; if ( $atts['style'] ) { $frm_vars['load_css'] = true; } if ( $atts['google'] ) { $filename = 'google_table'; self::prepare_google_table( $atts ); } else { $filename = 'table'; } // Trigger the js load $frm_vars['forms_loaded'][] = true; ob_start(); include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/'. $filename .'.php'); $contents .= ob_get_contents(); ob_end_clean(); if ( ! $atts['google'] && $atts['clickable'] ) { $contents = make_clickable( $contents ); } return $contents; } private static function get_field_columns_for_table( $atts ) { $where = array( 'fi.type not' => FrmFieldsHelper::no_save_fields(), 'fi.form_id' => $atts['form']->id ); if ( ! empty( $atts['fields'] ) ) { $f_list = array_filter( array_filter( $atts['fields'], 'trim' ), 'sanitize_text_field' ); if ( count( $atts['fields'] ) > 1 || ! in_array( 'id', $atts['fields'] ) ) { //don't search fields if only field id $where[] = array( 'or' => 1, 'fi.id' => $f_list, 'fi.field_key' => $f_list ); } } return FrmField::getAll( $where, 'field_order', $atts['cols'] ); } /** * If delete_link is set and frm_action is set to destroy, * check if entry should be deleted when page is loaded */ private static function add_delete_entry_message( $atts, &$contents ) { $action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ); if ( $atts['delete_link'] && $action == 'destroy' ) { $delete_message = self::ajax_destroy( false, false, false ); $delete_message = '<div class="' . esc_attr( $atts['style'] ? FrmFormsHelper::get_form_style_class() : '' ) . '"><div class="frm_message">' . $delete_message . '</div></div>'; $contents = $delete_message; } } private static function get_entries_for_table( $atts ) { $where = array( 'it.form_id' => $atts['form']->id ); if ( $atts['drafts'] != 'both' ) { $where['it.is_draft'] = (int) $atts['drafts']; } if ( $atts['user_id'] ) { $where['user_id'] = (int) FrmAppHelper::get_user_id_param( $atts['user_id'] ); } $s = FrmAppHelper::get_param( 'frm_search', false, 'get', 'sanitize_text_field' ); if ( $s ) { $new_ids = FrmProEntriesHelper::get_search_ids( $s, $atts['form']->id, array( 'is_draft' => $atts['drafts'] ) ); $where['it.id'] = $new_ids; } if ( isset( $new_ids ) && empty( $new_ids ) ) { $entries = false; } else { $entries = FrmEntry::getAll( $where, '', '', true, false ); } return $entries; } private static function prepare_google_table( $atts ) { global $frm_vars; $options = array( 'allowHtml' => true, 'sort' => $atts['sort'] ? 'enable' : 'disable', ); if ( $atts['pagesize'] ) { $options['page'] = 'enable'; $options['pageSize'] = (int) $atts['pagesize']; } if ( $atts['style'] ) { $options['cssClassNames'] = array( 'oddTableRow' => 'frm_even' ); } $shortcode_options = $atts; $shortcode_options['form_id'] = $atts['form']->id; unset( $shortcode_options['entries'], $shortcode_options['form_cols'], $shortcode_options['form'] ); unset( $shortcode_options['permalink'], $shortcode_options['anchor'] ); $graph_vals = array( 'fields' => array(), 'entries' => array(), 'options' => $shortcode_options, 'graphOpts' => $options, ); if ( $atts['clickable'] ) { $graph_vals['options']['no_entries'] = make_clickable( $graph_vals['options']['no_entries'] ); } $first_loop = true; foreach ( $atts['entries'] as $k => $entry ) { $this_entry = array( 'id' => $entry->id, 'metas' => array(), ); foreach ( $atts['form_cols'] as $col ) { $field_value = isset( $entry->metas[ $col->id ] ) ? $entry->metas[ $col->id ] : false; $val = FrmEntriesHelper::display_value( $field_value, $col, array( 'type' => $col->type, 'post_id' => $entry->post_id, 'entry_id' => $entry->id, 'show_filename' => false ) ); if ( $col->type == 'number' ) { $val = empty( $val ) ? '0' : $val; } else if ( ( $col->type == 'checkbox' || $col->type == 'select' ) && count( $col->options ) == 1 ) { // force boolean values $val = empty( $val ) ? false : true; } else if ( empty( $val ) ) { $val = ''; } else { $val = ( $atts['clickable'] && $col->type != 'file' ) ? make_clickable( $val ) : $val; } $this_entry['metas'][ $col->id ] = $val; if ( $first_loop ) { // add the fields to graphs on first loop only $graph_vals['fields'][] = array( 'id' => $col->id, 'type' => $col->type, 'name' => $col->name, 'options' => $col->options, 'field_options' => array( 'post_field' => isset( $col->field_options['post_field'] ) ? $col->field_options['post_field'] : '' ), ); } unset( $col ); } if ( $atts['edit_link'] && FrmProEntriesHelper::user_can_edit( $entry, $atts['form'] ) ) { $this_entry['editLink'] = esc_url_raw( add_query_arg( array( 'frm_action' => 'edit', 'entry' => $entry->id ), $atts['permalink'] ) ) . $atts['anchor']; } if ( $atts['delete_link'] && FrmProEntriesHelper::user_can_delete( $entry ) ){ $this_entry['deleteLink'] = esc_url_raw( add_query_arg( array( 'frm_action' => 'destroy', 'entry' => $entry->id ) ) ); } $graph_vals['entries'][] = $this_entry; $first_loop = false; unset( $k, $entry, $this_entry ); } if ( ! isset( $frm_vars['google_graphs'] ) ) { $frm_vars['google_graphs'] = array(); } if ( ! isset( $frm_vars['google_graphs']['table'] ) ) { $frm_vars['google_graphs']['table'] = array(); } $frm_vars['google_graphs']['table'][] = $graph_vals; } public static function get_search($atts){ $atts = shortcode_atts( array( 'post_id' => '', 'label' => __( 'Search', 'formidable' ), 'style' => false, ), $atts); if ( $atts['post_id'] == '' ) { global $post; if ( $post ) { $atts['post_id'] = $post->ID; } } if ( $atts['post_id'] != '' ) { $action_link = get_permalink($atts['post_id']); } else { $action_link = ''; } if ( ! empty($atts['style']) ) { global $frm_vars; $frm_vars['forms_loaded'][] = true; if ( $atts['style'] == 1 || 'true' == $atts['style'] ) { $atts['style'] = FrmStylesController::get_form_style_class('with_frm_style', 'default'); } else { $atts['style'] .= ' with_frm_style'; } } ob_start(); include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/search.php'); $contents = ob_get_contents(); ob_end_clean(); return $contents; } public static function entry_link_shortcode( $atts ) { $atts = shortcode_atts( array( 'id' => false, 'field_key' => 'created_at', 'type' => 'list', 'logged_in' => true, 'edit' => true, 'class' => '', 'link_type' => 'page', 'blank_label' => '', 'param_name' => 'entry', 'param_value' => 'key', 'page_id' => false, 'show_delete' => false, 'confirm' => __( 'Are you sure you want to delete that entry?', 'formidable' ), 'drafts' => false, ), $atts); $user_ID = get_current_user_id(); if ( ! $atts['id'] || ( $atts['logged_in'] && ! $user_ID) ) { return; } $atts = self::fill_entry_links_atts($atts); $action = ( isset($_GET) && isset($_GET['frm_action']) ) ? 'frm_action' : 'action'; $entry_action = FrmAppHelper::simple_get( $action, 'sanitize_title' ); $entry_key = FrmAppHelper::simple_get( 'entry', 'sanitize_title' ); if ( $entry_action == 'destroy' ) { self::maybe_delete_entry($entry_key); } $entries = self::get_entry_link_entries( $atts ); if ( empty($entries) ) { return; } $public_entries = array(); $post_status_check = array(); foreach ( $entries as $k => $entry ) { if ( $entry_action == 'destroy' && in_array($entry_key, array($entry->item_key, $entry->id)) ) { continue; } if ( $entry->post_id ) { $post_status_check[$entry->post_id] = $entry->id; } $public_entries[$entry->id] = $entry; } if ( ! empty($post_status_check) ) { global $wpdb; $query = array( 'post_status !' => 'publish', 'ID' => array_keys( $post_status_check ) ); $remove_entries = FrmDb::get_col( $wpdb->posts, $query, 'ID' ); unset($query); foreach ( $remove_entries as $entry_post_id ) { unset($public_entries[$post_status_check[$entry_post_id]]); } unset($remove_entries); } $entries = $public_entries; unset($public_entries); $content = array(); switch ( $atts['type'] ) { case 'list': self::entry_link_list($entries, $atts, $content); break; case 'select': self::entry_link_select($entries, $atts, $content); break; case 'collapse': self::entry_link_collapse($entries, $atts, $content); } $content = implode('', $content); return $content; } private static function fill_entry_links_atts($atts) { $atts['id'] = (int) $atts['id']; if ( $atts['show_delete'] === 1 ) { $atts['show_delete'] = __( 'Delete', 'formidable' ); } $atts['label'] = $atts['show_delete']; $atts['field'] = false; if ( $atts['field_key'] != 'created_at' ) { $atts['field'] = FrmField::getOne($atts['field_key']); if ( ! $atts['field'] ) { $atts['field_key'] = 'created_at'; } } if ( ! in_array($atts['type'], array( 'list', 'collapse', 'select') ) ) { $atts['type'] = 'select'; } if ( empty( $atts['confirm'] ) ) { $atts['confirm'] = __( 'Are you sure you want to delete that entry?', 'formidable' ); } global $post; $atts['permalink'] = get_permalink( $atts['page_id'] ? $atts['page_id'] : $post->ID ); return $atts; } private static function get_entry_link_entries($atts) { $s = FrmAppHelper::get_param( 'frm_search', false, 'get', 'sanitize_text_field' ); // Convert logged_in parameter to user_id for other functions $atts['user_id'] = false; if ( $atts['logged_in'] ) { global $wpdb; $atts['user_id'] = get_current_user_id(); } if ( $s ) { $entry_ids = FrmProEntriesHelper::get_search_ids( $s, $atts['id'], array( 'is_draft' => $atts['drafts'], 'user_id' => $atts['user_id'] ) ); } else { $entry_ids = FrmEntryMeta::getEntryIds( array( 'fi.form_id' => (int) $atts['id']), '', '', true, array( 'is_draft' => $atts['drafts'], 'user_id' => $atts['user_id'] ) ); } if ( empty($entry_ids) ) { return; } $order = ( $atts['type'] == 'collapse' ) ? ' ORDER BY it.created_at DESC' : ''; $entries = FrmEntry::getAll( array( 'it.id' => $entry_ids ), $order, '', true); return $entries; } private static function entry_link_list($entries, $atts, array &$content) { $content[] = '<ul class="frm_entry_ul '. $atts['class'] .'">'. "\n"; foreach ( $entries as $entry ) { $value = self::entry_link_meta_value($entry, $atts); $link = self::entry_link_href($entry, $atts); $content[] = '<li><a href="' . esc_url( $link ) . '">' . $value . '</a>'; if ( ! empty( $atts['show_delete'] ) && FrmProEntriesHelper::user_can_delete( $entry ) ) { $content[] = ' <a href="' . esc_url( add_query_arg( array( 'frm_action' => 'destroy', 'entry' => $entry->id ), $atts['permalink'] ) ) . '" class="frm_delete_list" onclick="return confirm(\''. esc_attr( $atts['confirm'] ) . '\')">' . $atts['show_delete'] . '</a>' . "\n"; } $content[] = "</li>\n"; } $content[] = "</ul>\n"; } private static function entry_link_collapse($entries, $atts, array &$content) { FrmStylesHelper::enqueue_jquery_css(); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('formidable' ); $content[] = '<div class="frm_collapse">'; $year = $month = ''; $prev_year = $prev_month = false; foreach ( $entries as $entry ) { $value = self::entry_link_meta_value($entry, $atts); $link = self::entry_link_href($entry, $atts); $new_year = strftime('%G', strtotime($entry->created_at)); $new_month = strftime('%B', strtotime($entry->created_at)); if ( $new_year != $year ) { if ( $prev_year ) { if ( $prev_month ) { $content[] = '</ul></div>'; } $content[] = '</div>'; $prev_month = false; } $class = $prev_year ? ' frm_hidden' : ''; $triangle = $prev_year ? 'e' : 's'; $content[] = "\n" . '<div class="frm_year_heading frm_year_heading_' . esc_attr( $atts['id'] ) . '"> <span class="ui-icon ui-icon-triangle-1-' . esc_attr( $triangle ) . '"></span>' . "\n" . '<a>' . sanitize_text_field( $new_year ) . '</a></div>' . "\n" . '<div class="frm_toggle_container' . esc_attr( $class ) . '">' . "\n"; $prev_year = true; } if ( $new_month != $month ) { if ( $prev_month ) { $content[] = '</ul></div>'; } $class = $prev_month ? ' frm_hidden' : ''; $triangle = $prev_month ? 'e' : 's'; $content[] = '<div class="frm_month_heading frm_month_heading_' . esc_attr( $atts['id'] ) . '"> <span class="ui-icon ui-icon-triangle-1-' . esc_attr( $triangle ) . '"></span>' . "\n" . '<a>' . sanitize_text_field( $new_month ) . '</a>' . "\n" . '</div>' . "\n" . '<div class="frm_toggle_container frm_month_listing' . esc_attr( $class ) . '"><ul>' . "\n"; $prev_month = true; } $content[] = '<li><a href="' . esc_url( $link ) . '">' . $value . '</a>'; if ( $atts['show_delete'] && FrmProEntriesHelper::user_can_delete($entry) ) { $content[] = ' <a href="' . esc_url( add_query_arg( array( 'frm_action' => 'destroy', 'entry' => $entry->id ), $atts['permalink'] ) ) . '" class="frm_delete_list" onclick="return confirm(\'' . esc_attr( $atts['confirm'] ) . '\')">' . $atts['show_delete'] . '</a>' . "\n"; } $content[] = "</li>\n"; $year = $new_year; $month = $new_month; } if ( $prev_year ) { $content[] = '</div>'; } if ( $prev_month ) { $content[] = '</ul></div>'; } $content[] = '</div>'; } private static function entry_link_select($entries, $atts, array &$content) { global $post; $content[] = '<select id="frm_select_form_' . esc_attr( $atts['id'] ) . '" name="frm_select_form_' . esc_attr( $atts['id'] ) . '" class="' . esc_attr( $atts['class'] ) . '" onchange="location=this.options[this.selectedIndex].value;">' . "\n"; $content[] = '<option value="' . esc_attr( get_permalink( $post->ID ) ) . '">' . $atts['blank_label'] . '</option>' . "\n"; $entry_param = FrmAppHelper::simple_get( 'entry', 'sanitize_title' ); foreach ( $entries as $entry ) { $value = self::entry_link_meta_value($entry, $atts); $link = self::entry_link_href($entry, $atts); $content[] = '<option value="' . esc_url( $link ) . '" ' . selected( $entry_param, $entry->item_key, false ) . '>' . esc_attr($value) . "</option>\n"; } $content[] = "</select>\n"; if ( $atts['show_delete'] && $entry_param ) { $content[] = " <a href='" . esc_url( add_query_arg( array( 'frm_action' => 'destroy', 'entry' => $entry_param ), $atts['permalink'] ) ) . "' class='frm_delete_list' onclick='return confirm(\"" . esc_attr( $atts['confirm'] ) . "\")'>" . $atts['show_delete'] . "</a>\n"; } } private static function entry_link_meta_value($entry, $atts) { $value = ''; if ( $atts['field_key'] && $atts['field_key'] != 'created_at' ) { if ( $entry->post_id && ( ( $atts['field'] && $atts['field']->field_options['post_field'] ) || $atts['field']->type == 'tag' ) ) { $meta = false; $value = FrmProEntryMetaHelper::get_post_value( $entry->post_id, $atts['field']->field_options['post_field'], $atts['field']->field_options['custom_field'], array( 'type' => $atts['field']->type, 'form_id' => $atts['field']->form_id, 'field' => $atts['field'] ) ); } else { $meta = isset($entry->metas[$atts['field']->id]) ? $entry->metas[$atts['field']->id] : ''; } } else { $meta = reset($entry->metas); } self::entry_link_value($entry, $atts, $meta, $value); return $value; } private static function entry_link_value($entry, $atts, $meta, &$value) { if ( 'created_at' != $atts['field_key'] && $meta ) { if ( is_object($meta) ) { $value = $meta->meta_value; } else { $value = $meta; } } if ( '' == $value ) { $value = date_i18n(get_option('date_format'), strtotime($entry->created_at)); return; } $value = FrmEntriesHelper::display_value($value, $atts['field'], array( 'type' => $atts['field']->type, 'show_filename' => false )); } private static function entry_link_href($entry, $atts) { $args = array( $atts['param_name'] => ( 'key' == $atts['param_value'] ) ? $entry->item_key : $entry->id, ); if ( $atts['edit'] ) { $args['frm_action'] = 'edit'; } if ( $atts['link_type'] == 'scroll' ) { $link = '#'. $entry->item_key; } else if ( $atts['link_type'] == 'admin' ) { $link = add_query_arg( $args, FrmAppHelper::get_server_value( 'REQUEST_URI' ) ); } else { $link = add_query_arg($args, $atts['permalink']); } return $link; } public static function entry_edit_link($atts){ global $post, $frm_vars, $wpdb; $atts = shortcode_atts( array( 'id' => (isset($frm_vars['editing_entry']) ? $frm_vars['editing_entry'] : false), 'label' => __( 'Edit', 'formidable' ), 'cancel' => __( 'Cancel', 'formidable' ), 'class' => '', 'page_id' => ( $post ? $post->ID : 0 ), 'html_id' => false, 'prefix' => '', 'form_id' => false, 'title' => '', ), $atts); $link = ''; $entry_id = ( $atts['id'] && is_numeric($atts['id']) ) ? $atts['id'] : FrmAppHelper::get_param('entry', false); if ( empty($entry_id) && $atts['id'] == 'current' ) { if ( isset($frm_vars['editing_entry']) && $frm_vars['editing_entry'] && is_numeric($frm_vars['editing_entry']) ) { $entry_id = $frm_vars['editing_entry']; } else if ( $post ) { $entry_id = FrmDb::get_var( $wpdb->prefix .'frm_items', array( 'post_id' => $post->ID) ); } } if ( ! $entry_id || empty($entry_id) ) { return ''; } if ( ! $atts['form_id'] ) { $atts['form_id'] = (int) FrmDb::get_var( $wpdb->prefix .'frm_items', array( 'id' => $entry_id), 'form_id' ); } //if user is not allowed to edit, then don't show the link if ( ! FrmProEntriesHelper::user_can_edit($entry_id, $atts['form_id']) ) { return $link; } if ( empty($atts['prefix']) ) { $link = add_query_arg( array( 'frm_action' => 'edit', 'entry' => $entry_id), get_permalink($atts['page_id'])); if ( $atts['label'] ) { $link = '<a href="' . esc_url( $link ) . '" class="' . esc_attr( $atts['class'] ) . '">' . $atts['label'] . '</a>'; } return $link; } $action = (isset($_POST) && isset($_POST['frm_action'])) ? 'frm_action' : 'action'; if ( isset($_POST[$action]) && $_POST[$action] =='update' && isset($_POST['form_id']) && $_POST['form_id'] == $atts['form_id'] && isset($_POST['id']) && $_POST['id'] == $entry_id ) { $errors = ( isset($frm_vars['created_entries'][$atts['form_id']]) && isset($frm_vars['created_entries'][$atts['form_id']]['errors']) ) ? $frm_vars['created_entries'][$atts['form_id']]['errors'] : array(); if ( ! empty($errors) ) { return FrmFormsController::get_form_shortcode( array( 'id' => $atts['form_id'], 'entry_id' => $entry_id)); } $link .= "<script type='text/javascript'>frmFrontForm.scrollToID('". $atts['prefix'] . $entry_id ."');</script>"; } if ( empty($atts['title']) ) { $atts['title'] = $atts['label']; } if ( ! $atts['html_id'] ) { $atts['html_id'] = 'frm_edit_'. $entry_id; } $frm_vars['forms_loaded'][] = true; $link .= "<a href='javascript:frmEditEntry(". $entry_id .',"'. $atts['prefix'] .'",'. $atts['page_id'] .','. $atts['form_id'] .',"'. htmlspecialchars(str_replace("'", '\"', $atts['cancel'])) .'","'. $atts['class'] ."\")' class='frm_edit_link ". $atts['class'] ."' id='". esc_attr($atts['html_id']) ."' title='". esc_attr($atts['title']) ."'>". $atts['label'] ."</a>\n"; return $link; } public static function entry_update_field($atts){ global $frm_vars, $post, $frm_update_link, $wpdb; $atts = shortcode_atts( array( 'id' => (isset($frm_vars['editing_entry']) ? $frm_vars['editing_entry'] : false), 'field_id' => false, 'form_id' => false, 'label' => __( 'Update', 'formidable' ), 'class' => '', 'value' => '', 'message' => '', 'title' => '', 'allow' => '', ), $atts); $entry_id = ( $atts['id'] && is_numeric( $atts['id'] ) ) ? absint( $atts['id'] ) : FrmAppHelper::get_param( 'entry', false, 'get', 'absint' ); if ( ! $entry_id || empty($entry_id) ) { return; } if ( ! $atts['form_id'] ) { $atts['form_id'] = (int) FrmDb::get_var($wpdb->prefix .'frm_items', array( 'id' => $entry_id), 'form_id'); } if ( $atts['allow'] != 'everyone' && ! FrmProEntriesHelper::user_can_edit( $entry_id, $atts['form_id'] ) ) { return; } $field = FrmField::getOne($atts['field_id']); if ( ! $field ) { return; } if ( ! is_numeric($atts['field_id']) ) { $atts['field_id'] = $field->id; } //check if current value is equal to new value $current_val = FrmProEntryMetaHelper::get_post_or_meta_value($entry_id, $field); if ( $current_val == $atts['value'] ) { return; } if ( ! $frm_update_link ) { $frm_update_link = array(); } $num = isset($frm_update_link[$entry_id .'-'. $atts['field_id']]) ? $frm_update_link[$entry_id .'-'. $atts['field_id']] : 0; $num = (int) $num + 1; $frm_update_link[$entry_id .'-'. $atts['field_id']] = $num; if ( empty($atts['title']) ) { $atts['title'] = $atts['label']; } $link = '<a href="#" onclick="frmUpdateField('. $entry_id .','. $atts['field_id'] .',\''. $atts['value'] .'\',\''. htmlspecialchars(str_replace("'", '\"', $atts['message'])) .'\','. $num .');return false;" id="frm_update_field_'. $entry_id .'_'. $atts['field_id'] .'_'. $num .'" class="frm_update_field_link '. $atts['class'] .'" title="'. esc_attr($atts['title']) .'">'. $atts['label'] .'</a>'; return $link; } public static function entry_delete_link($atts){ global $post, $frm_vars; $atts = shortcode_atts( array( 'id' => (isset($frm_vars['editing_entry']) ? $frm_vars['editing_entry'] : false), 'label' => __( 'Delete'), 'confirm' => __( 'Are you sure you want to delete that entry?', 'formidable' ), 'class' => '', 'page_id' => (($post) ? $post->ID : 0), 'html_id' => false, 'prefix' => '', 'title' => '', ), $atts); $entry_id = ( $atts['id'] && is_numeric( $atts['id'] ) ) ? $atts['id'] : ( FrmAppHelper::is_admin() ? FrmAppHelper::get_param( 'id', false, 'get', 'sanitize_text_field' ) : FrmAppHelper::get_param( 'entry', false, 'get', 'sanitize_text_field' ) ); if ( empty($entry_id) ) { return ''; } // Check if user has permission to delete before showing link if ( ! FrmProEntriesHelper::user_can_delete($entry_id) ) { return ''; } $frm_vars['forms_loaded'][] = true; if ( ! empty($atts['prefix']) ) { if ( ! $atts['html_id'] ) { $atts['html_id'] = 'frm_delete_'. $entry_id; } $link = "<a href='javascript:frmDeleteEntry(". $entry_id .",\"". $atts['prefix'] ."\")' class='frm_delete_link ". $atts['class'] ."' id='". $atts['html_id'] ."' onclick='return confirm(\"". $atts['confirm'] ."\")'>". $atts['label'] ."</a>\n"; return $link; } $link = ''; // Delete entry now $action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' ); if ( $action == 'destroy' ) { $entry_key = FrmAppHelper::get_param( 'entry', '', 'get', 'absint' ); if ( $entry_key && $entry_key == $entry_id ) { $link = self::ajax_destroy(false, false, false); if ( ! empty($link) ) { $new_link = '<div class="frm_message">'. $link .'</div>'; if ( empty($atts['label']) ) { return; } if ( $link == __( 'Your entry was successfully deleted', 'formidable' ) ) { return $new_link; } else { $link = $new_link; } unset($new_link); } } } $delete_link = wp_nonce_url(admin_url('admin-ajax.php') . '?action=frm_entries_destroy&entry='. $entry_id .'&redirect='. $atts['page_id'], 'frm_ajax', 'nonce'); if ( empty($atts['label']) ) { $link .= $delete_link; } else { if ( empty($atts['title']) ) { $atts['title'] = $atts['label']; } $link .= '<a href="' . esc_url( $delete_link ) . '" class="' . esc_attr( $atts['class'] ) . '" onclick="return confirm(\'' . esc_attr( $atts['confirm'] ) . '\')" title="' . esc_attr( $atts['title'] ) . '">' . $atts['label'] . '</a>' . "\n"; } return $link; } public static function get_field_value_shortcode($sc_atts){ $atts = shortcode_atts( array( 'entry_id' => false, 'field_id' => false, 'user_id' => false, 'ip' => false, 'show' => '', 'format' => '', 'return_array' => false, ), $sc_atts); // Include all user-defined atts as well $atts = (array) $atts + (array) $sc_atts; if ( ! $atts['field_id'] ) { return __( 'You are missing options in your shortcode. field_id is required.', 'formidable' ); } global $wpdb; $field = FrmField::getOne($atts['field_id']); if ( ! $field ) { return ''; } $query = array( 'form_id' => $field->form_id ); if ( $atts['user_id'] ) { // make sure we are not getting entries for logged-out users $query['user_id'] = (int) FrmAppHelper::get_user_id_param( $atts['user_id'] ); $query['user_id !'] = 0; } if ( $atts['entry_id'] ) { if ( ! is_numeric($atts['entry_id']) ) { $atts['entry_id'] = FrmAppHelper::simple_get( $atts['entry_id'], 'sanitize_title', $atts['entry_id'] ); } if ( (int) $atts['entry_id'] < 1 ) { // don't run the sql query if we know there will be no results return; } $query[] = array( 'or' => 1, 'id' => $atts['entry_id'], 'parent_item_id' => $atts['entry_id'] ); } if ( $atts['ip'] ) { $query['ip'] = ( $atts['ip'] == true ) ? FrmAppHelper::get_ip_address() : $atts['ip']; } $entry = FrmDb::get_row( 'frm_items', $query, 'post_id, id', array( 'order_by' => 'created_at DESC' ) ); if ( ! $entry ) { return; } $value = FrmProEntryMetaHelper::get_post_or_meta_value($entry, $field, $atts); $atts['type'] = $field->type; $atts['post_id'] = $entry->post_id; $atts['entry_id'] = $entry->id; if ( ! isset($atts['show_filename']) ) { $atts['show_filename'] = false; } if ( $field->type == 'file' && ! isset( $atts['html'] ) ) { // default to show the image instead of the url $atts['html'] = 1; } if ( ! empty( $atts['format'] ) || ( isset($atts['show']) && ! empty($atts['show']) ) ) { $value = FrmFieldsHelper::get_display_value($value, $field, $atts); } else { $value = FrmEntriesHelper::display_value( $value, $field, $atts); } return $value; } public static function show_entry_shortcode($atts){ $content = FrmEntriesController::show_entry_shortcode($atts); return $content; } /** * Alternate Row Color for Default HTML * @return string */ public static function change_row_color() { global $frm_email_col; $bg_color = 'bg_color'; if ( $frm_email_col ) { $bg_color .= '_active'; $frm_email_col = false; } else { $frm_email_col = true; } $bg_color = FrmStylesController::get_style_val($bg_color); $alt_color = 'background-color:#'. $bg_color .';'; return $alt_color; } public static function maybe_set_cookie($entry_id, $form_id) { if ( defined('WP_IMPORTING') || defined('DOING_AJAX') ) { return; } if ( isset($_POST) && isset($_POST['frm_skip_cookie']) ) { self::set_cookie($entry_id, $form_id); return; } include(FrmAppHelper::plugin_path() .'/pro/classes/views/frmpro-entries/set_cookie.php'); } /* AJAX */ public static function ajax_set_cookie(){ check_ajax_referer( 'frm_ajax', 'nonce' ); self::set_cookie(); wp_die(); } public static function set_cookie( $entry_id = false, $form_id = false ) { if ( headers_sent() ) { return; } if ( ! apply_filters('frm_create_cookies', true) ) { return; } if ( ! $entry_id ) { $entry_id = FrmAppHelper::get_param( 'entry_id', '', 'get', 'absint' ); } if ( ! $form_id ) { $form_id = FrmAppHelper::get_param( 'form_id', '', 'get', 'absint' ); } $form = FrmForm::getOne($form_id); $expiration = isset($form->options['cookie_expiration']) ? ( (float) $form->options['cookie_expiration'] *60*60 ) : 30000000; $expiration = apply_filters('frm_cookie_expiration', $expiration, $form_id, $entry_id); setcookie('frm_form'.$form_id.'_' . COOKIEHASH, current_time('mysql', 1), time() + $expiration, COOKIEPATH, COOKIE_DOMAIN); } public static function ajax_create(){ //if ( FrmAppHelper::doing_ajax() ) { // check_ajax_referer( 'frm_ajax', 'nonce' ); //} $form = FrmForm::getOne( (int) $_POST['form_id'] ); if ( ! $form ) { echo false; wp_die(); } $no_ajax_fields = array( 'file'); $errors = FrmEntry::validate($_POST, $no_ajax_fields); if ( empty( $errors ) ) { global $wpdb; $ajax = isset($form->options['ajax_submit']) ? $form->options['ajax_submit'] : 0; //ajax submit if no file, rte, captcha if ( $ajax ) { $where = array( 'form_id' => $form->id, 'type' => $no_ajax_fields); if ( isset($_POST['frm_page_order_'. $form->id]) ) { $where['field_order <'] = (int) $_POST['frm_page_order_'. $form->id] - 1; } $no_ajax = FrmDb::get_var( $wpdb->prefix .'frm_fields', $where); if ( $no_ajax ) { $ajax = false; } unset($where); } if ( $ajax ) { global $frm_vars; $frm_vars['ajax'] = true; $frm_vars['css_loaded'] = true; // don't load scripts if we are going backwards in the form $going_backwards = FrmProFormsHelper::going_to_prev( $form->id ); // save the entry if there is not another page or when saving a draft if ( ( ! isset( $_POST[ 'frm_page_order_' . $form->id ] ) && ! $going_backwards ) || FrmProFormsHelper::saving_draft() ) { $processed = true; FrmEntriesController::process_entry($errors, true); } echo FrmFormsController::show_form($form->id); // trigger the footer scripts if there is a form to show $show_form = ! isset( $form->options['show_form'] ) || $form->options['show_form']; if ( $errors || $show_form || ! isset( $processed ) ) { self::print_ajax_scripts( $going_backwards ? 'none' : '' ); } } else { echo false; } }else{ $errors = str_replace('"', '&quot;', $errors); $obj = array(); foreach ( $errors as $field => $error ) { $field_id = str_replace('field', '', $field); $obj[$field_id] = $error; } echo json_encode($obj); } wp_die(); } public static function ajax_update(){ if ( ! $_POST || ! isset( $_POST['nonce'] ) ) { // make sure the request is posted since the front-end nonce may be cached wp_die(); } return self::ajax_create(); } public static function wp_ajax_destroy(){ check_ajax_referer( 'frm_ajax', 'nonce' ); $echo = true; if ( isset($_REQUEST['redirect']) ) { // don't echo if redirecting $echo = false; } self::ajax_destroy(false, true, $echo); if ( ! $echo ) { // redirect instead of loading a blank page wp_redirect( esc_url_raw( get_permalink( $_REQUEST['redirect'] ) ) ); die(); } wp_die(); } public static function ajax_destroy($form_id = false, $ajax = true, $echo = true) { global $wpdb, $frm_vars; $entry_key = FrmAppHelper::get_param( 'entry', '', 'get', 'sanitize_title' ); if ( ! $form_id ) { $form_id = FrmAppHelper::get_param( 'form_id', '', 'get', 'absint' ); } if ( ! $entry_key ) { return; } if ( isset( $frm_vars['deleted_entries'] ) && is_array( $frm_vars['deleted_entries'] ) && in_array( $entry_key, $frm_vars['deleted_entries'] ) ) { return; } if ( is_numeric( $entry_key ) ) { $where = array( 'id' => $entry_key); } else { $where = array( 'item_key' => $entry_key); } $entry = FrmDb::get_row( $wpdb->prefix .'frm_items', $where, 'id, form_id, is_draft, user_id' ); unset( $where ); if ( ! $entry || ( $form_id && $entry->form_id != (int) $form_id ) ) { return; } $message = self::maybe_delete_entry($entry); if ( $message && ! is_numeric($message) ) { if ( $echo ) { echo '<div class="frm_message">'. $message .'</div>'; } return; } if ( ! isset( $frm_vars['deleted_entries'] ) || empty( $frm_vars['deleted_entries'] ) ) { $frm_vars['deleted_entries'] = array(); } $frm_vars['deleted_entries'][] = $entry->id; if ( $ajax && $echo ) { echo $message = 'success'; } else if ( ! $ajax ) { $message = apply_filters('frm_delete_message', __( 'Your entry was successfully deleted', 'formidable' ), $entry); if ( $echo ) { echo '<div class="frm_message">'. $message .'</div>'; } } else { $message = ''; } return $message; } public static function maybe_delete_entry($entry) { FrmEntriesHelper::maybe_get_entry( $entry ); if ( ! $entry || ! FrmProEntriesHelper::user_can_delete($entry) ) { $message = __( 'There was an error deleting that entry', 'formidable' ); return $message; } $result = FrmEntry::destroy( $entry->id ); return $result; } public static function edit_entry_ajax(){ //check_ajax_referer( 'frm_ajax', 'nonce' ); $id = FrmAppHelper::get_param( 'id', '', 'post', 'absint' ); $entry_id = FrmAppHelper::get_param('entry_id', 0, 'post', 'absint' ); $post_id = FrmAppHelper::get_param( 'post_id', 0, 'post', 'sanitize_title' ); global $frm_vars; $frm_vars['footer_loaded'] = true; if ( $entry_id ) { $_GET['entry'] = $entry_id; } if ( $post_id && is_numeric($post_id) ) { global $post; if ( ! $post ) { $post = get_post($post_id); } } echo "<script type='text/javascript'> /*<![CDATA[*/ jQuery(document).ready(function($){ $('#frm_form_" . esc_attr( $id ) . "_container .frm-show-form').submit(window.frmFrontForm.submitForm); }); /*]]>*/ </script>"; echo FrmFormsController::get_form_shortcode( compact( 'id', 'entry_id' ) ); self::print_ajax_scripts( 'all' ); wp_die(); } public static function update_field_ajax(){ check_ajax_referer( 'frm_ajax', 'nonce' ); $entry_id = FrmAppHelper::get_param( 'entry_id', 0, 'post', 'absint' ); $field_id = FrmAppHelper::get_param( 'field_id', 0, 'post', 'sanitize_title' ); $value = FrmAppHelper::get_param('value'); global $wpdb; if ( ! $entry_id ) { wp_die(); } if ( is_numeric( $field_id ) ) { $where = array( 'fi.id' => (int) $field_id ); } else { $where = array( 'field_key' => $field_id ); } $field = FrmField::getAll($where, '', ' LIMIT 1'); if ( ! $field || ! FrmProEntriesHelper::user_can_edit( $entry_id, $field->form_id ) ) { wp_die(); } $post_id = false; if ( isset($field->field_options['post_field']) && ! empty($field->field_options['post_field']) ) { $post_id = FrmDb::get_var( $wpdb->prefix .'frm_items', array( 'id' => $entry_id), 'post_id' ); } if ( ! $post_id ) { $updated = FrmEntryMeta::update_entry_meta($entry_id, $field_id, $meta_key = null, $value); if ( ! $updated ) { $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE item_id = %d and field_id = %d", $entry_id, $field_id)); $updated = FrmEntryMeta::add_entry_meta($entry_id, $field_id, '', $value); } wp_cache_delete( $entry_id, 'frm_entry'); }else{ switch ( $field->field_options['post_field'] ) { case 'post_custom': $updated = update_post_meta($post_id, $field->field_options['custom_field'], maybe_serialize($value)); break; case 'post_category': $taxonomy = ( isset($field->field_options['taxonomy']) && ! empty($field->field_options['taxonomy']) ) ? $field->field_options['taxonomy'] : 'category'; $updated = wp_set_post_terms( $post_id, $value, $taxonomy ); break; default: $post = get_post($post_id, ARRAY_A); $post[$field->field_options['post_field']] = maybe_serialize($value); $updated = wp_insert_post( $post ); break; } } if ( $updated ) { // set updated_at time $wpdb->update( $wpdb->prefix .'frm_items', array( 'updated_at' => current_time('mysql', 1), 'updated_by' => get_current_user_id()), array( 'id' => $entry_id) ); } do_action('frm_after_update_field', compact('entry_id', 'field_id', 'value')); echo $updated; wp_die(); } public static function send_email(){ if ( current_user_can('frm_view_forms') || current_user_can('frm_edit_forms') || current_user_can('frm_edit_entries') ) { if ( FrmAppHelper::doing_ajax() ) { check_ajax_referer( 'frm_ajax', 'nonce' ); } $entry_id = FrmAppHelper::get_param( 'entry_id', '', 'get', 'absint' ); $form_id = FrmAppHelper::get_param( 'form_id', '', 'get', 'absint' ); printf(__( 'Resent to %s', 'formidable' ), ''); add_filter('frm_echo_emails', '__return_true'); FrmFormActionsController::trigger_actions('create', $form_id, $entry_id, 'email'); }else{ _e( 'Resent to No one! You do not have permission', 'formidable' ); } wp_die(); } public static function redirect_url($url){ $url = str_replace( array( ' ', '[', ']', '|', '@'), array( '%20', '%5B', '%5D', '%7C', '%40'), $url); return $url; } public static function setup_edit_vars($values) { if ( ! isset($values['edit_value']) ) { $values['edit_value'] = ($_POST && isset($_POST['options']['edit_value'])) ? $_POST['options']['edit_value'] : __( 'Update', 'formidable' ); } if ( ! isset($values['edit_msg']) ) { if ( $_POST && isset($_POST['options']['edit_msg']) ) { $values['edit_msg'] = $_POST['options']['edit_msg']; } else { $frmpro_settings = new FrmProSettings(); $values['edit_msg'] = $frmpro_settings->edit_msg; } } return $values; } public static function allow_form_edit($action, $form) { _deprecated_function( __FUNCTION__, '2.0', 'FrmProEntriesHelper::allow_form_edit'); return FrmProEntriesHelper::allow_form_edit($action, $form); } public static function email_value($value, $meta, $entry) { _deprecated_function( __FUNCTION__, '2.0', 'FrmProEntryMetaHelper::email_value'); return FrmProEntryMetaHelper::email_value($value, $meta, $entry); } /* Trigger model actions */ public static function create_post($entry_id, $form_id) { _deprecated_function( __FUNCTION__, '2.0', 'FrmProEntriesController::trigger_post'); FrmProEntry::create_post($entry_id, $form_id); } public static function update_post($entry_id, $form_id) { _deprecated_function( __FUNCTION__, '2.0', 'FrmProEntriesController::trigger_post'); FrmProEntry::update_post($entry_id, $form_id); } }
rafapires/wp4net
wp-content/plugins/formidable/pro/classes/controllers/FrmProEntriesController.php
PHP
gpl-2.0
95,719
import wpilib import hal from wpilib import RobotDrive class KwarqsDriveMech(RobotDrive): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.weight_multiplier = 1 def set_multiplier(self, in_multi = None): if in_multi != None : self.weight_multiplier = in_multi else: self.weight_multiplier = 1 def mecanumDrive_Cartesian(self, x, y, rotation, gyroAngle): """Drive method for Mecanum wheeled robots. A method for driving with Mecanum wheeled robots. There are 4 wheels on the robot, arranged so that the front and back wheels are toed in 45 degrees. When looking at the wheels from the top, the roller axles should form an X across the robot. This is designed to be directly driven by joystick axes. :param x: The speed that the robot should drive in the X direction. [-1.0..1.0] :param y: The speed that the robot should drive in the Y direction. This input is inverted to match the forward == -1.0 that joysticks produce. [-1.0..1.0] :param rotation: The rate of rotation for the robot that is completely independent of the translation. [-1.0..1.0] :param gyroAngle: The current angle reading from the gyro. Use this to implement field-oriented controls. """ if not wpilib.RobotDrive.kMecanumCartesian_Reported: hal.HALReport(hal.HALUsageReporting.kResourceType_RobotDrive, self.getNumMotors(), hal.HALUsageReporting.kRobotDrive_MecanumCartesian) RobotDrive.kMecanumCartesian_Reported = True xIn = x yIn = y # Negate y for the joystick. yIn = -yIn # Compenstate for gyro angle. xIn, yIn = RobotDrive.rotateVector(xIn, yIn, gyroAngle) wheelSpeeds = [0]*self.kMaxNumberOfMotors wheelSpeeds[self.MotorType.kFrontLeft] = xIn + yIn + rotation wheelSpeeds[self.MotorType.kFrontRight] = -xIn + yIn - rotation wheelSpeeds[self.MotorType.kRearLeft] = -xIn + yIn + ( rotation * self.weight_multiplier ) wheelSpeeds[self.MotorType.kRearRight] = xIn + yIn - ( rotation * self.weight_multiplier ) RobotDrive.normalize(wheelSpeeds) self.frontLeftMotor.set(wheelSpeeds[self.MotorType.kFrontLeft] * self.invertedMotors[self.MotorType.kFrontLeft] * self.maxOutput, self.syncGroup) self.frontRightMotor.set(wheelSpeeds[self.MotorType.kFrontRight] * self.invertedMotors[self.MotorType.kFrontRight] * self.maxOutput, self.syncGroup) self.rearLeftMotor.set(wheelSpeeds[self.MotorType.kRearLeft] * self.invertedMotors[self.MotorType.kRearLeft] * self.maxOutput, self.syncGroup) self.rearRightMotor.set(wheelSpeeds[self.MotorType.kRearRight] * self.invertedMotors[self.MotorType.kRearRight] * self.maxOutput, self.syncGroup) if self.syncGroup != 0: wpilib.CANJaguar.updateSyncGroup(self.syncGroup) self.feed()
frc2423/2015
recycle_rush/custom/kwarqs_drive_mech.py
Python
gpl-2.0
3,114
package lab.springboot.authorization.controller; import lab.springboot.authorization.config.SecurityProperties; import lombok.NonNull; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("/oauth") @RequiredArgsConstructor public class OauthController { private final @NonNull SecurityProperties securityProperties; @GetMapping("login") public String loginView(Model model) { model.addAttribute("action", securityProperties.getLoginProcessingUrl()); return "form-login"; } }
rojarsmith/Lab
lab-springboot/lab-springboot-security-oauth2-authorization-expansion/src/main/java/lab/springboot/authorization/controller/OauthController.java
Java
gpl-2.0
734
<?php // Iniciamos sesión para recoger los valores de la búsqueda session_start(); require_once('conexion.php'); require_once('conexion_old.php'); if(isset($_POST['get_option_producto'])){ $producto = $_POST['get_option_producto']; $_SESSION['producto'] = $producto; $find = mysql_query("SELECT $producto FROM PIEZA GROUP BY $producto ASC"); while($row = mysql_fetch_array($find)){ /* Añadiendo el value espero poder pasar los datos de la opción escogida * Es posible que se pueda usar en el resto de menús para hacerlo más fácil y sensible * a las modificaciones introducidas */ echo "<option value='$row[$producto]'>".$row[$producto]."</option>"; } exit; } ?>
MMariscal/Varios
Buscador_lateral/src/php/fetch_data_producto.php
PHP
gpl-2.0
808
/** \file decentral_module_management.cpp * Contains the class functions of the decentral module managemener in * the \link voraus::Voraus Voraus \endlink framework. * Author : Martin Seidel * * This file depends on decentral_module_management.hpp **/ #include "decentral_module_management.hpp" namespace module_management { ModManDecentral::ModManDecentral(ros::NodeHandle roshandle):ModManBase(roshandle, false) { std::ostringstream temp; temp.str(""); temp << name.project_namespace << "robot_registration"; logIn = node.rosHandle.serviceClient<voraus::robot_registration>(temp.str().c_str()); robot.state = voraus::Voraus::unregistered; robot.lastHeartbeatWithMyIdCounter = 0; temp.str(""); temp << name.project_namespace << "known_robot_list"; serverHeartbeat = node.rosHandle.subscribe(temp.str().c_str(), 50, &ModManDecentral::serverHeartbeatCallback, this); temp.str(""); temp << name.project_namespace << "robot_state"; robotHeartbeat = node.rosHandle.advertise<voraus::heartbeat>(temp.str().c_str(), 50); } int ModManDecentral::loop(const ros::TimerEvent& event) { if (robot.state == voraus::Voraus::idle || robot.state == voraus::Voraus::working || robot.state == voraus::Voraus::failure) { //the robot will be unregistered if he didn't send a heartbeat-message after this time if (robot.lastHeartbeatTime < event.current_real - robot.maxTimeWithoutHeartbeat) { ROS_ERROR("%s master is lost. Trying to reconnect.", name.full.c_str()); registerAtServer(); } //a warning will be printed if the master didn't send a heartbeat-message after this time if (robot.lastHeartbeatTime < event.current_real - robot.maxTimeWithoutHeartbeat * 0.7) { ROS_WARN("%s no heartbeat from master since %.2f sec", name.full.c_str(), event.current_real.toSec() - robot.lastHeartbeatTime.toSec()); } sendHeartbeat(); } } int ModManDecentral::sendHeartbeat() { voraus::heartbeat temp_heartbeat; temp_heartbeat.header.stamp = ros::Time::now(); temp_heartbeat.current_known_robot_count = 1; temp_heartbeat.id = name.id; temp_heartbeat.name = name.name; temp_heartbeat.robotState = robot.state; robotHeartbeat.publish(temp_heartbeat); return 0; } int ModManDecentral::registerAtServer() { voraus::robot_registration logInTemp; logInTemp.request.name = name.name; if (logIn.call(logInTemp)) { robot.state = voraus::Voraus::idle; name.id = logInTemp.response.id; robot.maxTimeWithoutHeartbeat = ros::Duration(logInTemp.response.timeout); central.task_scheduling = logInTemp.response.task_scheduling; central.localisation = logInTemp.response.localisation; central.path_planing = logInTemp.response.path_planing; central.demo = logInTemp.response.demo; } else { robot.state = voraus::Voraus::unregistered; name.id = 0; robot.maxTimeWithoutHeartbeat = ros::Duration(3600); central.task_scheduling = true; central.localisation = true; central.path_planing = true; central.demo = true; } robot.lastHeartbeatWithMyIdCounter = 0; buildFullName(); if (name.id == 0) { ROS_ERROR("%s server unreachable", name.full.c_str()); } else { std::ostringstream temp; temp.str(""); temp << "Module-Config: "; temp << "task_scheduling = " << ((central.task_scheduling) ? "central" : "decentral"); temp << "; localisation = " << ((central.localisation) ? "central" : "decentral"); temp << "; path_planing = " << ((central.path_planing) ? "central" : "decentral"); temp << "; demo = " << ((central.demo) ? "central" : "decentral"); ROS_INFO("%s Connected to server; TimeOut: %.2fs; %s", name.full.c_str(), robot.maxTimeWithoutHeartbeat.toSec(), temp.str().c_str()); } return 0; } void ModManDecentral::serverHeartbeatCallback(const voraus::heartbeat event) { if (event.id == name.id) { robot.lastHeartbeatWithMyIdCounter = 0; if (event.robotState != robot.state) { ROS_WARN("%s server has a wrong state for this robot (%i instead of %i)", name.full.c_str(), event.robotState, robot.state);} } else { robot.lastHeartbeatWithMyIdCounter++; } if (robot.lastHeartbeatWithMyIdCounter >= event.current_known_robot_count * 2) { registerAtServer(); } robot.lastHeartbeatTime = event.header.stamp; } }
ein57ein/voraus
src/module_management/decentral_module_management.cpp
C++
gpl-2.0
4,314
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * This file is available under and governed by the GNU General Public * License version 2 only, as published by the Free Software Foundation. * However, the following notice accompanied the original version of this * file: * * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at * http://creativecommons.org/publicdomain/zero/1.0/ */ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.AbstractQueuedSynchronizer; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.atomic.AtomicInteger; import java.io.IOException; import java.io.ObjectInputStream; /** * A sample user extension of AbstractQueuedSynchronizer. */ public class Mutex implements Lock, java.io.Serializable { private static class Sync extends AbstractQueuedSynchronizer { public boolean isHeldExclusively() { return getState() == 1; } public boolean tryAcquire(int acquires) { assert acquires == 1; // Does not use multiple acquires return compareAndSetState(0, 1); } public boolean tryRelease(int releases) { setState(0); return true; } Condition newCondition() { return new ConditionObject(); } private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); setState(0); // reset to unlocked state } } private final Sync sync = new Sync(); public void lock() { sync.acquire(1); } public boolean tryLock() { return sync.tryAcquire(1); } public void lockInterruptibly() throws InterruptedException { sync.acquireInterruptibly(1); } public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException { return sync.tryAcquireNanos(1, unit.toNanos(timeout)); } public void unlock() { sync.release(1); } public Condition newCondition() { return sync.newCondition(); } public boolean isLocked() { return sync.isHeldExclusively(); } public boolean hasQueuedThreads() { return sync.hasQueuedThreads(); } }
FauxFaux/jdk9-jdk
test/java/util/concurrent/locks/Lock/Mutex.java
Java
gpl-2.0
3,212
/* * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include <jni.h> #include <jni_util.h> #include <jlong.h> #include "D3DSurfaceData.h" #include "D3DPipelineManager.h" #include "Trace.h" #include "awt_Toolkit.h" #include "awt_Window.h" #include "awt_BitmapUtil.h" #include "D3DRenderQueue.h" // REMIND: move to awt_Component.h extern "C" HWND AwtComponent_GetHWnd(JNIEnv *env, jlong pData); /** * Initializes nativeWidth/Height fields of the SurfaceData object with * dimensions on the native surface. */ void D3DSD_SetNativeDimensions(JNIEnv *env, D3DSDOps *d3dsdo) { jobject sdObject; jint width, height; RETURN_IF_NULL(sdObject = env->NewLocalRef(d3dsdo->sdOps.sdObject)); if (d3dsdo->pResource != NULL) { width = d3dsdo->pResource->GetDesc()->Width; height = d3dsdo->pResource->GetDesc()->Height; } else { width = d3dsdo->width; height = d3dsdo->height; } JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width); JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height); env->DeleteLocalRef(sdObject); } void D3DSD_Flush(void *pData) { J2dTraceLn(J2D_TRACE_INFO, "D3DSD_Flush"); RETURN_IF_NULL(pData); D3DSDOps *d3dsdo = (D3DSDOps*)pData; if (d3dsdo->pResource != NULL) { D3DContext *pCtx; D3DPipelineManager *pMgr; d3dsdo->pResource->SetSDOps(NULL); if ((pMgr = D3DPipelineManager::GetInstance()) != NULL && SUCCEEDED(pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { if (pCtx->GetResourceManager()) { pCtx->GetResourceManager()->ReleaseResource(d3dsdo->pResource); } } d3dsdo->pResource = NULL; } } void D3DSD_MarkLost(void *pData) { D3DSDOps *d3dsdo; jobject sdObject; JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); J2dTraceLn(J2D_TRACE_INFO, "D3DSD_MarkLost"); RETURN_IF_NULL(pData); d3dsdo = (D3DSDOps*)pData; RETURN_IF_NULL(sdObject = env->NewLocalRef(d3dsdo->sdOps.sdObject)); JNU_CallMethodByName(env, NULL, sdObject, "setSurfaceLost", "(Z)V", JNI_TRUE); env->DeleteLocalRef(sdObject); } // ------------ generic SurfaceData.h functions ---------------- void D3DSD_Dispose(JNIEnv *env, SurfaceDataOps *ops) { D3DSDOps *d3dsdo = (D3DSDOps *)ops; RETURN_IF_NULL(d3dsdo); JNU_CallStaticMethodByName(env, NULL, "sun/java2d/d3d/D3DSurfaceData", "dispose", "(J)V", ptr_to_jlong(ops)); } /** * This is the implementation of the general surface LockFunc defined in * SurfaceData.h. */ jint D3DSD_Lock(JNIEnv *env, SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo, jint lockflags) { JNU_ThrowInternalError(env, "D3DSD_Lock not implemented!"); return SD_FAILURE; } /** * This is the implementation of the general GetRasInfoFunc defined in * SurfaceData.h. */ void D3DSD_GetRasInfo(JNIEnv *env, SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo) { JNU_ThrowInternalError(env, "D3DSD_GetRasInfo not implemented!"); } /** * This is the implementation of the general surface UnlockFunc defined in * SurfaceData.h. */ void D3DSD_Unlock(JNIEnv *env, SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo) { JNU_ThrowInternalError(env, "D3DSD_Unlock not implemented!"); } // ------------ D3DSurfaceData's JNI methods ---------------- extern "C" { /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: initOps * Signature: (III)V */ JNIEXPORT void JNICALL Java_sun_java2d_d3d_D3DSurfaceData_initOps (JNIEnv *env, jobject d3dsd, jint gdiScreen, jint width, jint height) { D3DPipelineManager *pMgr; D3DSDOps *d3dsdo = (D3DSDOps *)SurfaceData_InitOps(env, d3dsd, sizeof(D3DSDOps)); J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_initOps"); if (d3dsdo == NULL) { JNU_ThrowOutOfMemoryError(env, "creating native d3d ops"); return; } d3dsdo->sdOps.Lock = D3DSD_Lock; d3dsdo->sdOps.GetRasInfo = D3DSD_GetRasInfo; d3dsdo->sdOps.Unlock = D3DSD_Unlock; d3dsdo->sdOps.Dispose = D3DSD_Dispose; d3dsdo->xoff = 0; d3dsdo->yoff = 0; d3dsdo->width = width; d3dsdo->height = height; d3dsdo->pResource = NULL; d3dsdo->adapter = (pMgr = D3DPipelineManager::GetInstance()) == NULL ? D3DADAPTER_DEFAULT : pMgr->GetAdapterOrdinalForScreen(gdiScreen); } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: initTexture * Signature: (JZZ)Z */ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DSurfaceData_initTexture (JNIEnv *env, jobject d3dsd, jlong pData, jboolean isRTT, jboolean isOpaque) { HRESULT res; D3DSDOps *d3dsdo; D3DContext *pCtx; D3DPipelineManager *pMgr; D3DFORMAT format; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_initTexture"); RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), JNI_FALSE); RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), JNI_FALSE); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } RETURN_STATUS_IF_NULL(pCtx->GetResourceManager(), JNI_FALSE); pCtx->GetResourceManager()->ReleaseResource(d3dsdo->pResource); d3dsdo->pResource = NULL; if (isRTT && isOpaque) { format = pCtx->GetPresentationParams()->BackBufferFormat; } else { format = D3DFMT_UNKNOWN; } res = pCtx->GetResourceManager()-> CreateTexture(d3dsdo->width, d3dsdo->height, isRTT, isOpaque, &format, 0/*usage*/, &d3dsdo->pResource); if (SUCCEEDED(res)) { J2dTraceLn1(J2D_TRACE_VERBOSE, " created texture pResource=%x", d3dsdo->pResource); d3dsdo->pResource->SetSDOps(d3dsdo); } else { D3DRQ_MarkLostIfNeeded(res, d3dsdo); } D3DSD_SetNativeDimensions(env, d3dsdo); return SUCCEEDED(res); } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: initPlain * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DSurfaceData_initRTSurface (JNIEnv *env, jobject d3dsd, jlong pData, jboolean isOpaque) { HRESULT res; D3DSDOps *d3dsdo; D3DContext *pCtx; D3DPipelineManager *pMgr; D3DFORMAT format = D3DFMT_UNKNOWN; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_initRTSurface"); RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), JNI_FALSE); RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), JNI_FALSE); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } RETURN_STATUS_IF_NULL(pCtx->GetResourceManager(), JNI_FALSE); pCtx->GetResourceManager()->ReleaseResource(d3dsdo->pResource); d3dsdo->pResource = NULL; res = pCtx->GetResourceManager()-> CreateRTSurface(d3dsdo->width, d3dsdo->height, isOpaque, FALSE /*lockable*/, &format, &d3dsdo->pResource); if (SUCCEEDED(res)) { J2dTraceLn1(J2D_TRACE_VERBOSE, " created RT surface pResource=0x%x", d3dsdo->pResource); d3dsdo->pResource->SetSDOps(d3dsdo); } else { D3DRQ_MarkLostIfNeeded(res, d3dsdo); } D3DSD_SetNativeDimensions(env, d3dsdo); return SUCCEEDED(res); } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: initFlipBackbuffer * Signature: (JJIZ)Z */ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DSurfaceData_initFlipBackbuffer (JNIEnv *env, jobject d3dsd, jlong pData, jlong pPeerData, jint numBuffers, jint swapEffect, jint vSyncType) { HRESULT res; D3DSDOps *d3dsdo; D3DContext *pCtx; D3DPipelineManager *pMgr; HWND hWnd; UINT presentationInterval; AwtComponent *pPeer; RECT r = { 0, 0, 0, 0 }; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_initFlipBackbuffer"); RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), JNI_FALSE); RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), JNI_FALSE); RETURN_STATUS_IF_NULL(pPeer = (AwtComponent *)jlong_to_ptr(pPeerData), JNI_FALSE); hWnd = pPeer->GetHWnd(); if (!IsWindow(hWnd)) { J2dTraceLn(J2D_TRACE_WARNING, "D3DSurfaceData_initFlipBackbuffer: disposed component"); return JNI_FALSE; } pPeer->GetInsets(&r); d3dsdo->xoff = -r.left; d3dsdo->yoff = -r.top; if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } RETURN_STATUS_IF_NULL(pCtx->GetResourceManager(), JNI_FALSE); pCtx->GetResourceManager()->ReleaseResource(d3dsdo->pResource); d3dsdo->pResource = NULL; d3dsdo->swapEffect = (D3DSWAPEFFECT)swapEffect; // in full-screen mode we should v-sync if (pCtx->GetPresentationParams()->Windowed) { if (vSyncType == VSYNC_ON) { presentationInterval = D3DPRESENT_INTERVAL_ONE; J2dTraceLn(J2D_TRACE_VERBOSE, " windowed, forced interval: ONE"); } else { presentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; J2dTraceLn(J2D_TRACE_VERBOSE, " windowed, default interval: IMMEDIATE"); } // REMIND: this is a workaround for the current issue // we have with non-copy flip chains: since we can not specify // the dest rectangle for Present for these modes, the result of // Present(NULL, NULL) is scaled to the client area. if (d3dsdo->xoff != 0 || d3dsdo->yoff != 0) { d3dsdo->swapEffect = D3DSWAPEFFECT_COPY; } } else { if (vSyncType == VSYNC_OFF) { presentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; J2dTraceLn(J2D_TRACE_VERBOSE, " full-screen, forced interval: IMMEDIATE"); } else { presentationInterval = D3DPRESENT_INTERVAL_ONE; J2dTraceLn(J2D_TRACE_VERBOSE, " full-screen, default interval: ONE"); } } res = pCtx->GetResourceManager()-> CreateSwapChain(hWnd, numBuffers, d3dsdo->width, d3dsdo->height, d3dsdo->swapEffect, presentationInterval, &d3dsdo->pResource); if (SUCCEEDED(res)) { J2dTraceLn1(J2D_TRACE_VERBOSE, " created swap chain pResource=0x%x", d3dsdo->pResource); d3dsdo->pResource->SetSDOps(d3dsdo); } else { D3DRQ_MarkLostIfNeeded(res, d3dsdo); } D3DSD_SetNativeDimensions(env, d3dsdo); return SUCCEEDED(res); } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: dbGetPixelNative * Signature: (JII)I */ JNIEXPORT jint JNICALL Java_sun_java2d_d3d_D3DSurfaceData_dbGetPixelNative (JNIEnv *env, jclass clazz, jlong pData, jint x, jint y) { HRESULT res; D3DSDOps *d3dsdo; D3DContext *pCtx; D3DPipelineManager *pMgr; D3DResource *pLockableRes; jint pixel = 0; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_dbGetPixelNative"); RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), pixel); RETURN_STATUS_IF_NULL(d3dsdo->pResource, pixel); RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), pixel); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return pixel; } RETURN_STATUS_IF_NULL(pCtx->GetResourceManager(), 0); IDirect3DDevice9 *pd3dDevice = pCtx->Get3DDevice(); IDirect3DSurface9 *pSrc = d3dsdo->pResource->GetSurface(); D3DFORMAT srcFmt = d3dsdo->pResource->GetDesc()->Format; pCtx->UpdateState(STATE_OTHEROP); res = pCtx->GetResourceManager()-> GetLockableRTSurface(1, 1, srcFmt, &pLockableRes); if (SUCCEEDED(res)) { IDirect3DSurface9 *pTmpSurface; RECT srcRect = { x, y, x+1, y+1}; RECT dstRect = { 0l, 0l, 1, 1 }; pTmpSurface = pLockableRes->GetSurface(); res = pd3dDevice->StretchRect(pSrc, &srcRect, pTmpSurface, &dstRect, D3DTEXF_NONE); if (SUCCEEDED(res)) { D3DLOCKED_RECT lRect; res = pTmpSurface->LockRect(&lRect, &dstRect, D3DLOCK_NOSYSLOCK); if (SUCCEEDED(res)) { if (srcFmt == D3DFMT_X8R8G8B8) { pixel = *(jint*)lRect.pBits; } else { pixel = *(unsigned short*)lRect.pBits; } pTmpSurface->UnlockRect(); } } } D3DRQ_MarkLostIfNeeded(res, d3dsdo); return pixel; } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: dbSetPixelNative * Signature: (JIII)V */ JNIEXPORT void JNICALL Java_sun_java2d_d3d_D3DSurfaceData_dbSetPixelNative (JNIEnv *env, jclass clazz, jlong pData, jint x, jint y, jint pixel) { HRESULT res; D3DSDOps *d3dsdo; D3DResource *pLockableRes; D3DContext *pCtx; D3DPipelineManager *pMgr; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_dbSetPixelNative"); RETURN_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData)); RETURN_IF_NULL(d3dsdo->pResource); RETURN_IF_NULL(pMgr = D3DPipelineManager::GetInstance()); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return; } RETURN_IF_NULL(pCtx->GetResourceManager()); IDirect3DDevice9 *pd3dDevice = pCtx->Get3DDevice(); IDirect3DSurface9 *pSrc = d3dsdo->pResource->GetSurface(); D3DFORMAT srcFmt = d3dsdo->pResource->GetDesc()->Format; pCtx->UpdateState(STATE_OTHEROP); res = pCtx->GetResourceManager()-> GetLockableRTSurface(1, 1, srcFmt, &pLockableRes); if (SUCCEEDED(res)) { IDirect3DSurface9 *pTmpSurface; D3DLOCKED_RECT lRect; RECT srcRect = { 0l, 0l, 1, 1 }; RECT dstRect = { x, y, x+1, y+1}; pTmpSurface = pLockableRes->GetSurface(); res = pTmpSurface->LockRect(&lRect, &srcRect, D3DLOCK_NOSYSLOCK); if (SUCCEEDED(res)) { if (srcFmt == D3DFMT_X8R8G8B8) { *(jint*)lRect.pBits = pixel; } else { *(unsigned short*)lRect.pBits = (unsigned short)pixel; } pTmpSurface->UnlockRect(); res = pd3dDevice->StretchRect(pTmpSurface, &srcRect, pSrc, &dstRect, D3DTEXF_NONE); } } D3DRQ_MarkLostIfNeeded(res, d3dsdo); } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: getNativeResourceNative * Signature: (JI)J */ JNIEXPORT jlong JNICALL Java_sun_java2d_d3d_D3DSurfaceData_getNativeResourceNative (JNIEnv *env, jclass d3sdc, jlong pData, jint resType) { D3DSDOps *d3dsdo; J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_getNativeResourceNative") RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), 0L); if (resType == D3D_DEVICE_RESOURCE) { HRESULT res; D3DPipelineManager *pMgr; D3DContext *pCtx; RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), 0L); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return 0L; } return ptr_to_jlong(pCtx->Get3DDevice()); } RETURN_STATUS_IF_NULL(d3dsdo->pResource, 0L); if (resType == RT_PLAIN || resType == RT_TEXTURE) { return ptr_to_jlong(d3dsdo->pResource->GetSurface()); } if (resType == TEXTURE) { return ptr_to_jlong(d3dsdo->pResource->GetTexture()); } if (resType == FLIP_BACKBUFFER) { return ptr_to_jlong(d3dsdo->pResource->GetSwapChain()); } return 0L; } /* * Class: sun_java2d_d3d_D3DSurfaceData * Method: updateWindowAccelImpl * Signature: (JJII)Z */ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DSurfaceData_updateWindowAccelImpl (JNIEnv *env, jclass clazz, jlong pd3dsd, jlong pData, jint w, jint h) { HRESULT res; AwtWindow *window; HBITMAP hBitmap = NULL; D3DSDOps *d3dsdo; D3DResource *pSrcRes; D3DContext *pCtx; D3DPipelineManager *pMgr; D3DResource *pLockableRes = NULL; IDirect3DSurface9 *pTmpSurface = NULL; IDirect3DDevice9 *pd3dDevice = NULL; D3DLOCKED_RECT lockedRect; J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_updateWindowAccelImpl"); if (w <= 0 || h <= 0) { return JNI_TRUE; } RETURN_STATUS_IF_NULL(window = (AwtWindow *)jlong_to_ptr(pData), JNI_FALSE); RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pd3dsd), JNI_FALSE); RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), JNI_FALSE); RETURN_STATUS_IF_NULL(pSrcRes = d3dsdo->pResource, JNI_FALSE); if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } RETURN_STATUS_IF_NULL(pd3dDevice = pCtx->Get3DDevice(), JNI_FALSE); pCtx->UpdateState(STATE_OTHEROP); res = pCtx->GetResourceManager()-> GetBlitOSPSurface(pSrcRes->GetDesc()->Width, pSrcRes->GetDesc()->Height, pSrcRes->GetDesc()->Format, &pLockableRes); if (FAILED(res)) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } pTmpSurface = pLockableRes->GetSurface(); res = pd3dDevice->GetRenderTargetData(pSrcRes->GetSurface(), pTmpSurface); if (FAILED(res)) { D3DRQ_MarkLostIfNeeded(res, d3dsdo); return JNI_FALSE; } res = pTmpSurface->LockRect(&lockedRect, NULL, D3DLOCK_NOSYSLOCK); if (SUCCEEDED(res)) { // REMIND: commented until translucent window support is integrated // hBitmap = // BitmapUtil::CreateBitmapFromARGBPre(w, h, // lockedRect.Pitch, // (int*)lockedRect.pBits); pTmpSurface->UnlockRect(); } RETURN_STATUS_IF_NULL(hBitmap, JNI_FALSE); // REMIND: commented until translucent window support is integrated // window->UpdateWindow(env, NULL, w, h, hBitmap); // hBitmap is released in UpdateWindow return JNI_TRUE; } }
shchiu/openjdk
jdk/src/windows/native/sun/java2d/d3d/D3DSurfaceData.cpp
C++
gpl-2.0
19,882
//////////////////////////////////////////////////////////////////////// // This file is part of the SndObj library // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Copyright (c)Victor Lazzarini, 1997-2004 // See License.txt for a disclaimer of all warranties // and licensing information //************************************************************// // IADSR.cpp: implementation of the IADSR class // // ADSR with init and end values // // // // // //************************************************************// #include "IADSR.h" //////////////// CONSTRUCTION / DESTRUCTION //////////////////// IADSR::IADSR(){ m_init = m_end = 0.f; AddMsg("init", 31); AddMsg("end", 32); } IADSR::IADSR(float init, float att, float maxamp, float dec, float sus, float rel, float end, float dur, SndObj* InObj, int vecsize, float sr) : ADSR(att, maxamp, dec, sus, rel,dur,InObj, vecsize, sr) { m_init = init; m_end = end; AddMsg("init", 31); AddMsg("end", 32); } IADSR::~IADSR(){ } ////////////////// OPERATIONS /////////////////////////////// int IADSR::Set(char* mess, float value){ switch (FindMsg(mess)){ case 31: SetInit(value); return 1; case 32: SetEnd(value); return 1; default: return ADSR::Set(mess,value); } } short IADSR::DoProcess() { if(!m_error){ float a = 0.f; for(m_vecpos=0; m_vecpos < m_vecsize; m_vecpos++){ if(m_enable){ if(m_count == m_dur)m_count=0; if(m_count < m_att) a = ((m_maxamp - m_init)/m_att)*m_count + m_init; if(m_count >= m_att && m_count < (m_att+m_dec)) a = ((m_sus - m_maxamp)/m_dec)*(m_count - m_att) + m_maxamp; if(m_count >= (m_att+m_dec) && m_count <= (m_dur - m_rel)) a = m_sus; if (m_count > (m_dur - m_rel)) { if( !m_sustain){ a = ((m_end - m_sus)/m_rel)*(m_count - (m_dur - m_rel)) + m_sus; m_count++; } else a = m_sus; } else m_count++; if(m_input) m_output[m_vecpos] = m_input->Output(m_vecpos)*a; else m_output[m_vecpos] = a; } else m_output[m_vecpos] = 0.f ; } return 1; } else return 0; }
johnglover/sndobj
src/IADSR.cpp
C++
gpl-2.0
2,946
<?php if ( ! defined( 'ABSPATH' ) ) exit; /*---------------------------------------------------------------------------------*/ /* Adspace Widget */ /*---------------------------------------------------------------------------------*/ class Woo_AdWidget extends WP_Widget { var $settings = array( 'title', 'adcode', 'image', 'href', 'alt' ); function Woo_AdWidget() { $widget_ops = array('description' => 'Use this widget to add any type of Ad as a widget.' ); parent::WP_Widget(false, __('JS - Adspace Widget', 'templatation'),$widget_ops); } function widget($args, $instance) { $settings = $this->woo_get_settings(); extract( $args, EXTR_SKIP ); $instance = wp_parse_args( $instance, $settings ); extract( $instance, EXTR_SKIP ); echo '<div class="adspace-widget widget">'; if ( $title != '' ) echo $before_title . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $after_title; if ( $adcode != '' ) { echo $adcode; } else { ?><a href="<?php echo esc_url( $href ); ?>"><img src="<?php echo apply_filters( 'image', $image, $instance, $this->id_base ); ?>" alt="<?php echo esc_attr( $alt ); ?>" /></a><?php } echo '</div>'; } function update( $new_instance, $old_instance ) { foreach ( array( 'title', 'alt', 'image', 'href' ) as $setting ) $new_instance[$setting] = strip_tags( $new_instance[$setting] ); // Users without unfiltered_html cannot update this arbitrary HTML field if ( !current_user_can( 'unfiltered_html' ) ) $new_instance['adcode'] = $old_instance['adcode']; return $new_instance; } /** * Provides an array of the settings with the setting name as the key and the default value as the value * This cannot be called get_settings() or it will override WP_Widget::get_settings() */ function woo_get_settings() { // Set the default to a blank string $settings = array_fill_keys( $this->settings, '' ); // Now set the more specific defaults return $settings; } function form($instance) { $instance = wp_parse_args( $instance, $this->woo_get_settings() ); extract( $instance, EXTR_SKIP ); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title (optional):','templatation'); ?></label> <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $title ); ?>" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" /> </p> <?php if ( current_user_can( 'unfiltered_html' ) ) : // Only show it to users who can edit it ?> <p> <label for="<?php echo $this->get_field_id('adcode'); ?>"><?php _e('Ad Code:','templatation'); ?></label> <textarea name="<?php echo $this->get_field_name('adcode'); ?>" class="widefat" id="<?php echo $this->get_field_id('adcode'); ?>"><?php echo esc_textarea( $adcode ); ?></textarea> </p> <p><strong>or</strong></p> <?php endif; ?> <p> <label for="<?php echo $this->get_field_id('image'); ?>"><?php _e('Image Url:','templatation'); ?></label> <input type="text" name="<?php echo $this->get_field_name('image'); ?>" value="<?php echo esc_attr( $image ); ?>" class="widefat" id="<?php echo $this->get_field_id('image'); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('href'); ?>"><?php _e('Link URL:','templatation'); ?></label> <input type="text" name="<?php echo $this->get_field_name('href'); ?>" value="<?php echo esc_attr( $href ); ?>" class="widefat" id="<?php echo $this->get_field_id('href'); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('alt'); ?>"><?php _e('Alt text:','templatation'); ?></label> <input type="text" name="<?php echo $this->get_field_name('alt'); ?>" value="<?php echo esc_attr( $alt ); ?>" class="widefat" id="<?php echo $this->get_field_id('alt'); ?>" /> </p> <?php } } register_widget( 'Woo_AdWidget' );
awadnajilp/delivour
wp-content/themes/justshop/includes/widgets/widget-woo-adspace.php
PHP
gpl-2.0
3,894
<?php /** * File Name PBWebToProspectOptionsPage.php * @package WordPress * @subpackage ParentTheme * @license GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @version 1.0 * @updated 00.00.00 **/ #################################################################################################### if ( ! is_admin() ) { return; } /** * PBWebToProspectOptionsPage **/ $PBWebToProspectOptionsPage = new PBWebToProspectOptionsPage(); class PBWebToProspectOptionsPage { /** * __construct * * @version 1.0 * @updated 02.16.13 **/ function __construct() { $this->set( 'settings', new PBSettings() ); $this->set( 'file_path', $this->settings->file_path . "/" . $this->settings->dir_name ); $this->add_options_page(); $this->add_actions_for_options(); } // end function __construct /** * set * * @version 1.0 * @updated 02.10.13 **/ function set( $key, $val = false ) { if ( isset( $key ) AND ! empty( $key ) ) { $this->$key = $val; } } // end function set #################################################################################################### /** * Functionality **/ #################################################################################################### /** * add_options_page * * @version 1.0 * @updated 02.17.14 **/ function add_options_page() { create__options_page( array( 'version' => $this->settings->version, 'option_name' => "_" . $this->settings->option_name, 'option_group' => $this->settings->option_name, 'default_options' => $this->settings->default_options, 'add_submenu_page' => array( 'parent_slug' => 'options-general.php', 'page_title' => __( 'Property Base Web to Prospect', 'pbwtp' ), 'menu_title' => __( 'Property Base', 'pbwtp' ), 'capability' => 'administrator', ), // 'options_page_title' => false, // 'options_page_desc' => 'Options page description and general information here.', // Metaboxs and Optionns 'options' => array( // pbase 'metacake' => array( 'meta_box' => array( 'title' => "<img style=\"height:18px;width:auto;position:relative;top:5px;margin-right:7px;\" src=\"$this->file_path/images/icon.png\" alt=\"Zuzsa\" /> Zuzsa", 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), 'settings' => array( 'text' => array( 'type' => 'blank', 'validation' => 'blank', 'title' => __( 'Blank', 'pbwtp' ), // 'desc' => __( '', 'pbwtp' ), ) ), ), // end pbase 'pbase' => array( 'meta_box' => array( 'title' => "Property Base Version", 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', // 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), 'settings' => array( 'version' => array( 'type' => 'select', 'validation' => 'select', 'title' => __( 'Version Number', 'pbwtp' ), 'desc' => __( 'Please select what version you current use within Property Base', 'pbwtp' ), 'options' => array( 'Select a Version' => 0, // 'Version 2' => 2, 'Version 3' => 3, ) ), 'force_subdomain' => array( 'type' => 'text', 'validation' => 'text', 'title' => __( 'Force Sub Domain', 'pbwtp' ), 'desc' => __( 'e.g. <strong>yoursubname</strong>.force.com', 'pbwtp' ), ), 'token' => array( 'type' => 'text', 'validation' => 'text', 'title' => __( 'Token', 'pbwtp' ), // 'desc' => __( 'e.g. <strong>yoursubname</strong>.force.com', 'pbwtp' ), ), /*'include__utm_campaign' => array( 'type' => 'select', 'validation' => 'select', 'title' => __( 'Include utm_campaign', 'pbwtp' ), 'desc' => __( 'This will allow the variable utm_campaign to be appended to your Specific_Lead_Source__c optional campaign data.', 'pbwtp' ), 'options' => array( 'Yes' => 1, 'No' => 0 ) ),*/ 'is_testing' => array( 'type' => 'select', 'validation' => 'select', 'title' => __( 'Test Mode', 'pbwtp' ), 'desc' => __( 'Test mode will update the Lead Source to include the word test which can be targeted in the property base system to ignored.', 'pbwtp' ), 'options' => array( 'Yes' => 1, 'No' => 0 ) ), ), ), // end pbase // pbasev3 'pbasev3' => array( // Metabox 'meta_box' => array( 'title' => __( 'Property Base V3', 'pbwtp' ), 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', // 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), // settings and options 'settings' => array( // Single setting and option 'LeadSource' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Lead Source', 'pbwtp' ), 'desc' => __( 'e.g. <strong>Web</strong>', 'pbwtp' ), ), 'FieldName_message' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'PBase Message field name', 'pbwtp' ), 'desc' => __( 'Please enter the custom field name you would like to receive the form "message" with in the contact object of property base.', 'pbwtp' ), ), /*'include__utm_campaign' => array( 'type' => 'select', 'validation' => 'select', 'title' => __( 'Include utm_campaign', 'pbwtp' ), 'desc' => __( 'This will allow the variable utm_campaign to be appended to your Specific_Lead_Source__c optional campaign data.', 'pbwtp' ), 'options' => array( 'Yes' => 1, 'No' => 0 ) ),*/ ), ), // end pbase // pbasev2 'pbasev2' => array( // Metabox 'meta_box' => array( 'title' => __( 'Property Base V2', 'pbwtp' ), 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', // 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), // settings and options 'settings' => array( // Single setting and option 'ContactType__pc' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'ContactType__pc', 'pbwtp' ), 'desc' => __( 'e.g. <strong>Email</strong>', 'pbwtp' ), ), 'Specific_Lead_Source__c' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Specific_Lead_Source__c', 'pbwtp' ), 'desc' => __( 'e.g. <strong>My website: Page: Short code</strong>', 'pbwtp' ), ), 'general_Lead_Source__c' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'general_Lead_Source__c', 'pbwtp' ), 'desc' => __( 'e.g. <strong>Interactive</strong>', 'pbwtp' ), ), 'Lead_Type__c' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Lead_Type__c', 'pbwtp' ), 'desc' => __( 'e.g. <strong>Website Page</strong>', 'pbwtp' ), ), /*'success_page' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Success Page', 'pbwtp' ), 'desc' => __( 'Leave this blank to have the success page return to the current page', 'pbwtp' ), ), 'fail_page' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Fail Page', 'pbwtp' ), 'desc' => __( 'Leave this blank to have the fail page return to the current page', 'pbwtp' ), ),*/ 'custom-message-field' => array( 'type' => 'text', 'validation' => 'text_only', 'title' => __( 'Custom message field', 'pbwtp' ), 'desc' => __( 'This will be the field within property base that has been created to receive messages about the lead. e.g. <strong>NOTES__c</strong>', 'pbwtp' ), ), ), ), // end pbasev2 // Form 'form' => array( // Metabox 'meta_box' => array( 'title' => __( 'Form Display', 'pbwtp' ), 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', // 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), // settings and options 'settings' => array( // Single setting and option 'title' => array( 'type' => 'text', 'validation' => 'text', 'title' => __( 'Form Title', 'pbwtp' ), ), 'desc' => array( 'type' => 'simple_text_editor', 'validation' => 'text_editor', 'title' => __( 'Form Description', 'pbwtp' ), ), 'error_message' => array( 'type' => 'simple_text_editor', 'validation' => 'text_editor', 'title' => __( 'Submission Error text', 'pbwtp' ), 'desc' => __( 'Please keep in mind that an email may only be entered into the Property Base system once, after that it will throw an error.', 'pbwtp' ), ), 'success_message' => array( 'type' => 'simple_text_editor', 'validation' => 'text_editor', 'title' => __( 'Submission Success text', 'pbwtp' ), ), ), ), // end Form // Settings 'settings' => array( // Metabox 'meta_box' => array( 'title' => __( 'Settings', 'pbwtp' ), 'context' => 'normal', 'priority' => 'core', // 'desc' => 'Description.', // 'callback' => array( &$this, 'custom_meta_box_option' ), // 'save_all_settings' => __( 'Save', 'pbwtp' ), // uses value as button text & sanitize_title_with_dashes(save_all_settings) for value ), // settings and options 'settings' => array( // Single setting and option 'remove_css' => array( 'type' => 'select', 'validation' => 'select', 'title' => __( 'Remove CSS', 'pbwtp' ), 'options' => array( 'Yes' => 1, 'No' => 0 ) ), 'reset_options' => array( 'type' => 'checkbox', 'validation' => 'reset_options', 'title' => __( 'Reset Options', 'pbwtp' ), 'desc' => __( 'Reset all options to default settings as if the plugin was just activated.', 'pbwtp' ), ), 'deactivate_plugin' => array( 'type' => 'checkbox', 'validation' => 'deactivate_plugin', 'title' => __( 'Uninstall', 'pbwtp' ), 'desc' => __( 'Delete all options from the database and deactivate the plugin. ', 'pbwtp' ), ), ), ), // end Settings ) // end options ) ); // end default_settings array } // end function add_options_page #################################################################################################### /** * Functionality **/ #################################################################################################### /** * Add Settings Field * * @version 1.0 * @updated 00.00.13 **/ function add_actions_for_options() { // add_action( "_" . $this->settings->option_name . "-add_settings_field", array( &$this, 'add_settings_field' ), 10, 2 ); add_action( "_" . $this->settings->option_name . "-sanitize-option", array( &$this, 'sanitize_callback' ), 10, 2 ); } // end function add_actions_for_options /** * Options Version Update * * @version 1.0 * @updated 00.00.13 * * ToDo: * Add switch case for version control **/ function options_version_update( $settings ) { // nothing here yet } // end function options_version_update /** * Add Settings Field * * @version 1.0 * @updated 00.00.13 **/ function add_settings_field( $field, $raw_option ) { if ( is_array( $field ) AND ! empty( $field ) ) { extract( $field, EXTR_SKIP ); } else { return; } // Options if ( isset( $field['options'] ) AND ! empty( $field['options'] ) ) { $options = $field['options']; } else { $options = false; } // Desc if ( isset( $field['desc'] ) AND ! empty( $field['desc'] ) ) { $desc = $field['desc']; } else { $desc = false; } // Desc if ( isset( $field['val'] ) AND ! empty( $field['val'] ) ) { $val = $field['val']; } else { $val = false; } switch ( $type ) { case "blank" : echo "<input type=\"text\" name=\"$name\" value=\"$val\" id=\"$id\" class=\"large-text\">"; if ( $desc ) echo "<p class=\"description\">$desc</p>"; break; } } // end function add_settings_field /** * Sanitize Callback * * @version 1.0 * @updated 00.00.13 **/ function sanitize_callback( $new_option, $option_args ) { switch ( $option_args['validation'] ) { case "deactivate_plugin" : if ( $new_option == 'on' ) { delete_option( "_" . $this->settings->option_name ); delete_option( "_" . $this->settings->option_name . "-version" ); $this->deactivate_plugin(); wp_redirect( home_url() . "/wp-admin" ); exit; } break; case "reset_options" : if ( $new_option == 'on' ) { delete_option( "_" . $this->settings->option_name ); delete_option( "_" . $this->settings->option_name . "-version" ); $new_option = false; } break; } return $new_option; } // end function sanitize_callback /** * Create Post meta form, Meta box content * * @version 1.0 * @updated 00.00.13 **/ function custom_meta_box_option( $options, $metabox ) { $style = "background:#e9ffe9;display:inline-block;"; ?> <h2>Shortcode Usage:</h2> <p>Copy and paste the shortcode <strong style="<?php echo $style; ?>">[pbase_form]</strong> into the text-editor of a page, post or custom-post-type to insert your property base form.</p> <h2>Widget Usage:</h2> <p>Drag and drop the widget <strong style="<?php echo $style; ?>">Property Base Form Widget</strong> to the widget area of your choice to display your Property Base Form.</p> <?php } // end function custom_meta_box /** * deactivate_plugin * * @version 1.0 * @updated 00.00.00 **/ function deactivate_plugin() { $this->set( 'plugin_path', $this->settings->dir_name . "/" . $this->settings->dir_name . ".php" ); if ( is_plugin_active( $this->plugin_path ) ) { deactivate_plugins( array( $this->plugin_path ) ); } } // end function deactivate_plugin } // end class PBWebToProspectOptionsPage
Metacakery/pbase-webtoprospect-wp
PBWebToProspectOptionsPage.php
PHP
gpl-2.0
15,339
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest16926") public class BenchmarkTest16926 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = request.getParameter("foo"); String bar = doSomething(param); String a1 = ""; String a2 = ""; String osName = System.getProperty("os.name"); if (osName.indexOf("Windows") != -1) { a1 = "cmd.exe"; a2 = "/c"; } else { a1 = "sh"; a2 = "-c"; } String[] args = {a1, a2, "echo", bar}; ProcessBuilder pb = new ProcessBuilder(); pb.command(args); try { Process p = pb.start(); org.owasp.benchmark.helpers.Utils.printOSCommandResults(p); } catch (IOException e) { System.out.println("Problem executing cmdi - java.lang.ProcessBuilder(java.util.List) Test Case"); throw new ServletException(e); } } // end doPost private static String doSomething(String param) throws ServletException, IOException { java.util.List<String> valuesList = new java.util.ArrayList<String>( ); valuesList.add("safe"); valuesList.add( param ); valuesList.add( "moresafe" ); valuesList.remove(0); // remove the 1st safe value String bar = valuesList.get(1); // get the last 'safe' value return bar; } }
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest16926.java
Java
gpl-2.0
2,641
<?php namespace Friends\ACL; const PLUGIN_ID = 'friends_acl'; const UPGRADE_VERSION = 20141209; require_once __DIR__ . '/lib/hooks.php'; require_once __DIR__ . '/lib/events.php'; require_once __DIR__ . '/lib/functions.php'; elgg_register_event_handler('init', 'system', __NAMESPACE__ . '\\init'); function init() { elgg_register_event_handler('login', 'user', __NAMESPACE__ . '\\user_login'); elgg_register_event_handler('create', 'friend', __NAMESPACE__ . '\\user_add_friend', 9999); elgg_register_event_handler('delete', 'friend', __NAMESPACE__ . '\\user_remove_friend', 9999); elgg_register_plugin_hook_handler('access:collections:write', 'user', __NAMESPACE__ . '\\write_access', 999); elgg_register_action('friends_acl/content_fix', __DIR__ . '/actions/content_fix.php', 'admin'); elgg_register_action('friends_acl/friends_fix', __DIR__ . '/actions/friends_fix.php', 'admin'); }
arckinteractive/friends_acl
start.php
PHP
gpl-2.0
903
<?php (!defined('IN_PowerBB')) ? die() : ''; $CALL_SYSTEM = array(); $CALL_SYSTEM['PM'] = true; $CALL_SYSTEM['ICONS'] = true; $CALL_SYSTEM['TOOLBOX'] = true; $CALL_SYSTEM['FILESEXTENSION'] = true; $CALL_SYSTEM['ATTACH'] = true; $CALL_SYSTEM['MODERATORS'] = true; $CALL_SYSTEM['USERRATING'] = true; define('JAVASCRIPT_PowerCode',true); include('common.php'); define('CLASS_NAME','PowerBBPrivateMassegeShowMOD'); class PowerBBPrivateMassegeShowMOD { function run() { global $PowerBB; if (!$PowerBB->_CONF['info_row']['pm_feature']) { $PowerBB->functions->ShowHeader(); $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['no_pm']); } /** Can't use the private massege system **/ $PowerBB->template->assign('use_pm',$PowerBB->_CONF['rows']['group_info']['use_pm']); /** Can't use the private massege system **/ if ($PowerBB->_CONF['member_row']['posts'] < $PowerBB->_CONF['rows']['group_info']['min_send_pm']) { $PowerBB->template->assign('use_pm',0); } /** **/ /** Visitor can't use the private massege system **/ if (!$PowerBB->_CONF['member_permission']) { $PowerBB->functions->ShowHeader(); $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['Cant_see_pm']); } /** **/ /** Read a massege **/ if ($PowerBB->_GET['show']) { $this->_ShowMassege(); } else { @header("Location: index.php"); exit; } $PowerBB->functions->GetFooter(); } /** * Get a massege information to show it */ function _ShowMassege() { global $PowerBB; $PowerBB->functions->ShowHeader(); if (empty($PowerBB->_GET['id'])) { $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['path_not_true']); } $PowerBB->_GET['id'] = $PowerBB->functions->CleanVariable($PowerBB->_GET['id'],'intval'); $id = $PowerBB->_GET['id']; $MsgArr = $PowerBB->DB->sql_query("SELECT * FROM " . $PowerBB->table['pm'] . " WHERE id = '$id'"); $MassegeInfo = $PowerBB->DB->sql_fetch_array($MsgArr); // Get the attachment information $date = $MassegeInfo['date']; $Attach_Info = $PowerBB->DB->sql_query("SELECT * FROM " . $PowerBB->table['attach'] . " WHERE time = '$date'"); $Attach_Row = $PowerBB->DB->sql_fetch_array($Attach_Info); $AttachArr = array(); if($MassegeInfo['date'] == $Attach_Row['time']) { $AttachArr['where'] = array('time',$Attach_Row['time']); } else { $AttachArr['where'] = array('pm_id',$PowerBB->_GET['id']); } $PowerBB->_CONF['template']['while']['AttachList'] = $PowerBB->core->GetList($AttachArr,'attach'); $PowerBB->template->assign('ATTACH_SHOW_PM','1'); /* if ($MassegeInfo['user_to'] != $PowerBB->_CONF['member_row']['username'] or $MassegeInfo['user_from'] != $PowerBB->_CONF['member_row']['username']) { $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['Letter_requested_does_not_exist']); } */ $PrivateMsgArr = array(); $PrivateMsgArr['id'] = $PowerBB->_GET['id']; $PrivateMsgArr['username'] = $PowerBB->_CONF['member_row']['username']; $PowerBB->_CONF['template']['MassegeRow'] = $PowerBB->pm->GetPrivateMassegeInfo($PrivateMsgArr); if (!$PowerBB->_CONF['template']['MassegeRow']) { $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['Letter_requested_does_not_exist']); } if ($PowerBB->_CONF['template']['MassegeRow']['user_to'] != $PowerBB->_CONF['member_row']['username'] AND $PowerBB->_CONF['template']['MassegeRow']['user_from'] != $PowerBB->_CONF['member_row']['username']) { $PowerBB->functions->error($PowerBB->_CONF['template']['_CONF']['lang']['Letter_requested_does_not_exist']); } $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow'],'html'); $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow'],'sql'); $SenderArr = array(); $SenderArr['where'] = array('username',$PowerBB->_CONF['template']['MassegeRow']['user_from']); //$PowerBB->_CONF['template']['Info'] = $PowerBB->member->GetMemberInfo($SenderArr); $PowerBB->_CONF['template']['ReplierInfo'] = $PowerBB->member->GetMemberInfo($SenderArr); if (is_numeric($PowerBB->_CONF['template']['ReplierInfo']['register_date'])) { $PowerBB->_CONF['template']['ReplierInfo']['register_date'] = $PowerBB->functions->year_date($PowerBB->_CONF['template']['ReplierInfo']['register_date']); } // Get username style $PowerBB->_CONF['template']['ReplierInfo']['display_username'] = $PowerBB->_CONF['template']['ReplierInfo']['username_style_cache']; $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['Info'],'html'); // Get username style $MemberArr = array(); $MemberArr['where'] = array('username',$PowerBB->_CONF['template']['MassegeRow']['user_from']); $StyleMemberInfo = $PowerBB->core->GetInfo($MemberArr,'member'); $GrpArr = array(); $GrpArr['where'] = array('id',$StyleMemberInfo['usergroup']); $GroupStyleInfo = $PowerBB->core->GetInfo($GrpArr,'group'); $GroupStyleInfo['username_style'] = str_ireplace('[username]',$PowerBB->_CONF['template']['MassegeRow']['user_from'],$GroupStyleInfo['username_style']); $PowerBB->template->assign('username_sender',$GroupStyleInfo['username_style']); //////// // replace away msg $PowerBB->_CONF['template']['Info']['away_msg'] = $PowerBB->Powerparse->replace($PowerBB->_CONF['template']['Info']['away_msg']); $PowerBB->Powerparse->replace_smiles($PowerBB->_CONF['template']['Info']['away_msg']); // feltr away msg // $PowerBB->_CONF['template']['MassegeRow']['text']= str_replace('../look/','look/',$PowerBB->_CONF['template']['MassegeRow']['text']); $send_text = $PowerBB->_CONF['template']['MassegeRow']['text']; // Moderator And admin Check for View the Icons Editing and Deletion $ModArr = array(); $ModArr['where'] = array('username',$PowerBB->_CONF['member_row']['username']); $PowerBB->_CONF['template']['while']['ModeratorsList'] = $PowerBB->moderator->GetModeratorList($ModArr); if (is_array($PowerBB->_CONF['template']['while']['ModeratorsList']) and sizeof($PowerBB->_CONF['template']['while']['ModeratorsList']) > 0) { $PowerBB->template->assign('mod_toolbar',0); } else { $PowerBB->template->assign('mod_toolbar',1); } $PowerBB->_CONF['template']['MassegeRow']['title'] = str_replace($PowerBB->_CONF['template']['_CONF']['lang']['Reply_pm'],'',$PowerBB->_CONF['template']['MassegeRow']['title']); if (is_numeric($PowerBB->_CONF['template']['MassegeRow']['date'])) { $MassegeDate = $PowerBB->functions->date($PowerBB->_CONF['template']['MassegeRow']['date']); $PowerBB->_CONF['template']['MassegeRow']['date'] = $MassegeDate; } // The writer signture isn't empty if (!empty($PowerBB->_CONF['template']['Info']['user_sig'])) { // So , use the PowerCode in it $PowerBB->_CONF['template']['Info']['user_sig'] = $PowerBB->Powerparse->replace($PowerBB->_CONF['template']['Info']['user_sig']); $PowerBB->Powerparse->replace_smiles($PowerBB->_CONF['template']['Info']['user_sig']); $PowerBB->_CONF['template']['show_sig'] = 1; } $censorwords = preg_split('#[ \r\n\t]+#', $PowerBB->_CONF['info_row']['censorwords'], -1, PREG_SPLIT_NO_EMPTY); $send_text = str_ireplace($censorwords,'**', $send_text); $send_text = str_ireplace('{39}',"'",$send_text); $send_text = str_ireplace('cookie','**',$send_text); //$send_text = $PowerBB->Powerparse->censor_words($send_text); $send_text = $PowerBB->functions->CleanVariable($send_text,'html'); $PowerBB->template->assign('send_title',$PowerBB->_CONF['template']['_CONF']['lang']['Reply_pm'] . $PowerBB->_CONF['template']['MassegeRow']['title']); $PowerBB->template->assign('send_text','[quote]' . $PowerBB->Powerparse->replace_htmlentities($send_text) . '[/quote]'); if ($PowerBB->_CONF['template']['MassegeRow']['folder'] == 'sent') { $PowerBB->template->assign('to',$PowerBB->_CONF['template']['MassegeRow']['user_to']); } else { $PowerBB->template->assign('to',$PowerBB->_CONF['template']['MassegeRow']['user_from']); } // feltr pm Text $censorwords = preg_split('#[ \r\n\t]+#', $PowerBB->_CONF['info_row']['censorwords'], -1, PREG_SPLIT_NO_EMPTY); $PowerBB->_CONF['template']['MassegeRow']['title'] = str_ireplace($censorwords,'**', $PowerBB->_CONF['template']['MassegeRow']['title']); $PowerBB->_CONF['template']['MassegeRow']['title'] = str_ireplace('cookie','**',$PowerBB->_CONF['template']['MassegeRow']['title']); $PowerBB->_CONF['template']['MassegeRow']['title'] = str_ireplace('{39}',"'",$PowerBB->_CONF['template']['MassegeRow']['title']); $PowerBB->_CONF['template']['MassegeRow']['text'] = $PowerBB->Powerparse->replace($PowerBB->_CONF['template']['MassegeRow']['text']); $PowerBB->Powerparse->replace_smiles($PowerBB->_CONF['template']['MassegeRow']['text']); $PowerBB->Powerparse->replace_wordwrap($PowerBB->_CONF['template']['MassegeRow']['text']); // feltr Subject Text $PowerBB->_CONF['template']['MassegeRow']['text'] = $PowerBB->Powerparse->censor_words($PowerBB->_CONF['template']['MassegeRow']['text']); // Kill SQL Injection // $PowerBB->_CONF['template']['MassegeRow']['text'] = $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow']['text'],'sql'); // Kill XSS // $PowerBB->_CONF['template']['MassegeRow']['text'] = $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow']['text'],'html'); $PowerBB->_CONF['template']['MassegeRow']['title'] = $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow']['title'],'html'); $PowerBB->_CONF['template']['MassegeRow']['title'] = $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['MassegeRow']['title'],'sql'); $PowerBB->functions->GetEditorTools(); $cache = unserialize(base64_decode($PowerBB->_CONF['member_row']['style_cache'])); $image_path = $PowerBB->_CONF['rows']['style']['image_path']; $MemberArr = array(); $MemberArr['where'] = array('username',$PowerBB->_CONF['template']['MassegeRow']['user_from']); $MemberInfo = $PowerBB->core->GetInfo($MemberArr,'member'); $CheckOnline = ($MemberInfo['logged'] < $PowerBB->_CONF['timeout']) ? false : true; ($CheckOnline) ? $PowerBB->template->assign('status',"<img title='online' src='$image_path/icon_user_online.gif'>") : $PowerBB->template->assign('status',"<img title='offline' src='$image_path/icon_user_offline.gif'>"); if (!$PowerBB->_CONF['template']['MassegeRow']['user_read']) { $ReadArr = array(); $ReadArr['where'] = array(); $ReadArr['where'][0] = array(); $ReadArr['where'][0]['name'] = 'id'; $ReadArr['where'][0]['oper'] = '='; $ReadArr['where'][0]['value'] = $PowerBB->_GET['id']; $Read = $PowerBB->pm->MakeMassegeRead($ReadArr); if ($Read) { $NumArr = array(); $NumArr['username'] = $PowerBB->_CONF['member_row']['username']; $Number = $PowerBB->pm->NewMessageNumber($NumArr); $CacheArr = array(); $CacheArr['field'] = array(); $CacheArr['field']['unread_pm'] = $Number; $CacheArr['where'] = array('username',$PowerBB->_CONF['member_row']['username']); $Cache = $PowerBB->member->UpdateMember($CacheArr); } } //////////////////// $ExArr = array(); $ExArr['order'] = array(); $ExArr['order']['field'] = 'id'; $ExArr['order']['type'] = 'DESC'; $ExArr['proc'] = array(); $ExArr['proc']['*'] = array('method'=>'clean','param'=>'html'); $PowerBB->_CONF['template']['while']['ExList'] = $PowerBB->core->GetList($ExArr,'ex'); //get user title $titles = $PowerBB->usertitle->GetCachedTitles(); $size = sizeof($titles); for ($i = 0; $i <= $size; $i++) { if($titles[$size-1]['posts'] < $PowerBB->_CONF['template']['ReplierInfo']['posts']) { $user_titles = $titles[$size-1]['usertitle']; break; } if($titles[$i]['posts'] > $PowerBB->_CONF['template']['ReplierInfo']['posts']) { $user_titles = $titles[$i]['usertitle']; break; } if($PowerBB->_CONF['template']['ReplierInfo']['posts'] < $titles[1]['posts']) { $user_titles = $titles[1]['usertitle']; break; } } $PowerBB->template->assign('Usertitle',$user_titles); ////////// //get user rating $ratings = $PowerBB->userrating->GetCachedRatings(); $y = sizeof($ratings); for ($b = 0; $b <= $y; $b++) { if($ratings[$y-1]['posts'] < $PowerBB->_CONF['template']['ReplierInfo']['posts']) { $user_ratings = $ratings[$y-1]['rating']; $user_posts = $ratings[$y-1]['posts']; break; } if($ratings[$b]['posts'] > $PowerBB->_CONF['template']['ReplierInfo']['posts']) { $user_ratings = $ratings[$b]['rating']; $user_posts = $ratings[$b]['posts']; break; } if($PowerBB->_CONF['template']['ReplierInfo']['posts'] < $ratings[1]['posts']) { $user_ratings = $ratings[1]['rating']; $user_posts = $ratings[1]['posts']; break; } } $PowerBB->_CONF['template']['RatingInfo']['rating'] = $user_ratings; $PowerBB->_CONF['template']['RatingInfo']['posts'] = $user_posts; $GrpArr = array(); $GrpArr['where'] = array('id',$PowerBB->_CONF['template']['Info']['usergroup']); $GroupInfo = $PowerBB->core->GetInfo($GrpArr,'group'); $PowerBB->template->assign('GroupInfo',$GroupInfo); if ($PowerBB->_GET['page'] == 'pm_show') { $PowerBB->template->assign('address_bar_pm_send_SHOW',true); } // show Custom_bbcode List $Custom_bbcodeArr = array(); $Custom_bbcodeArr['order'] = array(); $Custom_bbcodeArr['order']['field'] = 'id'; $Custom_bbcodeArr['order']['type'] = 'DESC'; $Custom_bbcodeArr['proc'] = array(); $Custom_bbcodeArr['proc']['*'] = array('method'=>'clean','param'=>'html'); $PowerBB->_CONF['template']['while']['Custom_bbcodesList'] = $PowerBB->core->GetList($Custom_bbcodeArr,'custom_bbcode'); $PowerBB->_CONF['template']['_CONF']['info_row']['show_list_last_5_posts_member'] = '0'; $PowerBB->template->display('pm_show'); } } ?>
pbboard/pbboard_3.0.2
modules/pm_show.module.php
PHP
gpl-2.0
14,429
<?php // Make sure no one attempts to run this script "directly" if (!defined('PUN')) { exit; } // Tell admin_loader.php that this is indeed a plugin and that it is loaded define('PUN_PLUGIN_LOADED', 1); define('PLUGIN_VERSION', 1.3); if (isset($_POST['prune'])) { // Make sure something something was entered if ((trim($_POST['days']) == '') || trim($_POST['posts']) == '') { message('Вы должны задать все настройки!'); } if ($_POST['admods_delete']) { $admod_delete = 'group_id > 0'; } else { $admod_delete = 'group_id > 3'; } if ($_POST['verified'] == 1) { $verified = ''; } else if ($_POST['verified'] == 0) { $verified = 'AND (group_id < 32000)'; } else { $verified = 'AND (group_id = 32000)'; } $prune = ($_POST['prune_by'] == 1) ? 'registered' : 'last_visit'; $user_time = $_SERVER['REQUEST_TIME'] - ($_POST['days'] * 86400); $result = $db->query('DELETE FROM ' . $db->prefix . 'users WHERE (num_posts < ' . intval($_POST['posts']) . ') AND (' . $prune . ' < ' . intval($user_time) . ') AND (id > 2) AND (' . $admod_delete . ')' . $verified) or error('Unable to delete users', __FILE__, __LINE__, $db->error()); $users_pruned = $db->affected_rows(); message('Сокращение завершено. Удалены пользователи ' . $users_pruned . '.'); } else if (isset($_POST['add_user'])) { require PUN_ROOT . 'lang/' . $pun_user['language'] . '/prof_reg.php'; require PUN_ROOT . 'lang/' . $pun_user['language'] . '/register.php'; $username = pun_trim($_POST['username']); $email1 = mb_strtolower(trim($_POST['email'])); $email2 = mb_strtolower(trim($_POST['email'])); if ($_POST['random_pass'] == 1) { $password1 = random_pass(8); $password2 = $password1; } else { $password1 = trim($_POST['password']); $password2 = trim($_POST['password']); } // Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames) $username = preg_replace('#\s+#s', ' ', $username); // Validate username and passwords if (mb_strlen($username) < 2) { message($lang_prof_reg['Username too short']); } else if (mb_strlen($username) > 25) { // This usually doesn't happen since the form element only accepts 25 characters message($lang_common['Bad request']); } else if (mb_strlen($password1) < 4) { message($lang_prof_reg['Pass too short']); } else if ($password1 != $password2) { message($lang_prof_reg['Pass not match']); } else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest'])) { message($lang_prof_reg['Username guest']); } else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username)) { message($lang_prof_reg['Username IP']); } else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, "'") !== false && strpos($username, '"') !== false) { message($lang_prof_reg['Username reserved chars']); } else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]|\[hide|\[/hide\]#i', $username)) { message($lang_prof_reg['Username BBCode']); } // Check username for any censored words if ($pun_config['o_censoring'] == 1) { // If the censored username differs from the username if (censor_words($username) != $username) { message($lang_register['Username censor']); } } // Check that the username (or a too similar username) is not already registered $result = $db->query('SELECT username FROM ' . $db->prefix . 'users WHERE username=\'' . $db->escape($username) . '\' OR username=\'' . $db->escape(preg_replace('/[^\w]/', '', $username)) . '\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { $busy = $db->result($result); message($lang_register['Username dupe 1'] . ' ' . pun_htmlspecialchars($busy) . '. ' . $lang_register['Username dupe 2']); } // Validate e-mail require PUN_ROOT . 'include/email.php'; if (!is_valid_email($email1)) { message($lang_common['Invalid e-mail']); } // Check if someone else already has registered with that e-mail address $dupe_list = array(); $result = $db->query('SELECT username FROM ' . $db->prefix . 'users WHERE email=\'' . $email1 . '\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { while ($cur_dupe = $db->fetch_assoc($result)) { $dupe_list[] = $cur_dupe['username']; } } $timezone = 0; $language = isset($_POST['language']) ? $_POST['language'] : $pun_config['o_default_lang']; $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != 1) ? 0 : 1; // Insert the new user into the database. We do this now to get the last inserted id for later use. $intial_group_id = ($_POST['random_pass'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED; $password_hash = pun_hash($password1); // Add the user $db->query('INSERT INTO ' . $db->prefix . 'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\'' . $db->escape($username) . '\', ' . $intial_group_id . ', \'' . $password_hash . '\', \'' . $email1 . '\', 1, ' . $save_pass . ', ' . $timezone . ' , \'' . $language . '\', \'' . $pun_config['o_default_style'] . '\', ' . $_SERVER['REQUEST_TIME'] . ', \'' . get_remote_address() . '\', ' . $_SERVER['REQUEST_TIME'] . ')') or error('Unable to create user', __FILE__, __LINE__, $db->error()); $new_uid = $db->insert_id(); // Should we alert people on the admin mailing list that a new user has registered? if ($pun_config['o_regs_report'] == 1) { $mail_subject = 'Alert - New registration'; $mail_message = 'User \'' . $username . '\' registered in the forums at ' . $pun_config['o_base_url'] . "\n\n" . 'User profile: ' . $pun_config['o_base_url'] . '/profile.php?id=' . $new_uid . "\n\n" . '-- ' . "\n" . 'Forum Mailer' . "\n" . '(Do not reply to this message)'; pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message); } // Must the user verify the registration or do we log him/her in right now? if ($_POST['random_pass'] == 1) { // Load the "welcome" template $mail_tpl = trim(file_get_contents(PUN_ROOT . 'lang/' . $pun_user['language'] . '/mail_templates/welcome.tpl')); // The first row contains the subject $first_crlf = strpos($mail_tpl, "\n"); $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8)); $mail_message = trim(substr($mail_tpl, $first_crlf)); $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject); $mail_message = str_replace('<base_url>', $pun_config['o_base_url'] . '/', $mail_message); $mail_message = str_replace('<username>', $username, $mail_message); $mail_message = str_replace('<password>', $password1, $mail_message); $mail_message = str_replace('<login_url>', $pun_config['o_base_url'] . '/login.php', $mail_message); $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer'], $mail_message); pun_mail($email1, $mail_subject, $mail_message); } message('Пользователь создан'); } else { // Display the admin navigation menu generate_admin_menu($plugin); ?> <div class="block"> <h2><span>Управление пользователями - v<?php echo PLUGIN_VERSION; ?></span></h2> <div class="box"> <div class="inbox"> <p>Этот плагин позволяет сокращать пользователей которые отвечали меньше определенного числа раз в течение заданного количество дней.</p> <p><strong>Внимание: Это на совсем и использовать нужно очень осторожно (рекомендуется сделать бэкап перед сокращением).</strong></p> <p>Так же вы можете вручную добавлять пользователей, это удобно для закрытых форумов (если вы отключили возможность регистрации в опциях.)</p> </div> </div> </div> <div class="blockform"> <h2 class="block2"><span>Сокращение пользователей</span></h2> <div class="box"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <div class="inform"> <fieldset> <legend>Настройки</legend> <div class="infldset"> <table class="aligntop" cellspacing="0"> <tr> <th scope="row">Сокращать по</th> <td> <input type="radio" name="prune_by" value="1" checked="checked"/>&#160;<strong>Дате регистрации</strong>&#160;&#160;&#160;<input type="radio" name="prune_by" value="0"/>&#160;<strong>Последнему посещению</strong> <span>Решите с момента даты регистрации или последнего посещения отсчитывать минимальное количество дней.</span> </td> </tr> <tr> <th scope="row">Минимум дней с регистрации/последего посещения</th> <td> <input type="text" name="days" value="28" size="25" /> <span>Минимум дней от настроек выше, с которого сократятся пользователи.</span> </td> </tr> <tr> <th scope="row">Максимум сообщений</th> <td> <input type="text" name="posts" value="1" size="25" /> <span>Пользователи с большим количеством сообщений не сократятся. т.е. значение 1 удалит пользователей без сообщений.</span> </td> </tr> <tr> <th scope="row">Удалять администраторов и модераторов?</th> <td> <input type="radio" name="admods_delete" value="1"/> <strong>Да</strong>&#160; &#160;<input type="radio" name="admods_delete" value="0" checked="checked"/> <strong>Нет</strong> <span>Если да, любой отвечающий условиям модератор или администратор тоже сократится.</span> </td> </tr> <tr> <th scope="row">Статус пользователя</th> <td> <input type="radio" name="verified" value="1"/> <strong>Удалить любых</strong>&#160; &#160;<input type="radio" name="verified" value="0" checked="checked"/> <strong>Удалить только проверенных</strong>&#160; &#160;<input type="radio" name="verified" value="2"/> <strong>Удалить только не проверенных</strong> <span>Решите проверенные или не проверенные пользователи должны быть удалены.</span> </td> </tr> </table> </div> </fieldset> </div> <p class="submitend"><input type="submit" name="prune" value="Отправить" /></p> </form> </div> <h2 class="block2"><span>Добавление пользователя</span></h2> <div class="box"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <div class="inform"> <fieldset> <legend>Параметры</legend> <div class="infldset"> <table class="aligntop" cellspacing="0"> <tr> <th scope="row">Имя пользователя</th> <td> <input type="text" name="username" size="25" /> </td> </tr> <tr> <th scope="row">Email</th> <td> <input type="text" name="email" size="50" /> </td> </tr> <tr> <th scope="row">Сгенерировать случайный пароль?</th> <td> <input type="radio" name="random_pass" value="1"/> <strong>Да</strong>&#160; &#160;<input type="radio" name="random_pass" value="0" checked="checked"/> <strong>Нет</strong> <span>Если да, случайный пароль будет сгенерирован и отослан по адресу выше.</span> </td> </tr> <tr> <th scope="row">Пароль</th> <td> <input type="text" name="password" size="25" /> <span>Если не хотите случайный пароль.</span> </td> </tr> </table> </div> </fieldset> </div> <p class="submitend"><input type="submit" name="add_user" value="Отправить" /></p> </form> </div> </div> <?php }
tipsun91/punbb-mod
plugins/AP_User_management.php
PHP
gpl-2.0
15,672
<?php namespace Core\Bundle\BlogBundle\Model; use Symfony\Component\Validator\Constraints as Assert; class CommentFront { /** * @Assert\NotBlank() */ protected $name; /** * @Assert\NotBlank() */ protected $email; /** * @Assert\NotBlank() */ protected $comment; public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } public function setEmail($email) { $this->email = $email; } public function getEmail() { return $this->email; } public function setComment($comment) { $this->comment = $comment; } public function getComment() { return $this->comment; } }
sastu/BlogBundle
Model/CommentFront.php
PHP
gpl-2.0
811
/*************************************************************************** ADM_muxerUtils.cpp - description ------------------- copyright : (C) 2008 by mean email : fixounet@free.fr ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "ADM_default.h" #include "ADM_muxerInternal.h" #include "ADM_muxerUtils.h" /** \fn rescaleFps \brief Rescale fps to be accurate (i.e. 23.976 become 24000/1001) */ void rescaleFps(uint32_t fps1000, AVRational *rational) { switch(fps1000) { case 23976 : { rational->num=1001; rational->den=24000; break; } case 29970 : { rational->num=1001; rational->den=30000; break; } default: rational->num=1000; rational->den=fps1000; } printf("[MP3] TimeBase for video %d/%d\n",rational->num,rational->den); } /** \fn rescaleLavPts \brief Rescale PTS/DTS the lavformat way, i.e. relative to the scale. */ uint64_t rescaleLavPts(uint64_t us, AVRational *scale) { if(us==ADM_NO_PTS) return 0x8000000000000000LL; // AV_NOPTS_VALUE double db=(double)us; double s=scale->den; db*=s; db=(db)/1000000.; // in seconds uint64_t i=(uint64_t)db; // round up to the closer num value i=(i+scale->num-1)/scale->num; i*=scale->num; return i; }
BackupTheBerlios/avidemux
avidemux/ADM_coreMuxer/src/ADM_muxerUtils.cpp
C++
gpl-2.0
2,064
#!/usr/bin/python3 import sys from gi.repository import GExiv2 phototags = { 'Exif.Photo.ExposureTime': "Belichtung:\t", 'Exif.Photo.FNumber': "Blende:\t\tF", # 'Exif.Photo.ExposureProgram', 'Exif.Photo.ISOSpeedRatings': "ISO:\t\t", # 'Exif.Photo.SensitivityType', # 'Exif.Photo.ExifVersion', # 'Exif.Photo.DateTimeOriginal', # 'Exif.Photo.DateTimeDigitized', # 'Exif.Photo.ComponentsConfiguration', # 'Exif.Photo.CompressedBitsPerPixel', # 'Exif.Photo.ExposureBiasValue', # 'Exif.Photo.MaxApertureValue', # 'Exif.Photo.MeteringMode', # 'Exif.Photo.LightSource', # 'Exif.Photo.Flash', 'Exif.Photo.FocalLength': "Brennweite:\t" # 'Exif.Photo.MakerNote' } for i in range(1, len(sys.argv)): metadata = GExiv2.Metadata(sys.argv[i]) print("file: {}".format(sys.argv[i])) for key in phototags: try: print("{}: {}".format(phototags[key], metadata[key])) except KeyError: continue
pseyfert/pyexiv2-scripts
dumpPHOTO.py
Python
gpl-2.0
997
/* * Copyright (C) 2005-2008 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "system.h" #include "GUIWindowVideoBase.h" #include "Util.h" #include "video/VideoInfoDownloader.h" #include "utils/RegExp.h" #include "utils/Variant.h" #include "addons/AddonManager.h" #include "addons/GUIDialogAddonInfo.h" #include "addons/IAddon.h" #include "video/dialogs/GUIDialogVideoInfo.h" #include "GUIWindowVideoNav.h" #include "video/dialogs/GUIDialogVideoScan.h" #include "dialogs/GUIDialogSmartPlaylistEditor.h" #include "dialogs/GUIDialogProgress.h" #include "dialogs/GUIDialogYesNo.h" #include "playlists/PlayListFactory.h" #include "Application.h" #include "NfoFile.h" #include "PlayListPlayer.h" #include "GUIPassword.h" #include "filesystem/ZipManager.h" #include "filesystem/StackDirectory.h" #include "filesystem/MultiPathDirectory.h" #include "video/dialogs/GUIDialogFileStacking.h" #include "dialogs/GUIDialogMediaSource.h" #include "windows/GUIWindowFileManager.h" #include "filesystem/VideoDatabaseDirectory.h" #include "PartyModeManager.h" #include "guilib/GUIWindowManager.h" #include "dialogs/GUIDialogOK.h" #include "dialogs/GUIDialogSelect.h" #include "guilib/GUIKeyboardFactory.h" #include "filesystem/Directory.h" #include "playlists/PlayList.h" #include "settings/Settings.h" #include "settings/AdvancedSettings.h" #include "settings/GUISettings.h" #include "settings/GUIDialogContentSettings.h" #include "guilib/LocalizeStrings.h" #include "utils/StringUtils.h" #include "utils/log.h" #include "utils/FileUtils.h" #include "utils/URIUtils.h" #include "GUIUserMessages.h" #include "addons/Skin.h" #include "storage/MediaManager.h" #include "Autorun.h" #include "URL.h" using namespace std; using namespace XFILE; using namespace PLAYLIST; using namespace VIDEODATABASEDIRECTORY; using namespace VIDEO; using namespace ADDON; #define CONTROL_BTNVIEWASICONS 2 #define CONTROL_BTNSORTBY 3 #define CONTROL_BTNSORTASC 4 #define CONTROL_BTNTYPE 5 #define CONTROL_LABELFILES 12 #define CONTROL_PLAY_DVD 6 #define CONTROL_STACK 7 #define CONTROL_BTNSCAN 8 CGUIWindowVideoBase::CGUIWindowVideoBase(int id, const CStdString &xmlFile) : CGUIMediaWindow(id, xmlFile) { m_thumbLoader.SetObserver(this); m_thumbLoader.SetStreamDetailsObserver(this); m_stackingAvailable = true; } CGUIWindowVideoBase::~CGUIWindowVideoBase() { } bool CGUIWindowVideoBase::OnAction(const CAction &action) { if (action.GetID() == ACTION_SCAN_ITEM) return OnContextButton(m_viewControl.GetSelectedItem(),CONTEXT_BUTTON_SCAN); return CGUIMediaWindow::OnAction(action); } bool CGUIWindowVideoBase::OnMessage(CGUIMessage& message) { switch ( message.GetMessage() ) { case GUI_MSG_WINDOW_DEINIT: if (m_thumbLoader.IsLoading()) m_thumbLoader.StopThread(); m_database.Close(); break; case GUI_MSG_WINDOW_INIT: { m_database.Open(); m_dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); // save current window, unless the current window is the video playlist window if (GetID() != WINDOW_VIDEO_PLAYLIST && g_settings.m_iVideoStartWindow != GetID()) { g_settings.m_iVideoStartWindow = GetID(); g_settings.Save(); } return CGUIMediaWindow::OnMessage(message); } break; case GUI_MSG_CLICKED: { int iControl = message.GetSenderId(); if (iControl == CONTROL_STACK) { g_settings.m_videoStacking = !g_settings.m_videoStacking; g_settings.Save(); UpdateButtons(); Update( m_vecItems->GetPath() ); } #if defined(HAS_DVD_DRIVE) else if (iControl == CONTROL_PLAY_DVD) { // play movie... MEDIA_DETECT::CAutorun::PlayDiscAskResume(g_mediaManager.TranslateDevicePath("")); } #endif else if (iControl == CONTROL_BTNTYPE) { CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_BTNTYPE); g_windowManager.SendMessage(msg); int nSelected = msg.GetParam1(); int nNewWindow = WINDOW_VIDEO_FILES; switch (nSelected) { case 0: // Movies nNewWindow = WINDOW_VIDEO_FILES; break; case 1: // Library nNewWindow = WINDOW_VIDEO_NAV; break; } if (nNewWindow != GetID()) { g_settings.m_iVideoStartWindow = nNewWindow; g_settings.Save(); g_windowManager.ChangeActiveWindow(nNewWindow); CGUIMessage msg2(GUI_MSG_SETFOCUS, nNewWindow, CONTROL_BTNTYPE); g_windowManager.SendMessage(msg2); } return true; } else if (m_viewControl.HasControl(iControl)) // list/thumb control { // get selected item int iItem = m_viewControl.GetSelectedItem(); int iAction = message.GetParam1(); // iItem is checked for validity inside these routines if (iAction == ACTION_QUEUE_ITEM || iAction == ACTION_MOUSE_MIDDLE_CLICK) { OnQueueItem(iItem); return true; } else if (iAction == ACTION_SHOW_INFO) { return OnInfo(iItem); } else if (iAction == ACTION_PLAYER_PLAY && !g_application.IsPlayingVideo()) { return OnResumeItem(iItem); } else if (iAction == ACTION_DELETE_ITEM) { // is delete allowed? if (g_settings.GetCurrentProfile().canWriteDatabases()) { // must be at the title window if (GetID() == WINDOW_VIDEO_NAV) OnDeleteItem(iItem); // or be at the files window and have file deletion enabled else if (GetID() == WINDOW_VIDEO_FILES && g_guiSettings.GetBool("filelists.allowfiledeletion")) OnDeleteItem(iItem); // or be at the video playlists location else if (m_vecItems->GetPath().Equals("special://videoplaylists/")) OnDeleteItem(iItem); else return false; return true; } } } } break; case GUI_MSG_SEARCH: OnSearch(); break; } return CGUIMediaWindow::OnMessage(message); } void CGUIWindowVideoBase::UpdateButtons() { // Remove labels from the window selection CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_BTNTYPE); g_windowManager.SendMessage(msg); // Add labels to the window selection CStdString strItem = g_localizeStrings.Get(744); // Files CGUIMessage msg2(GUI_MSG_LABEL_ADD, GetID(), CONTROL_BTNTYPE); msg2.SetLabel(strItem); g_windowManager.SendMessage(msg2); strItem = g_localizeStrings.Get(14022); // Library msg2.SetLabel(strItem); g_windowManager.SendMessage(msg2); // Select the current window as default item int nWindow = g_settings.m_iVideoStartWindow-WINDOW_VIDEO_FILES; CONTROL_SELECT_ITEM(CONTROL_BTNTYPE, nWindow); CONTROL_ENABLE(CONTROL_BTNSCAN); SET_CONTROL_LABEL(CONTROL_STACK, 14000); // Stack SET_CONTROL_SELECTED(GetID(), CONTROL_STACK, g_settings.m_videoStacking); CONTROL_ENABLE_ON_CONDITION(CONTROL_STACK, m_stackingAvailable); CGUIMediaWindow::UpdateButtons(); } void CGUIWindowVideoBase::OnInfo(CFileItem* pItem, const ADDON::ScraperPtr& scraper) { if (!pItem) return; if (pItem->IsParentFolder() || pItem->m_bIsShareOrDrive || pItem->GetPath().Equals("add") || (pItem->IsPlayList() && !URIUtils::GetExtension(pItem->GetPath()).Equals(".strm"))) return; // ShowIMDB can kill the item as this window can be closed while we do it, // so take a copy of the item now CFileItem item(*pItem); if (item.IsVideoDb() && item.HasVideoInfoTag()) { item.SetPath(item.GetVideoInfoTag()->GetPath()); } else { if (item.m_bIsFolder && scraper && scraper->Content() != CONTENT_TVSHOWS) { CFileItemList items; CDirectory::GetDirectory(item.GetPath(), items, g_settings.m_videoExtensions); items.Stack(); // check for media files bool bFoundFile(false); for (int i = 0; i < items.Size(); ++i) { CFileItemPtr item2 = items[i]; if (item2->IsVideo() && !item2->IsPlayList() && !CUtil::ExcludeFileOrFolder(item2->GetPath(), g_advancedSettings.m_moviesExcludeFromScanRegExps)) { item.SetPath(item2->GetPath()); item.m_bIsFolder = false; bFoundFile = true; break; } } // no video file in this folder if (!bFoundFile) { CGUIDialogOK::ShowAndGetInput(13346,20349,20022,20022); return; } } } // we need to also request any thumbs be applied to the folder item if (pItem->m_bIsFolder) item.SetProperty("set_folder_thumb", pItem->GetPath()); bool modified = ShowIMDB(&item, scraper); if (modified && (g_windowManager.GetActiveWindow() == WINDOW_VIDEO_FILES || g_windowManager.GetActiveWindow() == WINDOW_VIDEO_NAV)) // since we can be called from the music library we need this check { int itemNumber = m_viewControl.GetSelectedItem(); Update(m_vecItems->GetPath()); m_viewControl.SetSelectedItem(itemNumber); } } // ShowIMDB is called as follows: // 1. To lookup info on a file. // 2. To lookup info on a folder (which may or may not contain a file) // 3. To lookup info just for fun (no file or folder related) // We just need the item object for this. // A "blank" item object is sent for 3. // If a folder is sent, currently it sets strFolder and bFolder // this is only used for setting the folder thumb, however. // Steps should be: // 1. Check database to see if we have this information already // 2. Else, check for a nfoFile to get the URL // 3. Run a loop to check for refresh // 4. If no URL is present do a search to get the URL // 4. Once we have the URL, download the details // 5. Once we have the details, add to the database if necessary (case 1,2) // and show the information. // 6. Check for a refresh, and if so, go to 3. bool CGUIWindowVideoBase::ShowIMDB(CFileItem *item, const ScraperPtr &info2) { /* CLog::Log(LOGDEBUG,"CGUIWindowVideoBase::ShowIMDB"); CLog::Log(LOGDEBUG," strMovie = [%s]", strMovie.c_str()); CLog::Log(LOGDEBUG," strFile = [%s]", strFile.c_str()); CLog::Log(LOGDEBUG," strFolder = [%s]", strFolder.c_str()); CLog::Log(LOGDEBUG," bFolder = [%s]", ((int)bFolder ? "true" : "false")); */ CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); CGUIDialogVideoInfo* pDlgInfo = (CGUIDialogVideoInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_INFO); ScraperPtr info(info2); // use this as nfo might change it.. if (!pDlgProgress) return false; if (!pDlgSelect) return false; if (!pDlgInfo) return false; // 1. Check for already downloaded information, and if we have it, display our dialog // Return if no Refresh is needed. bool bHasInfo=false; CVideoInfoTag movieDetails; if (info) { m_database.Open(); // since we can be called from the music library if (info->Content() == CONTENT_MOVIES) { bHasInfo = m_database.GetMovieInfo(item->GetPath(), movieDetails); } if (info->Content() == CONTENT_TVSHOWS) { if (item->m_bIsFolder) { bHasInfo = m_database.GetTvShowInfo(item->GetPath(), movieDetails); } else { int EpisodeHint=-1; if (item->HasVideoInfoTag()) EpisodeHint = item->GetVideoInfoTag()->m_iEpisode; int idEpisode=-1; if ((idEpisode = m_database.GetEpisodeId(item->GetPath(),EpisodeHint)) > -1) { bHasInfo = true; m_database.GetEpisodeInfo(item->GetPath(), movieDetails, idEpisode); } else { // !! WORKAROUND !! // As we cannot add an episode to a non-existing tvshow entry, we have to check the parent directory // to see if it`s already in our video database. If it's not yet part of the database we will exit here. // (Ticket #4764) // // NOTE: This will fail for episodes on multipath shares, as the parent path isn't what is stored in the // database. Possible solutions are to store the paths in the db separately and rely on the show // stacking stuff, or to modify GetTvShowId to do support multipath:// shares CStdString strParentDirectory; URIUtils::GetParentPath(item->GetPath(), strParentDirectory); if (m_database.GetTvShowId(strParentDirectory) < 0) { CLog::Log(LOGERROR,"%s: could not add episode [%s]. tvshow does not exist yet..", __FUNCTION__, item->GetPath().c_str()); return false; } } } } if (info->Content() == CONTENT_MUSICVIDEOS) { bHasInfo = m_database.GetMusicVideoInfo(item->GetPath(), movieDetails); } m_database.Close(); } else if(item->HasVideoInfoTag()) { bHasInfo = true; movieDetails = *item->GetVideoInfoTag(); } bool needsRefresh = false; if (bHasInfo) { if (!info || info->Content() == CONTENT_NONE) // disable refresh button movieDetails.m_strIMDBNumber = "xx"+movieDetails.m_strIMDBNumber; *item->GetVideoInfoTag() = movieDetails; pDlgInfo->SetMovie(item); pDlgInfo->DoModal(); needsRefresh = pDlgInfo->NeedRefresh(); if (!needsRefresh) return pDlgInfo->HasUpdatedThumb(); } // quietly return if Internet lookups are disabled if (!g_settings.GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser) return false; if(!info) return false; if (g_application.IsVideoScanning()) { CGUIDialogOK::ShowAndGetInput(13346,14057,-1,-1); return false; } m_database.Open(); // 2. Look for a nfo File to get the search URL SScanSettings settings; info = m_database.GetScraperForPath(item->GetPath(),settings); if (!info) return false; // Get the correct movie title CStdString movieName = item->GetMovieName(settings.parent_name); CScraperUrl scrUrl; CVideoInfoScanner scanner; bool hasDetails = false; bool listNeedsUpdating = false; bool ignoreNfo = false; // 3. Run a loop so that if we Refresh we re-run this block do { if (!ignoreNfo) { CNfoFile::NFOResult nfoResult = scanner.CheckForNFOFile(item,settings.parent_name_root,info,scrUrl); if (nfoResult == CNfoFile::ERROR_NFO) ignoreNfo = true; else if (nfoResult != CNfoFile::NO_NFO) hasDetails = true; if (needsRefresh) { bHasInfo = true; if (nfoResult == CNfoFile::URL_NFO || nfoResult == CNfoFile::COMBINED_NFO || nfoResult == CNfoFile::FULL_NFO) { if (CGUIDialogYesNo::ShowAndGetInput(13346,20446,20447,20022)) { hasDetails = false; ignoreNfo = true; scrUrl.Clear(); info = info2; } } } } // 4. if we don't have an url, or need to refresh the search // then do the web search MOVIELIST movielist; if (info->Content() == CONTENT_TVSHOWS && !item->m_bIsFolder) hasDetails = true; if (!hasDetails && (scrUrl.m_url.size() == 0 || needsRefresh)) { // 4a. show dialog that we're busy querying www.imdb.com CStdString strHeading; strHeading.Format(g_localizeStrings.Get(197),info->Name().c_str()); pDlgProgress->SetHeading(strHeading); pDlgProgress->SetLine(0, movieName); pDlgProgress->SetLine(1, ""); pDlgProgress->SetLine(2, ""); pDlgProgress->StartModal(); pDlgProgress->Progress(); // 4b. do the websearch info->ClearCache(); CVideoInfoDownloader imdb(info); int returncode = imdb.FindMovie(movieName, movielist, pDlgProgress); if (returncode > 0) { pDlgProgress->Close(); if (movielist.size() > 0) { int iString = 196; if (info->Content() == CONTENT_TVSHOWS) iString = 20356; pDlgSelect->SetHeading(iString); pDlgSelect->Reset(); for (unsigned int i = 0; i < movielist.size(); ++i) pDlgSelect->Add(movielist[i].strTitle); pDlgSelect->EnableButton(true, 413); // manual pDlgSelect->DoModal(); // and wait till user selects one int iSelectedMovie = pDlgSelect->GetSelectedLabel(); if (iSelectedMovie >= 0) { scrUrl = movielist[iSelectedMovie]; CLog::Log(LOGDEBUG, "%s: user selected movie '%s' with URL '%s'", __FUNCTION__, scrUrl.strTitle.c_str(), scrUrl.m_url[0].m_url.c_str()); } else if (!pDlgSelect->IsButtonPressed()) { m_database.Close(); return listNeedsUpdating; // user backed out } } } else if (returncode == -1 || !CVideoInfoScanner::DownloadFailed(pDlgProgress)) { pDlgProgress->Close(); return false; } } // 4c. Check if url is still empty - occurs if user has selected to do a manual // lookup, or if the IMDb lookup failed or was cancelled. if (!hasDetails && scrUrl.m_url.size() == 0) { // Check for cancel of the progress dialog pDlgProgress->Close(); if (pDlgProgress->IsCanceled()) { m_database.Close(); return listNeedsUpdating; } // Prompt the user to input the movieName int iString = 16009; if (info->Content() == CONTENT_TVSHOWS) iString = 20357; if (!CGUIKeyboardFactory::ShowAndGetInput(movieName, g_localizeStrings.Get(iString), false)) { m_database.Close(); return listNeedsUpdating; // user backed out } needsRefresh = true; } else { // 5. Download the movie information // show dialog that we're downloading the movie info // clear artwork item->SetThumbnailImage(""); item->ClearProperty("fanart_image"); CFileItemList list; CStdString strPath=item->GetPath(); if (item->IsVideoDb()) { CFileItemPtr newItem(new CFileItem(*item->GetVideoInfoTag())); list.Add(newItem); strPath = item->GetVideoInfoTag()->m_strPath; } else { CFileItemPtr newItem(new CFileItem(*item)); list.Add(newItem); } if (item->m_bIsFolder) list.SetPath(URIUtils::GetParentPath(strPath)); else { CStdString path; URIUtils::GetDirectory(strPath, path); list.SetPath(path); } int iString=198; if (info->Content() == CONTENT_TVSHOWS) { if (item->m_bIsFolder) iString = 20353; else iString = 20361; } if (info->Content() == CONTENT_MUSICVIDEOS) iString = 20394; pDlgProgress->SetHeading(iString); pDlgProgress->SetLine(0, movieName); pDlgProgress->SetLine(1, scrUrl.strTitle); pDlgProgress->SetLine(2, ""); pDlgProgress->StartModal(); pDlgProgress->Progress(); if (bHasInfo) { if (info->Content() == CONTENT_MOVIES) m_database.DeleteMovie(item->GetPath()); if (info->Content() == CONTENT_TVSHOWS && !item->m_bIsFolder) m_database.DeleteEpisode(item->GetPath(),movieDetails.m_iDbId); if (info->Content() == CONTENT_MUSICVIDEOS) m_database.DeleteMusicVideo(item->GetPath()); if (info->Content() == CONTENT_TVSHOWS && item->m_bIsFolder) { if (pDlgInfo->RefreshAll()) m_database.DeleteTvShow(item->GetPath()); else m_database.DeleteDetailsForTvShow(item->GetPath()); } } if (scanner.RetrieveVideoInfo(list,settings.parent_name_root,info->Content(),!ignoreNfo,&scrUrl,pDlgInfo->RefreshAll(),pDlgProgress)) { if (info->Content() == CONTENT_MOVIES) m_database.GetMovieInfo(item->GetPath(),movieDetails); if (info->Content() == CONTENT_MUSICVIDEOS) m_database.GetMusicVideoInfo(item->GetPath(),movieDetails); if (info->Content() == CONTENT_TVSHOWS) { // update tvshow info to get updated episode numbers if (item->m_bIsFolder) m_database.GetTvShowInfo(item->GetPath(),movieDetails); else m_database.GetEpisodeInfo(item->GetPath(),movieDetails); } // got all movie details :-) OutputDebugString("got details\n"); pDlgProgress->Close(); // now show the imdb info OutputDebugString("show info\n"); // remove directory caches and reload images CUtil::DeleteVideoDatabaseDirectoryCache(); CGUIMessage reload(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS); OnMessage(reload); *item->GetVideoInfoTag() = movieDetails; pDlgInfo->SetMovie(item); pDlgInfo->DoModal(); item->SetThumbnailImage(pDlgInfo->GetThumbnail()); needsRefresh = pDlgInfo->NeedRefresh(); listNeedsUpdating = true; } else { pDlgProgress->Close(); if (pDlgProgress->IsCanceled()) { m_database.Close(); return listNeedsUpdating; // user cancelled } CGUIDialogOK::ShowAndGetInput(195, movieName, 0, 0); m_database.Close(); return listNeedsUpdating; } } // 6. Check for a refresh } while (needsRefresh); m_database.Close(); return listNeedsUpdating; } void CGUIWindowVideoBase::OnQueueItem(int iItem) { // don't re-queue items from playlist window if ( iItem < 0 || iItem >= m_vecItems->Size() || GetID() == WINDOW_VIDEO_PLAYLIST ) return ; // we take a copy so that we can alter the queue state CFileItemPtr item(new CFileItem(*m_vecItems->Get(iItem))); if (item->IsRAR() || item->IsZIP()) return; // Allow queuing of unqueueable items // when we try to queue them directly if (!item->CanQueue()) item->SetCanQueue(true); CFileItemList queuedItems; AddItemToPlayList(item, queuedItems); // if party mode, add items but DONT start playing if (g_partyModeManager.IsEnabled(PARTYMODECONTEXT_VIDEO)) { g_partyModeManager.AddUserSongs(queuedItems, false); return; } g_playlistPlayer.Add(PLAYLIST_VIDEO, queuedItems); g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO); // video does not auto play on queue like music m_viewControl.SetSelectedItem(iItem + 1); } void CGUIWindowVideoBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItemList &queuedItems) { if (!pItem->CanQueue() || pItem->IsRAR() || pItem->IsZIP() || pItem->IsParentFolder()) // no zip/rar enques thank you! return; if (pItem->m_bIsFolder) { if (pItem->IsParentFolder()) return; // Check if we add a locked share if ( pItem->m_bIsShareOrDrive ) { CFileItem item = *pItem; if ( !g_passwordManager.IsItemUnlocked( &item, "video" ) ) return; } // recursive CFileItemList items; GetDirectory(pItem->GetPath(), items); FormatAndSort(items); int watchedMode = g_settings.GetWatchMode(m_vecItems->GetContent()); bool unwatchedOnly = watchedMode == VIDEO_SHOW_UNWATCHED; bool watchedOnly = watchedMode == VIDEO_SHOW_WATCHED; for (int i = 0; i < items.Size(); ++i) { if (items[i]->m_bIsFolder) { CStdString strPath = items[i]->GetPath(); URIUtils::RemoveSlashAtEnd(strPath); strPath.ToLower(); if (strPath.size() > 6) { CStdString strSub = strPath.substr(strPath.size()-6); if (strPath.Mid(strPath.size()-6).Equals("sample")) // skip sample folders continue; } } else if (items[i]->HasVideoInfoTag() && ((unwatchedOnly && items[i]->GetVideoInfoTag()->m_playCount > 0) || (watchedOnly && items[i]->GetVideoInfoTag()->m_playCount <= 0))) continue; AddItemToPlayList(items[i], queuedItems); } } else { // just an item if (pItem->IsPlayList()) { auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem)); if (pPlayList.get()) { // load it if (!pPlayList->Load(pItem->GetPath())) { CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0); return; //hmmm unable to load playlist? } CPlayList playlist = *pPlayList; for (int i = 0; i < (int)playlist.size(); ++i) { AddItemToPlayList(playlist[i], queuedItems); } return; } } else if(pItem->IsInternetStream()) { // just queue the internet stream, it will be expanded on play queuedItems.Add(pItem); } else if (pItem->IsPlugin() && pItem->GetProperty("isplayable") == "true") { // a playable python files queuedItems.Add(pItem); } else if (pItem->IsVideoDb()) { // this case is needed unless we allow IsVideo() to return true for videodb items, // but then we have issues with playlists of videodb items CFileItemPtr item(new CFileItem(*pItem->GetVideoInfoTag())); queuedItems.Add(item); } else if (!pItem->IsNFO() && pItem->IsVideo()) { queuedItems.Add(pItem); } } } void CGUIWindowVideoBase::GetResumeItemOffset(const CFileItem *item, int& startoffset, int& partNumber) { // do not resume livetv if (item->IsLiveTV()) return; startoffset = 0; partNumber = 0; if (!item->IsNFO() && !item->IsPlayList()) { if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_resumePoint.timeInSeconds > 0.0) { startoffset = (int)(item->GetVideoInfoTag()->m_resumePoint.timeInSeconds*75); partNumber = item->GetVideoInfoTag()->m_resumePoint.partNumber; } else { CBookmark bookmark; CStdString strPath = item->GetPath(); if ((item->IsVideoDb() || item->IsDVD()) && item->HasVideoInfoTag()) strPath = item->GetVideoInfoTag()->m_strFileNameAndPath; CVideoDatabase db; if (!db.Open()) { CLog::Log(LOGERROR, "%s - Cannot open VideoDatabase", __FUNCTION__); return; } if (db.GetResumeBookMark(strPath, bookmark)) { startoffset = (int)(bookmark.timeInSeconds*75); partNumber = bookmark.partNumber; } db.Close(); } } } bool CGUIWindowVideoBase::HasResumeItemOffset(const CFileItem *item) { int startoffset = 0, partNumber = 0; GetResumeItemOffset(item, startoffset, partNumber); return startoffset > 0; } bool CGUIWindowVideoBase::OnClick(int iItem) { return CGUIMediaWindow::OnClick(iItem); } bool CGUIWindowVideoBase::OnSelect(int iItem) { if (iItem < 0 || iItem >= m_vecItems->Size()) return false; CFileItemPtr item = m_vecItems->Get(iItem); CStdString path = item->GetPath(); if (!item->m_bIsFolder && path != "add" && path != "addons://more/video" && path.Left(19) != "newsmartplaylist://" && path.Left(14) != "newplaylist://" && path.Left(9) != "newtag://") return OnFileAction(iItem, g_guiSettings.GetInt("myvideos.selectaction")); return CGUIMediaWindow::OnSelect(iItem); } bool CGUIWindowVideoBase::OnFileAction(int iItem, int action) { CFileItemPtr item = m_vecItems->Get(iItem); // Reset the current start offset. The actual resume // option is set in the switch, based on the action passed. item->m_lStartOffset = 0; switch (action) { case SELECT_ACTION_CHOOSE: { CContextButtons choices; bool resume = false; if (item->IsVideoDb()) { CStdString itemPath(item->GetPath()); itemPath = item->GetVideoInfoTag()->m_strFileNameAndPath; if (URIUtils::IsStack(itemPath) && CFileItem(CStackDirectory::GetFirstStackedFile(itemPath),false).IsDVDImage()) choices.Add(SELECT_ACTION_PLAYPART, 20324); // Play Part } if (!item->IsLiveTV()) { CStdString resumeString = GetResumeString(*item); if (!resumeString.IsEmpty()) { resume = true; choices.Add(SELECT_ACTION_RESUME, resumeString); choices.Add(SELECT_ACTION_PLAY, 12021); // Start from beginning } } if (!resume) choices.Add(SELECT_ACTION_PLAY, 208); // Play choices.Add(SELECT_ACTION_INFO, 22081); // Info choices.Add(SELECT_ACTION_MORE, 22082); // More int value = CGUIDialogContextMenu::ShowAndGetChoice(choices); if (value < 0) return true; return OnFileAction(iItem, value); } break; case SELECT_ACTION_PLAY_OR_RESUME: return OnResumeItem(iItem); case SELECT_ACTION_INFO: if (OnInfo(iItem)) return true; break; case SELECT_ACTION_MORE: OnPopupMenu(iItem); return true; case SELECT_ACTION_RESUME: item->m_lStartOffset = STARTOFFSET_RESUME; break; case SELECT_ACTION_PLAYPART: if (!OnPlayStackPart(iItem)) return false; break; case SELECT_ACTION_PLAY: default: break; } return OnClick(iItem); } bool CGUIWindowVideoBase::OnInfo(int iItem) { if (iItem < 0 || iItem >= m_vecItems->Size()) return false; CFileItemPtr item = m_vecItems->Get(iItem); if (item->GetPath().Equals("add") || item->IsParentFolder() || (item->IsPlayList() && !URIUtils::GetExtension(item->GetPath()).Equals(".strm"))) return false; if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript())) return CGUIDialogAddonInfo::ShowForItem(item); ADDON::ScraperPtr scraper; if (!m_vecItems->IsPlugin() && !m_vecItems->IsRSS() && !m_vecItems->IsLiveTV()) { CStdString strDir; if (item->IsVideoDb() && item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.IsEmpty()) { strDir = item->GetVideoInfoTag()->m_strPath; } else URIUtils::GetDirectory(item->GetPath(),strDir); SScanSettings settings; bool foundDirectly = false; scraper = m_database.GetScraperForPath(strDir, settings, foundDirectly); if (!scraper && !(m_database.HasMovieInfo(item->GetPath()) || m_database.HasTvShowInfo(strDir) || m_database.HasEpisodeInfo(item->GetPath()))) { return false; } if (scraper && scraper->Content() == CONTENT_TVSHOWS && foundDirectly && !settings.parent_name_root) // dont lookup on root tvshow folder return true; } OnInfo(item.get(), scraper); return true; } void CGUIWindowVideoBase::OnRestartItem(int iItem) { CGUIMediaWindow::OnClick(iItem); } CStdString CGUIWindowVideoBase::GetResumeString(CFileItem item) { CStdString resumeString; CStdString partString; CVideoDatabase db; if (db.Open()) { CBookmark bookmark; CStdString itemPath(item.GetPath()); if (item.IsVideoDb() || item.IsDVD()) itemPath = item.GetVideoInfoTag()->m_strFileNameAndPath; if (db.GetResumeBookMark(itemPath, bookmark)) { resumeString.Format(g_localizeStrings.Get(12022).c_str(), StringUtils::SecondsToTimeString(lrint(bookmark.timeInSeconds)).c_str()); if (bookmark.partNumber > 0) { partString.Format(g_localizeStrings.Get(23051).c_str(), bookmark.partNumber); resumeString.append(" (").append(partString).append(")"); } } db.Close(); } return resumeString; } bool CGUIWindowVideoBase::ShowResumeMenu(CFileItem &item) { if (!item.m_bIsFolder && !item.IsLiveTV()) { CStdString resumeString = GetResumeString(item); if (!resumeString.IsEmpty()) { // prompt user whether they wish to resume CContextButtons choices; choices.Add(1, resumeString); choices.Add(2, 12021); // start from the beginning int retVal = CGUIDialogContextMenu::ShowAndGetChoice(choices); if (retVal < 0) return false; // don't do anything if (retVal == 1) item.m_lStartOffset = STARTOFFSET_RESUME; } } return true; } bool CGUIWindowVideoBase::ShowPlaySelection(CFileItemPtr& item) { /* if asked to resume somewhere, we should not show anything */ if (item->m_lStartOffset) return true; if (item->IsBDFile()) { CStdString root = URIUtils::GetParentPath(item->GetPath()); URIUtils::RemoveSlashAtEnd(root); if(URIUtils::GetFileName(root) == "BDMV") { CURL url("bluray://"); url.SetHostName(URIUtils::GetParentPath(root)); return ShowPlaySelection(item, url.Get()); } } return true; } bool CGUIWindowVideoBase::ShowPlaySelection(CFileItemPtr& item, const CStdString& directory) { CFileItemList items; if (!XFILE::CDirectory::GetDirectory(directory, items, XFILE::CDirectory::CHints(), true)) { CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get play directory for %s", directory.c_str()); return true; } if (items.Size() == 0) { CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get any items %s", directory.c_str()); return true; } CGUIDialogSelect* dialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); while(true) { dialog->Reset(); dialog->SetHeading(25006 /* Select playback item */); dialog->SetItems(&items); dialog->SetUseDetails(true); dialog->DoModal(); CFileItemPtr item_new = dialog->GetSelectedItem(); if(!item_new || dialog->GetSelectedLabel() < 0) { CLog::Log(LOGDEBUG, "CGUIWindowVideoBase::ShowPlaySelection - User aborted %s", directory.c_str()); break; } if(item_new->m_bIsFolder == false) { item.reset(new CFileItem(*item)); item->SetPath(item_new->GetPath()); return true; } items.Clear(); if(!XFILE::CDirectory::GetDirectory(item_new->GetPath(), items, XFILE::CDirectory::CHints(), true) || items.Size() == 0) { CLog::Log(LOGERROR, "CGUIWindowVideoBase::ShowPlaySelection - Failed to get any items %s", item_new->GetPath().c_str()); break; } } return false; } bool CGUIWindowVideoBase::OnResumeItem(int iItem) { if (iItem < 0 || iItem >= m_vecItems->Size()) return true; CFileItemPtr item = m_vecItems->Get(iItem); if (item->m_bIsFolder) { // resuming directories isn't supported yet. play. PlayItem(iItem); return true; } CStdString resumeString = GetResumeString(*item); if (!resumeString.IsEmpty()) { CContextButtons choices; choices.Add(SELECT_ACTION_RESUME, resumeString); choices.Add(SELECT_ACTION_PLAY, 12021); // Start from beginning int value = CGUIDialogContextMenu::ShowAndGetChoice(choices); if (value < 0) return true; return OnFileAction(iItem, value); } return OnFileAction(iItem, SELECT_ACTION_PLAY); } void CGUIWindowVideoBase::OnStreamDetails(const CStreamDetails &details, const CStdString &strFileName, long lFileId) { CVideoDatabase db; if (db.Open()) { if (lFileId < 0) db.SetStreamDetailsForFile(details, strFileName); else db.SetStreamDetailsForFileId(details, lFileId); db.Close(); } } void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &buttons) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); // contextual buttons if (item && !item->GetProperty("pluginreplacecontextitems").asBoolean()) { if (!item->IsParentFolder()) { CStdString path(item->GetPath()); if (item->IsVideoDb() && item->HasVideoInfoTag()) path = item->GetVideoInfoTag()->m_strFileNameAndPath; if (!item->GetPath().Equals("add") && !item->IsPlugin() && !item->IsScript() && !item->IsAddonsPath() && !item->IsLiveTV()) { if (URIUtils::IsStack(path)) { vector<int> times; if (m_database.GetStackTimes(path,times) || CFileItem(CStackDirectory::GetFirstStackedFile(path),false).IsDVDImage()) buttons.Add(CONTEXT_BUTTON_PLAY_PART, 20324); } if (!m_vecItems->GetPath().IsEmpty() && !item->GetPath().Left(19).Equals("newsmartplaylist://") && !item->GetPath().Left(9).Equals("newtag://") && !m_vecItems->IsSourcesPath()) { buttons.Add(CONTEXT_BUTTON_QUEUE_ITEM, 13347); // Add to Playlist } // allow a folder to be ad-hoc queued and played by the default player if (item->m_bIsFolder || (item->IsPlayList() && !g_advancedSettings.m_playlistAsFolders)) { buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); } } if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript())) buttons.Add(CONTEXT_BUTTON_INFO,24003); // Add-on info if (!item->m_bIsFolder && !(item->IsPlayList() && !g_advancedSettings.m_playlistAsFolders)) { // get players VECPLAYERCORES vecCores; if (item->IsVideoDb()) { CFileItem item2(item->GetVideoInfoTag()->m_strFileNameAndPath, false); CPlayerCoreFactory::GetPlayers(item2, vecCores); } else CPlayerCoreFactory::GetPlayers(*item, vecCores); if (vecCores.size() > 1) buttons.Add(CONTEXT_BUTTON_PLAY_WITH, 15213); } if (item->IsSmartPlayList()) { buttons.Add(CONTEXT_BUTTON_PLAY_PARTYMODE, 15216); // Play in Partymode } // if autoresume is enabled then add restart video button // check to see if the Resume Video button is applicable // only if the video is NOT a DVD (in that case the resume button will be added by CGUIDialogContextMenu::GetContextButtons) if (!item->IsDVD() && HasResumeItemOffset(item.get())) { buttons.Add(CONTEXT_BUTTON_RESUME_ITEM, GetResumeString(*(item.get()))); // Resume Video } //if the item isn't a folder, is a member of a list rather than a single item //and we're not on the last element of the list, then add the 'play from here' option if (!item->m_bIsFolder && m_vecItems->Size() > 1 && itemNumber < m_vecItems->Size()-1) { buttons.Add(CONTEXT_BUTTON_PLAY_AND_QUEUE, 13412); } if (item->IsSmartPlayList() || m_vecItems->IsSmartPlayList()) buttons.Add(CONTEXT_BUTTON_EDIT_SMART_PLAYLIST, 586); } } CGUIMediaWindow::GetContextButtons(itemNumber, buttons); } void CGUIWindowVideoBase::GetNonContextButtons(int itemNumber, CContextButtons &buttons) { if (g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO).size() > 0) buttons.Add(CONTEXT_BUTTON_NOW_PLAYING, 13350); } bool CGUIWindowVideoBase::OnPlayStackPart(int iItem) { if (iItem < 0 || iItem >= m_vecItems->Size()) return false; CFileItemPtr stack = m_vecItems->Get(iItem); CStdString path(stack->GetPath()); if (stack->IsVideoDb()) path = stack->GetVideoInfoTag()->m_strFileNameAndPath; if (!URIUtils::IsStack(path)) return false; CFileItemList parts; CDirectory::GetDirectory(path,parts); CGUIDialogFileStacking* dlg = (CGUIDialogFileStacking*)g_windowManager.GetWindow(WINDOW_DIALOG_FILESTACKING); if (!dlg) return true; dlg->SetNumberOfFiles(parts.Size()); dlg->DoModal(); int selectedFile = dlg->GetSelectedFile(); if (selectedFile > 0) { // ISO stack if (CFileItem(CStackDirectory::GetFirstStackedFile(path),false).IsDVDImage()) { CStdString resumeString = CGUIWindowVideoBase::GetResumeString(*(parts[selectedFile - 1].get())); stack->m_lStartOffset = 0; if (!resumeString.IsEmpty()) { CContextButtons choices; choices.Add(SELECT_ACTION_RESUME, resumeString); choices.Add(SELECT_ACTION_PLAY, 12021); // Start from beginning int value = CGUIDialogContextMenu::ShowAndGetChoice(choices); if (value == SELECT_ACTION_RESUME) GetResumeItemOffset(parts[selectedFile - 1].get(), stack->m_lStartOffset, stack->m_lStartPartNumber); else if (value != SELECT_ACTION_PLAY) return false; // if not selected PLAY, then we changed our mind so return } stack->m_lStartPartNumber = selectedFile; } // regular stack else { if (selectedFile > 1) { vector<int> times; if (m_database.GetStackTimes(path,times)) stack->m_lStartOffset = times[selectedFile-2]*75; // wtf? } else stack->m_lStartOffset = 0; } } return true; } bool CGUIWindowVideoBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button) { CFileItemPtr item; if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) item = m_vecItems->Get(itemNumber); switch (button) { case CONTEXT_BUTTON_SET_CONTENT: { OnAssignContent(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.IsEmpty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath()); return true; } case CONTEXT_BUTTON_PLAY_PART: { if (OnPlayStackPart(itemNumber)) { // call CGUIMediaWindow::OnClick() as otherwise autoresume will kick in CGUIMediaWindow::OnClick(itemNumber); return true; } else return false; } case CONTEXT_BUTTON_QUEUE_ITEM: OnQueueItem(itemNumber); return true; case CONTEXT_BUTTON_PLAY_ITEM: PlayItem(itemNumber); return true; case CONTEXT_BUTTON_PLAY_WITH: { VECPLAYERCORES vecCores; if (item->IsVideoDb()) { CFileItem item2(*item->GetVideoInfoTag()); CPlayerCoreFactory::GetPlayers(item2, vecCores); } else CPlayerCoreFactory::GetPlayers(*item, vecCores); g_application.m_eForcedNextPlayer = CPlayerCoreFactory::SelectPlayerDialog(vecCores); if (g_application.m_eForcedNextPlayer != EPC_NONE) OnClick(itemNumber); return true; } case CONTEXT_BUTTON_PLAY_PARTYMODE: g_partyModeManager.Enable(PARTYMODECONTEXT_VIDEO, m_vecItems->Get(itemNumber)->GetPath()); return true; case CONTEXT_BUTTON_RESTART_ITEM: OnRestartItem(itemNumber); return true; case CONTEXT_BUTTON_RESUME_ITEM: return OnFileAction(itemNumber, SELECT_ACTION_RESUME); case CONTEXT_BUTTON_NOW_PLAYING: g_windowManager.ActivateWindow(WINDOW_VIDEO_PLAYLIST); return true; case CONTEXT_BUTTON_INFO: OnInfo(itemNumber); return true; case CONTEXT_BUTTON_STOP_SCANNING: { g_application.StopVideoScan(); return true; } case CONTEXT_BUTTON_SCAN: case CONTEXT_BUTTON_UPDATE_TVSHOW: { if( !item) return false; ADDON::ScraperPtr info; SScanSettings settings; GetScraperForItem(item.get(), info, settings); CStdString strPath = item->GetPath(); if (item->IsVideoDb() && (!item->m_bIsFolder || item->GetVideoInfoTag()->m_strPath.IsEmpty())) return false; if (item->IsVideoDb()) strPath = item->GetVideoInfoTag()->m_strPath; if (!info || info->Content() == CONTENT_NONE) return false; if (item->m_bIsFolder) { m_database.SetPathHash(strPath,""); // to force scan OnScan(strPath, true); } else OnInfo(item.get(),info); return true; } case CONTEXT_BUTTON_DELETE: OnDeleteItem(itemNumber); return true; case CONTEXT_BUTTON_EDIT_SMART_PLAYLIST: { CStdString playlist = m_vecItems->Get(itemNumber)->IsSmartPlayList() ? m_vecItems->Get(itemNumber)->GetPath() : m_vecItems->GetPath(); // save path as activatewindow will destroy our items if (CGUIDialogSmartPlaylistEditor::EditPlaylist(playlist, "video")) { // need to update m_vecItems->RemoveDiscCache(GetID()); Update(m_vecItems->GetPath()); } return true; } case CONTEXT_BUTTON_RENAME: OnRenameItem(itemNumber); return true; case CONTEXT_BUTTON_MARK_WATCHED: { int newSelection = m_viewControl.GetSelectedItem() + 1; MarkWatched(item,true); m_viewControl.SetSelectedItem(newSelection); CUtil::DeleteVideoDatabaseDirectoryCache(); Update(m_vecItems->GetPath()); return true; } case CONTEXT_BUTTON_MARK_UNWATCHED: MarkWatched(item,false); CUtil::DeleteVideoDatabaseDirectoryCache(); Update(m_vecItems->GetPath()); return true; case CONTEXT_BUTTON_PLAY_AND_QUEUE: return OnPlayAndQueueMedia(item); default: break; } return CGUIMediaWindow::OnContextButton(itemNumber, button); } bool CGUIWindowVideoBase::OnPlayMedia(int iItem) { if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return false; CFileItemPtr pItem = m_vecItems->Get(iItem); // party mode if (g_partyModeManager.IsEnabled(PARTYMODECONTEXT_VIDEO)) { CPlayList playlistTemp; playlistTemp.Add(pItem); g_partyModeManager.AddUserSongs(playlistTemp, true); return true; } // Reset Playlistplayer, playback started now does // not use the playlistplayer. g_playlistPlayer.Reset(); g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_NONE); CFileItem item(*pItem); if (pItem->IsVideoDb()) { item.SetPath(pItem->GetVideoInfoTag()->m_strFileNameAndPath); item.SetProperty("original_listitem_url", pItem->GetPath()); } CLog::Log(LOGDEBUG, "%s %s", __FUNCTION__, item.GetPath().c_str()); PlayMovie(&item); return true; } bool CGUIWindowVideoBase::OnPlayAndQueueMedia(const CFileItemPtr &item) { // Get the current playlist and make sure it is not shuffled int iPlaylist = m_guiState->GetPlaylist(); if (iPlaylist != PLAYLIST_NONE && g_playlistPlayer.IsShuffled(iPlaylist)) g_playlistPlayer.SetShuffle(iPlaylist, false); // Call the base method to actually queue the items // and start playing the given item return CGUIMediaWindow::OnPlayAndQueueMedia(item); } void CGUIWindowVideoBase::PlayMovie(const CFileItem *item) { CFileItemPtr movieItem(new CFileItem(*item)); if(!ShowPlaySelection(movieItem)) return; g_playlistPlayer.Reset(); g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO); CPlayList& playlist = g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO); playlist.Clear(); playlist.Add(movieItem); if(m_thumbLoader.IsLoading()) m_thumbLoader.StopAsync(); // play movie... g_playlistPlayer.Play(0); if(!g_application.IsPlayingVideo()) m_thumbLoader.Load(*m_vecItems); } void CGUIWindowVideoBase::OnDeleteItem(int iItem) { if ( iItem < 0 || iItem >= m_vecItems->Size()) return; OnDeleteItem(m_vecItems->Get(iItem)); m_vecItems->RemoveDiscCache(GetID()); Update(m_vecItems->GetPath()); m_viewControl.SetSelectedItem(iItem); } void CGUIWindowVideoBase::OnDeleteItem(CFileItemPtr item) { // HACK: stacked files need to be treated as folders in order to be deleted if (item->IsStack()) item->m_bIsFolder = true; if (g_settings.GetCurrentProfile().getLockMode() != LOCK_MODE_EVERYONE && g_settings.GetCurrentProfile().filesLocked()) { if (!g_passwordManager.IsMasterLockUnlocked(true)) return; } if (g_guiSettings.GetBool("filelists.allowfiledeletion") && CUtil::SupportsFileOperations(item->GetPath())) CFileUtils::DeleteItem(item); } void CGUIWindowVideoBase::MarkWatched(const CFileItemPtr &item, bool bMark) { if (!g_settings.GetCurrentProfile().canWriteDatabases()) return; // dont allow update while scanning if (g_application.IsVideoScanning()) { CGUIDialogOK::ShowAndGetInput(257, 0, 14057, 0); return; } CVideoDatabase database; if (database.Open()) { CFileItemList items; if (item->m_bIsFolder) { CStdString strPath = item->GetPath(); CDirectory::GetDirectory(strPath, items); } else items.Add(item); for (int i=0;i<items.Size();++i) { CFileItemPtr pItem=items[i]; if (pItem->m_bIsFolder) { MarkWatched(pItem, bMark); continue; } if (pItem->HasVideoInfoTag() && (( bMark && pItem->GetVideoInfoTag()->m_playCount) || (!bMark && !(pItem->GetVideoInfoTag()->m_playCount)))) continue; // Clear resume bookmark if (bMark) database.ClearBookMarksOfFile(pItem->GetPath(), CBookmark::RESUME); database.SetPlayCount(*pItem, bMark ? 1 : 0); } database.Close(); } } //Add change a title's name void CGUIWindowVideoBase::UpdateVideoTitle(const CFileItem* pItem) { // dont allow update while scanning if (g_application.IsVideoScanning()) { CGUIDialogOK::ShowAndGetInput(257, 0, 14057, 0); return; } CVideoInfoTag detail; CVideoDatabase database; database.Open(); CVideoDatabaseDirectory dir; CQueryParams params; dir.GetQueryParams(pItem->GetPath(),params); int iDbId = pItem->GetVideoInfoTag()->m_iDbId; VIDEODB_CONTENT_TYPE iType=VIDEODB_CONTENT_MOVIES; if (pItem->HasVideoInfoTag() && (!pItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty() || pItem->GetVideoInfoTag()->m_iEpisode > 0)) { iType = VIDEODB_CONTENT_TVSHOWS; } if (pItem->HasVideoInfoTag() && pItem->GetVideoInfoTag()->m_iSeason > -1 && !pItem->m_bIsFolder) iType = VIDEODB_CONTENT_EPISODES; if (pItem->HasVideoInfoTag() && !pItem->GetVideoInfoTag()->m_artist.empty()) iType = VIDEODB_CONTENT_MUSICVIDEOS; if (params.GetSetId() != -1 && params.GetMovieId() == -1) iType = VIDEODB_CONTENT_MOVIE_SETS; if (iType == VIDEODB_CONTENT_MOVIES) database.GetMovieInfo("", detail, pItem->GetVideoInfoTag()->m_iDbId); if (iType == VIDEODB_CONTENT_MOVIE_SETS) database.GetSetInfo(params.GetSetId(), detail); if (iType == VIDEODB_CONTENT_EPISODES) database.GetEpisodeInfo(pItem->GetPath(),detail,pItem->GetVideoInfoTag()->m_iDbId); if (iType == VIDEODB_CONTENT_TVSHOWS) database.GetTvShowInfo(pItem->GetVideoInfoTag()->m_strFileNameAndPath,detail,pItem->GetVideoInfoTag()->m_iDbId); if (iType == VIDEODB_CONTENT_MUSICVIDEOS) database.GetMusicVideoInfo(pItem->GetVideoInfoTag()->m_strFileNameAndPath,detail,pItem->GetVideoInfoTag()->m_iDbId); CStdString strInput; strInput = detail.m_strTitle; //Get the new title if (!CGUIKeyboardFactory::ShowAndGetInput(strInput, g_localizeStrings.Get(16105), false)) return; database.UpdateMovieTitle(iDbId, strInput, iType); } void CGUIWindowVideoBase::LoadPlayList(const CStdString& strPlayList, int iPlayList /* = PLAYLIST_VIDEO */) { // if partymode is active, we disable it if (g_partyModeManager.IsEnabled()) g_partyModeManager.Disable(); // load a playlist like .m3u, .pls // first get correct factory to load playlist auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if (pPlayList.get()) { // load it if (!pPlayList->Load(strPlayList)) { CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0); return; //hmmm unable to load playlist? } } if (g_application.ProcessAndStartPlaylist(strPlayList, *pPlayList, iPlayList)) { if (m_guiState.get()) m_guiState->SetPlaylistDirectory("playlistvideo://"); } } void CGUIWindowVideoBase::PlayItem(int iItem) { // restrictions should be placed in the appropiate window code // only call the base code if the item passes since this clears // the currently playing temp playlist const CFileItemPtr pItem = m_vecItems->Get(iItem); // if its a folder, build a temp playlist if (pItem->m_bIsFolder && !pItem->IsPlugin()) { // take a copy so we can alter the queue state CFileItemPtr item(new CFileItem(*m_vecItems->Get(iItem))); // Allow queuing of unqueueable items // when we try to queue them directly if (!item->CanQueue()) item->SetCanQueue(true); // skip ".." if (item->IsParentFolder()) return; // recursively add items to list CFileItemList queuedItems; AddItemToPlayList(item, queuedItems); g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO); g_playlistPlayer.Reset(); g_playlistPlayer.Add(PLAYLIST_VIDEO, queuedItems); g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO); g_playlistPlayer.Play(); } else if (pItem->IsPlayList()) { // load the playlist the old way LoadPlayList(pItem->GetPath(), PLAYLIST_VIDEO); } else { // single item, play it OnClick(iItem); } } bool CGUIWindowVideoBase::Update(const CStdString &strDirectory) { if (m_thumbLoader.IsLoading()) m_thumbLoader.StopThread(); if (!CGUIMediaWindow::Update(strDirectory)) return false; m_thumbLoader.Load(*m_unfilteredItems); return true; } bool CGUIWindowVideoBase::GetDirectory(const CStdString &strDirectory, CFileItemList &items) { bool bResult = CGUIMediaWindow::GetDirectory(strDirectory,items); // add in the "New Playlist" item if we're in the playlists folder if ((items.GetPath() == "special://videoplaylists/") && !items.Contains("newplaylist://")) { CFileItemPtr newPlaylist(new CFileItem(g_settings.GetUserDataItem("PartyMode-Video.xsp"),false)); newPlaylist->SetLabel(g_localizeStrings.Get(16035)); newPlaylist->SetLabelPreformated(true); newPlaylist->m_bIsFolder = true; items.Add(newPlaylist); /* newPlaylist.reset(new CFileItem("newplaylist://", false)); newPlaylist->SetLabel(g_localizeStrings.Get(525)); newPlaylist->SetLabelPreformated(true); items.Add(newPlaylist); */ newPlaylist.reset(new CFileItem("newsmartplaylist://video", false)); newPlaylist->SetLabel(g_localizeStrings.Get(21437)); // "new smart playlist..." newPlaylist->SetLabelPreformated(true); items.Add(newPlaylist); } m_stackingAvailable = StackingAvailable(items); // we may also be in a tvshow files listing // (ideally this should be removed, and our stack regexps tidied up if necessary // No "normal" episodes should stack, and multi-parts should be supported) ADDON::ScraperPtr info = m_database.GetScraperForPath(strDirectory); if (info && info->Content() == CONTENT_TVSHOWS) m_stackingAvailable = false; if (m_stackingAvailable && !items.IsStack() && g_settings.m_videoStacking) items.Stack(); return bResult; } bool CGUIWindowVideoBase::StackingAvailable(const CFileItemList &items) const { return !(items.IsTuxBox() || items.IsPlugin() || items.IsAddonsPath() || items.IsRSS() || items.IsInternetStream() || items.IsVideoDb()); } void CGUIWindowVideoBase::OnPrepareFileItems(CFileItemList &items) { } void CGUIWindowVideoBase::AddToDatabase(int iItem) { if (iItem < 0 || iItem >= m_vecItems->Size()) return; CFileItemPtr pItem = m_vecItems->Get(iItem); if (pItem->IsParentFolder() || pItem->m_bIsFolder) return; CVideoInfoTag movie; movie.Reset(); // prompt for data // enter a new title CStdString strTitle = pItem->GetLabel(); if (!CGUIKeyboardFactory::ShowAndGetInput(strTitle, g_localizeStrings.Get(528), false)) // Enter Title return; // pick genre CGUIDialogSelect* pSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); if (!pSelect) return; pSelect->SetHeading(530); // Select Genre pSelect->Reset(); CFileItemList items; if (!CDirectory::GetDirectory("videodb://1/1/", items)) return; pSelect->SetItems(&items); pSelect->EnableButton(true, 531); // New Genre pSelect->DoModal(); CStdString strGenre; int iSelected = pSelect->GetSelectedLabel(); if (iSelected >= 0) strGenre = items[iSelected]->GetLabel(); else if (!pSelect->IsButtonPressed()) return; // enter new genre string if (strGenre.IsEmpty()) { strGenre = g_localizeStrings.Get(532); // Manual Addition if (!CGUIKeyboardFactory::ShowAndGetInput(strGenre, g_localizeStrings.Get(533), false)) // Enter Genre return; // user backed out if (strGenre.IsEmpty()) return; // no genre string } // set movie info movie.m_strTitle = strTitle; movie.m_genre = StringUtils::Split(strGenre, g_advancedSettings.m_videoItemSeparator); // everything is ok, so add to database m_database.Open(); int idMovie = m_database.AddMovie(pItem->GetPath()); movie.m_strIMDBNumber.Format("xx%08i", idMovie); m_database.SetDetailsForMovie(pItem->GetPath(), movie, pItem->GetArt()); m_database.Close(); // done... CGUIDialogOK::ShowAndGetInput(20177, movie.m_strTitle, StringUtils::Join(movie.m_genre, g_advancedSettings.m_videoItemSeparator), movie.m_strIMDBNumber); // library view cache needs to be cleared CUtil::DeleteVideoDatabaseDirectoryCache(); } /// \brief Search the current directory for a string got from the virtual keyboard void CGUIWindowVideoBase::OnSearch() { CStdString strSearch; if (!CGUIKeyboardFactory::ShowAndGetInput(strSearch, g_localizeStrings.Get(16017), false)) return ; strSearch.ToLower(); if (m_dlgProgress) { m_dlgProgress->SetHeading(194); m_dlgProgress->SetLine(0, strSearch); m_dlgProgress->SetLine(1, ""); m_dlgProgress->SetLine(2, ""); m_dlgProgress->StartModal(); m_dlgProgress->Progress(); } CFileItemList items; DoSearch(strSearch, items); if (m_dlgProgress) m_dlgProgress->Close(); if (items.Size()) { CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); pDlgSelect->Reset(); pDlgSelect->SetHeading(283); for (int i = 0; i < (int)items.Size(); i++) { CFileItemPtr pItem = items[i]; pDlgSelect->Add(pItem->GetLabel()); } pDlgSelect->DoModal(); int iItem = pDlgSelect->GetSelectedLabel(); if (iItem < 0) return; CFileItemPtr pSelItem = items[iItem]; OnSearchItemFound(pSelItem.get()); } else { CGUIDialogOK::ShowAndGetInput(194, 284, 0, 0); } } /// \brief React on the selected search item /// \param pItem Search result item void CGUIWindowVideoBase::OnSearchItemFound(const CFileItem* pSelItem) { if (pSelItem->m_bIsFolder) { CStdString strPath = pSelItem->GetPath(); CStdString strParentPath; URIUtils::GetParentPath(strPath, strParentPath); Update(strParentPath); if (pSelItem->IsVideoDb() && g_settings.m_bMyVideoNavFlatten) SetHistoryForPath(""); else SetHistoryForPath(strParentPath); strPath = pSelItem->GetPath(); CURL url(strPath); if (pSelItem->IsSmb() && !URIUtils::HasSlashAtEnd(strPath)) strPath += "/"; for (int i = 0; i < m_vecItems->Size(); i++) { CFileItemPtr pItem = m_vecItems->Get(i); if (pItem->GetPath() == strPath) { m_viewControl.SetSelectedItem(i); break; } } } else { CStdString strPath; URIUtils::GetDirectory(pSelItem->GetPath(), strPath); Update(strPath); if (pSelItem->IsVideoDb() && g_settings.m_bMyVideoNavFlatten) SetHistoryForPath(""); else SetHistoryForPath(strPath); for (int i = 0; i < (int)m_vecItems->Size(); i++) { CFileItemPtr pItem = m_vecItems->Get(i); if (pItem->GetPath() == pSelItem->GetPath()) { m_viewControl.SetSelectedItem(i); break; } } } m_viewControl.SetFocused(); } int CGUIWindowVideoBase::GetScraperForItem(CFileItem *item, ADDON::ScraperPtr &info, SScanSettings& settings) { if (!item) return 0; if (m_vecItems->IsPlugin() || m_vecItems->IsRSS()) { info.reset(); return 0; } else if(m_vecItems->IsLiveTV()) { info.reset(); return 0; } bool foundDirectly = false; info = m_database.GetScraperForPath(item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_strPath.IsEmpty() ? item->GetVideoInfoTag()->m_strPath : item->GetPath(), settings, foundDirectly); return foundDirectly ? 1 : 0; } void CGUIWindowVideoBase::OnScan(const CStdString& strPath, bool scanAll) { g_application.StartVideoScan(strPath, scanAll); } CStdString CGUIWindowVideoBase::GetStartFolder(const CStdString &dir) { if (dir.Equals("$PLAYLISTS") || dir.Equals("Playlists")) return "special://videoplaylists/"; else if (dir.Equals("Plugins") || dir.Equals("Addons")) return "addons://sources/video/"; return CGUIMediaWindow::GetStartFolder(dir); } void CGUIWindowVideoBase::AppendAndClearSearchItems(CFileItemList &searchItems, const CStdString &prependLabel, CFileItemList &results) { if (!searchItems.Size()) return; searchItems.Sort(g_guiSettings.GetBool("filelists.ignorethewhensorting") ? SORT_METHOD_LABEL_IGNORE_THE : SORT_METHOD_LABEL, SortOrderAscending); for (int i = 0; i < searchItems.Size(); i++) searchItems[i]->SetLabel(prependLabel + searchItems[i]->GetLabel()); results.Append(searchItems); searchItems.Clear(); } bool CGUIWindowVideoBase::OnUnAssignContent(const CStdString &path, int label1, int label2, int label3) { bool bCanceled; CVideoDatabase db; db.Open(); if (CGUIDialogYesNo::ShowAndGetInput(label1,label2,label3,20022,bCanceled)) { db.RemoveContentForPath(path); db.Close(); CUtil::DeleteVideoDatabaseDirectoryCache(); return true; } else { if (!bCanceled) { ADDON::ScraperPtr info; SScanSettings settings; settings.exclude = true; db.SetScraperForPath(path,info,settings); } } db.Close(); return false; } void CGUIWindowVideoBase::OnAssignContent(const CStdString &path) { bool bScan=false; CVideoDatabase db; db.Open(); SScanSettings settings; ADDON::ScraperPtr info = db.GetScraperForPath(path, settings); ADDON::ScraperPtr info2(info); if (CGUIDialogContentSettings::Show(info, settings)) { if(settings.exclude || (!info && info2)) { OnUnAssignContent(path,20375,20340,20341); } else if (info != info2) { if (OnUnAssignContent(path,20442,20443,20444)) bScan = true; } } db.SetScraperForPath(path,info,settings); if (bScan) { g_application.StartVideoScan(path, true); } }
xbmc/android
xbmc/video/windows/GUIWindowVideoBase.cpp
C++
gpl-2.0
62,643
<?php /** * Defines the customizer setting map * On live context, used to generate the default option values * * * @package Customizr * @subpackage classes * @since 3.0 * @author Nicolas GUILLAUME <nicolas@presscustomizr.com> * @copyright Copyright (c) 2013-2015, Nicolas GUILLAUME * @link http://presscustomizr.com/customizr * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ if ( ! class_exists( 'TC_utils_settings_map' ) ) : class TC_utils_settings_map { static $instance; private $is_wp_version_before_4_0; public $customizer_map = array(); function __construct () { self::$instance =& $this; //declare a private property to check wp version >= 4.0 global $wp_version; $this -> is_wp_version_before_4_0 = ( ! version_compare( $wp_version, '4.0', '>=' ) ) ? true : false; }//end of construct /** * Defines sections, settings and function of customizer and return and array * Also used to get the default options array, in this case $get_default = true and we DISABLE the __get_option (=>infinite loop) * * @package Customizr * @since Customizr 3.0 */ public function tc_get_customizer_map( $get_default = null ) { if ( ! empty( $this -> customizer_map ) ) return $this -> customizer_map; //POPULATE THE MAP WITH DEFAULT CUSTOMIZR SETTINGS add_filter( 'tc_add_panel_map' , array( $this, 'tc_popul_panels_map')); add_filter( 'tc_remove_section_map' , array( $this, 'tc_popul_remove_section_map')); //theme switcher's enabled when user opened the customizer from the theme's page add_filter( 'tc_remove_section_map' , array( $this, 'tc_set_theme_switcher_visibility')); add_filter( 'tc_add_section_map' , array( $this, 'tc_popul_section_map' )); //add controls to the map add_filter( 'tc_add_setting_control_map' , array( $this , 'tc_popul_setting_control_map' ), 10, 2 ); //$this -> tc_populate_setting_control_map(); //FILTER SPECIFIC SETTING-CONTROL MAPS //ADDS SETTING / CONTROLS TO THE RELEVANT SECTIONS add_filter( 'tc_social_option_map' , array( $this, 'tc_generates_socials' )); add_filter( 'tc_front_page_option_map' , array( $this, 'tc_generates_featured_pages' )); //CACHE THE GLOBAL CUSTOMIZER MAP $this -> customizer_map = array_merge( array( 'add_panel' => apply_filters( 'tc_add_panel_map', array() ) ), array( 'remove_section' => apply_filters( 'tc_remove_section_map', array() ) ), array( 'add_section' => apply_filters( 'tc_add_section_map', array() ) ), array( 'add_setting_control' => apply_filters( 'tc_add_setting_control_map', array(), $get_default ) ) ); return apply_filters( 'tc_customizer_map', $this -> customizer_map ); } /** * Populate the control map * hook : 'tc_add_setting_control_map' * => loops on a callback list, each callback is a section setting group * @return array() * * @package Customizr * @since Customizr 3.3+ */ function tc_popul_setting_control_map( $_map, $get_default = null ) { $_new_map = array(); $_settings_sections = array( //GLOBAL SETTINGS 'tc_logo_favicon_option_map', 'tc_skin_option_map', 'tc_fonts_option_map', 'tc_social_option_map', 'tc_icons_option_map', 'tc_links_option_map', 'tc_images_option_map', 'tc_responsive_option_map', 'tc_authors_option_map', 'tc_smoothscroll_option_map', //HEADER 'tc_header_design_option_map', 'tc_navigation_option_map', //CONTENT 'tc_front_page_option_map', 'tc_layout_option_map', 'tc_comment_option_map', 'tc_breadcrumb_option_map', 'tc_post_metas_option_map', 'tc_post_list_option_map', 'tc_single_post_option_map', 'tc_gallery_option_map', 'tc_paragraph_option_map', 'tc_post_navigation_option_map', //SIDEBARS 'tc_sidebars_option_map', //FOOTER 'tc_footer_global_settings_option_map', //WOOCOMMERCE 'tc_woocommerce_option_map', //ADVANCED OPTIONS 'tc_custom_css_option_map', 'tc_performance_option_map', 'tc_placeholders_notice_map', 'tc_external_resources_option_map' ); foreach ( $_settings_sections as $_section_cb ) { if ( ! method_exists( $this , $_section_cb ) ) continue; //applies a filter to each section settings map => allows plugins (featured pages for ex.) to add/remove settings //each section map takes one boolean param : $get_default $_section_map = apply_filters( $_section_cb, call_user_func_array( array( $this, $_section_cb ), array( $get_default ) ) ); if ( ! is_array( $_section_map) ) continue; $_new_map = array_merge( $_new_map, $_section_map ); }//foreach return array_merge( $_map, $_new_map ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : GLOBAL SETTINGS ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- LOGO & FAVICON SECTION ------------------------------------------------------------------------------------------------------*/ function tc_logo_favicon_option_map( $get_default = null ) { global $wp_version; return array( 'tc_logo_upload' => array( 'control' => version_compare( $wp_version, '4.3', '>=' ) ? 'TC_Customize_Cropped_Image_Control' : 'TC_Customize_Upload_Control', 'label' => __( 'Logo Upload (supported formats : .jpg, .png, .gif, svg, svgz)' , 'customizr' ), 'title' => __( 'LOGO' , 'customizr'), 'section' => 'logo_sec', 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), //we can define suggested cropping area and allow it to be flexible (def 150x150 and not flexible) 'width' => 250, 'height' => 100, 'flex_width' => true, 'flex_height' => true, //to keep the selected cropped size 'dst_width' => false, 'dst_height' => false ), //force logo resize 250 * 85 'tc_logo_resize' => array( 'default' => 1, 'label' => __( 'Force logo dimensions to max-width:250px and max-height:100px' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'logo_sec' , 'type' => 'checkbox' , 'notice' => __( "Uncheck this option to keep your original logo dimensions." , 'customizr') ), 'tc_sticky_logo_upload' => array( 'control' => version_compare( $wp_version, '4.3', '>=' ) ? 'TC_Customize_Cropped_Image_Control' : 'TC_Customize_Upload_Control', 'label' => __( 'Sticky Logo Upload (supported formats : .jpg, .png, .gif, svg, svgz)' , 'customizr' ), 'section' => 'logo_sec' , 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), //we can define suggested cropping area and allow it to be flexible (def 150x150 and not flexible) 'width' => 75, 'height' => 30, 'flex_width' => true, 'flex_height' => true, //to keep the selected cropped size 'dst_width' => false, 'dst_height' => false, 'notice' => __( "Use this upload control to specify a different logo on sticky header mode." , 'customizr') ), //favicon 'tc_fav_upload' => array( 'control' => 'TC_Customize_Upload_Control' , 'label' => __( 'Favicon Upload (supported formats : .ico, .png, .gif)' , 'customizr' ), 'title' => __( 'FAVICON' , 'customizr'), 'section' => 'logo_sec' , 'type' => 'tc_upload', 'sanitize_callback' => array( $this , 'tc_sanitize_number'), ) ); } /*----------------------------------------------------------------------------------------------------- SKIN SECTION ------------------------------------------------------------------------------------------------------*/ function tc_skin_option_map( $get_default = null ) { return array( //skin select 'tc_skin' => array( 'default' => 'blue3.css' , 'control' => 'TC_controls' , 'label' => __( 'Choose a predefined skin' , 'customizr' ), 'section' => 'skins_sec' , 'type' => 'select' , 'choices' => $this -> tc_build_skin_list(), 'transport' => 'postMessage', 'notice' => __( 'Disabled if the random option is on.' , 'customizr' ) ), 'tc_skin_random' => array( 'default' => 0, 'control' => 'TC_controls', 'label' => __('Randomize the skin', 'customizr'), 'section' => 'skins_sec', 'type' => 'checkbox', 'notice' => __( 'Apply a random color skin on each page load.' , 'customizr' ) ) );//end of skin options } /*----------------------------------------------------------------------------------------------------- FONT SECTION ------------------------------------------------------------------------------------------------------*/ function tc_fonts_option_map( $get_default = null ) { return array( 'tc_fonts' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.2.9' , '1.0.1') ? 'helvetica_arial' : '_g_fjalla_cantarell', 'label' => __( 'Select a beautiful font pair (headings &amp; default fonts) or single font for your website.' , 'customizr' ), 'control' => 'TC_controls', 'section' => 'fonts_sec', 'type' => 'select' , 'choices' => TC_utils::$inst -> tc_get_font( 'list' , 'name' ), 'priority' => 10, 'transport' => 'postMessage', 'notice' => __( "This font picker allows you to preview and select among a handy selection of font pairs and single fonts. If you choose a pair, the first font will be applied to the site main headings : site name, site description, titles h1, h2, h3., while the second will be the default font of your website for any texts or paragraphs." , 'customizr' ) ), 'tc_body_font_size' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.2.9', '1.0.1' ) ? 14 : 15, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'label' => __( 'Set your website default font size in pixels.' , 'customizr' ), 'control' => 'TC_controls', 'section' => 'fonts_sec', 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 20, 'transport' => 'postMessage', 'notice' => __( "This option sets the default font size applied to any text element of your website, when no font size is already applied." , 'customizr' ) ) ); } /*----------------------------------------------------------------------------------------------------- SOCIAL NETWORKS + POSITION SECTION ------------------------------------------------------------------------------------------------------*/ function tc_social_option_map( $get_default = null ) { return array();//end of social layout map } /*----------------------------------------------------------------------------------------------------- LINKS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_links_option_map( $get_default = null ) { return array( 'tc_link_scroll' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( 'Smooth scroll on click' , 'customizr' ), 'section' => 'links_sec' , 'type' => 'checkbox' , 'notice' => sprintf( '%s<br/><strong>%s</strong> : %s', __( 'If enabled, this option activates a smooth page scroll when clicking on a link to an anchor of the same page.' , 'customizr' ), __( 'Important note' , 'customizr' ), __('this option can create conflicts with some plugins, make sure that your plugins features (if any) are working fine after enabling this option.', 'customizr') ) ), 'tc_link_hover_effect' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Fade effect on link hover" , "customizr" ), 'section' => 'links_sec' , 'type' => 'checkbox' , 'priority' => 20, 'transport' => 'postMessage' ), 'tc_ext_link_style' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Display an icon next to external links" , "customizr" ), 'section' => 'links_sec' , 'type' => 'checkbox' , 'priority' => 30, 'notice' => __( 'This will be applied to the links included in post or page content only.' , 'customizr' ), 'transport' => 'postMessage' ), 'tc_ext_link_target' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Open external links in a new tab" , "customizr" ), 'section' => 'links_sec' , 'type' => 'checkbox' , 'priority' => 40, 'notice' => __( 'This will be applied to the links included in post or page content only.' , 'customizr' ), 'transport' => 'postMessage' ) );//end of links options } /*----------------------------------------------------------------------------------------------------- ICONS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_icons_option_map( $get_default = null ) { return array( 'tc_show_title_icon' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display icons next to titles" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'priority' => 10, 'notice' => __( 'When this option is checked, a contextual icon is displayed next to the titles of pages, posts, archives, and WP built-in widgets.' , 'customizr' ), 'transport' => 'postMessage' ), 'tc_show_page_title_icon' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.0', '1.0.11' ) ? 1 : 0, 'control' => 'TC_controls' , 'label' => __( "Display a page icon next to the page title" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'priority' => 20, 'transport' => 'postMessage' ), 'tc_show_post_title_icon' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.0', '1.0.11' ) ? 1 : 0, 'control' => 'TC_controls' , 'label' => __( "Display a post icon next to the single post title" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'priority' => 30, 'transport' => 'postMessage' ), 'tc_show_archive_title_icon' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display an icon next to the archive title" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'notice' => __( 'When this option is checked, an archive type icon is displayed in the heading of every types of archives, on the left of the title. An archive page can be : category, tag, author, date archive, custom taxonomies, search results.' , 'customizr' ), 'priority' => 40, 'transport' => 'postMessage' ), 'tc_show_post_list_title_icon' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.0' , '1.0.11' ) ? 1 : 0, 'control' => 'TC_controls' , 'label' => __( "Display an icon next to each post title in an archive page" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'notice' => __( 'When this option is checked, a post type icon is displayed on the left of each post titles in an archive page. An archive page can be : category, tag, author, date archive, custom taxonomies, search results.' , 'customizr' ), 'priority' => 50, 'transport' => 'postMessage' ), 'tc_show_sidebar_widget_icon' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "WP sidebar widgets : display icons next to titles" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'priority' => 60, 'transport' => 'postMessage' ), 'tc_show_footer_widget_icon' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "WP footer widgets : display icons next to titles" , "customizr" ), 'section' => 'titles_icons_sec' , 'type' => 'checkbox', 'priority' => 70, 'transport' => 'postMessage' ) ); } /*----------------------------------------------------------------------------------------------------- IMAGE SECTION ------------------------------------------------------------------------------------------------------*/ function tc_images_option_map( $get_default = null ) { global $wp_version; $_image_options = array( 'tc_fancybox' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Lightbox effect on images' , 'customizr' ), 'section' => 'images_sec' , 'type' => 'checkbox' , 'notice' => __( 'If enabled, this option activates a popin window whith a zoom effect when an image is clicked. Note : to enable this effect on the images of your pages and posts, images have to be linked to the Media File.' , 'customizr' ), ), 'tc_fancybox_autoscale' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Autoscale images on zoom' , 'customizr' ), 'section' => 'images_sec' , 'type' => 'checkbox' , 'notice' => __( 'If enabled, this option will force images to fit the screen on lightbox zoom.' , 'customizr' ), ), 'tc_retina_support' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( 'High resolution (Retina) support' , 'customizr' ), 'section' => 'images_sec' , 'type' => 'checkbox' , 'notice' => sprintf('%1$s <strong>%2$s</strong> : <a href="%4$splugin-install.php?tab=plugin-information&plugin=regenerate-thumbnails" title="%5$s" target="_blank">%3$s</a>.', __( 'If enabled, your website will include support for high resolution devices.' , 'customizr' ), __( "It is strongly recommended to regenerate your media library images in high definition with this free plugin" , 'customizr'), __( "regenerate thumbnails" , 'customizr'), admin_url(), __( "Open the description page of the Regenerate thumbnails plugin" , 'customizr') ) ), 'tc_display_slide_loader' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Sliders : display on loading icon before rendering the slides" , "customizr" ), 'section' => 'images_sec' , 'type' => 'checkbox' , 'notice' => __( 'When checked, this option displays a loading icon when the slides are being setup.' , 'customizr' ), ), 'tc_center_slider_img' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Dynamic slider images centering on any devices" , "customizr" ), 'section' => 'images_sec' , 'type' => 'checkbox' , //'notice' => __( 'This option dynamically centers your images on any devices vertically or horizontally (without stretching them) according to their initial dimensions.' , 'customizr' ), ), 'tc_center_img' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Dynamic thumbnails centering on any devices" , "customizr" ), 'section' => 'images_sec' , 'type' => 'checkbox' , 'notice' => __( 'This option dynamically centers your images on any devices, vertically or horizontally according to their initial aspect ratio.' , 'customizr' ), ) );//end of images options //add responsive image settings for wp >= 4.4 if ( version_compare( $wp_version, '4.4', '>=' ) ) $_image_options = array_merge( $_image_options, array( 'tc_resp_slider_img' => array( 'default' => 0, 'control' => 'TC_controls' , 'title' => __( 'Responsive settings', 'customizr' ), 'label' => __( "Enable the WordPress responsive image feature for the slider" , "customizr" ), 'section' => 'images_sec' , 'type' => 'checkbox' , ), 'tc_resp_thumbs_img' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Enable the WordPress responsive image feature for the theme's thumbnails" , "customizr" ), 'section' => 'images_sec' , 'notice' => __( 'This feature has been introduced in WordPress v4.4+ (dec-2015), and might have minor side effects on some of your existing images. Check / uncheck this option to safely verify that your images are displayed nicely.' , 'customizr' ), 'type' => 'checkbox' , ) ) ); return $_image_options; } /*----------------------------------------------------------------------------------------------------- RESPONSIVE SETTINGS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_responsive_option_map( $get_default = null ) { return array( 'tc_block_reorder' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => sprintf('<span class="dashicons dashicons-smartphone"></span> %s', __( 'Dynamic sidebar reordering on small devices' , 'customizr' ) ), 'section' => 'responsive_sec' , 'type' => 'checkbox' , 'notice' => __( 'Activate this option to move the sidebars (if any) after the main content block, for smartphones or tablets viewport.' , 'customizr' ), ) );//end of links options } /*----------------------------------------------------------------------------------------------------- AUTHORS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_authors_option_map( $get_default = null ) { return array( 'tc_show_author_info' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display an author box after each single post content" , "customizr" ), 'section' => 'authors_sec', 'type' => 'checkbox', 'priority' => 1, 'notice' => __( 'Check this option to display an author info block after each single post content. Note : the Biographical info field must be filled out in the user profile.' , 'customizr' ), ) ); } /*----------------------------------------------------------------------------------------------------- SMOOTH SCROLL SECTION ------------------------------------------------------------------------------------------------------*/ function tc_smoothscroll_option_map( $get_default = null ) { return array( 'tc_smoothscroll' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __("Enable Smooth Scroll", "customizr"), 'section' => 'smoothscroll_sec', 'type' => 'checkbox', 'priority' => 1, 'notice' => __( 'This option enables a smoother page scroll.' , 'customizr' ), 'transport' => 'postMessage' ) ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : HEADER ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- HEADER DESIGN AND LAYOUT ------------------------------------------------------------------------------------------------------*/ function tc_header_design_option_map( $get_default = null ) { return array( 'tc_header_layout' => array( 'default' => 'left', 'title' => __( 'Header design and layout' , 'customizr'), 'control' => 'TC_controls' , 'label' => __( "Choose a layout for the header" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'select' , 'choices' => array( 'left' => __( 'Logo / title on the left' , 'customizr' ), 'centered' => __( 'Logo / title centered' , 'customizr'), 'right' => __( 'Logo / title on the right' , 'customizr' ) ), 'priority' => 5, 'notice' => __( 'This setting might impact the side on which the menu is revealed.' , 'customizr' ), ), //enable/disable top border 'tc_top_border' => array( 'default' => 1,//top border on by default 'label' => __( 'Display top border' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'notice' => __( 'Uncheck this option to remove the colored top border.' , 'customizr' ), 'priority' => 10 ), 'tc_show_tagline' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display the tagline" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 15, 'transport' => 'postMessage' ), 'tc_social_in_header' => array( 'default' => 1, 'label' => __( 'Social links in header' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 20, 'transport' => 'postMessage' ), 'tc_display_boxed_navbar' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.13', '1.0.18' ) ? 1 : 0, 'control' => 'TC_controls' , 'label' => __( "Display menu in a box" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 25, 'transport' => 'postMessage', 'notice' => __( 'If checked, this option wraps the header menu/tagline/social in a light grey box.' , 'customizr' ), ), 'tc_sticky_header' => array( 'default' => 1, 'control' => 'TC_controls' , 'title' => __( 'Sticky header settings' , 'customizr'), 'label' => __( "Sticky on scroll" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 30, 'transport' => 'postMessage', 'notice' => __( 'If checked, this option makes the header stick to the top of the page on scroll down.' , 'customizr' ) ), 'tc_sticky_show_tagline' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Sticky header : display the tagline" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 40, 'transport' => 'postMessage', ), 'tc_sticky_show_title_logo' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Sticky header : display the title / logo" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 50, 'transport' => 'postMessage', ), 'tc_sticky_shrink_title_logo' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Sticky header : shrink title / logo" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 60, 'transport' => 'postMessage', ), 'tc_sticky_show_menu' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Sticky header : display the menu" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 60, 'transport' => 'postMessage', 'notice' => __('Also applied to the secondary menu if any.' , 'customizr') ), 'tc_sticky_transparent_on_scroll' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Sticky header : semi-transparent on scroll" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'checkbox' , 'priority' => 67, 'transport' => 'postMessage', ), 'tc_sticky_z_index' => array( 'default' => 100, 'control' => 'TC_controls' , 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'label' => __( "Set the header z-index" , "customizr" ), 'section' => 'header_layout_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 70, 'transport' => 'postMessage', 'notice' => sprintf('%1$s <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index" target="_blank">%2$s</a> ?', __( "What is" , 'customizr' ), __( "the z-index" , 'customizr') ), ) ); } /*----------------------------------------------------------------------------------------------------- NAVIGATION SECTION ------------------------------------------------------------------------------------------------------*/ //NOTE : priorities 10 and 20 are "used" bu menus main and secondary function tc_navigation_option_map( $get_default = null ) { return array( 'tc_display_second_menu' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Display a secondary (horizontal) menu in the header." , "customizr" ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 15,//must be located between the two menus 'notice' => __( "When you've set your main menu as a vertical side navigation, you can check this option to display a complementary horizontal menu in the header." , 'customizr' ), ), 'tc_menu_style' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.4.0', '1.2.0' ) ? 'navbar' : 'aside', 'control' => 'TC_controls' , 'title' => __( 'Main menu design' , 'customizr'), 'label' => __( 'Select a design : side menu (vertical) or regular (horizontal)' , 'customizr' ), 'section' => 'nav' , 'type' => 'select', 'choices' => array( 'navbar' => __( 'Regular (horizontal)' , 'customizr' ), 'aside' => __( 'Side Menu (vertical)' , 'customizr' ), ), 'priority' => 30 ), 'tc_menu_resp_dropdown_limit_to_viewport' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => sprintf('<span class="dashicons dashicons-smartphone"></span> %s', __( "For mobile devices (responsive), limit the height of the dropdown menu block to the visible viewport." , "customizr" ) ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 35, //'transport' => 'postMessage', ), 'tc_display_menu_label' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Display a label next to the menu button." , "customizr" ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 45, 'notice' => __( 'Note : the label is hidden on mobile devices.' , 'customizr' ), ), 'tc_menu_position' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.4.0', '1.2.0' ) ? 'pull-menu-left' : 'pull-menu-right', 'control' => 'TC_controls' , 'label' => __( 'Menu position (for "main" menu)' , "customizr" ), 'section' => 'nav' , 'type' => 'select' , 'choices' => array( 'pull-menu-left' => __( 'Menu on the left' , 'customizr' ), 'pull-menu-right' => __( 'Menu on the right' , 'customizr' ) ), 'priority' => 50, 'transport' => 'postMessage', 'notice' => sprintf( '%1$s<br/><br/>%2$s', __( 'When the menu style is set to "Side Menu", the menu position is the side on which the menu will be revealed.' , 'customizr' ), sprintf( __("To change the global header layout, %s" , "customizr"), sprintf( '<a href="%1$s" title="%3$s">%2$s &raquo;</a>', "javascript:wp.customize.section('header_layout_sec').focus();", __("jump to the Design and Layout section" , "customizr"), __("Change the header layout", "customizr") ) ) ) ), 'tc_second_menu_position' => array( 'default' => 'pull-menu-left', 'control' => 'TC_controls' , 'title' => __( 'Secondary (horizontal) menu design' , 'customizr'), 'label' => __( 'Menu position (for the horizontal menu)' , "customizr" ), 'section' => 'nav' , 'type' => 'select' , 'choices' => array( 'pull-menu-left' => __( 'Menu on the left' , 'customizr' ), 'pull-menu-right' => __( 'Menu on the right' , 'customizr' ) ), 'priority' => 55, 'transport' => 'postMessage' ), //The hover menu type has been introduced in v3.1.0. //For users already using the theme (no theme's option set), the default choice is click, for new users, it is hover. 'tc_menu_type' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.1.0' , '1.0.0' ) ? 'click' : 'hover', 'control' => 'TC_controls' , 'label' => __( 'Select a submenu expansion option' , 'customizr' ), 'section' => 'nav' , 'type' => 'select' , 'choices' => array( 'click' => __( 'Expand submenus on click' , 'customizr'), 'hover' => __( 'Expand submenus on hover' , 'customizr' ), ), 'priority' => 60 ), 'tc_menu_submenu_fade_effect' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Reveal the sub-menus blocks with a fade effect" , "customizr" ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 70, 'transport' => 'postMessage', ), 'tc_menu_submenu_item_move_effect' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Hover move effect for the sub menu items" , "customizr" ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 80, 'transport' => 'postMessage', ), 'tc_second_menu_resp_setting' => array( 'default' => 'in-sn-before', 'control' => 'TC_controls' , 'label' => sprintf('<span class="dashicons dashicons-smartphone"></span> %s', __( "Choose a mobile devices (responsive) behaviour for the secondary menu." , "customizr" ) ), 'section' => 'nav', 'type' => 'select', 'choices' => array( 'in-sn-before' => __( 'Move before inside the side menu ' , 'customizr'), 'in-sn-after' => __( 'Move after inside the side menu ' , 'customizr'), 'display-in-header' => __( 'Display in the header' , 'customizr'), 'hide' => __( 'Hide' , 'customizr' ), ), 'priority' => 90, // 'notice' => __( 'Note : the label is hidden on mobile devices.' , 'customizr' ), ), 'tc_hide_all_menus' => array( 'default' => 0, 'control' => 'TC_controls' , 'title' => __( 'Remove all the menus.' , 'customizr'), 'label' => __( "Don't display any menus in the header of your website" , "customizr" ), 'section' => 'nav' , 'type' => 'checkbox' , 'priority' => 100,//must be located between the two menus 'notice' => __( 'Use with caution : provide an alternative way to navigate in your website for your users.' , 'customizr' ), ), ); //end of navigation options } /****************************************************************************************************** ******************************************************************************************************* * PANEL : CONTENT ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- FRONT PAGE SECTION ------------------------------------------------------------------------------------------------------*/ function tc_front_page_option_map( $get_default = null ) { //prepare the cat picker notice global $wp_version; $_cat_picker_notice = sprintf( '%1$s <a href="%2$s" target="_blank">%3$s<span style="font-size: 17px;" class="dashicons dashicons-external"></span></a>' , __( "Click inside the above field and pick post categories you want to display. No filter will be applied if empty.", 'customizr'), esc_url('codex.wordpress.org/Posts_Categories_SubPanel'), __('Learn more about post categories in WordPress' , 'customizr') ); //for wp version >= 4.3 add deep links if ( ! version_compare( $wp_version, '4.3', '<' ) ) { $_cat_picker_notice = sprintf( '%1$s<br/><br/><ul><li>%2$s</li><li>%3$s</li></ul>', $_cat_picker_notice, sprintf( '%1$s <a href="%2$s">%3$s &raquo;</a>', __("Set the number of posts to display" , "customizr"), "javascript:wp.customize.section('frontpage_sec').container.find('.customize-section-back').trigger('click'); wp.customize.control('posts_per_page').focus();", __("here", "customizr") ), sprintf( '%1$s <a href="%2$s">%3$s &raquo;</a>', __('Jump to the blog design options' , 'customizr'), "javascript:wp.customize.section('frontpage_sec').container.find('.customize-section-back').trigger('click'); wp.customize.control('tc_theme_options[tc_post_list_grid]').focus();", __("here", "customizr") ) ); } return array( //title 'homecontent_title' => array( 'setting_type' => null, 'control' => 'TC_controls' , 'title' => __( 'Choose content and layout' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'title' , 'priority' => 0, ), //show on front 'show_on_front' => array( 'label' => __( 'Front page displays' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'select' , 'priority' => 1, 'choices' => array( 'nothing' => __( 'Don\'t show any posts or page' , 'customizr'), 'posts' => __( 'Your latest posts' , 'customizr'), 'page' => __( 'A static page' , 'customizr' ), ), ), //page on front 'page_on_front' => array( 'label' => __( 'Front page' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'dropdown-pages' , 'priority' => 1, ), //page for posts 'page_for_posts' => array( 'label' => __( 'Posts page' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'dropdown-pages' , 'priority' => 1, ), 'tc_show_post_navigation_home' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display navigation in your home blog" , "customizr" ), 'section' => 'frontpage_sec', 'type' => 'checkbox', 'priority' => 1, 'transport' => 'postMessage', ), //page for posts 'tc_blog_restrict_by_cat' => array( 'default' => array(), 'label' => __( 'Apply a category filter to your home / blog posts' , 'customizr' ), 'section' => 'frontpage_sec', 'control' => 'TC_Customize_Multipicker_Categories_Control', 'type' => 'tc_multiple_picker', 'priority' => 1, 'notice' => $_cat_picker_notice ), //layout 'tc_front_layout' => array( 'default' => 'f' ,//Default layout for home page is full width 'label' => __( 'Set up the front page layout' , 'customizr' ), 'section' => 'frontpage_sec' , 'control' => 'TC_controls' , 'type' => 'select' , 'choices' => $this -> tc_layout_choices(), 'priority' => 2, ), //select slider 'tc_front_slider' => array( 'default' => 'demo' , 'control' => 'TC_controls' , 'title' => __( 'Slider options' , 'customizr' ), 'label' => __( 'Select front page slider' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'select' , //!important 'choices' => ( true == $get_default ) ? null : $this -> tc_slider_choices(), 'priority' => 20 ), //posts slider 'tc_posts_slider_number' => array( 'default' => 1 , 'control' => 'TC_controls', 'label' => __('Number of posts to display', 'customizr'), 'section' => 'frontpage_sec' , 'type' => 'number', 'priority' => 22, 'notice' => __( "Only the posts with a featured image or at least an image inside their content will qualify for the slider. The number of post slides displayed won't exceed the number of available posts in your website.", 'customizr' ) ), 'tc_posts_slider_stickies' => array( 'default' => 0, 'control' => 'TC_controls', 'label' => __( 'Include only sticky posts' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 23, 'notice' => sprintf('%1$s <a href="https://codex.wordpress.org/Sticky_Posts" target="_blank">%2$s</a>', __( 'You can choose to display only the sticky posts. If you\'re not sure how to set a sticky post, check', 'customizr' ), __('the WordPress documentation.', 'customizr' ) ) ), 'tc_posts_slider_title' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( 'Display the title' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 24, 'notice' => __( 'The title will be limited to 80 chars max', 'customizr' ), ), 'tc_posts_slider_text' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( 'Display the excerpt' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 25, 'notice' => __( 'The excerpt will be limited to 80 chars max', 'customizr' ), ), 'tc_posts_slider_link' => array( 'default' => 'cta', 'control' => 'TC_controls', 'label' => __( 'Link post with' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'select' , 'choices' => array( 'cta' => __('Call to action button', 'customizr' ), 'slide' => __('Entire slide', 'customizr' ), 'slide_cta' => __('Entire slide and call to action button', 'customizr' ) ), 'priority' => 26, ), 'tc_posts_slider_button_text' => array( 'default' => __( 'Read more &raquo;' , 'customizr' ), 'label' => __( 'Button text' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'text' , 'priority' => 28, 'notice' => __( 'The button text will be limited to 80 chars max. Leave this field empty to hide the button', 'customizr' ), ), //select slider 'tc_slider_width' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Full width slider' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 30, 'notice' => __( "When checked, the front page slider occupies the full viewport's width", 'customizr' ), ), //Delay between each slides 'tc_slider_delay' => array( 'default' => 5000, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( 'Delay between each slides' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'number' , 'step' => 500, 'min' => 1000, 'notice' => __( 'in ms : 1000ms = 1s' , 'customizr' ), 'priority' => 50, ), 'tc_slider_default_height' => array( 'default' => 500, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( "Set slider's height in pixels" , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 52, 'transport' => 'postMessage' ), 'tc_slider_default_height_apply_all' => array( 'default' => 1, 'label' => __( 'Apply this height to all sliders' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 53, ), 'tc_slider_change_default_img_size' => array( 'default' => 0, 'label' => __( "Replace the default image slider's height" , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'priority' => 54, 'notice' => sprintf('%1$s <a href="http://docs.presscustomizr.com/article/74-recommended-plugins-for-the-customizr-wordpress-theme/#images" target="_blank">%2$s</a>', __( "If this option is checked, your images will be resized with your custom height on upload. This is better for your overall loading performance." , 'customizr' ), __( "You might want to regenerate your thumbnails." , 'customizr') ), ), //Front page widget area 'tc_show_featured_pages' => array( 'default' => 1, 'control' => 'TC_controls' , 'title' => __( 'Featured pages options' , 'customizr' ), 'label' => __( 'Display home featured pages area' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'select' , 'choices' => array( 1 => __( 'Enable' , 'customizr' ), 0 => __( 'Disable' , 'customizr' ), ), 'priority' => 55, ), //display featured page images 'tc_show_featured_pages_img' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Show images' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'checkbox' , 'notice' => __( 'The images are set with the "featured image" of each pages (in the page edit screen). Uncheck the option above to disable the featured page images.' , 'customizr' ), 'priority' => 60, ), //display featured page images 'tc_featured_page_button_text' => array( 'default' => __( 'Read more &raquo;' , 'customizr' ), 'transport' => 'postMessage', 'label' => __( 'Button text' , 'customizr' ), 'section' => 'frontpage_sec' , 'type' => 'text' , 'priority' => 65, ) );//end of front_page_options } /*----------------------------------------------------------------------------------------------------- PAGES AND POST LAYOUT SETTINGS ------------------------------------------------------------------------------------------------------*/ function tc_layout_option_map( $get_default = null ) { return array( //Global sidebar layout 'tc_sidebar_global_layout' => array( 'default' => 'l' ,//Default sidebar layout is on the left 'label' => __( 'Choose the global default layout' , 'customizr' ), 'section' => 'post_layout_sec' , 'type' => 'select' , 'choices' => $this -> tc_layout_choices(), 'notice' => __( 'Note : the home page layout has to be set in the home page section' , 'customizr' ), 'priority' => 10 ), //force default layout on every posts 'tc_sidebar_force_layout' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( 'Force default layout everywhere' , 'customizr' ), 'section' => 'post_layout_sec' , 'type' => 'checkbox' , 'notice' => __( 'This option will override the specific layouts on all posts/pages, including the front page.' , 'customizr' ), 'priority' => 20 ), //Post sidebar layout 'tc_sidebar_post_layout' => array( 'default' => 'l' ,//Default sidebar layout is on the left 'label' => __( 'Choose the posts default layout' , 'customizr' ), 'section' => 'post_layout_sec' , 'type' => 'select' , 'choices' => $this -> tc_layout_choices(), 'priority' => 30 ), //Post per page 'posts_per_page' => array( 'default' => get_option( 'posts_per_page' ), 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'title' => __( 'Global Post Lists Settings' , 'customizr' ), 'label' => __( 'Maximum number of posts per page' , 'customizr' ), 'section' => 'post_lists_sec' , 'type' => 'number' , 'step' => 1, 'min' => 1, 'priority' => 10, ), //Post list length 'tc_post_list_length' => array( 'default' => 'excerpt', 'label' => __( 'Select the length of posts in lists (home, search, archives, ...)' , 'customizr' ), 'section' => 'post_lists_sec' , 'type' => 'select' , 'choices' => array( 'excerpt' => __( 'Display the excerpt' , 'customizr' ), 'full' => __( 'Display the full content' , 'customizr' ) ), 'priority' => 20, ), //Page sidebar layout 'tc_sidebar_page_layout' => array( 'default' => 'l' ,//Default sidebar layout is on the left 'label' => __( 'Choose the pages default layout' , 'customizr' ), 'section' => 'post_layout_sec' , 'type' => 'select' , 'choices' => $this -> tc_layout_choices(), 'priority' => 40, 'notice' => sprintf('<br/> %s<br/>%s', sprintf( __("The above layout options will set your layout globally for your post and pages. But you can also define the layout for each post and page individually. Learn how in the %s.", "customizr"), sprintf('<a href="%1$s" title="%2$s" target="_blank">%2$s<span style="font-size: 17px;" class="dashicons dashicons-external"></span></a>' , esc_url('http://docs.presscustomizr.com/article/107-customizr-theme-options-pages-and-posts-layout'), __("Customizr theme documentation" , "customizr" ) ) ), sprintf( __("If you need to change the layout design of the front page, then open the 'Front Page' section above this one.", "customizr") ) ) ), );//end of layout_options } /*----------------------------------------------------------------------------------------------------- POST LISTS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_post_list_option_map( $get_default = null ) { global $wp_version; return array( 'tc_post_list_excerpt_length' => array( 'default' => 50, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( "Set the excerpt length (in number of words) " , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 23 ), 'tc_post_list_show_thumb' => array( 'default' => 1, 'control' => 'TC_controls' , 'title' => __( 'Thumbnails options' , 'customizr' ), 'label' => __( "Display the post thumbnails" , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 68, 'notice' => sprintf( '%s %s' , __( 'When this option is checked, the post thumbnails are displayed in all post lists : blog, archives, author page, search pages, ...' , 'customizr' ), __( 'Note : thumbnails are always displayed when the grid layout is choosen.' , 'customizr') ) ), 'tc_post_list_use_attachment_as_thumb' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "If no featured image is set, use the last image attached to this post." , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 70 ), 'tc_post_list_default_thumb' => array( 'control' => version_compare( $wp_version, '4.3', '>=' ) ? 'TC_Customize_Cropped_Image_Control' : 'TC_Customize_Upload_Control', 'label' => __( 'Upload a default thumbnail' , 'customizr' ), 'section' => 'post_lists_sec' , 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), //we can define suggested cropping area and allow it to be flexible (def 150x150 and not flexible) 'width' => 570, 'height' => 350, 'flex_width' => true, 'flex_height' => true, //to keep the selected cropped size 'dst_width' => false, 'dst_height' => false, 'priority' => 73 ), 'tc_post_list_thumb_shape' => array( 'default' => 'rounded', 'control' => 'TC_controls' , 'title' => __( 'Thumbnails options for the alternate thumbnails layout' , 'customizr' ), 'label' => __( "Thumbnails shape" , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'select' , 'choices' => array( 'rounded' => __( 'Rounded, expand on hover' , 'customizr'), 'rounded-expanded' => __( 'Rounded, no expansion' , 'customizr'), 'squared' => __( 'Squared, expand on hover' , 'customizr'), 'squared-expanded' => __( 'Squared, no expansion' , 'customizr'), 'rectangular' => __( 'Rectangular with no effect' , 'customizr' ), 'rectangular-blurred' => __( 'Rectangular with blur effect on hover' , 'customizr' ), 'rectangular-unblurred' => __( 'Rectangular with unblur effect on hover' , 'customizr'), ), 'priority' => 77 ), 'tc_post_list_thumb_height' => array( 'default' => 250, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( "Set the thumbnail's max height in pixels" , 'customizr' ), 'section' => 'post_lists_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 80, 'transport' => 'postMessage' ), 'tc_post_list_thumb_position' => array( 'default' => 'right', 'control' => 'TC_controls' , 'label' => __( "Thumbnails position" , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'select' , 'choices' => array( 'top' => __( 'Top' , 'customizr' ), 'right' => __( 'Right' , 'customizr' ), 'bottom' => __( 'Bottom' , 'customizr' ), 'left' => __( 'Left' , 'customizr' ), ), 'priority' => 90 ), 'tc_post_list_thumb_alternate' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Alternate thumbnail/content" , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 95 ), /* ARCHIVE TITLES */ 'tc_cat_title' => array( 'default' => '', 'title' => __( 'Archive titles' , 'customizr' ), 'label' => __( 'Category pages titles' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'post_lists_sec' , 'type' => 'text' , 'priority' => 100 //'notice' => __( 'Will be hidden if empty' , 'customizr' ) ), 'tc_tag_title' => array( 'default' => '', 'label' => __( 'Tag pages titles' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'post_lists_sec' , 'type' => 'text' , 'priority' => 105 //'notice' => __( 'Will be hidden if empty' , 'customizr' ) ), 'tc_author_title' => array( 'default' => '', 'label' => __( 'Author pages titles' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'post_lists_sec' , 'type' => 'text' , 'priority' => 110 //'notice' => __( 'Will be hidden if empty' , 'customizr' ) ), 'tc_search_title' => array( 'default' => __( 'Search Results for :' , 'customizr' ), 'label' => __( 'Search results page titles' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'post_lists_sec' , 'type' => 'text' , 'priority' => 115 //'notice' => __( 'Will be hidden if empty' , 'customizr' ) ), 'tc_post_list_grid' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.2.18', '1.0.13' ) ? 'alternate' : 'grid', 'control' => 'TC_controls' , 'title' => __( 'Post List Design' , 'customizr' ), 'label' => __( 'Select a Layout' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'select', 'choices' => array( 'alternate' => __( 'Alternate thumbnails layout' , 'customizr'), 'grid' => __( 'Grid layout' , 'customizr') ), 'priority' => 40, 'notice' => __( 'When you select the grid Layout, the post content is limited to the excerpt.' , 'customizr' ), ), 'tc_grid_columns' => array( 'default' => '3', 'control' => 'TC_controls' , 'label' => __( 'Number of columns per row' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'select', 'choices' => array( '1' => __( '1' , 'customizr'), '2' => __( '2' , 'customizr'), '3' => __( '3' , 'customizr'), '4' => __( '4' , 'customizr') ), 'priority' => 45, 'notice' => __( 'Note : columns are limited to 3 for single sidebar layouts and to 2 for double sidebar layouts.' , 'customizr' ) ), 'tc_grid_expand_featured' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Expand the last sticky post (for home and blog page only)' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 47 ), 'tc_grid_in_blog' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Apply the grid layout to Home/Blog' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 57 ), 'tc_grid_in_archive' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Apply the grid layout to Archives (archives, categories, author posts)' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 58 ), 'tc_grid_in_search' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Apply the grid layout to Search results' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 60, 'notice' => __( 'Unchecked contexts are displayed with the alternate thumbnails layout.' , 'customizr' ), ), 'tc_grid_shadow' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Apply a shadow to each grid items' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 61, 'transport' => 'postMessage' ), 'tc_grid_bottom_border' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Apply a colored bottom border to each grid items' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 62, 'transport' => 'postMessage' ), 'tc_grid_icons' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( 'Display post format icons in the background' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'checkbox', 'priority' => 63, 'transport' => 'postMessage' ), 'tc_grid_num_words' => array( 'default' => 10, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( 'Max. length for post titles (in words)' , "customizr" ), 'section' => 'post_lists_sec' , 'type' => 'number' , 'step' => 1, 'min' => 1, 'priority' => 64 ), 'tc_grid_thumb_height' => array( 'default' => 350, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'title' => __( 'Thumbnails max height for the grid layout' , 'customizr' ), 'label' => __( "Set the post grid thumbnail's max height in pixels" , 'customizr' ), 'section' => 'post_lists_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 65 //'transport' => 'postMessage' ) ); } /*----------------------------------------------------------------------------------------------------- SINGLE POSTS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_single_post_option_map( $get_default = null ) { return array( 'tc_single_post_thumb_location' => array( 'default' => 'hide', 'control' => 'TC_controls' , 'label' => __( "Post thumbnail position" , "customizr" ), 'section' => 'single_posts_sec' , 'type' => 'select' , 'choices' => array( 'hide' => __( "Don't display" , 'customizr' ), '__before_main_wrapper|200' => __( 'Before the title in full width' , 'customizr' ), '__before_content|0' => __( 'Before the title boxed' , 'customizr' ), '__after_content_title|10' => __( 'After the title' , 'customizr' ), ), 'priority' => 10, 'notice' => sprintf( '%s<br/>%s', __( 'You can display the featured image (also called the post thumbnail) of your posts before their content, when they are displayed individually.' , 'customizr' ), sprintf( __( "Don't know how to set a featured image to a post? Learn how in the %s.", "customizr" ), sprintf('<a href="%1$s" title="%2$s" target="_blank">%2$s<span style="font-size: 17px;" class="dashicons dashicons-external"></span></a>' , esc_url('codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail'), __("WordPress documentation" , "customizr" ) ) ) ) ), 'tc_single_post_thumb_height' => array( 'default' => 250, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( "Set the thumbnail's max height in pixels" , 'customizr' ), 'section' => 'single_posts_sec' , 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 20, 'transport' => 'postMessage' ) ); } /*----------------------------------------------------------------------------------------------------- BREADCRUMB SECTION ------------------------------------------------------------------------------------------------------*/ function tc_breadcrumb_option_map( $get_default = null ) { return array( 'tc_breadcrumb' => array( 'default' => 1,//Breadcrumb is checked by default 'label' => __( 'Display Breadcrumb' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'breadcrumb_sec' , 'type' => 'checkbox' , 'priority' => 1, ), 'tc_show_breadcrumb_home' => array( 'default' => 0, 'control' => 'TC_controls' , 'label' => __( "Display the breadcrumb on home page" , "customizr" ), 'section' => 'breadcrumb_sec' , 'type' => 'checkbox' , 'priority' => 20 ), 'tc_show_breadcrumb_in_pages' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display the breadcrumb in pages" , "customizr" ), 'section' => 'breadcrumb_sec' , 'type' => 'checkbox' , 'priority' => 30 ), 'tc_show_breadcrumb_in_single_posts' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display the breadcrumb in single posts" , "customizr" ), 'section' => 'breadcrumb_sec' , 'type' => 'checkbox' , 'priority' => 40 ), 'tc_show_breadcrumb_in_post_lists' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display the breadcrumb in posts lists : blog page, archives, search results..." , "customizr" ), 'section' => 'breadcrumb_sec' , 'type' => 'checkbox' , 'priority' => 50 ) ); } /*----------------------------------------------------------------------------------------------------- POST METAS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_post_metas_option_map( $get_default = null ){ return array( 'tc_show_post_metas' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts metas" , "customizr" ), 'section' => 'post_metas_sec' , 'type' => 'checkbox', 'notice' => __( 'When this option is checked, the post metas (like taxonomies, date and author) are displayed below the post titles.' , 'customizr' ), 'priority' => 5, 'transport' => 'postMessage' ), 'tc_post_metas_design' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.2' , '1.0.11' ) ? 'buttons' : 'no-buttons', 'control' => 'TC_controls' , 'title' => __( 'Metas Design' , 'customizr' ), 'label' => __( "Select a design for the post metas" , "customizr" ), 'section' => 'post_metas_sec' , 'type' => 'select' , 'choices' => array( 'buttons' => __( 'Buttons and text' , 'customizr' ), 'no-buttons' => __( 'Text only' , 'customizr' ) ), 'priority' => 10 ), 'tc_show_post_metas_home' => array( 'default' => 0, 'control' => 'TC_controls' , 'title' => __( 'Select the contexts' , 'customizr' ), 'label' => __( "Display posts metas on home" , "customizr" ), 'section' => 'post_metas_sec' , 'type' => 'checkbox', 'priority' => 15, 'transport' => 'postMessage' ), 'tc_show_post_metas_single_post' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts metas for single posts" , "customizr" ), 'section' => 'post_metas_sec' , 'type' => 'checkbox', 'priority' => 20, 'transport' => 'postMessage' ), 'tc_show_post_metas_post_lists' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts metas in post lists (archives, blog page)" , "customizr" ), 'section' => 'post_metas_sec' , 'type' => 'checkbox', 'priority' => 25, 'transport' => 'postMessage' ), 'tc_show_post_metas_categories' => array( 'default' => 1, 'control' => 'TC_controls', 'title' => __( 'Select the metas to display' , 'customizr' ), 'label' => __( "Display hierarchical taxonomies (like categories)" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 30 ), 'tc_show_post_metas_tags' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( "Display non-hierarchical taxonomies (like tags)" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 35 ), 'tc_show_post_metas_publication_date' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( "Display the publication date" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 40 ), 'tc_show_post_metas_author' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( "Display the author" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 45 ), 'tc_show_post_metas_update_date' => array( 'default' => 0, 'control' => 'TC_controls', 'label' => __( "Display the update date" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 50, 'notice' => __( 'If this option is checked, additional date informations about the the last post update can be displayed (nothing will show up if the post has never been updated).' , 'customizr' ), ), 'tc_post_metas_update_date_format' => array( 'default' => 'days', 'control' => 'TC_controls', 'label' => __( "Select the last update format" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'select' , 'choices' => array( 'days' => __( 'Nb of days since last update' , 'customizr' ), 'date' => __( 'Date of the last update' , 'customizr' ) ), 'priority' => 55 ), 'tc_post_metas_update_notice_in_title' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.2' , '1.0.11' ) ? 1 : 0, 'control' => 'TC_controls', 'title' => __( 'Recent update notice after post titles' , 'customizr' ), 'label' => __( "Display a recent update notice" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'checkbox', 'priority' => 65, 'notice' => __( 'If this option is checked, a customizable recent update notice is displayed next to the post title.' , 'customizr' ) ), 'tc_post_metas_update_notice_interval' => array( 'default' => 10, 'control' => 'TC_controls', 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'label' => __( "Display the notice if the last update is less (strictly) than n days old" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'number' , 'step' => 1, 'min' => 0, 'priority' => 70, 'notice' => __( 'Set a maximum interval (in days) during which the last update notice will be displayed.' , 'customizr' ), ), 'tc_post_metas_update_notice_text' => array( 'default' => __( "Recently updated !" , "customizr" ), 'control' => 'TC_controls', 'label' => __( "Update notice text" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'text', 'priority' => 75, 'transport' => 'postMessage' ), 'tc_post_metas_update_notice_format' => array( 'default' => 'label-default', 'control' => 'TC_controls', 'label' => __( "Update notice style" , "customizr" ), 'section' => 'post_metas_sec', 'type' => 'select' , 'choices' => array( 'label-default' => __( 'Default (grey)' , 'customizr' ), 'label-success' => __( 'Success (green)' , 'customizr' ), 'label-warning' => __( 'Alert (orange)' , 'customizr' ), 'label-important' => __( 'Important (red)' , 'customizr' ), 'label-info' => __( 'Info (blue)' , 'customizr' ) ), 'priority' => 80, 'transport' => 'postMessage' ) ); } /*----------------------------------------------------------------------------------------------------- GALLERY SECTION -----------------------------------------------------------------------------------------------------*/ function tc_gallery_option_map( $get_default = null ){ return array( 'tc_enable_gallery' => array( 'default' => 1, 'label' => __('Enable Customizr galleries' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply Customizr effects to galleries images" , "customizr" ), 'section' => 'galleries_sec' , 'type' => 'checkbox', 'priority' => 1 ), 'tc_gallery_fancybox'=> array( 'default' => 1, 'label' => __('Enable Lightbox effect in galleries' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply lightbox effects to galleries images" , "customizr" ), 'section' => 'galleries_sec' , 'type' => 'checkbox', 'priority' => 1 ), 'tc_gallery_style'=> array( 'default' => 1, 'label' => __('Enable Customizr effects on hover' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply nice on hover expansion effect to the galleries images" , "customizr" ), 'section' => 'galleries_sec' , 'type' => 'checkbox', 'transport' => 'postMessage', 'priority' => 1 ) ); } /*----------------------------------------------------------------------------------------------------- PARAGRAPHS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_paragraph_option_map( $get_default = null ){ return array( 'tc_enable_dropcap' => array( 'default' => 0, 'title' => __( 'Drop caps', 'customizr'), 'label' => __('Enable drop caps' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply a drop cap to the first paragraph of your post / page content" , "customizr" ), 'section' => 'paragraphs_sec' , 'type' => 'checkbox', 'priority' => 1 ), 'tc_dropcap_minwords' => array( 'default' => 50, 'sanitize_callback' => array( $this , 'tc_sanitize_number' ), 'control' => 'TC_controls' , 'label' => __( "Apply a drop cap when the paragraph includes at least the following number of words :" , "customizr" ), 'notice' => __( "(number of words)" , "customizr" ), 'section' => 'paragraphs_sec' , 'type' => 'number' , 'step' => 1, 'min' => 1, 'priority' => 10 ), 'tc_dropcap_design' => array( 'default' => 'skin-shadow', 'control' => 'TC_controls', 'label' => __( 'Drop cap style' , 'customizr' ), 'section' => 'paragraphs_sec', 'type' => 'select' , 'choices' => array( 'skin-shadow' => __( "Skin color with shadow" , 'customizr' ), 'simple-black' => __( 'Simple black' , 'customizr' ), ), 'priority' => 20, ), 'tc_post_dropcap' => array( 'default' => 0, 'label' => __('Enable drop caps in posts' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply a drop cap to the first paragraph of your single posts content" , "customizr" ), 'section' => 'paragraphs_sec' , 'type' => 'checkbox', 'priority' => 30 ), 'tc_page_dropcap' => array( 'default' => 0, 'label' => __('Enable drop caps in pages' , 'customizr'), 'control' => 'TC_controls' , 'notice' => __( "Apply a drop cap to the first paragraph of your pages" , "customizr" ), 'section' => 'paragraphs_sec' , 'type' => 'checkbox', 'priority' => 40 ) ); } /*----------------------------------------------------------------------------------------------------- COMMENTS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_comment_option_map( $get_default = null ) { return array( 'tc_comment_show_bubble' => array( 'default' => 1, 'title' => __('Comments bubbles' , 'customizr'), 'control' => 'TC_controls' , 'label' => __( "Display the number of comments in a bubble next to the post title" , "customizr" ), 'section' => 'comments_sec' , 'type' => 'checkbox', 'priority' => 1 ), 'tc_comment_bubble_shape' => array( 'default' => 'default', 'control' => 'TC_controls', 'label' => __( 'Comments bubble shape' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'select' , 'choices' => array( 'default' => __( "Small bubbles" , 'customizr' ), 'custom-bubble-one' => __( 'Large bubbles' , 'customizr' ), ), 'priority' => 10, ), 'tc_comment_bubble_color_type' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.2' , '1.0.11' ) ? 'custom' : 'skin', 'control' => 'TC_controls', 'label' => __( 'Comments bubble color' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'select' , 'choices' => array( 'skin' => __( "Skin color" , 'customizr' ), 'custom' => __( 'Custom' , 'customizr' ), ), 'priority' => 20, ), 'tc_comment_bubble_color' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.3.2' , '1.0.11' ) ? '#F00' : TC_utils::$inst -> tc_get_skin_color(), 'control' => 'WP_Customize_Color_Control', 'label' => __( 'Comments bubble color' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'color' , 'priority' => 30, 'sanitize_callback' => array( $this, 'tc_sanitize_hex_color' ), 'sanitize_js_callback' => 'maybe_hash_hex_color', 'transport' => 'postMessage' ), 'tc_page_comments' => array( 'default' => 0, 'control' => 'TC_controls', 'title' => __( 'Other comments settings' , 'customizr'), 'label' => __( 'Enable comments on pages' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'checkbox', 'priority' => 40, 'notice' => sprintf('%1$s<br/> %2$s <a href="%3$s" target="_blank">%4$s</a>', __( 'If checked, this option will enable comments on pages. You can disable comments for a single page in the quick edit mode of the page list screen.' , 'customizr' ), __( "You can also change other comments settings in :" , 'customizr'), admin_url() . 'options-discussion.php', __( 'the discussion settings page.' , 'customizr' ) ), ), 'tc_post_comments' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( 'Enable comments on posts' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'checkbox', 'priority' => 45, 'notice' => sprintf('%1$s <a href="%2$s" target="_blank">%3$s<span style="font-size: 17px;" class="dashicons dashicons-external"></span></a>.<br/>%4$s <a href="%5$s" target="_blank">%6$s</a>', __( 'If checked, this option enables comments on all types of single posts. You can disable comments for a single post in quick edit mode from the' , 'customizr' ), esc_url('codex.wordpress.org/Posts_Screen'), __( 'post screen', 'customizr'), __( "You can also change other comments settings in the" , 'customizr'), admin_url('options-discussion.php'), __( 'discussion settings page.' , 'customizr' ) ), ), 'tc_show_comment_list' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( 'Display the comment list' , 'customizr' ), 'section' => 'comments_sec', 'type' => 'checkbox', 'priority' => 50, 'notice' =>__( 'By default, WordPress displays the past comments, even if comments are disabled in posts or pages. Unchecking this option allows you to not display this comment history.' , 'customizr' ) ) ); } /*----------------------------------------------------------------------------------------------------- POST NAVIGATION SECTION ------------------------------------------------------------------------------------------------------*/ function tc_post_navigation_option_map( $get_default = null ) { return array( 'tc_show_post_navigation' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts navigation" , "customizr" ), 'section' => 'post_navigation_sec' , 'type' => 'checkbox', 'notice' => __( 'When this option is checked, the posts navigation is displayed below the posts' , 'customizr' ), 'priority' => 5, 'transport' => 'postMessage' ), 'tc_show_post_navigation_page' => array( 'default' => 0, 'control' => 'TC_controls' , 'title' => __( 'Select the contexts' , 'customizr' ), 'label' => __( "Display navigation in pages" , "customizr" ), 'section' => 'post_navigation_sec' , 'type' => 'checkbox', 'priority' => 10, 'transport' => 'postMessage' ), 'tc_show_post_navigation_single' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts navigation in single posts" , "customizr" ), 'section' => 'post_navigation_sec' , 'type' => 'checkbox', 'priority' => 20, 'transport' => 'postMessage' ), 'tc_show_post_navigation_archive' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display posts navigation in post lists (archives, blog page, categories, search results ..)" , "customizr" ), 'section' => 'post_navigation_sec' , 'type' => 'checkbox', 'priority' => 25, 'transport' => 'postMessage' ), ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : SIDEBARS ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- SIDEBAR SOCIAL LINKS SETTINGS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_sidebars_option_map( $get_default = null ) { return array( 'tc_social_in_left-sidebar' => array( 'default' => 0, 'label' => __( 'Social links in left sidebar' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'sidebar_socials_sec', 'type' => 'checkbox' , 'priority' => 20, 'transport' => 'postMessage' ), 'tc_social_in_right-sidebar' => array( 'default' => 0, 'label' => __( 'Social links in right sidebar' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'sidebar_socials_sec', 'type' => 'checkbox' , 'priority' => 25, 'transport' => 'postMessage' ), 'tc_social_in_sidebar_title' => array( 'default' => __( 'Social links' , 'customizr' ), 'label' => __( 'Social link title in sidebars' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'sidebar_socials_sec', 'type' => 'text' , 'priority' => 30, 'transport' => 'postMessage', 'notice' => __( 'Will be hidden if empty' , 'customizr' ) ) ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : FOOTER ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- FOOTER GLOBAL SETTINGS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_footer_global_settings_option_map( $get_default = null ) { return array( 'tc_social_in_footer' => array( 'default' => 1, 'label' => __( 'Social links in footer' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'footer_global_sec' , 'type' => 'checkbox' , 'priority' => 0, 'transport' => 'postMessage' ), 'tc_sticky_footer' => array( 'default' => TC_utils::$inst -> tc_user_started_before_version( '3.4.0' , '1.1.14' ) ? 0 : 1, 'control' => 'TC_controls' , 'label' => __( "Stick the footer to the bottom of the page", "customizr" ), 'section' => 'footer_global_sec' , 'type' => 'checkbox', 'priority' => 1, 'transport' => 'postMessage' ), 'tc_show_back_to_top' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Display a back to top arrow on scroll" , "customizr" ), 'section' => 'footer_global_sec' , 'type' => 'checkbox', 'priority' => 5 ) ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : WOOCOMMERCE OPTIONS ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- HEADER CART ------------------------------------------------------------------------------------------------------*/ function tc_woocommerce_option_map( $get_default = null ) { return array( 'tc_woocommerce_header_cart' => array( 'default' => 1, 'label' => __( 'Display the shopping cart in the header' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'tc_woocommerce_sec', 'notice' => __( "You can display a cart icon showing the number of items in your cart next to your header's tagline", 'customizr' ), 'type' => 'checkbox' , 'priority' => 10, ), 'tc_woocommerce_header_cart_sticky' => array( 'default' => 1, 'label' => __( 'Sticky header: display the shopping cart' , 'customizr' ), 'control' => 'TC_controls' , 'section' => 'tc_woocommerce_sec', 'type' => 'checkbox' , 'priority' => 15, 'transport' => 'postMessage' ), ); } /****************************************************************************************************** ******************************************************************************************************* * PANEL : ADVANCED OPTIONS ******************************************************************************************************* ******************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- CUSTOM CSS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_custom_css_option_map( $get_default = null ) { return array( 'tc_custom_css' => array( 'sanitize_callback' => 'wp_filter_nohtml_kses', 'sanitize_js_callback' => 'wp_filter_nohtml_kses', 'control' => 'TC_controls' , 'label' => __( 'Add your custom css here and design live! (for advanced users)' , 'customizr' ), 'section' => 'custom_sec' , 'type' => 'textarea' , 'notice' => sprintf('%1$s <a href="%4$ssnippet/creating-child-theme-customizr/" title="%3$s" target="_blank">%2$s</a>', __( "Use this field to test small chunks of CSS code. For important CSS customizations, you'll want to modify the style.css file of a" , 'customizr' ), __( 'child theme.' , 'customizr'), __( 'How to create and use a child theme ?' , 'customizr'), TC_WEBSITE ), 'transport' => 'postMessage' ), );//end of custom_css_options } /*----------------------------------------------------------------------------------------------------- WEBSITE PERFORMANCES SECTION ------------------------------------------------------------------------------------------------------*/ function tc_performance_option_map( $get_default = null ) { return array( 'tc_minified_skin' => array( 'default' => 1, 'control' => 'TC_controls' , 'label' => __( "Performance : use the minified CSS stylesheets", 'customizr' ), 'section' => 'performances_sec' , 'type' => 'checkbox' , 'notice' => __( 'Using the minified version of the stylesheets will speed up your webpage load time.' , 'customizr' ), ), 'tc_img_smart_load' => array( 'default' => 0, 'label' => __( 'Load images on scroll' , 'customizr' ), 'control' => 'TC_controls', 'section' => 'performances_sec', 'type' => 'checkbox', 'priority' => 20, 'notice' => __('Check this option to delay the loading of non visible images. Images below the viewport will be loaded dynamically on scroll. This can boost performances by reducing the weight of long web pages with images.' , 'customizr') ) ); } /*----------------------------------------------------------------------------------------------------- FRONT END NOTICES AND PLACEHOLDERS SECTION ------------------------------------------------------------------------------------------------------*/ function tc_placeholders_notice_map( $get_default = null ) { return array( 'tc_display_front_help' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( "Display help notices on front-end for logged in users.", 'customizr' ), 'section' => 'placeholder_sec', 'type' => 'checkbox', 'notice' => __( 'When this options is enabled, various help notices and some placeholder blocks are displayed on the front-end of your website. They are only visible by logged in users with administration capabilities.' , 'customizr' ) ) ); } /*----------------------------------------------------------------------------------------------------- FRONT END EXTERNAL RESOURCES SECTION ------------------------------------------------------------------------------------------------------*/ function tc_external_resources_option_map( $get_default = null ) { return array( 'tc_font_awesome_icons' => array( 'default' => 1, 'control' => 'TC_controls', 'label' => __( "Load Font Awesome set of icons", 'customizr' ), 'section' => 'extresources_sec', 'type' => 'checkbox', 'notice' => sprintf('<strong>%1$s</strong>. %2$s', __( 'Use with caution' , 'customizr'), __( 'When checked, the Font Awesome icons will be loaded on front end. You might want to load the Font Awesome icons with a custom code, or let a plugin do it for you.', 'customizr' ) ) ), 'tc_font_awesome_css' => array( 'default' => 0, 'control' => 'TC_controls', 'label' => __( "Load Font Awesome CSS", 'customizr' ), 'section' => 'extresources_sec', 'type' => 'checkbox', 'notice' => sprintf('%1$s </br>%2$s <a href="%3$s" target="_blank">%4$s<span style="font-size: 17px;" class="dashicons dashicons-external"></span></a>.', __( "When checked, the additional Font Awesome CSS stylesheet will be loaded. This stylesheet is not loaded by default to save bandwidth but you might need it if you want to use the whole Font Awesome CSS.", 'customizr' ), __( "Check out some example of uses", 'customizr'), esc_url('http://fontawesome.io/examples/'), __('here', 'customizr') ) ) ); } /*************************************************************** * POPULATE PANELS ***************************************************************/ /** * hook : tc_add_panel_map * @return associative array of customizer panels */ function tc_popul_panels_map( $panel_map ) { $_new_panels = array( 'tc-global-panel' => array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Global settings' , 'customizr' ), 'description' => __( "Global settings for the Customizr theme :skin, socials, links..." , 'customizr' ) ), 'tc-header-panel' => array( 'priority' => 20, 'capability' => 'edit_theme_options', 'title' => __( 'Header' , 'customizr' ), 'description' => __( "Header settings for the Customizr theme." , 'customizr' ) ), 'tc-content-panel' => array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Content : home, posts, ...' , 'customizr' ), 'description' => __( "Content settings for the Customizr theme." , 'customizr' ) ), 'tc-sidebars-panel' => array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Sidebars' , 'customizr' ), 'description' => __( "Sidebars settings for the Customizr theme." , 'customizr' ) ), 'tc-footer-panel' => array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Footer' , 'customizr' ), 'description' => __( "Footer settings for the Customizr theme." , 'customizr' ) ), 'tc-advanced-panel' => array( 'priority' => 1000, 'capability' => 'edit_theme_options', 'title' => __( 'Advanced options' , 'customizr' ), 'description' => __( "Advanced settings for the Customizr theme." , 'customizr' ) ) ); return array_merge( $panel_map, $_new_panels ); } /*************************************************************** * POPULATE REMOVE SECTIONS ***************************************************************/ /** * hook : tc_remove_section_map */ function tc_popul_remove_section_map( $_sections ) { //customizer option array $remove_section = array( 'static_front_page' , 'nav', 'title_tagline', 'tc_page_comments' ); return array_merge( $_sections, $remove_section ); } /*************************************************************** * HANDLES THE THEME SWITCHER (since WP 4.2) ***************************************************************/ /** * Print the themes section (themes switcher) when previewing the themes from wp-admin/themes.php * hook : tc_remove_section_map */ function tc_set_theme_switcher_visibility( $_sections) { //Don't do anything is in preview frame //=> because once the preview is ready, a postMessage is sent to the panel frame to refresh the sections and panels //Do nothing if WP version under 4.2 global $wp_version; if ( TC___::$instance -> tc_is_customize_preview_frame() || ! version_compare( $wp_version, '4.2', '>=') ) return $_sections; //when user access the theme switcher from the admin bar $_theme_switcher_requested = false; if ( isset( $_GET['autofocus'] ) ) { $autofocus = wp_unslash( $_GET['autofocus'] ); if ( is_array( $autofocus ) && isset($autofocus['section']) ) { $_theme_switcher_requested = 'themes' == $autofocus['section']; } } if ( isset($_GET['theme']) || ! is_array($_sections) || $_theme_switcher_requested ) return $_sections; array_push( $_sections, 'themes'); return $_sections; } /*************************************************************** * POPULATE SECTIONS ***************************************************************/ /** * hook : tc_add_section_map */ function tc_popul_section_map( $_sections ) { //For nav menus option $locations = get_registered_nav_menus(); $menus = wp_get_nav_menus(); $num_locations = count( array_keys( $locations ) ); global $wp_version; $nav_section_desc = sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations, 'customizr' ), number_format_i18n( $num_locations ) ); //adapt the nav section description for v4.3 (menu in the customizer from now on) if ( version_compare( $wp_version, '4.3', '<' ) ) { $nav_section_desc .= "<br/>" . sprintf( __("You can create new menu and edit your menu's content %s." , "customizr"), sprintf( '<strong><a href="%1$s" target="_blank" title="%3$s">%2$s &raquo;</a></strong>', admin_url('nav-menus.php'), __("on the Menus screen in the Appearance section" , "customizr"), __("create/edit menus", "customizr") ) ); } else { $nav_section_desc .= "<br/>" . sprintf( __("You can create new menu and edit your menu's content %s." , "customizr"), sprintf( '<strong><a href="%1$s" title="%3$s">%2$s &raquo;</a><strong>', "javascript:wp.customize.section('nav').container.find('.customize-section-back').trigger('click'); wp.customize.panel('nav_menus').focus();", __("in the menu panel" , "customizr"), __("create/edit menus", "customizr") ) ); } $nav_section_desc .= "<br/><br/>". __( 'If a menu location has no menu assigned to it, a default page menu will be used.', 'customizr'); $_new_sections = array( /*--------------------------------------------------------------------------------------------- -> PANEL : GLOBAL SETTINGS ----------------------------------------------------------------------------------------------*/ 'title_tagline' => array( 'title' => __( 'Site Title & Tagline', 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 7 : 0, 'panel' => 'tc-global-panel' ), 'logo_sec' => array( 'title' => __( 'Logo &amp; Favicon' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 8 : 5, 'description' => __( 'Set up logo and favicon options' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'skins_sec' => array( 'title' => __( 'Skin' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 1 : 7, 'description' => __( 'Select a skin for Customizr' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'fonts_sec' => array( 'title' => __( 'Fonts' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 40 : 10, 'description' => __( 'Set up the font global settings' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'socials_sec' => array( 'title' => __( 'Social links' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 9 : 20, 'description' => __( 'Set up your social links' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'links_sec' => array( 'title' => __( 'Links style and effects' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 22 : 30, 'description' => __( 'Various links settings' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'titles_icons_sec' => array( 'title' => __( 'Titles icons settings' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 18 : 40, 'description' => __( 'Set up the titles icons options' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'images_sec' => array( 'title' => __( 'Image settings' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 95 : 50, 'description' => __( 'Various images settings' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'authors_sec' => array( 'title' => __( 'Authors' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 220 : 70, 'description' => __( 'Post authors settings' , 'customizr' ), 'panel' => 'tc-global-panel' ), 'smoothscroll_sec' => array( 'title' => __( 'Smooth Scroll' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 97 : 75, 'description' => __( 'Smooth Scroll settings' , 'customizr' ), 'panel' => 'tc-global-panel' ), /*--------------------------------------------------------------------------------------------- -> PANEL : HEADER ----------------------------------------------------------------------------------------------*/ 'header_layout_sec' => array( 'title' => $this -> is_wp_version_before_4_0 ? __( 'Header design and layout', 'customizr' ) : __( 'Design and layout', 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 5 : 20, 'panel' => 'tc-header-panel' ), 'nav' => array( 'title' => __( 'Navigation Menus' , 'customizr' ), 'theme_supports' => 'menus', 'priority' => $this -> is_wp_version_before_4_0 ? 10 : 40, 'description' => $nav_section_desc, 'panel' => 'tc-header-panel' ), /*--------------------------------------------------------------------------------------------- -> PANEL : CONTENT ----------------------------------------------------------------------------------------------*/ 'frontpage_sec' => array( 'title' => __( 'Front Page' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 12 : 10, 'description' => __( 'Set up front page options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'post_layout_sec' => array( 'title' => __( 'Pages &amp; Posts Layout' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 15 : 15, 'description' => __( 'Set up layout options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'post_lists_sec' => array( 'title' => __( 'Post lists : blog, archives, ...' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 16 : 20, 'description' => __( 'Set up post lists options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'single_posts_sec' => array( 'title' => __( 'Single posts' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 17 : 24, 'description' => __( 'Set up single posts options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'breadcrumb_sec' => array( 'title' => __( 'Breadcrumb' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 11 : 30, 'description' => __( 'Set up breadcrumb options' , 'customizr' ), 'panel' => 'tc-content-panel' ), /*'tc_page_settings' => array( 'title' => __( 'Pages' , 'customizr' ), 'priority' => 25, 'description' => __( 'Set up pages options' , 'customizr' ), 'panel' => 'tc-content-panel' ),*/ 'post_metas_sec' => array( 'title' => __( 'Post metas (category, tags, custom taxonomies)' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 20 : 50, 'description' => __( 'Set up post metas options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'galleries_sec' => array( 'title' => __( 'Galleries' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 20 : 55, 'description' => __( 'Set up gallery options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'paragraphs_sec' => array( 'title' => __( 'Paragraphs' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 20 : 55, 'description' => __( 'Set up paragraphs options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'comments_sec' => array( 'title' => __( 'Comments' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 25 : 60, 'description' => __( 'Set up comments options' , 'customizr' ), 'panel' => 'tc-content-panel' ), 'post_navigation_sec' => array( 'title' => __( 'Post/Page Navigation' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 30 : 65, 'description' => __( 'Set up post/page navigation options' , 'customizr' ), 'panel' => 'tc-content-panel' ), /*--------------------------------------------------------------------------------------------- -> PANEL : SIDEBARS ----------------------------------------------------------------------------------------------*/ 'sidebar_socials_sec' => array( 'title' => __( 'Socials in Sidebars' , 'customizr' ), 'priority' => 10, 'description' => __( 'Set up your social profiles links in the sidebar(s).' , 'customizr' ), 'panel' => 'tc-sidebars-panel' ), 'responsive_sec' => array( 'title' => __( 'Responsive settings' , 'customizr' ), 'priority' => 20, 'description' => __( 'Various settings for responsive display' , 'customizr' ), 'panel' => 'tc-sidebars-panel' ), /*--------------------------------------------------------------------------------------------- -> PANEL : FOOTER ----------------------------------------------------------------------------------------------*/ 'footer_global_sec' => array( 'title' => __( 'Footer global settings' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 40 : 10, 'description' => __( 'Set up footer global options' , 'customizr' ), 'panel' => 'tc-footer-panel' ), /*--------------------------------------------------------------------------------------------- -> PANEL : ADVANCED ----------------------------------------------------------------------------------------------*/ 'custom_sec' => array( 'title' => __( 'Custom CSS' , 'customizr' ), 'priority' => $this -> is_wp_version_before_4_0 ? 100 : 10, 'panel' => 'tc-advanced-panel' ), 'performances_sec' => array( 'title' => __( 'Website Performances' , 'customizr' ), 'priority' => 20, 'description' => __( 'On the web, speed is key ! Improve the load time of your pages with those options.' , 'customizr' ), 'panel' => 'tc-advanced-panel' ), 'placeholder_sec' => array( 'title' => __( 'Front-end placeholders and help blocks' , 'customizr' ), 'priority' => 30, 'panel' => 'tc-advanced-panel' ), 'extresources_sec' => array( 'title' => __( 'Front-end Icons (Font Awesome)' , 'customizr' ), 'priority' => 40, 'panel' => 'tc-advanced-panel' ) ); return array_merge( $_sections, $_new_sections ); } /*************************************************************** * CONTROLS HELPERS ***************************************************************/ /** * Generates the featured pages options * add the settings/controls to the relevant section * hook : tc_front_page_option_map * * @package Customizr * @since Customizr 3.0.15 * */ function tc_generates_featured_pages( $_original_map ) { $default = array( 'dropdown' => array( 'one' => __( 'Home featured page one' , 'customizr' ), 'two' => __( 'Home featured page two' , 'customizr' ), 'three' => __( 'Home featured page three' , 'customizr' ) ), 'text' => array( 'one' => __( 'Featured text one (200 char. max)' , 'customizr' ), 'two' => __( 'Featured text two (200 char. max)' , 'customizr' ), 'three' => __( 'Featured text three (200 char. max)' , 'customizr' ) ) ); //declares some loop's vars and the settings array $priority = 70; $incr = 0; $fp_setting_control = array(); //gets the featured pages id from init $fp_ids = apply_filters( 'tc_featured_pages_ids' , TC_init::$instance -> fp_ids); //dropdown field generator foreach ( $fp_ids as $id ) { $priority = $priority + $incr; $fp_setting_control['tc_featured_page_'. $id] = array( 'label' => isset($default['dropdown'][$id]) ? $default['dropdown'][$id] : sprintf( __('Custom featured page %1$s' , 'customizr' ) , $id ), 'section' => 'frontpage_sec' , 'type' => 'dropdown-pages' , 'priority' => $priority ); $incr += 10; } //text field generator $incr = 10; foreach ( $fp_ids as $id ) { $priority = $priority + $incr; $fp_setting_control['tc_featured_text_' . $id] = array( 'sanitize_callback' => array( $this , 'tc_sanitize_textarea' ), 'transport' => 'postMessage', 'control' => 'TC_controls' , 'label' => isset($default['text'][$id]) ? $default['text'][$id] : sprintf( __('Featured text %1$s (200 char. max)' , 'customizr' ) , $id ), 'section' => 'frontpage_sec' , 'type' => 'textarea' , 'notice' => __( 'You need to select a page first. Leave this field empty if you want to use the page excerpt.' , 'customizr' ), 'priority' => $priority, ); $incr += 10; } return array_merge( $_original_map , $fp_setting_control ); } /** * Generates social network options * Populate the social section map of settings/controls * hook : tc_social_option_map * * @package Customizr * @since Customizr 3.0.15 * */ function tc_generates_socials( $_original_map ) { //gets the social network array $socials = apply_filters( 'tc_default_socials' , TC_init::$instance -> socials ); //declares some loop's vars and the settings array $priority = 50;//start priority $incr = 0; $_new_map = array(); foreach ( $socials as $key => $data ) { $priority += $incr; $type = isset( $data['type'] ) && ! is_null( $data['type'] ) ? $data['type'] : 'url'; $_new_map[$key] = array( 'default' => ( isset($data['default']) && !is_null($data['default']) ) ? $data['default'] : null, 'sanitize_callback' => array( $this , 'tc_sanitize_' . $type ), 'control' => 'TC_controls' , 'label' => ( isset($data['option_label']) ) ? call_user_func( '__' , $data['option_label'] , 'customizr' ) : $key, 'section' => 'socials_sec' , 'type' => $type, 'priority' => $priority, 'icon' => "tc-icon-". str_replace('tc_', '', $key) ); $incr += 5; } return array_merge( $_original_map, $_new_map ); } /** * Generates skin select list * * @package Customizr * @since Customizr 3.0.15 * */ private function tc_get_skins($path) { //checks if path exists if ( !file_exists($path) ) return; //gets the skins from init $default_skin_list = TC_init::$instance -> skins; //declares the skin list array $skin_list = array(); //gets the skins : filters the files with a css extension and generates and array[] : $key = filename.css => $value = filename $files = scandir($path) ; foreach( $files as $file ) { //skips the minified and tc_common if ( false !== strpos($file, '.min.') || false !== strpos($file, 'tc_common') ) continue; if ( $file[0] != '.' && !is_dir($path.$file) ) { if ( substr( $file, -4) == '.css' ) { $skin_list[$file] = isset($default_skin_list[$file]) ? call_user_func( '__' , $default_skin_list[$file] , 'customizr' ) : substr_replace( $file , '' , -4 , 4); } } }//endforeach $_to_return = array(); //Order skins like in the default array foreach( $default_skin_list as $_key => $value ) { if( isset($skin_list[$_key]) ) { $_to_return[$_key] = $skin_list[$_key]; } } //add skins not included in default foreach( $skin_list as $_file => $_name ) { if( ! isset( $_to_return[$_file] ) ) $_to_return[$_file] = $_name; } return $_to_return; }//end of function /** * Returns the layout choices array * * @package Customizr * @since Customizr 3.1.0 */ private function tc_layout_choices() { $global_layout = apply_filters( 'tc_global_layout' , TC_init::$instance -> global_layout ); $layout_choices = array(); foreach ($global_layout as $key => $value) { $layout_choices[$key] = ( $value['customizer'] ) ? call_user_func( '__' , $value['customizer'] , 'customizr' ) : null ; } return $layout_choices; } /** * Retrieves slider names and generate the select list * @package Customizr * @since Customizr 3.0.1 */ private function tc_slider_choices() { $__options = get_option('tc_theme_options'); $slider_names = isset($__options['tc_sliders']) ? $__options['tc_sliders'] : array(); $slider_choices = array( 0 => __( '&mdash; No slider &mdash;' , 'customizr' ), 'demo' => __( '&mdash; Demo Slider &mdash;' , 'customizr' ), 'tc_posts_slider' => __('&mdash; Auto-generated slider from your blog posts &mdash;', 'customizr') ); if ( $slider_names ) { foreach( $slider_names as $tc_name => $slides) { $slider_choices[$tc_name] = $tc_name; } } return $slider_choices; } /** * Returns the list of available skins from child (if exists) and parent theme * * @package Customizr * @since Customizr 3.0.11 * @updated Customizr 3.0.15 */ private function tc_build_skin_list() { $parent_skins = $this -> tc_get_skins(TC_BASE .'inc/assets/css'); $child_skins = ( TC___::$instance -> tc_is_child() && file_exists(TC_BASE_CHILD .'inc/assets/css') ) ? $this -> tc_get_skins(TC_BASE_CHILD .'inc/assets/css') : array(); $skin_list = array_merge( $parent_skins , $child_skins ); return apply_filters( 'tc_skin_list', $skin_list ); } /*************************************************************** * SANITIZATION HELPERS ***************************************************************/ /** * adds sanitization callback funtion : textarea * @package Customizr * @since Customizr 1.1.4 */ function tc_sanitize_textarea( $value) { $value = esc_html( $value); return $value; } /** * adds sanitization callback funtion : number * @package Customizr * @since Customizr 1.1.4 */ function tc_sanitize_number( $value) { if ( ! $value || is_null($value) ) return $value; $value = esc_attr( $value); // clean input $value = (int) $value; // Force the value into integer type. return ( 0 < $value ) ? $value : null; } /** * adds sanitization callback funtion : url * @package Customizr * @since Customizr 1.1.4 */ function tc_sanitize_url( $value) { $value = esc_url( $value); return $value; } /** * adds sanitization callback funtion : email * @package Customizr * @since Customizr 3.4.11 */ function tc_sanitize_email( $value) { return sanitize_email( $value ); } /** * adds sanitization callback funtion : colors * @package Customizr * @since Customizr 1.1.4 */ function tc_sanitize_hex_color( $color ) { if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) return '#' . $unhashed; return $color; } /** * Change upload's path to relative instead of absolute * @package Customizr * @since Customizr 3.1.11 */ function tc_sanitize_uploads( $url ) { $upload_dir = wp_upload_dir(); return str_replace($upload_dir['baseurl'], '', $url); } }//end of class endif;
darespaco/parlaproject
wp-content/themes/customizr/inc/class-fire-utils_settings_map.php
PHP
gpl-2.0
168,403
using UnityEngine; using UnityEditor; using System.Collections; namespace M8.Editor { public class ProjectObjectPlacer : EditorWindow { const string prefKey = "projectobjplace"; static int mDupCounter = 0; private int mAxisInd = 0; private string[] mAxisNames = { "X", "Y", "Z" }; private string[] mLayerMasks; private bool mInv = false; private float mOfs = 0.01f; private int mLayerMask = 0; private GameObject mPrefab; private bool mIsPlacingObject = false; private Transform mPrefabPreviewer; private RaycastHit mHit; private bool mIsHit; private float mRotAxis; private bool mPlaceUnderSelection; private bool mUpdateOriginal; [MenuItem("M8/Tools/ProjectObjectPlacer")] static void DoIt() { EditorWindow.GetWindow(typeof(ProjectObjectPlacer)); } void OnEnable() { mAxisInd = EditorPrefs.GetInt(M8.Editor.Utility.PreferenceKey(prefKey, "axis"), mAxisInd); mInv = EditorPrefs.GetBool(M8.Editor.Utility.PreferenceKey(prefKey, "inv"), mInv); mOfs = EditorPrefs.GetFloat(M8.Editor.Utility.PreferenceKey(prefKey, "ofs"), mOfs); mLayerMask = EditorPrefs.GetInt(M8.Editor.Utility.PreferenceKey(prefKey, "layer"), mLayerMask); if(SceneView.onSceneGUIDelegate != OnSceneGUI) SceneView.onSceneGUIDelegate += OnSceneGUI; mLayerMasks = M8.Editor.Utility.GenerateLayerMaskString(); } void OnDisable() { EditorPrefs.SetInt(M8.Editor.Utility.PreferenceKey(prefKey, "axis"), mAxisInd); EditorPrefs.SetBool(M8.Editor.Utility.PreferenceKey(prefKey, "inv"), mInv); EditorPrefs.SetFloat(M8.Editor.Utility.PreferenceKey(prefKey, "ofs"), mOfs); EditorPrefs.SetInt(M8.Editor.Utility.PreferenceKey(prefKey, "layer"), mLayerMask); if(mPrefabPreviewer != null) { DestroyImmediate(mPrefabPreviewer.gameObject); mPrefabPreviewer = null; } SceneView.onSceneGUIDelegate -= OnSceneGUI; } void OnFocus() { mLayerMasks = M8.Editor.Utility.GenerateLayerMaskString(); } void OnSelectionChange() { Repaint(); } void OnGUI() { GUILayout.BeginVertical(); EditorGUIUtility.LookLikeControls(20, 50); GUILayout.BeginHorizontal(); //axis select GUILayout.BeginHorizontal(GUI.skin.box); mAxisInd = GUILayout.SelectionGrid(mAxisInd, mAxisNames, mAxisNames.Length, GUI.skin.toggle); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(GUI.skin.box); mInv = GUILayout.Toggle(mInv, "Inv", GUILayout.MaxWidth(35)); GUILayout.EndHorizontal(); GUILayout.EndHorizontal(); //offset GUILayout.BeginHorizontal(GUI.skin.box); mRotAxis = EditorGUILayout.FloatField("rot", mRotAxis); mOfs = EditorGUILayout.FloatField("ofs", mOfs); GUILayout.EndHorizontal(); //layer mLayerMask = EditorGUILayout.MaskField(mLayerMask, mLayerMasks); //prefab EditorGUIUtility.LookLikeControls(); GameObject prevPrefab = mPrefab; mPrefab = EditorGUILayout.ObjectField("Object", mPrefab, typeof(GameObject), true) as GameObject; if(mPrefab != prevPrefab) { mIsPlacingObject = false; if(mPrefabPreviewer != null) { DestroyImmediate(mPrefabPreviewer.gameObject); mPrefabPreviewer = null; } } bool prevEnabled = GUI.enabled; // GUILayout.BeginVertical(GUI.skin.box); GUI.enabled = prevEnabled && mPrefab != null && Selection.activeGameObject != null && PrefabUtility.GetPrefabType(Selection.activeGameObject) != PrefabType.Prefab && PrefabUtility.GetPrefabType(Selection.activeGameObject) != PrefabType.ModelPrefab && (PrefabUtility.GetPrefabType(mPrefab) == PrefabType.Prefab || PrefabUtility.GetPrefabType(mPrefab) == PrefabType.ModelPrefab); mPlaceUnderSelection = GUILayout.Toggle(mPlaceUnderSelection, "Place under selection."); GUI.enabled = prevEnabled && mPrefab != null && PrefabUtility.GetPrefabType(mPrefab) != PrefabType.Prefab && PrefabUtility.GetPrefabType(mPrefab) != PrefabType.ModelPrefab; mUpdateOriginal = GUILayout.Toggle(mUpdateOriginal, "Update object."); GUILayout.EndVertical(); //do it GUI.enabled = prevEnabled && mPrefab != null; if(GUILayout.Button(mIsPlacingObject ? "Stop Placing Object" : "Start Placing Object")) { if(mPrefabPreviewer != null) { DestroyImmediate(mPrefabPreviewer.gameObject); mPrefabPreviewer = null; } mIsPlacingObject = !mIsPlacingObject; mIsHit = false; if(mIsPlacingObject) { //now placing objects GameObject newGo = Instantiate(mPrefab) as GameObject; newGo.hideFlags |= HideFlags.HideAndDontSave; mPrefabPreviewer = newGo.transform; M8.Util.SetPhysicsLayerRecursive(mPrefabPreviewer, LayerMask.NameToLayer("Ignore Raycast")); } else HandleUtility.Repaint(); } GUI.enabled = prevEnabled; EditorGUIUtility.LookLikeControls(); GUILayout.EndVertical(); } void OnSceneGUI(SceneView sceneView) { if(mIsPlacingObject && mPrefabPreviewer != null) { HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive)); switch(Event.current.type) { case EventType.KeyDown: if(Event.current.keyCode == KeyCode.Escape) { mIsPlacingObject = false; mIsHit = false; if(mPrefabPreviewer != null) { DestroyImmediate(mPrefabPreviewer.gameObject); mPrefabPreviewer = null; } Repaint(); } break; case EventType.MouseDown: if(Event.current.button == 0) Stamp(); break; case EventType.MouseMove: if(Event.current.shift) { mRotAxis += Event.current.delta.x;// / 10.0f; mRotAxis %= 360.0f; if(mIsHit) ApplyRot(); Repaint(); } else if(Event.current.control) { mOfs += Event.current.delta.y * 0.01f; if(mIsHit) mPrefabPreviewer.position = mHit.point + mHit.normal * mOfs; Repaint(); } else { UpdatePreview(sceneView.camera); } break; } if(Event.current.isMouse && Event.current.button == 0) { Event.current.Use(); } } } void Stamp() { if(mIsHit) { GameObject newGo; Transform newT; if(mUpdateOriginal && PrefabUtility.GetPrefabType(mPrefab) != PrefabType.Prefab && PrefabUtility.GetPrefabType(mPrefab) != PrefabType.ModelPrefab) { newGo = mPrefab; newT = newGo.transform; } else { newGo = Instantiate(mPrefab) as GameObject; newT = newGo.transform; newGo.name = mPrefab.name + mDupCounter; newT.parent = mPlaceUnderSelection && Selection.activeGameObject != null && PrefabUtility.GetPrefabType(Selection.activeGameObject) != PrefabType.Prefab && PrefabUtility.GetPrefabType(Selection.activeGameObject) != PrefabType.ModelPrefab ? Selection.activeGameObject.transform : null; mDupCounter++; } newT.position = mPrefabPreviewer.position; newT.rotation = mPrefabPreviewer.rotation; } } void UpdatePreview(Camera cam) { Vector2 mousePos = Event.current.mousePosition; mousePos.y = Screen.height - Event.current.mousePosition.y; Ray ray = cam.ScreenPointToRay(mousePos); mIsHit = Physics.Raycast(ray, out mHit, Mathf.Infinity, mLayerMask); if(mIsHit) { mPrefabPreviewer.position = mHit.point + mHit.normal * mOfs; ApplyRot(); } } void ApplyRot() { switch(mAxisInd) { case 0: mPrefabPreviewer.right = mInv ? mHit.normal : -mHit.normal; break; case 1: mPrefabPreviewer.up = mInv ? mHit.normal : -mHit.normal; mPrefabPreviewer.rotation *= Quaternion.AngleAxis(mRotAxis, Vector3.up); break; case 2: mPrefabPreviewer.forward = mInv ? mHit.normal : -mHit.normal; break; } } } }
ddionisio/WreckingWhore
Assets/M8/Editor/Tools/ProjectObjectPlacer.cs
C#
gpl-2.0
10,263
/*! * smooth-scroll v16.1.0 * Animate scrolling to anchor links * (c) 2019 Chris Ferdinandi * MIT License * http://github.com/cferdinandi/smooth-scroll */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define([], (function () { return factory(root); })); } else if (typeof exports === 'object') { module.exports = factory(root); } else { root.SmoothScroll = factory(root); } })(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { 'use strict'; // // Default settings // var defaults = { // Selectors ignore: '[data-scroll-ignore]', header: null, topOnEmptyHash: true, // Speed & Duration speed: 500, speedAsDuration: false, durationMax: null, durationMin: null, clip: true, offset: 0, // Easing easing: 'easeInOutCubic', customEasing: null, // History updateURL: true, popstate: true, // Custom Events emitEvents: true }; // // Utility Methods // /** * Check if browser supports required methods * @return {Boolean} Returns true if all required methods are supported */ var supports = function () { return ( 'querySelector' in document && 'addEventListener' in window && 'requestAnimationFrame' in window && 'closest' in window.Element.prototype ); }; /** * Merge two or more objects together. * @param {Object} objects The objects to merge together * @returns {Object} Merged values of defaults and options */ var extend = function () { var merged = {}; Array.prototype.forEach.call(arguments, (function (obj) { for (var key in obj) { if (!obj.hasOwnProperty(key)) return; merged[key] = obj[key]; } })); return merged; }; /** * Check to see if user prefers reduced motion * @param {Object} settings Script settings */ var reduceMotion = function () { if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { return true; } return false; }; /** * Get the height of an element. * @param {Node} elem The element to get the height of * @return {Number} The element's height in pixels */ var getHeight = function (elem) { return parseInt(window.getComputedStyle(elem).height, 10); }; /** * Escape special characters for use with querySelector * @author Mathias Bynens * @link https://github.com/mathiasbynens/CSS.escape * @param {String} id The anchor ID to escape */ var escapeCharacters = function (id) { // Remove leading hash if (id.charAt(0) === '#') { id = id.substr(1); } var string = String(id); var length = string.length; var index = -1; var codeUnit; var result = ''; var firstCodeUnit = string.charCodeAt(0); while (++index < length) { codeUnit = string.charCodeAt(index); // Note: there’s no need to special-case astral symbols, surrogate // pairs, or lone surrogates. // If the character is NULL (U+0000), then throw an // `InvalidCharacterError` exception and terminate these steps. if (codeUnit === 0x0000) { throw new InvalidCharacterError( 'Invalid character: the input contains U+0000.' ); } if ( // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is // U+007F, […] (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9] // (U+0030 to U+0039), […] (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || // If the character is the second character and is in the range [0-9] // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] ( index === 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit === 0x002D ) ) { // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point result += '\\' + codeUnit.toString(16) + ' '; continue; } // If the character is not handled by one of the above rules and is // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to // U+005A), or [a-z] (U+0061 to U+007A), […] if ( codeUnit >= 0x0080 || codeUnit === 0x002D || codeUnit === 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A ) { // the character itself result += string.charAt(index); continue; } // Otherwise, the escaped character. // http://dev.w3.org/csswg/cssom/#escape-a-character result += '\\' + string.charAt(index); } // Return sanitized hash return '#' + result; }; /** * Calculate the easing pattern * @link https://gist.github.com/gre/1650294 * @param {String} type Easing pattern * @param {Number} time Time animation should take to complete * @returns {Number} */ var easingPattern = function (settings, time) { var pattern; // Default Easing Patterns if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration // Custom Easing Patterns if (!!settings.customEasing) pattern = settings.customEasing(time); return pattern || time; // no easing, no acceleration }; /** * Determine the document's height * @returns {Number} */ var getDocumentHeight = function () { return Math.max( document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight ); }; /** * Calculate how far to scroll * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 * @param {Element} anchor The anchor element to scroll to * @param {Number} headerHeight Height of a fixed header, if any * @param {Number} offset Number of pixels by which to offset scroll * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page * @returns {Number} */ var getEndLocation = function (anchor, headerHeight, offset, clip) { var location = 0; if (anchor.offsetParent) { do { location += anchor.offsetTop; anchor = anchor.offsetParent; } while (anchor); } location = Math.max(location - headerHeight - offset, 0); if (clip) { location = Math.min(location, getDocumentHeight() - window.innerHeight); } return location; }; /** * Get the height of the fixed header * @param {Node} header The header * @return {Number} The height of the header */ var getHeaderHeight = function (header) { return !header ? 0 : (getHeight(header) + header.offsetTop); }; /** * Calculate the speed to use for the animation * @param {Number} distance The distance to travel * @param {Object} settings The plugin settings * @return {Number} How fast to animate */ var getSpeed = function (distance, settings) { var speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed); if (settings.durationMax && speed > settings.durationMax) return settings.durationMax; if (settings.durationMin && speed < settings.durationMin) return settings.durationMin; return parseInt(speed, 10); }; var setHistory = function (options) { // Make sure this should run if (!history.replaceState || !options.updateURL || history.state) return; // Get the hash to use var hash = window.location.hash; hash = hash ? hash : ''; // Set a default history history.replaceState( { smoothScroll: JSON.stringify(options), anchor: hash ? hash : window.pageYOffset }, document.title, hash ? hash : window.location.href ); }; /** * Update the URL * @param {Node} anchor The anchor that was scrolled to * @param {Boolean} isNum If true, anchor is a number * @param {Object} options Settings for Smooth Scroll */ var updateURL = function (anchor, isNum, options) { // Bail if the anchor is a number if (isNum) return; // Verify that pushState is supported and the updateURL option is enabled if (!history.pushState || !options.updateURL) return; // Update URL history.pushState( { smoothScroll: JSON.stringify(options), anchor: anchor.id }, document.title, anchor === document.documentElement ? '#top' : '#' + anchor.id ); }; /** * Bring the anchored element into focus * @param {Node} anchor The anchor element * @param {Number} endLocation The end location to scroll to * @param {Boolean} isNum If true, scroll is to a position rather than an element */ var adjustFocus = function (anchor, endLocation, isNum) { // Is scrolling to top of page, blur if (anchor === 0) { document.body.focus(); } // Don't run if scrolling to a number on the page if (isNum) return; // Otherwise, bring anchor element into focus anchor.focus(); if (document.activeElement !== anchor) { anchor.setAttribute('tabindex', '-1'); anchor.focus(); anchor.style.outline = 'none'; } window.scrollTo(0 , endLocation); }; /** * Emit a custom event * @param {String} type The event type * @param {Object} options The settings object * @param {Node} anchor The anchor element * @param {Node} toggle The toggle element */ var emitEvent = function (type, options, anchor, toggle) { if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; var event = new CustomEvent(type, { bubbles: true, detail: { anchor: anchor, toggle: toggle } }); document.dispatchEvent(event); }; // // SmoothScroll Constructor // var SmoothScroll = function (selector, options) { // // Variables // var smoothScroll = {}; // Object for public APIs var settings, anchor, toggle, fixedHeader, eventTimeout, animationInterval; // // Methods // /** * Cancel a scroll-in-progress */ smoothScroll.cancelScroll = function (noEvent) { cancelAnimationFrame(animationInterval); animationInterval = null; if (noEvent) return; emitEvent('scrollCancel', settings); }; /** * Start/stop the scrolling animation * @param {Node|Number} anchor The element or position to scroll to * @param {Element} toggle The element that toggled the scroll event * @param {Object} options */ smoothScroll.animateScroll = function (anchor, toggle, options) { // Cancel any in progress scrolls smoothScroll.cancelScroll(); // Local settings var _settings = extend(settings || defaults, options || {}); // Merge user options with defaults // Selectors and variables var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; var anchorElem = isNum || !anchor.tagName ? null : anchor; if (!isNum && !anchorElem) return; var startLocation = window.pageYOffset; // Current location on the page if (_settings.header && !fixedHeader) { // Get the fixed header if not already set fixedHeader = document.querySelector(_settings.header); } var headerHeight = getHeaderHeight(fixedHeader); var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to var distance = endLocation - startLocation; // distance to travel var documentHeight = getDocumentHeight(); var timeLapsed = 0; var speed = getSpeed(distance, _settings); var start, percentage, position; /** * Stop the scroll animation when it reaches its target (or the bottom/top of page) * @param {Number} position Current position on the page * @param {Number} endLocation Scroll to location * @param {Number} animationInterval How much to scroll on this loop */ var stopAnimateScroll = function (position, endLocation) { // Get the current location var currentLocation = window.pageYOffset; // Check if the end location has been reached yet (or we've hit the end of the document) if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { // Clear the animation timer smoothScroll.cancelScroll(true); // Bring the anchored element into focus adjustFocus(anchor, endLocation, isNum); // Emit a custom event emitEvent('scrollStop', _settings, anchor, toggle); // Reset start start = null; animationInterval = null; return true; } }; /** * Loop scrolling animation */ var loopAnimateScroll = function (timestamp) { if (!start) { start = timestamp; } timeLapsed += timestamp - start; percentage = speed === 0 ? 0 : (timeLapsed / speed); percentage = (percentage > 1) ? 1 : percentage; position = startLocation + (distance * easingPattern(_settings, percentage)); window.scrollTo(0, Math.floor(position)); if (!stopAnimateScroll(position, endLocation)) { animationInterval = window.requestAnimationFrame(loopAnimateScroll); start = timestamp; } }; /** * Reset position to fix weird iOS bug * @link https://github.com/cferdinandi/smooth-scroll/issues/45 */ if (window.pageYOffset === 0) { window.scrollTo(0, 0); } // Update the URL updateURL(anchor, isNum, _settings); // If the user prefers reduced motion, jump to location if (reduceMotion()) { window.scrollTo(0, Math.floor(endLocation)); return; } // Emit a custom event emitEvent('scrollStart', _settings, anchor, toggle); // Start scrolling animation smoothScroll.cancelScroll(true); window.requestAnimationFrame(loopAnimateScroll); }; /** * If smooth scroll element clicked, animate scroll */ var clickHandler = function (event) { // Don't run if event was canceled but still bubbled up // By @mgreter - https://github.com/cferdinandi/smooth-scroll/pull/462/ if (event.defaultPrevented) return; // Don't run if right-click or command/control + click or shift + click if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return; // Check if event.target has closest() method // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ if (!('closest' in event.target)) return; // Check if a smooth scroll link was clicked toggle = event.target.closest(selector); if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; // Only run if link is an anchor and points to the current page if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; // Get an escaped version of the hash var hash = escapeCharacters(toggle.hash); // Get the anchored element var anchor; if (hash === '#') { if (!settings.topOnEmptyHash) return; anchor = document.documentElement; } else { anchor = document.querySelector(hash); } anchor = !anchor && hash === '#top' ? document.documentElement : anchor; // If anchored element exists, scroll to it if (!anchor) return; event.preventDefault(); setHistory(settings); smoothScroll.animateScroll(anchor, toggle); }; /** * Animate scroll on popstate events */ var popstateHandler = function (event) { // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. if (history.state === null) return; // Only run if state is a popstate record for this instantiation if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; // Only run if state includes an anchor // if (!history.state.anchor && history.state.anchor !== 0) return; // Get the anchor var anchor = history.state.anchor; if (typeof anchor === 'string' && anchor) { anchor = document.querySelector(escapeCharacters(history.state.anchor)); if (!anchor) return; } // Animate scroll to anchor link smoothScroll.animateScroll(anchor, null, {updateURL: false}); }; /** * Destroy the current initialization. */ smoothScroll.destroy = function () { // If plugin isn't already initialized, stop if (!settings) return; // Remove event listeners document.removeEventListener('click', clickHandler, false); window.removeEventListener('popstate', popstateHandler, false); // Cancel any scrolls-in-progress smoothScroll.cancelScroll(); // Reset variables settings = null; anchor = null; toggle = null; fixedHeader = null; eventTimeout = null; animationInterval = null; }; /** * Initialize Smooth Scroll * @param {Object} options User settings */ var init = function () { // feature test if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; // Destroy any existing initializations smoothScroll.destroy(); // Selectors and variables settings = extend(defaults, options || {}); // Merge user options with defaults fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header // When a toggle is clicked, run the click handler document.addEventListener('click', clickHandler, false); // If updateURL and popState are enabled, listen for pop events if (settings.updateURL && settings.popstate) { window.addEventListener('popstate', popstateHandler, false); } }; // // Initialize plugin // init(); // // Public APIs // return smoothScroll; }; return SmoothScroll; }));
MattTavares/MattTavares.github.io
assets/js/plugins/SmoothScroll/SmoothScroll.js
JavaScript
gpl-2.0
23,210
package com.mbpr.gengjian.playface; import java.util.List; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; /** * Created by gengjian on 15/12/23. */ public class ViewPagerAdapter extends PagerAdapter { private List<View> views; private Context context; public ViewPagerAdapter(List<View> views, Context context) { this.views = views; this.context = context; } @Override public void destroyItem(View container, int position, Object object) { //super.destroyItem(container, position, object); ((ViewPager)container).removeView(views.get(position)); } @Override public Object instantiateItem(View container, int position) { ((ViewPager)container).addView(views.get(position)); return views.get(position); } @Override public int getCount() { return views.size(); } @Override public boolean isViewFromObject(View view, Object object) { return (view == object); } }
gengjian1203/PlayFace
app/src/main/java/com/mbpr/gengjian/playface/ViewPagerAdapter.java
Java
gpl-2.0
1,100
""" WSGI config for mongobacked project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mongobacked.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
ludi1001/IonMedicationSystem
mongobacked/mongobacked/wsgi.py
Python
gpl-2.0
397
<?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * Testing integration with MediaWiki OAuth Extension * * The current extension follows OAuth 1.0a spec and while the * extension works, you have to be aware of a few quirks. * * This sample is there to help you work your mind through the OAuth * process. Its assuming your MediaWiki installation has this extension * installed so you can become your own OAuth service provider. In other * words, users in the wiki will be able to make various APIs calls * to this wiki using OAuth tokens. * * PLEASE NOTE: * * Remember that OAuth 1.0 expects that the GET Request parameters * are sorted in some order, then to have it hashed. * * In relation to MW; One known caveat is that the `$baseurl` has to * be calling to your MediaWiki's `index.php` with * `index.php?title=Special:OAuth` directly. * * Otherwise the extension will return an URL that way, and will break the hash * signature and you will get an error. */ require __DIR__ . '/../lib/OAuth.php'; /** * Local to this example * * Whether you want to also see * the objects being sent to the wire. */ $moreVerbose = false; /** * Consumer key * * This is the application key you would * get from the application you want to connect * with your MediaWiki installation. */ $consumerKey = 'dpf43f3p2l4k3l03'; /** * Secret * * This is the generated secret key * that you would get when you ask. */ $consumerSecret = 'kd94hf93k423kf44'; /** * Base URL * * Set to your MediaWiki address with "index.php?title=Special:OAuth". * * Remember that its a known limitation that you cannot use pretty URLs * in this context. * * Ideally, you should have a SSL VirtualHost, but this test would not * fail if you don't have one yet. */ $baseurl = 'https://localhost/w/index.php?title=Special:OAuth'; /** * Request token (a.k.a. the first step) * * The first step starts at "Special:OAuth/initiate" from the extension. * * Note that the `oauth_callback=oob` means "Out Of Band", and we currently * cannot generate an URL based on headers, but from contents of the Response * body (hence "out of band"). * * This is due to the fact that the way the extension is made, it'll return * something in the Response body that will need to create the link and * make the user validate, and get the token. */ $request_token_url = $baseurl . '/initiate&format=json&oauth_callback=oob'; /** * Validate token (a.k.a. the 2nd step) * * This is the URL you use to send back to the application * when that the connecting application gives you when the * user accepted the request. */ $validate_token_url = $baseurl . '/token&format=json'; /** * You should not need to edit anything else beyond this point */ // This is to allow you to work without SSL locally $baseUrlIsSsl = (bool)preg_match( '/^https/i', $baseurl ); print <<<HELPTEXT Testing OAuth integration with MediaWiki. HELPTEXT; /** * First step */ $c = new OAuthConsumer( $consumerKey, $consumerSecret ); $parsed = parse_url( $request_token_url ); $params = []; parse_str( $parsed['query'], $params ); $req_req = OAuthRequest::from_consumer_and_token( $c, null, "GET", $request_token_url, $params ); $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); $sig_method = $hmac_method; $req_req->sign_request( $sig_method, $c, null ); print <<<HELPTEXT First step, asking for an URL to send the user to. HELPTEXT; echo "Calling: $req_req" . PHP_EOL; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string)$req_req ); if ( $baseUrlIsSsl === true ) { curl_setopt( $ch, CURLOPT_PORT, 443 ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 ); } curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); if ( $moreVerbose === true ) { curl_setopt( $ch, CURLOPT_VERBOSE, 1 ); } $data = curl_exec( $ch ); if ( !$data ) { die( 'cURL error: ' . curl_error( $ch ) ); } $token = json_decode( $data ); // phpcs:disable Generic.Files.LineLength print <<<HELPTEXT Response body should be a JSON object with three keys: - key - secret - oauth_callback_confirmed You got: {$data} ************************ Step two! So far, we made one request and we should have what we need to get acknowledgement from the end user. In order to continue, we have to ask the user for a permission. With what we just did, it gave us a one-time URL to send our user to. The process can continue only if the user accepted it. Once accepted, MediaWiki's OAuth Extension creates an "oauth_verifier" string that you need to give for the next step. Now, WITH YOUR WEB BROWSER, follow this link and pass through the validation. Link: {$baseurl}/authorize&oauth_token={$token->key}&oauth_consumer_key={$consumerKey} HELPTEXT; // phpcs:enable // ACCESS TOKEN print 'What was the "verification value" the MediaWiki installation gave?' . PHP_EOL; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); /** * Second step */ $rc = new OAuthConsumer( $token->key, $token->secret ); $parsed = parse_url( $validate_token_url ); parse_str( $parsed['query'], $params ); $params['oauth_verifier'] = trim( $line ); $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $validate_token_url, $params ); $acc_req->sign_request( $sig_method, $c, $rc ); print <<<HELPTEXT Going to validate token with another Request to the backend... HELPTEXT; echo "Calling: $acc_req" . PHP_EOL; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string)$acc_req ); if ( $baseUrlIsSsl === true ) { curl_setopt( $ch, CURLOPT_PORT, 443 ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 ); } curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); if ( $moreVerbose === true ) { curl_setopt( $ch, CURLOPT_VERBOSE, 1 ); } $data = curl_exec( $ch ); if ( !$data ) { echo 'Curl error: ' . curl_error( $ch ); } print <<<HELPTEXT If all worked well, you should have a JSON object with two keys: key, secret. You got: HELPTEXT; var_dump( $data );
wikimedia/mediawiki-extensions-OAuth
examples/testClient.php
PHP
gpl-2.0
6,074
package playertraits.traits; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; public class StrengthTrait extends Trait { public StrengthTrait() { super("Strength"); } @Override public void tick(EntityPlayerMP player) { player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 200, 1)); } @Override public void init() { } }
HexagonalDiamond/PlayerTraits
src/main/java/playertraits/traits/StrengthTrait.java
Java
gpl-2.0
430
{ "CMSMAIN.WARNINGSAVEPAGESBEFOREADDING" : "You have to save a page before adding children underneath it", "CMSMAIN.CANTADDCHILDREN" : "You can't add children to the selected node", "CMSMAIN.ERRORADDINGPAGE" : "Error adding page", "CMSMAIN.FILTEREDTREE" : "Filtered tree to only show changed pages", "CMSMAIN.ERRORFILTERPAGES" : "Could not filter tree to only show changed pages<br />%s", "CMSMAIN.ERRORUNFILTER" : "Unfiltered tree", "CMSMAIN.PUBLISHINGPAGES" : "Publishing pages...", "CMSMAIN.SELECTONEPAGE" : "Please select at least 1 page.", "CMSMAIN.ERRORPUBLISHING" : "Error publishing pages", "CMSMAIN.REALLYDELETEPAGES" : "Do you really want to delete the %s marked pages?", "CMSMAIN.DELETINGPAGES" : "Deleting pages...", "CMSMAIN.ERRORDELETINGPAGES": "Error deleting pages", "CMSMAIN.PUBLISHING" : "Publishing...", "CMSMAIN.RESTORING": "Restoring...", "CMSMAIN.ERRORREVERTING": "Error reverting to live content", "CMSMAIN.SAVING" : "saving...", "CMSMAIN.SELECTMOREPAGES" : "You have %s pages selected.\n\nDo you really want to perform this action?", "CMSMAIN.ALERTCLASSNAME": "The page type will be updated after the page is saved", "CMSMAIN.URLSEGMENTVALIDATION": "URLs can only be made up of letters, digits and hyphens.", "AssetAdmin.BATCHACTIONSDELETECONFIRM": "Do you really want to delete %s folders?", "AssetTableField.REALLYDELETE": "Do you really want to delete the marked files?", "AssetTableField.MOVING": "Moving %s file(s)", "CMSMAIN.AddSearchCriteria": "Add Criteria", "WidgetAreaEditor.TOOMANY": "Sorry, you have reached the maximum number of widgets in this area", "AssetAdmin.ConfirmDelete": "Do you really want to delete this folder and all contained files?", "Folder.Name": "Folder name", "Tree.AddSubPage": "Add new page here", "Tree.Duplicate": "Duplicate", "Tree.EditPage": "Edit", "Tree.ThisPageOnly": "This page only", "Tree.ThisPageAndSubpages": "This page and subpages", "Tree.ShowAsList": "Show children as list", "CMSMain.ConfirmRestoreFromLive": "Do you really want to copy the published content to the draft site?", "CMSMain.RollbackToVersion": "Do you really want to roll back to version #%s of this page?", "URLSEGMENT.Edit": "Edit", "URLSEGMENT.OK": "OK", "URLSEGMENT.Cancel": "Cancel", "URLSEGMENT.UpdateURL": "Update URL" }
maent45/PersianFeast
cms/javascript/lang/src/en.js
JavaScript
gpl-2.0
2,305
<?php /** * ------------------------------------------------------------------------ * JUDownload for Joomla 2.5, 3.x * ------------------------------------------------------------------------ * * @copyright Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author JoomUltra Co., Ltd * @website http://www.joomultra.com * @----------------------------------------------------------------------@ */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); class JUDLView extends JViewLegacy { public function __construct($config = array()) { parent::__construct($config); $this->_path['template'] = array(); } public function loadTemplate($tpl = null) { $this->_output = null; $app = JFactory::getApplication(); $template = JFactory::getApplication()->getTemplate(); if ($this->getName() == 'category' || $this->getName() == 'tree') { $layoutUrl = $app->input->getString('layout', ''); if (isset($layoutUrl) && $layoutUrl != '') { $layout = $layoutUrl; } else { $layout = null; } $catId = $app->input->getInt('id', 1); $layout = JUDownloadFrontHelperCategory::getCategoryViewLayout($layout, $catId); $this->setLayout($layout); } elseif ($this->getName() == 'document') { $layoutUrl = $app->input->getString('layout', ''); if (isset($layoutUrl) && $layoutUrl != '') { $layout = $layoutUrl; } else { $layout = null; } $docId = $app->input->getInt('id', 0); if ($docId > 0) { $layout = JUDownloadFrontHelperDocument::getDocumentViewLayout($layout, $docId); $this->setLayout($layout); } } $layout = $this->getLayout(); $layoutTemplate = $this->getLayoutTemplate(); $file = isset ($tpl) ? $layout . '_' . $tpl : $layout; $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file); $tpl = isset ($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl) : $tpl; $lang = JFactory::getLanguage(); $lang->load('tpl_' . $template, JPATH_BASE, null, false, false) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, false); $component = JApplicationHelper::getComponentName(); $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $component); $app = JFactory::getApplication(); $id = $app->input->getInt('id', 0); $user = JFactory::getUser(); if ($previewStyle = (int) $app->input->getInt('tplStyle', 0)) { if ($user->id == 0) { $uri = JUri::getInstance(); $loginUrl = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode($uri), false); $app->enqueueMessage(JText::_("COM_JUDOWNLOAD_YOU_MUST_LOGIN_AS_SUPER_ADMIN_TO_PREVIEW_TEMPLATE_STYLE"), 'Notice'); $app->redirect($loginUrl); return false; } else { if (!$user->authorise('core.admin', 'com_judownload')) { $app->enqueueMessage(JText::_("COM_JUDOWNLOAD_YOU_MUST_LOGIN_AS_SUPER_ADMIN_TO_PREVIEW_TEMPLATE_STYLE"), 'Notice'); } } } if ($user->authorise('core.admin', 'com_judownload') && $previewStyle = (int) $app->input->getInt('tplStyle', 0)) { $currentTemplateStyleObject = JUDownloadFrontHelperTemplate::getTemplateStyleObject($previewStyle); } else { $currentTemplateStyleObject = JUDownloadFrontHelperTemplate::getCurrentTemplateStyle($this->getName(), $id); } $JUTemplate = trim($currentTemplateStyleObject->folder); $JUTemplate = strtolower($JUTemplate); $this->template_params = $currentTemplateStyleObject->params; if (!$JUTemplate) { $JUTemplate = 'default'; } $this->template = $JUTemplate; $JUTemplatePath = JUDownloadFrontHelperTemplate::getTemplatePathWithoutRoot($currentTemplateStyleObject->template_id); $topLevelTemplate = $JUTemplatePath[0]->folder ? $JUTemplatePath[0]->folder : 'default'; $asset_file = JPATH_SITE . '/components/com_judownload/templates/' . $topLevelTemplate . '/load_assets.php'; if (JFile::exists($asset_file)) { include_once $asset_file; } $JUTemplatePathFull = array(); $JUTemplatePathFull[] = $this->_basePath . '/templates/default/' . $this->getName(); $JUTemplatePathFull[] = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . 'default' . '/' . $this->getName(); $JUTemplatePath = array_reverse($JUTemplatePath); foreach ($JUTemplatePath AS $JUTemplatePathItem) { $JUTemplatePathFull[] = $this->_basePath . '/templates/' . $JUTemplatePathItem->folder . '/' . $this->getName(); $JUTemplatePathFull[] = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $JUTemplatePathItem->folder . '/' . $this->getName(); } foreach ($JUTemplatePathFull AS $item) { $this->_addPath('template', $item); } if (isset ($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) { $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']); } $jversion_arr = explode(".", JVERSION); $priVersion = $jversion_arr[0]; $subVersion = $jversion_arr[1]; $fileToFind = $this->_createFileName('template', array('name' => $file . '.j' . $priVersion . $subVersion)); $this->_template = JPath::find($this->_path['template'], $fileToFind); if ($this->_template == false) { $fileToFind = $this->_createFileName('template', array('name' => $file . '.j' . $priVersion . 'x')); $this->_template = JPath::find($this->_path['template'], $fileToFind); } if ($this->_template == false) { $fileToFind = $this->_createFileName('template', array('name' => $file)); $this->_template = JPath::find($this->_path['template'], $fileToFind); } if ($this->_template == false) { $fallbackPaths = array(); $fallbackPaths[] = $this->_basePath . '/templates/default/' . $this->getName(); $fallbackPaths[] = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . 'default' . '/' . $this->getName(); foreach ($fallbackPaths AS $fallbackPath) { $fallbackPath = trim($fallbackPath); if (substr($fallbackPath, -1) != DIRECTORY_SEPARATOR) { $fallbackPath .= DIRECTORY_SEPARATOR; } array_unshift($fallbackPaths, $fallbackPath); } $fileToFind = $this->_createFileName('', array('name' => 'default.j' . $priVersion . $subVersion . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($fallbackPaths, $fileToFind); if ($this->_template == false) { $fileToFind = $this->_createFileName('', array('name' => 'default.j' . $priVersion . 'x' . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($fallbackPaths, $fileToFind); } if ($this->_template == false) { $fileToFind = $this->_createFileName('', array('name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($fallbackPaths, $fileToFind); } } if ($this->_template != false) { unset ($tpl); unset ($file); if (isset ($this->this)) { unset ($this->this); } ob_start(); include $this->_template; $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; } else { return JError::raiseError(500, JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file)); } } /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @see JViewLegacy::loadTemplate() * @since 12.2 */ public function display($tpl = null) { $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { return $result; } /* ----------------- */ $result .= "<" . "di" . "v st" . "yle='t" . "ext-al" . "ign: c" . "enter; fo" . "nt-si" . "ze: sm" . "all" . "er;'>P" . "ow" . "ere" /* Return the result */ . "d b" . "y <" . "a hr" . "ef='ht" . "tp" . ":/" . "/ww" . "w.j" . "o" . "omu" . "lt" . "ra.c" . "om' t" . "ar" . "ge" /* ----------------- */ . "t='_" . "bla" . "nk' " . "re" . "l='f" . "ol" . "low" . "'>J" . "U D" . "ow" . "nl" . "oa" . "d</" . "a></" . "di" . "v>"; echo $result; } }
kosmosby/medicine-prof
components/com_judownload/helpers/judlview.php
PHP
gpl-2.0
9,073
package com.day21; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; /** * 代理类 * @author tenlee * */ public class Proxy implements InvocationHandler{ private Subject target; public Proxy(Subject target) { this.target = target; } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { System.out.println("做大量的评估"); method.invoke(target, args); //代购之后要做的事 System.out.println("代购之后满意度调查"); return null; } }
tenlee2012/AllCode
JAVA/CodingkeStudy/src/com/day21/Proxy.java
Java
gpl-2.0
549
<aside id="sidebar" class="cf"> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar Top')); ?> <section class="sidebar_section wrapper social_section"> <div class="follow_button facebook"> <div class="fb-like" data-href="https://facebook.com/ldnfashion" data-width="250" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div> </div> <div class="follow_button twitter"> <a href="https://twitter.com/ldnfashion" class="twitter-follow-button" data-show-count="true">Follow @ldnfashion</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> </div> <div class="cf follow_button instagram"> <style>.ig-b- { display: inline-block; } .ig-b- img { visibility: hidden; } .ig-b-:hover { background-position: 0 -60px; } .ig-b-:active { background-position: 0 -120px; } .ig-b-v-24 { width: 137px; height: 24px; background: url(//badges.instagram.com/static/images/ig-badge-view-sprite-24.png) no-repeat 0 0; } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { .ig-b-v-24 { background-image: url(//badges.instagram.com/static/images/ig-badge-view-sprite-24@2x.png); background-size: 160px 178px; } }</style> <a href="http://instagram.com/ldnfashion?ref=badge" class="ig-b- ig-b-v-24"><img src="//badges.instagram.com/static/images/ig-badge-view-24.png" alt="Instagram" /></a> </div> </section> <section class="sidebar_section wrapper"> <header class="section_header sidebar_header"> <h4>Search LDNfashion</h4> </header> <?php get_search_form(); ?> </section> <!-- <section class="sidebar_section wrapper newsletter_signup"> <header class="section_header sidebar_header"> <h4>Subscribe to LDNfashion</h4> </header> <p>Get the latest LDN Fashion updates via email</p> <form action="//ldnfashion.us9.list-manage.com/subscribe/post?u=dacb3e7db54afa3fc77bb88c9&amp;id=ec84afbda0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="search-wrapper validate" novalidate> <div class="mc-field-group"> <input type="email" value="" name="EMAIL" class="required email search_box" placeholder="your.name@email.com" id="mce-EMAIL"> <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button search_submit longer"> <div style="position: absolute; left: -5000px;"><input type="text" name="b_dacb3e7db54afa3fc77bb88c9_ec84afbda0" tabindex="-1" value=""></div> </div> <div id="mce-responses"> <div class="response" id="mce-error-response" style="display:none"></div> <div class="response" id="mce-success-response" style="display:none"></div> </div> </form> </section> --> <section class="sidebar_section wrapper"> <header class="section_header sidebar_header"> <h4>Top 10 most read</h4> </header> <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular('limit=10&stats_comments=0&stats_views=0&thumbnail_width=50&thumbnail_height=50'); ?> </section> <?php if ( is_dynamic_sidebar('Sidebar Mini Adverts') ) : ?> <ul class="cf mini-ads"> <?php dynamic_sidebar('Sidebar Mini Adverts'); ?> </ul> <?php endif; ?> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar Bottom')); ?> </aside>
jonheslop/LDNfashion
parts/_sidebar.php
PHP
gpl-2.0
3,728