text
stringlengths
3
1.05M
from copy import deepcopy from pprint import pprint import uuid DEFAULT_MAJOR = { "id": "13", "imgUrl": "#", "type": "major", "name": "Sex Slavery", "name2": "bondage, masochism, submission", "prerequisites": "414 420", "description": "You will become a sex slave who derives pleasure from pain.", "tier": "major", "daily1": "none", "daily2": "none", "exam1": "Gag yourself. Make a clothespin zipper that runs from one of your breasts, around your navel and back to the other breast (20 clothespins minimum). Keep it on and spank your ass until it becomes red (50 times minimum). Then pull the zipper hard and fast.", "exam2": "Attach clothespins to your nipples and insert a buttplug/vibrator/dildo in your ass. Tie yourself in a hogtie/frog-tie/mummy-tie for 60minutes while blindfolded and gagged.", "exam3": "Go in chat or online and request 10 slave tasks to perform which preferably include bondage and pain. Spank your ass hard 20 times and your balls/pussy 10 times for every task you refuse.", "tags": "slave" } class Major(): def __init__(self, parent, **kwargs): super().__init__() self.parent = parent self.data = deepcopy(DEFAULT_MAJOR) for k, v in kwargs.items(): self.data[k] = v def __str__(self): return f"[{self.id}] {self.name} - {self.description}" def as_list(self): return f"{self.id} - {self.name}" @property def id(self): return self.data.get("id") @property def imgUrl(self): return self.data.get("imgUrl") @property def type(self): return self.data.get("type") @property def name(self): return self.data.get("name") @property def name2(self): return self.data.get("name2") @property def prerequisites(self): prerequisites = self.data.get("prerequisites") if isinstance(prerequisites, int): prerequisites = [prerequisites] else: prerequisites = [int(i) for i in prerequisites.split()] # prerequisites for majors are courses return [self.parent.parent.courses.get_by_property("id", _id) for _id in prerequisites] # return self.data.get("prerequisites") @property def description(self): return self.data.get("description") @property def tier(self): return self.data.get("tier") @property def locked(self): return self.tier > 1 @property def daily1(self): return self.data.get("daily1") @property def daily2(self): return self.data.get("daily2") @property def exam1(self): return self.data.get("exam1") @property def exam2(self): return self.data.get("exam2") @property def exam3(self): return self.data.get("exam3") @property def tags(self): return self.data.get("tags") if __name__ == "__main__": test = Majors() print(test) # test2 = test.get_by_property('id', 1) # print(test2.prerequisites)
import React from 'react' function Test({ title }) { return <span>{title}</span> } export default Test
import React from 'react'; import Container from './styled-components/Container'; import NickDiv from './styled-components/NickDiv'; import Avatar from './styled-components/Avatar'; import kuc1 from '../../../../../assets/icons/kuc1.svg'; import Nick from './styled-components/Nick'; import FlexGapContainer from '../../../global/molecules/FlexGapContainer/FlexGapContainer'; import Icon from './styled-components/Icon'; import health from '../../../../../assets/icons/health.svg'; import shield from '../../../../../assets/icons/shield.svg' import UserStatistic from "../../atoms/UserStatistic"; import ColumnGapContainer from "../../../global/molecules/ColumnGapContainer"; import Media from "react-media"; import {desktop, mobile} from "../../../../utils/globals"; import EffectFrame from "./styled-components/EffectFrame"; class EnemyStateContainer extends React.Component { /* props: hp <- information about health points shield <- information about shield points setTranslateX <- handle init animation */ render() { return ( <> <Media query={mobile}> <Container setTranslateX={this.props.setTranslateX}> <NickDiv> <Avatar src={this.props.image ? this.props.image : kuc1}/> <Nick> {this.props.username} </Nick> </NickDiv> <ColumnGapContainer gap={'8px'}> <EffectFrame setOpacity={this.props.effectFrameOpacity} type={this.props.frameOpacityType}/> <FlexGapContainer gap={'16px'}> <Icon src={health}/> <UserStatistic type={'hp'} statisticNumber={this.props.hp}/> </FlexGapContainer> <FlexGapContainer gap={'16px'}> <Icon src={shield}/> <UserStatistic type={'shield'} statisticNumber={this.props.shield}/> </FlexGapContainer> </ColumnGapContainer> </Container> </Media> <Media query={desktop}> <Container setTranslateY={this.props.setTranslateY}> <FlexGapContainer gap={'24px'} setMargin={'auto 0'}> <Avatar src={this.props.image ? this.props.image : kuc1}/> <ColumnGapContainer gap={'8px'}> <EffectFrame setOpacity={this.props.effectFrameOpacity} type={this.props.frameOpacityType}/> <FlexGapContainer gap={'16px'}> <Icon src={shield}/> <UserStatistic type={'shield'} statisticNumber={this.props.shield}/> </FlexGapContainer> <FlexGapContainer gap={'16px'}> <Icon src={health}/> <UserStatistic type={'hp'} statisticNumber={this.props.hp}/> </FlexGapContainer> </ColumnGapContainer> </FlexGapContainer> <NickDiv> <Nick> {this.props.username} </Nick> </NickDiv> </Container> </Media> </> ); } } export default EnemyStateContainer;
#!/usr/bin/python """A more advanced Mapper, using Python iterators and generators.""" import sys from collections import Counter def read_input(file): for line in file: # split the line into words yield line.split() def read_word(word): c = Counter(word) for k,v in c.items(): yield k,v def main(separator='\t'): # input comes from STDIN (standard input) data = read_input(sys.stdin) for words in data: # write the results to STDOUT (standard output); # what we output here will be the input for the # Reduce step, i.e. the input for reducer.py # # tab-delimited; the trivial word count is 1 for word in words: charcnt = read_word(word) for char,cnt in charcnt: print "%s%s%d" %(char, separator,cnt) # print '%s%s%d' % (word, separator, 1) if __name__ == "__main__": main()
"""Custom shna errors.""" class ShnaError(Exception): """Custom shna exception class.""" pass
'use strict'; function create(value) { return /* Indices */{ _0: value }; } function value(indices) { return indices._0; } function getCount(indices) { return indices._0.length; } exports.create = create; exports.value = value; exports.getCount = getCount; /* No side effect */
/** * Controla las acciones que se deben ejecutar en la página de Lista de Modelos * @class Session_List * @constructor * @module Public */ Session_List = function () { var self = this; var modelsTable, sessionsTable; /** * Ejecuta las acciones de configuración necesarias * @method init */ this.init = function () { initDataTables(); $('.new-session').hide(); $('#action-new-session').click(function (event) { event.preventDefault(); var ele = $(this); if (!ele.hasClass('inactive')) { ele.blur(); ele.addClass('inactive'); $('#action-cancel-new-session').removeClass('inactive'); $('.current-session').hide(); $('.new-session').show(); } }); $('#action-cancel-new-session').click(function (event) { event.preventDefault(); var ele = $(this); if (!ele.hasClass('inactive')) { ele.blur(); ele.addClass('inactive'); $('#action-new-session').removeClass('inactive'); $('.new-session').hide(); $('.current-session').show(); } }); $('#action-reload-sessions-models').click(function (event) { event.preventDefault(); $(this).blur(); self.reloadSessionsData(); }); $('#action-cancel-new-session').click(); }; /** * Recarga las tablas de lista de sesiones y lista de modelos * @method reloadSessionsData */ this.reloadSessionsData = function (){ var url = window.location.pathname; var tablesLoadCount = 0; var initDataTables_ = function(){ ++tablesLoadCount; if(tablesLoadCount === 2){ initDataTables(); } }; $.get(url, function(response){ var modelsTable = $('#models-list-table-container'); var sessionsTable = $('#sessions-list-table-container'); var newModelsTable = $('#models-list-table-container', response).hide().html(); var newSessionsTable = $('#sessions-list-table-container', response).hide().html(); modelsTable.fadeOut('slow', function(){ modelsTable.html(newModelsTable).fadeIn('slow'); initDataTables_(); }); sessionsTable.fadeOut('slow', function(){ sessionsTable.html(newSessionsTable).fadeIn('slow'); initDataTables_(); }); }); }; /** * Inicializa la tabla que contiene la lista de sesiones * @method initModelsTable */ var initDataTables = function () { if(modelsTable){ modelsTable.destroy(); } if(sessionsTable){ sessionsTable.destroy(); } modelsTable = $('#models-list-table').DataTable({ 'responsive': true, 'language': { 'url': '/js/dataTables.spanish.lang' } }); sessionsTable = $('#sessions-list-table').DataTable({ 'responsive': true, 'language': { 'url': '/js/dataTables.spanish.lang' } }); }; }; /** * Crea e inicializa el objeto Session_List * @method init */ Session_List.init = function () { var app = new Session_List(); app.init(); }; $(Session_List.init);
define(["require", "exports", "../Libs/protos"], function (require, exports, protos_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ProtoCreator { static Init() { if (this._init) { return; } this._init = true; ProtoCreator._TYPE2ID.set(protos_1.Protos.G_AskPing, 10); ProtoCreator._TYPE2ID.set(protos_1.Protos.G_AskPingRet, 11); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2LS_AskRegister, 1000); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2LS_AskLogin, 1001); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2LS_AskSmartLogin, 1002); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2LS_AskWXLogin, 1003); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2LC_UpdateProfile, 1004); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2GS_AskLogin, 1100); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2GS_KeepAlive, 1101); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_AskLogin, 1200); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_KeepAlive, 1201); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_RequestSnapshot, 1202); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_FrameAction, 1203); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_RequestFrameActions, 1204); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_CommitSnapshot, 1205); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2BS_EndBattle, 1206); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_BeginMatch, 1300); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_CancelMatch, 1301); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_QueryRanking, 1302); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_QueryChampions, 1303); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_BuyChampion, 1304); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_CreateRoom, 1305); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_LeaveRoom, 1306); ProtoCreator._TYPE2ID.set(protos_1.Protos.GC2CS_JoinRoom, 1307); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2GC_GSInfo, 2000); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2GC_AskRegRet, 2001); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2GC_AskLoginRet, 2002); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2CS_GCLogin, 2100); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2DB_QueryAccount, 2200); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2DB_QueryLogin, 2201); ProtoCreator._TYPE2ID.set(protos_1.Protos.LS2DB_Exec, 2202); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2CS_ReportState, 3000); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2CS_GCAskLogin, 3001); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2CS_GCLost, 3002); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2GC_LoginRet, 3100); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2GC_Kick, 3101); ProtoCreator._TYPE2ID.set(protos_1.Protos.GS2GC_CSLost, 3102); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2CS_ReportState, 4000); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2CS_BattleInfoRet, 4001); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2CS_BattleEnd, 4002); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2CS_KickUser, 4003); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2GC_LoginRet, 4100); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2GC_RequestSnapshotRet, 4101); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2GC_FrameAction, 4102); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2GC_RequestFrameActionsRet, 4103); ProtoCreator._TYPE2ID.set(protos_1.Protos.BS2GC_OutOfSync, 4104); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2LS_GSInfos, 5000); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2LS_GSInfo, 5001); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2LS_GSLost, 5002); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2LS_GCLoginRet, 5003); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GS_GCLoginRet, 5100); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GS_KickGC, 5101); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2BS_BattleInfo, 5200); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2BS_BattleEndRet, 5201); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_BeginMatchRet, 5300); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_MatchState, 5303); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_AddToMatch, 5304); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_RemoveFromMatch, 5305); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_EnterBattle, 5306); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_BattleEnd, 5307); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_BSLose, 5308); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_QueryRankingRet, 5309); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_QueryChampionsRet, 5310); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_BuyChampionRet, 5111); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_CreateRoomRet, 5112); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2GC_JoinRoomRet, 5113); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2DB_UpdateRank, 5400); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2DB_QueryRanking, 5401); ProtoCreator._TYPE2ID.set(protos_1.Protos.CS2DB_BuyChampion, 5402); ProtoCreator._TYPE2ID.set(protos_1.Protos.DB2LS_QueryAccountRet, 8000); ProtoCreator._TYPE2ID.set(protos_1.Protos.DB2LS_QueryLoginRet, 8001); ProtoCreator._TYPE2ID.set(protos_1.Protos.DB2LS_ExecRet, 8002); ProtoCreator._TYPE2ID.set(protos_1.Protos.DB2CS_QueryRankingRet, 9000); ProtoCreator._TYPE2ID.set(protos_1.Protos.DB2CS_BuyChampionRet, 9001); ProtoCreator._ID2TYPE.set(10, protos_1.Protos.G_AskPing); ProtoCreator._ID2TYPE.set(11, protos_1.Protos.G_AskPingRet); ProtoCreator._ID2TYPE.set(1000, protos_1.Protos.GC2LS_AskRegister); ProtoCreator._ID2TYPE.set(1001, protos_1.Protos.GC2LS_AskLogin); ProtoCreator._ID2TYPE.set(1002, protos_1.Protos.GC2LS_AskSmartLogin); ProtoCreator._ID2TYPE.set(1003, protos_1.Protos.GC2LS_AskWXLogin); ProtoCreator._ID2TYPE.set(1004, protos_1.Protos.GC2LC_UpdateProfile); ProtoCreator._ID2TYPE.set(1100, protos_1.Protos.GC2GS_AskLogin); ProtoCreator._ID2TYPE.set(1101, protos_1.Protos.GC2GS_KeepAlive); ProtoCreator._ID2TYPE.set(1200, protos_1.Protos.GC2BS_AskLogin); ProtoCreator._ID2TYPE.set(1201, protos_1.Protos.GC2BS_KeepAlive); ProtoCreator._ID2TYPE.set(1202, protos_1.Protos.GC2BS_RequestSnapshot); ProtoCreator._ID2TYPE.set(1203, protos_1.Protos.GC2BS_FrameAction); ProtoCreator._ID2TYPE.set(1204, protos_1.Protos.GC2BS_RequestFrameActions); ProtoCreator._ID2TYPE.set(1205, protos_1.Protos.GC2BS_CommitSnapshot); ProtoCreator._ID2TYPE.set(1206, protos_1.Protos.GC2BS_EndBattle); ProtoCreator._ID2TYPE.set(1300, protos_1.Protos.GC2CS_BeginMatch); ProtoCreator._ID2TYPE.set(1301, protos_1.Protos.GC2CS_CancelMatch); ProtoCreator._ID2TYPE.set(1302, protos_1.Protos.GC2CS_QueryRanking); ProtoCreator._ID2TYPE.set(1303, protos_1.Protos.GC2CS_QueryChampions); ProtoCreator._ID2TYPE.set(1304, protos_1.Protos.GC2CS_BuyChampion); ProtoCreator._ID2TYPE.set(1305, protos_1.Protos.GC2CS_CreateRoom); ProtoCreator._ID2TYPE.set(1306, protos_1.Protos.GC2CS_LeaveRoom); ProtoCreator._ID2TYPE.set(1307, protos_1.Protos.GC2CS_JoinRoom); ProtoCreator._ID2TYPE.set(2000, protos_1.Protos.LS2GC_GSInfo); ProtoCreator._ID2TYPE.set(2001, protos_1.Protos.LS2GC_AskRegRet); ProtoCreator._ID2TYPE.set(2002, protos_1.Protos.LS2GC_AskLoginRet); ProtoCreator._ID2TYPE.set(2100, protos_1.Protos.LS2CS_GCLogin); ProtoCreator._ID2TYPE.set(2200, protos_1.Protos.LS2DB_QueryAccount); ProtoCreator._ID2TYPE.set(2201, protos_1.Protos.LS2DB_QueryLogin); ProtoCreator._ID2TYPE.set(2202, protos_1.Protos.LS2DB_Exec); ProtoCreator._ID2TYPE.set(3000, protos_1.Protos.GS2CS_ReportState); ProtoCreator._ID2TYPE.set(3001, protos_1.Protos.GS2CS_GCAskLogin); ProtoCreator._ID2TYPE.set(3002, protos_1.Protos.GS2CS_GCLost); ProtoCreator._ID2TYPE.set(3100, protos_1.Protos.GS2GC_LoginRet); ProtoCreator._ID2TYPE.set(3101, protos_1.Protos.GS2GC_Kick); ProtoCreator._ID2TYPE.set(3102, protos_1.Protos.GS2GC_CSLost); ProtoCreator._ID2TYPE.set(4000, protos_1.Protos.BS2CS_ReportState); ProtoCreator._ID2TYPE.set(4001, protos_1.Protos.BS2CS_BattleInfoRet); ProtoCreator._ID2TYPE.set(4002, protos_1.Protos.BS2CS_BattleEnd); ProtoCreator._ID2TYPE.set(4003, protos_1.Protos.BS2CS_KickUser); ProtoCreator._ID2TYPE.set(4100, protos_1.Protos.BS2GC_LoginRet); ProtoCreator._ID2TYPE.set(4101, protos_1.Protos.BS2GC_RequestSnapshotRet); ProtoCreator._ID2TYPE.set(4102, protos_1.Protos.BS2GC_FrameAction); ProtoCreator._ID2TYPE.set(4103, protos_1.Protos.BS2GC_RequestFrameActionsRet); ProtoCreator._ID2TYPE.set(4104, protos_1.Protos.BS2GC_OutOfSync); ProtoCreator._ID2TYPE.set(5000, protos_1.Protos.CS2LS_GSInfos); ProtoCreator._ID2TYPE.set(5001, protos_1.Protos.CS2LS_GSInfo); ProtoCreator._ID2TYPE.set(5002, protos_1.Protos.CS2LS_GSLost); ProtoCreator._ID2TYPE.set(5003, protos_1.Protos.CS2LS_GCLoginRet); ProtoCreator._ID2TYPE.set(5100, protos_1.Protos.CS2GS_GCLoginRet); ProtoCreator._ID2TYPE.set(5101, protos_1.Protos.CS2GS_KickGC); ProtoCreator._ID2TYPE.set(5200, protos_1.Protos.CS2BS_BattleInfo); ProtoCreator._ID2TYPE.set(5201, protos_1.Protos.CS2BS_BattleEndRet); ProtoCreator._ID2TYPE.set(5300, protos_1.Protos.CS2GC_BeginMatchRet); ProtoCreator._ID2TYPE.set(5303, protos_1.Protos.CS2GC_MatchState); ProtoCreator._ID2TYPE.set(5304, protos_1.Protos.CS2GC_AddToMatch); ProtoCreator._ID2TYPE.set(5305, protos_1.Protos.CS2GC_RemoveFromMatch); ProtoCreator._ID2TYPE.set(5306, protos_1.Protos.CS2GC_EnterBattle); ProtoCreator._ID2TYPE.set(5307, protos_1.Protos.CS2GC_BattleEnd); ProtoCreator._ID2TYPE.set(5308, protos_1.Protos.CS2GC_BSLose); ProtoCreator._ID2TYPE.set(5309, protos_1.Protos.CS2GC_QueryRankingRet); ProtoCreator._ID2TYPE.set(5310, protos_1.Protos.CS2GC_QueryChampionsRet); ProtoCreator._ID2TYPE.set(5111, protos_1.Protos.CS2GC_BuyChampionRet); ProtoCreator._ID2TYPE.set(5112, protos_1.Protos.CS2GC_CreateRoomRet); ProtoCreator._ID2TYPE.set(5113, protos_1.Protos.CS2GC_JoinRoomRet); ProtoCreator._ID2TYPE.set(5400, protos_1.Protos.CS2DB_UpdateRank); ProtoCreator._ID2TYPE.set(5401, protos_1.Protos.CS2DB_QueryRanking); ProtoCreator._ID2TYPE.set(5402, protos_1.Protos.CS2DB_BuyChampion); ProtoCreator._ID2TYPE.set(8000, protos_1.Protos.DB2LS_QueryAccountRet); ProtoCreator._ID2TYPE.set(8001, protos_1.Protos.DB2LS_QueryLoginRet); ProtoCreator._ID2TYPE.set(8002, protos_1.Protos.DB2LS_ExecRet); ProtoCreator._ID2TYPE.set(9000, protos_1.Protos.DB2CS_QueryRankingRet); ProtoCreator._ID2TYPE.set(9001, protos_1.Protos.DB2CS_BuyChampionRet); } static MakeTransMessage(msg, transTarget, transID) { msg.opts.flag |= 1 << 3; msg.opts.flag |= 1 << (3 + transTarget); msg.opts.transid = transID; } static Q_G_AskPing() { let msg = new protos_1.Protos.G_AskPing(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_G_AskPingRet() { let msg = new protos_1.Protos.G_AskPingRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2LS_AskRegister() { let msg = new protos_1.Protos.GC2LS_AskRegister(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2LS_AskLogin() { let msg = new protos_1.Protos.GC2LS_AskLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2LS_AskSmartLogin() { let msg = new protos_1.Protos.GC2LS_AskSmartLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2LS_AskWXLogin() { let msg = new protos_1.Protos.GC2LS_AskWXLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2LC_UpdateProfile() { let msg = new protos_1.Protos.GC2LC_UpdateProfile(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2GS_AskLogin() { let msg = new protos_1.Protos.GC2GS_AskLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2GS_KeepAlive() { let msg = new protos_1.Protos.GC2GS_KeepAlive(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2BS_AskLogin() { let msg = new protos_1.Protos.GC2BS_AskLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2BS_KeepAlive() { let msg = new protos_1.Protos.GC2BS_KeepAlive(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2BS_RequestSnapshot() { let msg = new protos_1.Protos.GC2BS_RequestSnapshot(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2BS_FrameAction() { let msg = new protos_1.Protos.GC2BS_FrameAction(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2BS_RequestFrameActions() { let msg = new protos_1.Protos.GC2BS_RequestFrameActions(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2BS_CommitSnapshot() { let msg = new protos_1.Protos.GC2BS_CommitSnapshot(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2BS_EndBattle() { let msg = new protos_1.Protos.GC2BS_EndBattle(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2CS_BeginMatch() { let msg = new protos_1.Protos.GC2CS_BeginMatch(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2CS_CancelMatch() { let msg = new protos_1.Protos.GC2CS_CancelMatch(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2CS_QueryRanking() { let msg = new protos_1.Protos.GC2CS_QueryRanking(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2CS_QueryChampions() { let msg = new protos_1.Protos.GC2CS_QueryChampions(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2CS_BuyChampion() { let msg = new protos_1.Protos.GC2CS_BuyChampion(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2CS_CreateRoom() { let msg = new protos_1.Protos.GC2CS_CreateRoom(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GC2CS_LeaveRoom() { let msg = new protos_1.Protos.GC2CS_LeaveRoom(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GC2CS_JoinRoom() { let msg = new protos_1.Protos.GC2CS_JoinRoom(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_LS2GC_GSInfo() { let msg = new protos_1.Protos.LS2GC_GSInfo(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_LS2GC_AskRegRet() { let msg = new protos_1.Protos.LS2GC_AskRegRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_LS2GC_AskLoginRet() { let msg = new protos_1.Protos.LS2GC_AskLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_LS2CS_GCLogin() { let msg = new protos_1.Protos.LS2CS_GCLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_LS2DB_QueryAccount() { let msg = new protos_1.Protos.LS2DB_QueryAccount(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_LS2DB_QueryLogin() { let msg = new protos_1.Protos.LS2DB_QueryLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_LS2DB_Exec() { let msg = new protos_1.Protos.LS2DB_Exec(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GS2CS_ReportState() { let msg = new protos_1.Protos.GS2CS_ReportState(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GS2CS_GCAskLogin() { let msg = new protos_1.Protos.GS2CS_GCAskLogin(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_GS2CS_GCLost() { let msg = new protos_1.Protos.GS2CS_GCLost(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GS2GC_LoginRet() { let msg = new protos_1.Protos.GS2GC_LoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GS2GC_Kick() { let msg = new protos_1.Protos.GS2GC_Kick(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_GS2GC_CSLost() { let msg = new protos_1.Protos.GS2GC_CSLost(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2CS_ReportState() { let msg = new protos_1.Protos.BS2CS_ReportState(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2CS_BattleInfoRet() { let msg = new protos_1.Protos.BS2CS_BattleInfoRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2CS_BattleEnd() { let msg = new protos_1.Protos.BS2CS_BattleEnd(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_BS2CS_KickUser() { let msg = new protos_1.Protos.BS2CS_KickUser(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2GC_LoginRet() { let msg = new protos_1.Protos.BS2GC_LoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2GC_RequestSnapshotRet() { let msg = new protos_1.Protos.BS2GC_RequestSnapshotRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2GC_FrameAction() { let msg = new protos_1.Protos.BS2GC_FrameAction(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2GC_RequestFrameActionsRet() { let msg = new protos_1.Protos.BS2GC_RequestFrameActionsRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_BS2GC_OutOfSync() { let msg = new protos_1.Protos.BS2GC_OutOfSync(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2LS_GSInfos() { let msg = new protos_1.Protos.CS2LS_GSInfos(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2LS_GSInfo() { let msg = new protos_1.Protos.CS2LS_GSInfo(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2LS_GSLost() { let msg = new protos_1.Protos.CS2LS_GSLost(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2LS_GCLoginRet() { let msg = new protos_1.Protos.CS2LS_GCLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GS_GCLoginRet() { let msg = new protos_1.Protos.CS2GS_GCLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GS_KickGC() { let msg = new protos_1.Protos.CS2GS_KickGC(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2BS_BattleInfo() { let msg = new protos_1.Protos.CS2BS_BattleInfo(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_CS2BS_BattleEndRet() { let msg = new protos_1.Protos.CS2BS_BattleEndRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_BeginMatchRet() { let msg = new protos_1.Protos.CS2GC_BeginMatchRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_MatchState() { let msg = new protos_1.Protos.CS2GC_MatchState(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_AddToMatch() { let msg = new protos_1.Protos.CS2GC_AddToMatch(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_RemoveFromMatch() { let msg = new protos_1.Protos.CS2GC_RemoveFromMatch(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_EnterBattle() { let msg = new protos_1.Protos.CS2GC_EnterBattle(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_BattleEnd() { let msg = new protos_1.Protos.CS2GC_BattleEnd(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_BSLose() { let msg = new protos_1.Protos.CS2GC_BSLose(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_QueryRankingRet() { let msg = new protos_1.Protos.CS2GC_QueryRankingRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_QueryChampionsRet() { let msg = new protos_1.Protos.CS2GC_QueryChampionsRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_BuyChampionRet() { let msg = new protos_1.Protos.CS2GC_BuyChampionRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_CreateRoomRet() { let msg = new protos_1.Protos.CS2GC_CreateRoomRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2GC_JoinRoomRet() { let msg = new protos_1.Protos.CS2GC_JoinRoomRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2DB_UpdateRank() { let msg = new protos_1.Protos.CS2DB_UpdateRank(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_CS2DB_QueryRanking() { let msg = new protos_1.Protos.CS2DB_QueryRanking(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_CS2DB_BuyChampion() { let msg = new protos_1.Protos.CS2DB_BuyChampion(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RPC; return msg; } static Q_DB2LS_QueryAccountRet() { let msg = new protos_1.Protos.DB2LS_QueryAccountRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_DB2LS_QueryLoginRet() { let msg = new protos_1.Protos.DB2LS_QueryLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_DB2LS_ExecRet() { let msg = new protos_1.Protos.DB2LS_ExecRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_DB2CS_QueryRankingRet() { let msg = new protos_1.Protos.DB2CS_QueryRankingRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static Q_DB2CS_BuyChampionRet() { let msg = new protos_1.Protos.DB2CS_BuyChampionRet(); msg.opts = new protos_1.Protos.MsgOpts(); return msg; } static R_GC2CS_QueryChampions(pid) { let msg = new protos_1.Protos.CS2GC_QueryChampionsRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_CS2BS_BattleInfo(pid) { let msg = new protos_1.Protos.BS2CS_BattleInfoRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_LS2DB_Exec(pid) { let msg = new protos_1.Protos.DB2LS_ExecRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2GS_AskLogin(pid) { let msg = new protos_1.Protos.GS2GC_LoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_CS2DB_BuyChampion(pid) { let msg = new protos_1.Protos.DB2CS_BuyChampionRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2CS_QueryRanking(pid) { let msg = new protos_1.Protos.CS2GC_QueryRankingRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2CS_JoinRoom(pid) { let msg = new protos_1.Protos.CS2GC_JoinRoomRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_BS2CS_BattleEnd(pid) { let msg = new protos_1.Protos.CS2BS_BattleEndRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2BS_AskLogin(pid) { let msg = new protos_1.Protos.BS2GC_LoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2CS_BeginMatch(pid) { let msg = new protos_1.Protos.CS2GC_BeginMatchRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GS2CS_GCAskLogin(pid) { let msg = new protos_1.Protos.CS2GS_GCLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_CS2DB_QueryRanking(pid) { let msg = new protos_1.Protos.DB2CS_QueryRankingRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_G_AskPing(pid) { let msg = new protos_1.Protos.G_AskPingRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2CS_BuyChampion(pid) { let msg = new protos_1.Protos.CS2GC_BuyChampionRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_LS2DB_QueryLogin(pid) { let msg = new protos_1.Protos.DB2LS_QueryLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_LS2CS_GCLogin(pid) { let msg = new protos_1.Protos.CS2LS_GCLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2LS_AskLogin(pid) { let msg = new protos_1.Protos.LS2GC_AskLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_LS2DB_QueryAccount(pid) { let msg = new protos_1.Protos.DB2LS_QueryAccountRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2CS_CreateRoom(pid) { let msg = new protos_1.Protos.CS2GC_CreateRoomRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2BS_RequestSnapshot(pid) { let msg = new protos_1.Protos.BS2GC_RequestSnapshotRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2LS_AskSmartLogin(pid) { let msg = new protos_1.Protos.LS2GC_AskLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2LS_AskRegister(pid) { let msg = new protos_1.Protos.LS2GC_AskRegRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2LS_AskWXLogin(pid) { let msg = new protos_1.Protos.LS2GC_AskLoginRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static R_GC2BS_RequestFrameActions(pid) { let msg = new protos_1.Protos.BS2GC_RequestFrameActionsRet(); msg.opts = new protos_1.Protos.MsgOpts(); msg.opts.flag |= 1 << protos_1.Protos.MsgOpts.Flag.RESP; msg.opts.rpid = pid; return msg; } static DecodeMsg(msgID, data, size) { switch (msgID) { case 10: { let msg = protos_1.Protos.G_AskPing.decode(data, size); return msg; } case 11: { let msg = protos_1.Protos.G_AskPingRet.decode(data, size); return msg; } case 1000: { let msg = protos_1.Protos.GC2LS_AskRegister.decode(data, size); return msg; } case 1001: { let msg = protos_1.Protos.GC2LS_AskLogin.decode(data, size); return msg; } case 1002: { let msg = protos_1.Protos.GC2LS_AskSmartLogin.decode(data, size); return msg; } case 1003: { let msg = protos_1.Protos.GC2LS_AskWXLogin.decode(data, size); return msg; } case 1004: { let msg = protos_1.Protos.GC2LC_UpdateProfile.decode(data, size); return msg; } case 1100: { let msg = protos_1.Protos.GC2GS_AskLogin.decode(data, size); return msg; } case 1101: { let msg = protos_1.Protos.GC2GS_KeepAlive.decode(data, size); return msg; } case 1200: { let msg = protos_1.Protos.GC2BS_AskLogin.decode(data, size); return msg; } case 1201: { let msg = protos_1.Protos.GC2BS_KeepAlive.decode(data, size); return msg; } case 1202: { let msg = protos_1.Protos.GC2BS_RequestSnapshot.decode(data, size); return msg; } case 1203: { let msg = protos_1.Protos.GC2BS_FrameAction.decode(data, size); return msg; } case 1204: { let msg = protos_1.Protos.GC2BS_RequestFrameActions.decode(data, size); return msg; } case 1205: { let msg = protos_1.Protos.GC2BS_CommitSnapshot.decode(data, size); return msg; } case 1206: { let msg = protos_1.Protos.GC2BS_EndBattle.decode(data, size); return msg; } case 1300: { let msg = protos_1.Protos.GC2CS_BeginMatch.decode(data, size); return msg; } case 1301: { let msg = protos_1.Protos.GC2CS_CancelMatch.decode(data, size); return msg; } case 1302: { let msg = protos_1.Protos.GC2CS_QueryRanking.decode(data, size); return msg; } case 1303: { let msg = protos_1.Protos.GC2CS_QueryChampions.decode(data, size); return msg; } case 1304: { let msg = protos_1.Protos.GC2CS_BuyChampion.decode(data, size); return msg; } case 1305: { let msg = protos_1.Protos.GC2CS_CreateRoom.decode(data, size); return msg; } case 1306: { let msg = protos_1.Protos.GC2CS_LeaveRoom.decode(data, size); return msg; } case 1307: { let msg = protos_1.Protos.GC2CS_JoinRoom.decode(data, size); return msg; } case 2000: { let msg = protos_1.Protos.LS2GC_GSInfo.decode(data, size); return msg; } case 2001: { let msg = protos_1.Protos.LS2GC_AskRegRet.decode(data, size); return msg; } case 2002: { let msg = protos_1.Protos.LS2GC_AskLoginRet.decode(data, size); return msg; } case 2100: { let msg = protos_1.Protos.LS2CS_GCLogin.decode(data, size); return msg; } case 2200: { let msg = protos_1.Protos.LS2DB_QueryAccount.decode(data, size); return msg; } case 2201: { let msg = protos_1.Protos.LS2DB_QueryLogin.decode(data, size); return msg; } case 2202: { let msg = protos_1.Protos.LS2DB_Exec.decode(data, size); return msg; } case 3000: { let msg = protos_1.Protos.GS2CS_ReportState.decode(data, size); return msg; } case 3001: { let msg = protos_1.Protos.GS2CS_GCAskLogin.decode(data, size); return msg; } case 3002: { let msg = protos_1.Protos.GS2CS_GCLost.decode(data, size); return msg; } case 3100: { let msg = protos_1.Protos.GS2GC_LoginRet.decode(data, size); return msg; } case 3101: { let msg = protos_1.Protos.GS2GC_Kick.decode(data, size); return msg; } case 3102: { let msg = protos_1.Protos.GS2GC_CSLost.decode(data, size); return msg; } case 4000: { let msg = protos_1.Protos.BS2CS_ReportState.decode(data, size); return msg; } case 4001: { let msg = protos_1.Protos.BS2CS_BattleInfoRet.decode(data, size); return msg; } case 4002: { let msg = protos_1.Protos.BS2CS_BattleEnd.decode(data, size); return msg; } case 4003: { let msg = protos_1.Protos.BS2CS_KickUser.decode(data, size); return msg; } case 4100: { let msg = protos_1.Protos.BS2GC_LoginRet.decode(data, size); return msg; } case 4101: { let msg = protos_1.Protos.BS2GC_RequestSnapshotRet.decode(data, size); return msg; } case 4102: { let msg = protos_1.Protos.BS2GC_FrameAction.decode(data, size); return msg; } case 4103: { let msg = protos_1.Protos.BS2GC_RequestFrameActionsRet.decode(data, size); return msg; } case 4104: { let msg = protos_1.Protos.BS2GC_OutOfSync.decode(data, size); return msg; } case 5000: { let msg = protos_1.Protos.CS2LS_GSInfos.decode(data, size); return msg; } case 5001: { let msg = protos_1.Protos.CS2LS_GSInfo.decode(data, size); return msg; } case 5002: { let msg = protos_1.Protos.CS2LS_GSLost.decode(data, size); return msg; } case 5003: { let msg = protos_1.Protos.CS2LS_GCLoginRet.decode(data, size); return msg; } case 5100: { let msg = protos_1.Protos.CS2GS_GCLoginRet.decode(data, size); return msg; } case 5101: { let msg = protos_1.Protos.CS2GS_KickGC.decode(data, size); return msg; } case 5200: { let msg = protos_1.Protos.CS2BS_BattleInfo.decode(data, size); return msg; } case 5201: { let msg = protos_1.Protos.CS2BS_BattleEndRet.decode(data, size); return msg; } case 5300: { let msg = protos_1.Protos.CS2GC_BeginMatchRet.decode(data, size); return msg; } case 5303: { let msg = protos_1.Protos.CS2GC_MatchState.decode(data, size); return msg; } case 5304: { let msg = protos_1.Protos.CS2GC_AddToMatch.decode(data, size); return msg; } case 5305: { let msg = protos_1.Protos.CS2GC_RemoveFromMatch.decode(data, size); return msg; } case 5306: { let msg = protos_1.Protos.CS2GC_EnterBattle.decode(data, size); return msg; } case 5307: { let msg = protos_1.Protos.CS2GC_BattleEnd.decode(data, size); return msg; } case 5308: { let msg = protos_1.Protos.CS2GC_BSLose.decode(data, size); return msg; } case 5309: { let msg = protos_1.Protos.CS2GC_QueryRankingRet.decode(data, size); return msg; } case 5310: { let msg = protos_1.Protos.CS2GC_QueryChampionsRet.decode(data, size); return msg; } case 5111: { let msg = protos_1.Protos.CS2GC_BuyChampionRet.decode(data, size); return msg; } case 5112: { let msg = protos_1.Protos.CS2GC_CreateRoomRet.decode(data, size); return msg; } case 5113: { let msg = protos_1.Protos.CS2GC_JoinRoomRet.decode(data, size); return msg; } case 5400: { let msg = protos_1.Protos.CS2DB_UpdateRank.decode(data, size); return msg; } case 5401: { let msg = protos_1.Protos.CS2DB_QueryRanking.decode(data, size); return msg; } case 5402: { let msg = protos_1.Protos.CS2DB_BuyChampion.decode(data, size); return msg; } case 8000: { let msg = protos_1.Protos.DB2LS_QueryAccountRet.decode(data, size); return msg; } case 8001: { let msg = protos_1.Protos.DB2LS_QueryLoginRet.decode(data, size); return msg; } case 8002: { let msg = protos_1.Protos.DB2LS_ExecRet.decode(data, size); return msg; } case 9000: { let msg = protos_1.Protos.DB2CS_QueryRankingRet.decode(data, size); return msg; } case 9001: { let msg = protos_1.Protos.DB2CS_BuyChampionRet.decode(data, size); return msg; } } return null; } static D_G_AskPing(data, size) { let msg = protos_1.Protos.G_AskPing.decode(data, size); return msg; } static D_G_AskPingRet(data, size) { let msg = protos_1.Protos.G_AskPingRet.decode(data, size); return msg; } static D_GC2LS_AskRegister(data, size) { let msg = protos_1.Protos.GC2LS_AskRegister.decode(data, size); return msg; } static D_GC2LS_AskLogin(data, size) { let msg = protos_1.Protos.GC2LS_AskLogin.decode(data, size); return msg; } static D_GC2LS_AskSmartLogin(data, size) { let msg = protos_1.Protos.GC2LS_AskSmartLogin.decode(data, size); return msg; } static D_GC2LS_AskWXLogin(data, size) { let msg = protos_1.Protos.GC2LS_AskWXLogin.decode(data, size); return msg; } static D_GC2LC_UpdateProfile(data, size) { let msg = protos_1.Protos.GC2LC_UpdateProfile.decode(data, size); return msg; } static D_GC2GS_AskLogin(data, size) { let msg = protos_1.Protos.GC2GS_AskLogin.decode(data, size); return msg; } static D_GC2GS_KeepAlive(data, size) { let msg = protos_1.Protos.GC2GS_KeepAlive.decode(data, size); return msg; } static D_GC2BS_AskLogin(data, size) { let msg = protos_1.Protos.GC2BS_AskLogin.decode(data, size); return msg; } static D_GC2BS_KeepAlive(data, size) { let msg = protos_1.Protos.GC2BS_KeepAlive.decode(data, size); return msg; } static D_GC2BS_RequestSnapshot(data, size) { let msg = protos_1.Protos.GC2BS_RequestSnapshot.decode(data, size); return msg; } static D_GC2BS_FrameAction(data, size) { let msg = protos_1.Protos.GC2BS_FrameAction.decode(data, size); return msg; } static D_GC2BS_RequestFrameActions(data, size) { let msg = protos_1.Protos.GC2BS_RequestFrameActions.decode(data, size); return msg; } static D_GC2BS_CommitSnapshot(data, size) { let msg = protos_1.Protos.GC2BS_CommitSnapshot.decode(data, size); return msg; } static D_GC2BS_EndBattle(data, size) { let msg = protos_1.Protos.GC2BS_EndBattle.decode(data, size); return msg; } static D_GC2CS_BeginMatch(data, size) { let msg = protos_1.Protos.GC2CS_BeginMatch.decode(data, size); return msg; } static D_GC2CS_CancelMatch(data, size) { let msg = protos_1.Protos.GC2CS_CancelMatch.decode(data, size); return msg; } static D_GC2CS_QueryRanking(data, size) { let msg = protos_1.Protos.GC2CS_QueryRanking.decode(data, size); return msg; } static D_GC2CS_QueryChampions(data, size) { let msg = protos_1.Protos.GC2CS_QueryChampions.decode(data, size); return msg; } static D_GC2CS_BuyChampion(data, size) { let msg = protos_1.Protos.GC2CS_BuyChampion.decode(data, size); return msg; } static D_GC2CS_CreateRoom(data, size) { let msg = protos_1.Protos.GC2CS_CreateRoom.decode(data, size); return msg; } static D_GC2CS_LeaveRoom(data, size) { let msg = protos_1.Protos.GC2CS_LeaveRoom.decode(data, size); return msg; } static D_GC2CS_JoinRoom(data, size) { let msg = protos_1.Protos.GC2CS_JoinRoom.decode(data, size); return msg; } static D_LS2GC_GSInfo(data, size) { let msg = protos_1.Protos.LS2GC_GSInfo.decode(data, size); return msg; } static D_LS2GC_AskRegRet(data, size) { let msg = protos_1.Protos.LS2GC_AskRegRet.decode(data, size); return msg; } static D_LS2GC_AskLoginRet(data, size) { let msg = protos_1.Protos.LS2GC_AskLoginRet.decode(data, size); return msg; } static D_LS2CS_GCLogin(data, size) { let msg = protos_1.Protos.LS2CS_GCLogin.decode(data, size); return msg; } static D_LS2DB_QueryAccount(data, size) { let msg = protos_1.Protos.LS2DB_QueryAccount.decode(data, size); return msg; } static D_LS2DB_QueryLogin(data, size) { let msg = protos_1.Protos.LS2DB_QueryLogin.decode(data, size); return msg; } static D_LS2DB_Exec(data, size) { let msg = protos_1.Protos.LS2DB_Exec.decode(data, size); return msg; } static D_GS2CS_ReportState(data, size) { let msg = protos_1.Protos.GS2CS_ReportState.decode(data, size); return msg; } static D_GS2CS_GCAskLogin(data, size) { let msg = protos_1.Protos.GS2CS_GCAskLogin.decode(data, size); return msg; } static D_GS2CS_GCLost(data, size) { let msg = protos_1.Protos.GS2CS_GCLost.decode(data, size); return msg; } static D_GS2GC_LoginRet(data, size) { let msg = protos_1.Protos.GS2GC_LoginRet.decode(data, size); return msg; } static D_GS2GC_Kick(data, size) { let msg = protos_1.Protos.GS2GC_Kick.decode(data, size); return msg; } static D_GS2GC_CSLost(data, size) { let msg = protos_1.Protos.GS2GC_CSLost.decode(data, size); return msg; } static D_BS2CS_ReportState(data, size) { let msg = protos_1.Protos.BS2CS_ReportState.decode(data, size); return msg; } static D_BS2CS_BattleInfoRet(data, size) { let msg = protos_1.Protos.BS2CS_BattleInfoRet.decode(data, size); return msg; } static D_BS2CS_BattleEnd(data, size) { let msg = protos_1.Protos.BS2CS_BattleEnd.decode(data, size); return msg; } static D_BS2CS_KickUser(data, size) { let msg = protos_1.Protos.BS2CS_KickUser.decode(data, size); return msg; } static D_BS2GC_LoginRet(data, size) { let msg = protos_1.Protos.BS2GC_LoginRet.decode(data, size); return msg; } static D_BS2GC_RequestSnapshotRet(data, size) { let msg = protos_1.Protos.BS2GC_RequestSnapshotRet.decode(data, size); return msg; } static D_BS2GC_FrameAction(data, size) { let msg = protos_1.Protos.BS2GC_FrameAction.decode(data, size); return msg; } static D_BS2GC_RequestFrameActionsRet(data, size) { let msg = protos_1.Protos.BS2GC_RequestFrameActionsRet.decode(data, size); return msg; } static D_BS2GC_OutOfSync(data, size) { let msg = protos_1.Protos.BS2GC_OutOfSync.decode(data, size); return msg; } static D_CS2LS_GSInfos(data, size) { let msg = protos_1.Protos.CS2LS_GSInfos.decode(data, size); return msg; } static D_CS2LS_GSInfo(data, size) { let msg = protos_1.Protos.CS2LS_GSInfo.decode(data, size); return msg; } static D_CS2LS_GSLost(data, size) { let msg = protos_1.Protos.CS2LS_GSLost.decode(data, size); return msg; } static D_CS2LS_GCLoginRet(data, size) { let msg = protos_1.Protos.CS2LS_GCLoginRet.decode(data, size); return msg; } static D_CS2GS_GCLoginRet(data, size) { let msg = protos_1.Protos.CS2GS_GCLoginRet.decode(data, size); return msg; } static D_CS2GS_KickGC(data, size) { let msg = protos_1.Protos.CS2GS_KickGC.decode(data, size); return msg; } static D_CS2BS_BattleInfo(data, size) { let msg = protos_1.Protos.CS2BS_BattleInfo.decode(data, size); return msg; } static D_CS2BS_BattleEndRet(data, size) { let msg = protos_1.Protos.CS2BS_BattleEndRet.decode(data, size); return msg; } static D_CS2GC_BeginMatchRet(data, size) { let msg = protos_1.Protos.CS2GC_BeginMatchRet.decode(data, size); return msg; } static D_CS2GC_MatchState(data, size) { let msg = protos_1.Protos.CS2GC_MatchState.decode(data, size); return msg; } static D_CS2GC_AddToMatch(data, size) { let msg = protos_1.Protos.CS2GC_AddToMatch.decode(data, size); return msg; } static D_CS2GC_RemoveFromMatch(data, size) { let msg = protos_1.Protos.CS2GC_RemoveFromMatch.decode(data, size); return msg; } static D_CS2GC_EnterBattle(data, size) { let msg = protos_1.Protos.CS2GC_EnterBattle.decode(data, size); return msg; } static D_CS2GC_BattleEnd(data, size) { let msg = protos_1.Protos.CS2GC_BattleEnd.decode(data, size); return msg; } static D_CS2GC_BSLose(data, size) { let msg = protos_1.Protos.CS2GC_BSLose.decode(data, size); return msg; } static D_CS2GC_QueryRankingRet(data, size) { let msg = protos_1.Protos.CS2GC_QueryRankingRet.decode(data, size); return msg; } static D_CS2GC_QueryChampionsRet(data, size) { let msg = protos_1.Protos.CS2GC_QueryChampionsRet.decode(data, size); return msg; } static D_CS2GC_BuyChampionRet(data, size) { let msg = protos_1.Protos.CS2GC_BuyChampionRet.decode(data, size); return msg; } static D_CS2GC_CreateRoomRet(data, size) { let msg = protos_1.Protos.CS2GC_CreateRoomRet.decode(data, size); return msg; } static D_CS2GC_JoinRoomRet(data, size) { let msg = protos_1.Protos.CS2GC_JoinRoomRet.decode(data, size); return msg; } static D_CS2DB_UpdateRank(data, size) { let msg = protos_1.Protos.CS2DB_UpdateRank.decode(data, size); return msg; } static D_CS2DB_QueryRanking(data, size) { let msg = protos_1.Protos.CS2DB_QueryRanking.decode(data, size); return msg; } static D_CS2DB_BuyChampion(data, size) { let msg = protos_1.Protos.CS2DB_BuyChampion.decode(data, size); return msg; } static D_DB2LS_QueryAccountRet(data, size) { let msg = protos_1.Protos.DB2LS_QueryAccountRet.decode(data, size); return msg; } static D_DB2LS_QueryLoginRet(data, size) { let msg = protos_1.Protos.DB2LS_QueryLoginRet.decode(data, size); return msg; } static D_DB2LS_ExecRet(data, size) { let msg = protos_1.Protos.DB2LS_ExecRet.decode(data, size); return msg; } static D_DB2CS_QueryRankingRet(data, size) { let msg = protos_1.Protos.DB2CS_QueryRankingRet.decode(data, size); return msg; } static D_DB2CS_BuyChampionRet(data, size) { let msg = protos_1.Protos.DB2CS_BuyChampionRet.decode(data, size); return msg; } static CreateMsgByID(msgID) { switch (msgID) { case 10: { return new protos_1.Protos.G_AskPing(); } case 11: { return new protos_1.Protos.G_AskPingRet(); } case 1000: { return new protos_1.Protos.GC2LS_AskRegister(); } case 1001: { return new protos_1.Protos.GC2LS_AskLogin(); } case 1002: { return new protos_1.Protos.GC2LS_AskSmartLogin(); } case 1003: { return new protos_1.Protos.GC2LS_AskWXLogin(); } case 1004: { return new protos_1.Protos.GC2LC_UpdateProfile(); } case 1100: { return new protos_1.Protos.GC2GS_AskLogin(); } case 1101: { return new protos_1.Protos.GC2GS_KeepAlive(); } case 1200: { return new protos_1.Protos.GC2BS_AskLogin(); } case 1201: { return new protos_1.Protos.GC2BS_KeepAlive(); } case 1202: { return new protos_1.Protos.GC2BS_RequestSnapshot(); } case 1203: { return new protos_1.Protos.GC2BS_FrameAction(); } case 1204: { return new protos_1.Protos.GC2BS_RequestFrameActions(); } case 1205: { return new protos_1.Protos.GC2BS_CommitSnapshot(); } case 1206: { return new protos_1.Protos.GC2BS_EndBattle(); } case 1300: { return new protos_1.Protos.GC2CS_BeginMatch(); } case 1301: { return new protos_1.Protos.GC2CS_CancelMatch(); } case 1302: { return new protos_1.Protos.GC2CS_QueryRanking(); } case 1303: { return new protos_1.Protos.GC2CS_QueryChampions(); } case 1304: { return new protos_1.Protos.GC2CS_BuyChampion(); } case 1305: { return new protos_1.Protos.GC2CS_CreateRoom(); } case 1306: { return new protos_1.Protos.GC2CS_LeaveRoom(); } case 1307: { return new protos_1.Protos.GC2CS_JoinRoom(); } case 2000: { return new protos_1.Protos.LS2GC_GSInfo(); } case 2001: { return new protos_1.Protos.LS2GC_AskRegRet(); } case 2002: { return new protos_1.Protos.LS2GC_AskLoginRet(); } case 2100: { return new protos_1.Protos.LS2CS_GCLogin(); } case 2200: { return new protos_1.Protos.LS2DB_QueryAccount(); } case 2201: { return new protos_1.Protos.LS2DB_QueryLogin(); } case 2202: { return new protos_1.Protos.LS2DB_Exec(); } case 3000: { return new protos_1.Protos.GS2CS_ReportState(); } case 3001: { return new protos_1.Protos.GS2CS_GCAskLogin(); } case 3002: { return new protos_1.Protos.GS2CS_GCLost(); } case 3100: { return new protos_1.Protos.GS2GC_LoginRet(); } case 3101: { return new protos_1.Protos.GS2GC_Kick(); } case 3102: { return new protos_1.Protos.GS2GC_CSLost(); } case 4000: { return new protos_1.Protos.BS2CS_ReportState(); } case 4001: { return new protos_1.Protos.BS2CS_BattleInfoRet(); } case 4002: { return new protos_1.Protos.BS2CS_BattleEnd(); } case 4003: { return new protos_1.Protos.BS2CS_KickUser(); } case 4100: { return new protos_1.Protos.BS2GC_LoginRet(); } case 4101: { return new protos_1.Protos.BS2GC_RequestSnapshotRet(); } case 4102: { return new protos_1.Protos.BS2GC_FrameAction(); } case 4103: { return new protos_1.Protos.BS2GC_RequestFrameActionsRet(); } case 4104: { return new protos_1.Protos.BS2GC_OutOfSync(); } case 5000: { return new protos_1.Protos.CS2LS_GSInfos(); } case 5001: { return new protos_1.Protos.CS2LS_GSInfo(); } case 5002: { return new protos_1.Protos.CS2LS_GSLost(); } case 5003: { return new protos_1.Protos.CS2LS_GCLoginRet(); } case 5100: { return new protos_1.Protos.CS2GS_GCLoginRet(); } case 5101: { return new protos_1.Protos.CS2GS_KickGC(); } case 5200: { return new protos_1.Protos.CS2BS_BattleInfo(); } case 5201: { return new protos_1.Protos.CS2BS_BattleEndRet(); } case 5300: { return new protos_1.Protos.CS2GC_BeginMatchRet(); } case 5303: { return new protos_1.Protos.CS2GC_MatchState(); } case 5304: { return new protos_1.Protos.CS2GC_AddToMatch(); } case 5305: { return new protos_1.Protos.CS2GC_RemoveFromMatch(); } case 5306: { return new protos_1.Protos.CS2GC_EnterBattle(); } case 5307: { return new protos_1.Protos.CS2GC_BattleEnd(); } case 5308: { return new protos_1.Protos.CS2GC_BSLose(); } case 5309: { return new protos_1.Protos.CS2GC_QueryRankingRet(); } case 5310: { return new protos_1.Protos.CS2GC_QueryChampionsRet(); } case 5111: { return new protos_1.Protos.CS2GC_BuyChampionRet(); } case 5112: { return new protos_1.Protos.CS2GC_CreateRoomRet(); } case 5113: { return new protos_1.Protos.CS2GC_JoinRoomRet(); } case 5400: { return new protos_1.Protos.CS2DB_UpdateRank(); } case 5401: { return new protos_1.Protos.CS2DB_QueryRanking(); } case 5402: { return new protos_1.Protos.CS2DB_BuyChampion(); } case 8000: { return new protos_1.Protos.DB2LS_QueryAccountRet(); } case 8001: { return new protos_1.Protos.DB2LS_QueryLoginRet(); } case 8002: { return new protos_1.Protos.DB2LS_ExecRet(); } case 9000: { return new protos_1.Protos.DB2CS_QueryRankingRet(); } case 9001: { return new protos_1.Protos.DB2CS_BuyChampionRet(); } } return null; } static GetMsgOpts(message) { let msgID = ProtoCreator.GetMsgID(message); switch (msgID) { case 10: { return message.opts; } case 11: { return message.opts; } case 1000: { return message.opts; } case 1001: { return message.opts; } case 1002: { return message.opts; } case 1003: { return message.opts; } case 1004: { return message.opts; } case 1100: { return message.opts; } case 1101: { return message.opts; } case 1200: { return message.opts; } case 1201: { return message.opts; } case 1202: { return message.opts; } case 1203: { return message.opts; } case 1204: { return message.opts; } case 1205: { return message.opts; } case 1206: { return message.opts; } case 1300: { return message.opts; } case 1301: { return message.opts; } case 1302: { return message.opts; } case 1303: { return message.opts; } case 1304: { return message.opts; } case 1305: { return message.opts; } case 1306: { return message.opts; } case 1307: { return message.opts; } case 2000: { return message.opts; } case 2001: { return message.opts; } case 2002: { return message.opts; } case 2100: { return message.opts; } case 2200: { return message.opts; } case 2201: { return message.opts; } case 2202: { return message.opts; } case 3000: { return message.opts; } case 3001: { return message.opts; } case 3002: { return message.opts; } case 3100: { return message.opts; } case 3101: { return message.opts; } case 3102: { return message.opts; } case 4000: { return message.opts; } case 4001: { return message.opts; } case 4002: { return message.opts; } case 4003: { return message.opts; } case 4100: { return message.opts; } case 4101: { return message.opts; } case 4102: { return message.opts; } case 4103: { return message.opts; } case 4104: { return message.opts; } case 5000: { return message.opts; } case 5001: { return message.opts; } case 5002: { return message.opts; } case 5003: { return message.opts; } case 5100: { return message.opts; } case 5101: { return message.opts; } case 5200: { return message.opts; } case 5201: { return message.opts; } case 5300: { return message.opts; } case 5303: { return message.opts; } case 5304: { return message.opts; } case 5305: { return message.opts; } case 5306: { return message.opts; } case 5307: { return message.opts; } case 5308: { return message.opts; } case 5309: { return message.opts; } case 5310: { return message.opts; } case 5111: { return message.opts; } case 5112: { return message.opts; } case 5113: { return message.opts; } case 5400: { return message.opts; } case 5401: { return message.opts; } case 5402: { return message.opts; } case 8000: { return message.opts; } case 8001: { return message.opts; } case 8002: { return message.opts; } case 9000: { return message.opts; } case 9001: { return message.opts; } } return null; } static GetMsgIDByType(type) { return ProtoCreator._TYPE2ID.get(type); } static GetMsgID(message) { return ProtoCreator._TYPE2ID.get(message.constructor); } } ProtoCreator._init = false; ProtoCreator._TYPE2ID = new Map(); ProtoCreator._ID2TYPE = new Map(); exports.ProtoCreator = ProtoCreator; }); //# sourceMappingURL=ProtoHelper.js.map
(function(a){function f(a){document.location.href=a}function g(){return a(".mnav").length?!0:!1}function h(b){var c=!0;b.each(function(){if(!a(this).is("ul")&&!a(this).is("ol")){c=!1;}});return c}function i(){return a(window).width()<b.switchWidth}function j(b){return a.trim(b.clone().children("ul, ol").remove().end().text())}function k(b){return a.inArray(b,e)===-1?!0:!1}function l(b){b.find(" > li").each(function(){var c=a(this),d=c.find("a").attr("href"),f=function(){return c.parent().parent().is("li")?c.parent().parent().find("a").attr("href"):null};c.find(" ul, ol").length&&l(c.find("> ul, > ol"));c.find(" > ul li, > ol li").length||c.find("ul, ol").remove();!k(f(),e)&&k(d,e)?c.appendTo(b.closest("ul#mmnav").find("li:has(a[href="+f()+"]):first ul")):k(d)?e.push(d):c.remove()})}function m(){var b=a('<ul id="mmnav" />');c.each(function(){a(this).children().clone().appendTo(b)});l(b);return b}function n(b,c,d){d?a('<option value="'+b.find("a:first").attr("href")+'">'+d+"</option>").appendTo(c):a('<option value="'+b.find("a:first").attr("href")+'">'+a.trim(j(b))+"</option>").appendTo(c)}function o(c,d){var e=a('<optgroup label="'+a.trim(j(c))+'" />');n(c,e,b.groupPageText);c.children("ul, ol").each(function(){a(this).children("li").each(function(){n(a(this),e)})});e.appendTo(d)}function p(c){var e=a('<select id="mm'+d+'" class="mnav" />');d++;b.topOptionText&&n(a("<li>"+b.topOptionText+"</li>"),e);c.children("li").each(function(){var c=a(this);c.children("ul, ol").length&&b.nested?o(c,e):n(c,e)});e.change(function(){f(a(this).val())}).prependTo(b.prependTo)}function q(){if(i()&&!g())if(b.combine){var d=m();p(d)}else c.each(function(){p(a(this))});if(i()&&g()){a(".mnav").show();c.hide()}if(!i()&&g()){a(".mnav").hide();c.show()}}var b={combine:!0,groupPageText:"Main",nested:!0,prependTo:"body",switchWidth:768,topOptionText:"Select a page"},c,d=0,e=[];a.fn.mobileMenu=function(d){d&&a.extend(b,d);if(h(a(this))){c=a(this);q();a(window).resize(function(){q()})}else alert("mobileMenu only works with <ul>/<ol>")}})(jQuery);
__version_info__ = (1, 1, 3) __version__ = ".".join("{0}".format(x) for x in __version_info__)
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ------------------------------------------------------------------------------------------ from typing import Any, Dict, List import torch from pytorch_lightning.utilities import move_data_to_device from InnerEye.Common.common_util import SUBJECT_METRICS_FILE_NAME from InnerEye.Common.metrics_constants import LoggingColumns, MetricType, TRAIN_PREFIX, VALIDATION_PREFIX from InnerEye.ML.common import ModelExecutionMode from InnerEye.ML.config import SegmentationModelBase from InnerEye.ML.dataset.sample import CroppedSample from InnerEye.ML.dataset.scalar_sample import ScalarItem from InnerEye.ML.lightning_base import InnerEyeLightning from InnerEye.ML.lightning_metrics import MetricForMultipleStructures from InnerEye.ML.metrics import compute_dice_across_patches from InnerEye.ML.metrics_dict import DataframeLogger, MetricsDict from InnerEye.ML.model_config_base import ModelConfigBase from InnerEye.ML.scalar_config import ScalarModelBase from InnerEye.ML.sequence_config import SequenceModelBase from InnerEye.ML.utils import image_util, metrics_util, model_util from InnerEye.ML.utils.dataset_util import DatasetExample, store_and_upload_example from InnerEye.ML.utils.model_util import get_scalar_model_inputs_and_labels from InnerEye.ML.utils.sequence_utils import apply_sequence_model_loss from pytorch_lightning import Trainer SUBJECT_OUTPUT_PER_RANK_PREFIX = f"{SUBJECT_METRICS_FILE_NAME}.rank" class SegmentationLightning(InnerEyeLightning): """ This class implements 3D segmentation models with PyTorch Lightning. """ def __init__(self, config: SegmentationModelBase, *args: Any, **kwargs: Any) -> None: super().__init__(config, *args, **kwargs) self.config = config self.model = config.create_model() self.loss_fn = model_util.create_segmentation_loss_function(config) self.ground_truth_ids = config.ground_truth_ids self.train_dice = MetricForMultipleStructures(ground_truth_ids=self.ground_truth_ids, is_training=True) self.val_dice = MetricForMultipleStructures(ground_truth_ids=self.ground_truth_ids, is_training=False) self.train_voxels = MetricForMultipleStructures(ground_truth_ids=self.ground_truth_ids, is_training=True, metric_name=MetricType.VOXEL_COUNT.value, use_average_across_structures=False) self.val_voxels = MetricForMultipleStructures(ground_truth_ids=self.ground_truth_ids, is_training=False, metric_name=MetricType.VOXEL_COUNT.value, use_average_across_structures=False) def forward(self, patches: torch.Tensor) -> torch.Tensor: # type: ignore """ Runs a set of 3D crops through the segmentation model, and returns the result. This method is used at inference time. :param patches: A tensor of size [batches, channels, Z, Y, X] """ return self.logits_to_posterior(self.model(patches)) def logits_to_posterior(self, logits: torch.Tensor) -> torch.Tensor: """ Apply Softmax on dimension 1 (Class) to map model output into a posterior probability distribution [0,1] """ return torch.nn.functional.softmax(logits, dim=1) def training_or_validation_step(self, sample: Dict[str, Any], batch_index: int, is_training: bool) -> torch.Tensor: """ Runs training for a single minibatch of training or validation data, and computes all metrics. :param is_training: If true, the method is called from `training_step`, otherwise it is called from `validation_step`. :param sample: The batched sample on which the model should be trained. :param batch_index: The index of the present batch (supplied only for diagnostics). """ cropped_sample: CroppedSample = CroppedSample.from_dict(sample=sample) # Forward propagation can lead to a model output that is smaller than the input image (crop). # labels_center_crop is the relevant part of the labels tensor that the model will actually produce. labels = cropped_sample.labels_center_crop mask = cropped_sample.mask_center_crop if is_training else None if is_training: logits = self.model(cropped_sample.image) else: with torch.no_grad(): logits = self.model(cropped_sample.image) loss = self.loss_fn(logits, labels) # apply Softmax on dimension 1 (Class) to map model output into a posterior probability distribution [0,1] posteriors = self.logits_to_posterior(logits) # apply mask if required if mask is not None: posteriors = image_util.apply_mask_to_posteriors(posteriors=posteriors, mask=mask) # post process posteriors to compute result segmentation = image_util.posteriors_to_segmentation(posteriors=posteriors) self.compute_metrics(cropped_sample, segmentation, is_training) self.write_loss(is_training, loss) return loss def compute_metrics(self, cropped_sample: CroppedSample, segmentation: torch.Tensor, is_training: bool) -> None: """ Computes and stores all metrics coming out of a single training step. :param cropped_sample: The batched image crops used for training or validation. :param segmentation: The segmentation that was produced by the model. :param is_training: If true, the method is called from `training_step`, otherwise it is called from `validation_step`. """ # dice_per_crop_and_class has one row per crop, with background class removed # Dice NaN means that both ground truth and prediction are empty. dice_per_crop_and_class = compute_dice_across_patches( segmentation=segmentation, ground_truth=cropped_sample.labels_center_crop, allow_multiple_classes_for_each_pixel=True)[:, 1:] # Number of foreground voxels per class, across all crops foreground_voxels = metrics_util.get_number_of_voxels_per_class(cropped_sample.labels)[:, 1:] # Store Dice and voxel count per sample in the minibatch. We need a custom aggregation logic for Dice # because it can be NaN. Also use custom logging for voxel count because Lightning's batch-size weighted # average has a bug. for i in range(dice_per_crop_and_class.shape[0]): dice = self.train_dice if is_training else self.val_dice dice.update(dice_per_crop_and_class[i, :]) voxel_count = self.train_voxels if is_training else self.val_voxels voxel_count.update(foreground_voxels[i, :]) # store diagnostics per batch center_indices = cropped_sample.center_indices if isinstance(center_indices, torch.Tensor): center_indices = center_indices.cpu().numpy() if is_training: self.storing_logger.train_diagnostics.append(center_indices) else: self.storing_logger.val_diagnostics.append(center_indices) if is_training and self.config.store_dataset_sample: # store the sample train patch from this epoch for visualization # remove batches and channels dataset_example = DatasetExample(image=cropped_sample.image[0][0].cpu().detach().numpy(), labels=cropped_sample.labels[0].cpu().detach().numpy(), prediction=segmentation[0].cpu().detach().numpy(), header=cropped_sample.metadata[0].image_header, # type: ignore patient_id=cropped_sample.metadata[0].patient_id, # type: ignore epoch=self.current_epoch) store_and_upload_example(dataset_example, self.config) num_subjects = cropped_sample.image.shape[0] self.log_on_epoch(name=MetricType.SUBJECT_COUNT, value=num_subjects, is_training=is_training, reduce_fx=torch.sum, sync_dist_op="sum") def training_or_validation_epoch_end(self, is_training: bool) -> None: """ Writes all training or validation metrics that were aggregated over the epoch to the loggers. """ dice = self.train_dice if is_training else self.val_dice for name, value in dice.compute_all(): self.log(name, value) dice.reset() voxel_count = self.train_voxels if is_training else self.val_voxels for name, value in voxel_count.compute_all(): self.log(name, value) voxel_count.reset() super().training_or_validation_epoch_end(is_training=is_training) def get_subject_output_file_per_rank(rank: int) -> str: """ Gets the name of a file that will store the per-rank per-subject model outputs. :param rank: The rank of the current model in distributed training. :return: A string like "rank7_metrics.csv" """ return f"{SUBJECT_OUTPUT_PER_RANK_PREFIX}{rank}" class ScalarLightning(InnerEyeLightning): """ This class implements training of classification, regression, and sequence models with PyTorch Lightning. """ def __init__(self, config: ScalarModelBase, *args: Any, **kwargs: Any) -> None: super().__init__(config, *args, **kwargs) self.model = config.create_model() raw_loss = model_util.create_scalar_loss_function(config) if isinstance(config, SequenceModelBase): self.loss_fn = lambda model_output, loss: apply_sequence_model_loss(raw_loss, model_output, loss) self.target_indices = config.get_target_indices() else: self.loss_fn = raw_loss self.target_indices = [] self.target_names = config.target_names self.is_classification_model = config.is_classification_model self.use_mean_teacher_model = config.compute_mean_teacher_model self.is_binary_classification_or_regression = True if len(config.class_names) == 1 else False self.logits_to_posterior_fn = config.get_post_loss_logits_normalization_function() self.loss_type = config.loss_type # These two fields store the PyTorch Lightning Metrics objects that will compute metrics on validation # and training set, in particular ones that are not possible to compute from a single minibatch (AUC and alike) self.train_metric_computers = config.create_metric_computers() self.val_metric_computers = config.create_metric_computers() self.compute_and_log_metrics = config.compute_and_log_metrics # if config.compute_grad_cam: # model_to_evaluate = self.train_val_params.mean_teacher_model if \ # config.compute_mean_teacher_model else self.train_val_params.model # self.guided_grad_cam = VisualizationMaps(model_to_evaluate, config) # config.visualization_folder.mkdir(exist_ok=True) def forward(self, *model_inputs: torch.Tensor) -> torch.Tensor: # type: ignore """ Runs a list of model input tensors through the model and returns the results. """ return self.logits_to_posterior(self.model(*model_inputs)) def logits_to_posterior(self, logits: torch.Tensor) -> torch.Tensor: """ Apply the model-specific normalization to go from logits (model outputs) to posteriors. """ return self.logits_to_posterior_fn(logits) def on_train_start(self) -> None: """ Initializes the per-rank logger objects that write to the file system. """ # These loggers store the per-subject model outputs. They cannot be initialized in the constructor because # the trainer object will not yet be set, and we need to get the rank from there. assert isinstance(self.trainer, Trainer) fixed_logger_columns = {LoggingColumns.CrossValidationSplitIndex.value: self.cross_validation_split_index} subject_output_file = get_subject_output_file_per_rank(self.trainer.global_rank) self.train_subject_outputs_logger = DataframeLogger(self.train_metrics_folder / subject_output_file, fixed_columns=fixed_logger_columns) self.val_subject_outputs_logger = DataframeLogger(self.val_metrics_folder / subject_output_file, fixed_columns=fixed_logger_columns) def training_or_validation_step(self, sample: Dict[str, Any], batch_index: int, is_training: bool) -> torch.Tensor: """ Runs training for a single minibatch of training or validation data, and computes all metrics. :param is_training: If true, the method is called from `training_step`, otherwise it is called from `validation_step`. :param sample: The batched sample on which the model should be trained. :param batch_index: The index of the present batch (supplied only for diagnostics). Runs a minibatch of training or validation data through the model. """ model_inputs_and_labels = get_scalar_model_inputs_and_labels(self.model, self.target_indices, sample) labels = model_inputs_and_labels.labels if is_training: logits = self.model(*model_inputs_and_labels.model_inputs) else: with torch.no_grad(): logits = self.model(*model_inputs_and_labels.model_inputs) subject_ids = model_inputs_and_labels.subject_ids loss = self.loss_fn(logits, labels) self.write_loss(is_training, loss) metrics = self.train_metric_computers if is_training else self.val_metric_computers logger = self.train_subject_outputs_logger if is_training else self.val_subject_outputs_logger # type: ignore data_split = ModelExecutionMode.TRAIN if is_training else ModelExecutionMode.VAL self.compute_and_log_metrics(logits=logits, targets=labels, subject_ids=subject_ids, is_training=is_training, metrics=metrics, logger=logger, current_epoch=self.current_epoch, data_split=data_split) self.log_on_epoch(name=MetricType.SUBJECT_COUNT, value=len(model_inputs_and_labels.subject_ids), is_training=is_training, reduce_fx=sum) return loss def training_or_validation_epoch_end(self, is_training: bool) -> None: """ Writes all training or validation metrics that were aggregated over the epoch to the loggers. """ metric_computers = self.train_metric_computers if is_training else self.val_metric_computers prefix = TRAIN_PREFIX if is_training else VALIDATION_PREFIX for prediction_target, metric_list in metric_computers.items(): target_suffix = "" if (prediction_target == MetricsDict.DEFAULT_HUE_KEY or self.is_binary_classification_or_regression) else f"/{prediction_target}" for metric in metric_list: if metric.has_predictions: # Sequence models can have no predictions at all for particular positions, depending on the data. # Hence, only log if anything has been accumulated. self.log(name=prefix + metric.name + target_suffix, value=metric.compute()) metric.reset() logger = self.train_subject_outputs_logger if is_training else self.val_subject_outputs_logger # type: ignore logger.flush() super().training_or_validation_epoch_end(is_training) def transfer_batch_to_device(self, batch: Any, device: torch.device) -> Any: # type: ignore """ For sequence models, transfer the nested lists of items to the given GPU device. For all other models, this relies on the superclass to move the batch of data to the GPU. :param batch: A batch of data coming from the dataloader. :param device: The target CUDA device. :return: A modified batch of data, where all tensor now live on the given CUDA device. """ return transfer_batch_to_device(batch, device) def transfer_batch_to_device(batch: Any, device: torch.device) -> Any: """ For sequence models, transfer the nested lists of items to the given GPU device. For all other models, this relies on Lightning's default code to move the batch of data to the GPU. :param batch: A batch of data coming from the dataloader. :param device: The target CUDA device. :return: A modified batch of data, where all tensor now live on the given CUDA device. """ if not isinstance(batch, dict): raise ValueError(f"This function expects a dictionary input, but got: {type(batch)}") # For sequence models, this method receives a dictionary with "item": List[List[ScalarItem]] items = batch.get("items", None) if items is not None and isinstance(items, List) and isinstance(items[0], List) and \ isinstance(items[0][0], ScalarItem): batch["items"] = [[j.to_device(device) for j in i] for i in items] return batch else: return move_data_to_device(batch, device) def create_lightning_model(config: ModelConfigBase, set_optimizer_and_scheduler: bool = True) -> InnerEyeLightning: """ Creates a PyTorch Lightning model that matches the provided InnerEye model configuration object. The `optimizer` and `l_rate_scheduler` object of the Lightning model will also be populated. :param set_optimizer_and_scheduler: If True (default), initialize the optimizer and LR scheduler of the model. If False, skip that step (this is only meant to be used for unit tests.) :param config: An InnerEye model configuration object :return: A PyTorch Lightning model object. """ if config.is_segmentation_model: model: InnerEyeLightning = SegmentationLightning(config) elif config.is_scalar_model: model = ScalarLightning(config) else: raise NotImplementedError(f"Don't know how to handle config of type {type(config)}") if set_optimizer_and_scheduler: model.set_optimizer_and_scheduler(config) return model
import React, { Component } from 'react'; import { Redirect } from 'react-router-dom'; import requester from '../../../api/utilities/requester'; import observer from '../../../api/utilities/observer'; export default class Logout extends Component { logout = () => { requester.post('user', '_logout', 'kinvey') .then(res => { observer.trigger(observer.events.logoutUser) }); } render = () => { this.logout(); return <Redirect to='/' /> } }
# -*- coding: utf-8 -*- from six.moves import http_cookiejar as cookielib import time import os import requests from requests import exceptions as excps from smart_qq_bot.config import ( SMART_QQ_REFER, COOKIE_FILE, SSL_VERIFY, ) from smart_qq_bot.logger import logger def _get_cookiejar(cookie_file): return cookielib.LWPCookieJar(cookie_file) class HttpClient(object): # urllib2.install_opener(_req) def __init__(self, load_cookie=False, cookie_file=COOKIE_FILE): if not os.path.isdir(os.path.dirname(cookie_file)): os.mkdir(os.path.dirname(cookie_file)) self._cookie_file = cookie_file self._cookies = _get_cookiejar(cookie_file) if load_cookie: self.load_cookie() self.session = requests.session() self.session.cookies = self._cookies @staticmethod def _get_headers(headers): """ :type headers: dict :rtype: dict """ _headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) " "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36", 'Referer': 'http://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1', } _headers.update(headers) return _headers def load_cookie(self): try: self._cookies.load(ignore_discard=True, ignore_expires=True) except : logger.warn("Failed to load cookie file {0}".format(self._cookie_file)) finally: self._cookies.save(ignore_discard=True, ignore_expires=True) @staticmethod def get_timestamp(): return str(int(time.time()*1000)) def get(self, url, refer=None): try: resp = self.session.get( url, headers=self._get_headers({'Referer': refer or SMART_QQ_REFER}), verify=SSL_VERIFY, ) except (excps.ConnectTimeout, excps.HTTPError): error_msg = "Failed to send finish request to `{0}`".format( url ) logger.exception(error_msg) return error_msg except requests.exceptions.SSLError: logger.exception("SSL连接验证失败,请检查您所在的网络环境。如果需要禁用SSL验证,请修改config.py中的SSL_VERIFY为False") else: self._cookies.save(COOKIE_FILE, ignore_discard=True, ignore_expires=True) return resp.text def post(self, url, data, refer=None): try: resp = self.session.post( url, data, headers=self._get_headers({'Referer': refer or SMART_QQ_REFER}), verify=SSL_VERIFY, ) except requests.exceptions.SSLError: logger.exception("SSL连接验证失败,请检查您所在的网络环境。如果需要禁用SSL验证,请修改config.py中的SSL_VERIFY为False") except (excps.ConnectTimeout, excps.HTTPError): error_msg = "Failed to send request to `{0}`".format( url ) logger.exception(error_msg) return error_msg else: self._cookies.save(COOKIE_FILE, ignore_discard=True, ignore_expires=True) return resp.text def get_cookie(self, key): for c in self._cookies: if c.name == key: return c.value return '' def download(self, url, fname): with open(fname, "wb") as o_file: try: resp = self.session.get(url, stream=True, verify=SSL_VERIFY) except requests.exceptions.SSLError: logger.exception("SSL连接验证失败,请检查您所在的网络环境。如果需要禁用SSL验证,请修改config.py中的SSL_VERIFY为False") except (excps.ConnectTimeout, excps.HTTPError): error_msg = "Failed to send request to `{0}`".format( url ) logger.exception(error_msg) return error_msg else: self._cookies.save(COOKIE_FILE, ignore_discard=True, ignore_expires=True) o_file.write(resp.raw.read())
/* This is a file for sample data used during development. */ const recipes = [ { name: "Chana Masala", categories: [ "Lunch", "Dinner", "Meal Prep", "Easy to Cook" ], nutrition: { calories: 500, protien: 25, carbs: 50, fat: 22 }, servings: 4, description: "Chana masala, also known as channay, chole masala, chhole masala, chole or chholay, is a dish originating from the Indian subcontinent. The main ingredient is a variety of chickpea called chana or kala chana" }, { name: "Tacos", categories: [ "Lunch", "Dinner" ], nutrition: { calories: 500, protien: 25, carbs: 50, fat: 22 }, servings: 4, description: "A taco is a traditional Mexican dish consisting of a small hand-sized corn or wheat tortilla topped with a filling. The tortilla is then folded around the filling and eaten by hand." }, { name: "Waffles", categories: [ "Breakfast", ], nutrition: { calories: 500, protien: 25, carbs: 50, fat: 22 }, servings: 4, description: "A waffle is a dish made from leavened batter or dough that is cooked between two plates that are patterned to give a characteristic size, shape, and surface impression. There are many variations based on the type of waffle iron and recipe used." }, { name: "Sandwich", categories: [ "Lunch", "Meal Prep", "Cold" ], nutrition: { calories: 500, protien: 25, carbs: 50, fat: 22 }, servings: 4, description: "A sandwich is a food typically consisting of vegetables, sliced cheese or meat, placed on or between slices of bread, or more generally any dish wherein bread serves as a container or wrapper for another food type" } ]; export default recipes;
"""Climate data pre-processing""" # Built ins import logging from distutils.version import LooseVersion from datetime import datetime # External libs import numpy as np import netCDF4 import xarray as xr # Locals from oggm import cfg from oggm import utils from oggm import entity_task from oggm.exceptions import InvalidParamsError # Module logger log = logging.getLogger(__name__) @entity_task(log, writes=['gcm_data']) def process_gcm_data(gdir, filesuffix='', prcp=None, temp=None, year_range=('1961', '1990'), scale_stddev=True, time_unit=None, calendar=None, source=''): """ Applies the anomaly method to GCM climate data This function can be applied to any GCM data, if it is provided in a suitable :py:class:`xarray.DataArray`. See Parameter description for format details. For CESM-LME a specific function :py:func:`tasks.process_cesm_data` is available which does the preprocessing of the data and subsequently calls this function. Parameters ---------- gdir : :py:class:`oggm.GlacierDirectory` where to write the data filesuffix : str append a suffix to the filename (useful for ensemble experiments). prcp : :py:class:`xarray.DataArray` | monthly total precipitation [mm month-1] | Coordinates: | lat float64 | lon float64 | time: cftime object temp : :py:class:`xarray.DataArray` | monthly temperature [K] | Coordinates: | lat float64 | lon float64 | time cftime object year_range : tuple of str the year range for which you want to compute the anomalies. Default is `('1961', '1990')` scale_stddev : bool whether or not to scale the temperature standard deviation as well time_unit : str The unit conversion for NetCDF files. It must be adapted to the length of the time series. The default is to choose it ourselves based on the starting year. For example: 'days since 0850-01-01 00:00:00' calendar : str If you use an exotic calendar (e.g. 'noleap') source : str For metadata: the source of the climate data """ # Standard sanity checks months = temp['time.month'] if (months[0] != 1) or (months[-1] != 12): raise ValueError('We expect the files to start in January and end in ' 'December!') if (np.abs(temp['lon']) > 180) or (np.abs(prcp['lon']) > 180): raise ValueError('We expect the longitude coordinates to be within ' '[-180, 180].') # from normal years to hydrological years sm = cfg.PARAMS['hydro_month_' + gdir.hemisphere] prcp = prcp[sm-1:sm-13].load() temp = temp[sm-1:sm-13].load() # Get CRU to apply the anomaly to fpath = gdir.get_filepath('climate_historical') ds_cru = xr.open_dataset(fpath) # Add CRU clim dscru = ds_cru.sel(time=slice(*year_range)) # compute monthly anomalies # of temp if scale_stddev: # This is a bit more arithmetic ts_tmp_sel = temp.sel(time=slice(*year_range)) ts_tmp_std = ts_tmp_sel.groupby('time.month').std(dim='time') std_fac = dscru.temp.groupby('time.month').std(dim='time') / ts_tmp_std std_fac = std_fac.roll(month=13-sm, roll_coords=True) std_fac = np.tile(std_fac.data, len(temp) // 12) # We need an even number of years for this to work if ((len(ts_tmp_sel) // 12) % 2) == 1: raise InvalidParamsError('We need an even number of years ' 'for this to work') win_size = len(ts_tmp_sel) + 1 def roll_func(x, axis=None): x = x[:, ::12] n = len(x[0, :]) // 2 xm = np.nanmean(x, axis=axis) return xm + (x[:, n] - xm) * std_fac temp = temp.rolling(time=win_size, center=True, min_periods=1).reduce(roll_func) ts_tmp_sel = temp.sel(time=slice(*year_range)) ts_tmp_avg = ts_tmp_sel.groupby('time.month').mean(dim='time') ts_tmp = temp.groupby('time.month') - ts_tmp_avg # of precip -- scaled anomalies ts_pre_avg = prcp.sel(time=slice(*year_range)) ts_pre_avg = ts_pre_avg.groupby('time.month').mean(dim='time') ts_pre_ano = prcp.groupby('time.month') - ts_pre_avg # scaled anomalies is the default. Standard anomalies above # are used later for where ts_pre_avg == 0 ts_pre = prcp.groupby('time.month') / ts_pre_avg # for temp loc_tmp = dscru.temp.groupby('time.month').mean() ts_tmp = ts_tmp.groupby('time.month') + loc_tmp # for prcp loc_pre = dscru.prcp.groupby('time.month').mean() # scaled anomalies ts_pre = ts_pre.groupby('time.month') * loc_pre # standard anomalies ts_pre_ano = ts_pre_ano.groupby('time.month') + loc_pre # Correct infinite values with standard anomalies ts_pre.values = np.where(np.isfinite(ts_pre.values), ts_pre.values, ts_pre_ano.values) # The previous step might create negative values (unlikely). Clip them ts_pre.values = utils.clip_min(ts_pre.values, 0) assert np.all(np.isfinite(ts_pre.values)) assert np.all(np.isfinite(ts_tmp.values)) gdir.write_monthly_climate_file(temp.time.values, ts_pre.values, ts_tmp.values, float(dscru.ref_hgt), prcp.lon.values, prcp.lat.values, time_unit=time_unit, calendar=calendar, file_name='gcm_data', source=source, filesuffix=filesuffix) ds_cru.close() @entity_task(log, writes=['gcm_data']) def process_cesm_data(gdir, filesuffix='', fpath_temp=None, fpath_precc=None, fpath_precl=None, **kwargs): """Processes and writes CESM climate data for this glacier. This function is made for interpolating the Community Earth System Model Last Millennium Ensemble (CESM-LME) climate simulations, from Otto-Bliesner et al. (2016), to the high-resolution CL2 climatologies (provided with OGGM) and writes everything to a NetCDF file. Parameters ---------- gdir : :py:class:`oggm.GlacierDirectory` where to write the data filesuffix : str append a suffix to the filename (useful for ensemble experiments). fpath_temp : str path to the temp file (default: cfg.PATHS['cesm_temp_file']) fpath_precc : str path to the precc file (default: cfg.PATHS['cesm_precc_file']) fpath_precl : str path to the precl file (default: cfg.PATHS['cesm_precl_file']) **kwargs: any kwarg to be passed to ref:`process_gcm_data` """ # CESM temperature and precipitation data if fpath_temp is None: if not ('cesm_temp_file' in cfg.PATHS): raise ValueError("Need to set cfg.PATHS['cesm_temp_file']") fpath_temp = cfg.PATHS['cesm_temp_file'] if fpath_precc is None: if not ('cesm_precc_file' in cfg.PATHS): raise ValueError("Need to set cfg.PATHS['cesm_precc_file']") fpath_precc = cfg.PATHS['cesm_precc_file'] if fpath_precl is None: if not ('cesm_precl_file' in cfg.PATHS): raise ValueError("Need to set cfg.PATHS['cesm_precl_file']") fpath_precl = cfg.PATHS['cesm_precl_file'] # read the files if LooseVersion(xr.__version__) < LooseVersion('0.11'): raise ImportError('This task needs xarray v0.11 or newer to run.') tempds = xr.open_dataset(fpath_temp) precpcds = xr.open_dataset(fpath_precc) preclpds = xr.open_dataset(fpath_precl) # Get the time right - i.e. from time bounds # Fix for https://github.com/pydata/xarray/issues/2565 with utils.ncDataset(fpath_temp, mode='r') as nc: time_unit = nc.variables['time'].units calendar = nc.variables['time'].calendar try: # xarray v0.11 time = netCDF4.num2date(tempds.time_bnds[:, 0], time_unit, calendar=calendar) except TypeError: # xarray > v0.11 time = tempds.time_bnds[:, 0].values # select for location lon = gdir.cenlon lat = gdir.cenlat # CESM files are in 0-360 if lon <= 0: lon += 360 # take the closest # Should we consider GCM interpolation? temp = tempds.TREFHT.sel(lat=lat, lon=lon, method='nearest') prcp = (precpcds.PRECC.sel(lat=lat, lon=lon, method='nearest') + preclpds.PRECL.sel(lat=lat, lon=lon, method='nearest')) temp['time'] = time prcp['time'] = time temp.lon.values = temp.lon if temp.lon <= 180 else temp.lon - 360 prcp.lon.values = prcp.lon if prcp.lon <= 180 else prcp.lon - 360 # Convert m s-1 to mm mth-1 if time[0].month != 1: raise ValueError('We expect the files to start in January!') ny, r = divmod(len(time), 12) assert r == 0 ndays = np.tile(cfg.DAYS_IN_MONTH, ny) prcp = prcp * ndays * (60 * 60 * 24 * 1000) tempds.close() precpcds.close() preclpds.close() # Here: # - time_unit='days since 0850-01-01 00:00:00' # - calendar='noleap' process_gcm_data(gdir, filesuffix=filesuffix, prcp=prcp, temp=temp, time_unit=time_unit, calendar=calendar, **kwargs) @entity_task(log, writes=['gcm_data']) def process_cmip5_data(gdir, filesuffix='', fpath_temp=None, fpath_precip=None, **kwargs): """Read, process and store the CMIP5 climate data data for this glacier. It stores the data in a format that can be used by the OGGM mass balance model and in the glacier directory. Currently, this function is built for the CMIP5 projection simulation (https://pcmdi.llnl.gov/mips/cmip5/) from Taylor et al. (2012). Parameters ---------- filesuffix : str append a suffix to the filename (useful for ensemble experiments). fpath_temp : str path to the temp file (default: cfg.PATHS['cmip5_temp_file']) fpath_precip : str path to the precip file (default: cfg.PATHS['cmip5_precip_file']) **kwargs: any kwarg to be passed to ref:`process_gcm_data` """ # Get the path of GCM temperature & precipitation data if fpath_temp is None: if not ('cmip5_temp_file' in cfg.PATHS): raise ValueError("Need to set cfg.PATHS['cmip5_temp_file']") fpath_temp = cfg.PATHS['cmip5_temp_file'] if fpath_precip is None: if not ('cmip5_precip_file' in cfg.PATHS): raise ValueError("Need to set cfg.PATHS['cmip5_precip_file']") fpath_precip = cfg.PATHS['cmip5_precip_file'] # Read the GCM files tempds = xr.open_dataset(fpath_temp, decode_times=False) precipds = xr.open_dataset(fpath_precip, decode_times=False) with utils.ncDataset(fpath_temp, mode='r') as nc: time_units = nc.variables['time'].units calendar = nc.variables['time'].calendar time = netCDF4.num2date(nc.variables['time'][:], time_units) # Select for location lon = gdir.cenlon lat = gdir.cenlat # Conversion of the longitude if lon <= 0: lon += 360 # Take the closest to the glacier # Should we consider GCM interpolation? temp = tempds.tas.sel(lat=lat, lon=lon, method='nearest') precip = precipds.pr.sel(lat=lat, lon=lon, method='nearest') # Time needs a set to start of month time = [datetime(t.year, t.month, 1) for t in time] temp['time'] = time precip['time'] = time temp.lon.values = temp.lon if temp.lon <= 180 else temp.lon - 360 precip.lon.values = precip.lon if precip.lon <= 180 else precip.lon - 360 # Convert kg m-2 s-1 to mm mth-1 => 1 kg m-2 = 1 mm !!! if temp.time[0].dt.month != 1: raise ValueError('We expect the files to start in January!') ny, r = divmod(len(temp), 12) assert r == 0 precip = precip * precip.time.dt.days_in_month * (60 * 60 * 24) tempds.close() precipds.close() # Here: # - time_unit='days since 1870-01-15 12:00:00' # - calendar='standard' process_gcm_data(gdir, filesuffix=filesuffix, prcp=precip, temp=temp, time_unit=time_units, calendar=calendar, source='CESM', **kwargs)
'use strict'; /* eslint-disable no-mixed-operators */ module.exports = (red, green, blue, alpha) => { const isPercent = (red + (alpha || '')).toString().includes('%'); if (typeof red === 'string') { const res = red.match(/(0?\.?\d{1,3})%?\b/g).map(Number); // TODO: use destructuring when targeting Node.js 6 red = res[0]; green = res[1]; blue = res[2]; alpha = res[3]; } else if (alpha !== undefined) { alpha = parseFloat(alpha); } if (typeof red !== 'number' || typeof green !== 'number' || typeof blue !== 'number' || red > 255 || green > 255 || blue > 255) { throw new TypeError('Expected three numbers below 256'); } if (typeof alpha === 'number') { if (!isPercent && alpha >= 0 && alpha <= 1) { alpha = Math.round(255 * alpha); } else if (isPercent && alpha >= 0 && alpha <= 100) { alpha = Math.round(255 * alpha / 100); } else { throw new TypeError(`Expected alpha value (${alpha}) as a fraction or percentage`); } alpha = (alpha | 1 << 8).toString(16).slice(1); } else { alpha = ''; } return ((blue | green << 8 | red << 16) | 1 << 24).toString(16).slice(1) + alpha; };
from tqdm import tqdm from . import limits from . import delay def unfollow(self, user_id): user_id = self.convert_to_user_id(user_id) if self.check_user(user_id): return True # whitelisted user if limits.check_if_bot_can_unfollow(self): delay.unfollow_delay(self) if super(self.__class__, self).unfollow(user_id): self.total_unfollowed += 1 return True else: self.logger.info("Out of unfollows for today.") return False def unfollow_users(self, user_ids): broken_items = [] self.logger.info("Going to unfollow %d users." % len(user_ids)) total_unfollowed = 0 for user_id in tqdm(user_ids): if not self.unfollow(user_id): delay.error_delay(self) broken_items.append(user_id) self.logger.info("DONE: Total unfollowed %d users. " % total_unfollowed) return broken_items def unfollow_non_followers(self): self.logger.info("Unfollowing non-followers") followings = set([item["pk"] for item in self.getTotalSelfFollowings()]) self.logger.info("You follow %d users." % len(followings)) followers = set([item["pk"] for item in self.getTotalSelfFollowers()]) self.logger.info("You are followed by %d users." % len(followers)) diff = followings - followers self.logger.info("%d users don't follow you back." % len(diff)) self.unfollow_users(list(diff)) def unfollow_everyone(self): your_following = self.get_user_following(self.user_id) self.unfollow_users(your_following)
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='orders', version='0.0.1', description='Orders microservice', long_description=long_description, url='https://github.com/pap/simplebank', author='Simplebank Engineering', author_email='engineering@simplebank.book', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules', "Programming Language :: Python", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Topic :: Internet", "Topic :: Software Development :: Libraries :: Python Modules", "Intended Audience :: Developers", ], keywords='microservices orders', packages=find_packages(exclude=['contrib', 'docs', 'tests']), install_requires=[ 'nameko>=2.6.0', 'logstash_formatter>=0.5.16', 'statsd>=3.2.1', "circuitbreaker>=1.0.1", 'gutter>=0.5.0', 'request-id>=0.2.1', 'nameko-sentry>=0.0.5', ], # List additional groups of dependencies here (e.g. development # dependencies). You can install these using the following syntax, # for example: # $ pip install -e .[dev,test] extras_require={ 'dev': ['check-manifest'], 'test': ['coverage'], }, )
frappe.ui.form.on("System Settings", "refresh", function(frm) { frappe.call({ method: "frappe.core.doctype.system_settings.system_settings.load", callback: function(data) { frappe.all_timezones = data.message.timezones; frm.set_df_property("time_zone", "options", frappe.all_timezones); $.each(data.message.defaults, function(key, val) { frm.set_value(key, val); frappe.sys_defaults[key] = val; }) } }); }); frappe.ui.form.on("System Settings", "enable_password_policy", function(frm) { if(frm.doc.enable_password_policy == 0){ frm.set_value("minimum_password_score", ""); } else { frm.set_value("minimum_password_score", "2"); } });
'use strict'; const Command = require('../../../../../../'); class TestCommand extends Command { constructor(rawArgv) { super(rawArgv); this.yargs.usage('test command'); this.yargs.options({ a: { type: 'string', description: 'test argv: a description', }, }); } async run({ argv }) { const aa = argv.a || ''; const bb = argv.b || ''; const cc = argv._.join(','); await this.ctx.service.file.write(`argv: ${aa}${bb}${cc}`); const con = await this.ctx.service.file.read(); console.log(con.toString()); return con; } get description() { return 'test description'; } } module.exports = TestCommand;
from setuptools import setup with open('README.md', 'r') as f_desc: long_description = f_desc.read() setup( name='exheader', version='0.0.1', description='Library for handling 3ds exheader files', long_description=long_description, long_description_content_type='text/markdown', py_modules=['exheader'], package_dir={'': 'src'}, classifiers=[ 'Programming Language :: Python :: 3', "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], )
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2018-11-5 SummerGift first version */ #ifndef __DRV_SPI_H__ #define __DRV_SPI_H__ #include <rtthread.h> #include "rtdevice.h" #include <rthw.h> #include <drv_common.h> #include "drv_dma.h" #ifdef __cplusplus extern "C" { #endif rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, GPIO_TypeDef* cs_gpiox, uint16_t cs_gpio_pin); #ifdef __cplusplus } #endif struct stm32_hw_spi_cs { GPIO_TypeDef* GPIOx; uint16_t GPIO_Pin; }; struct stm32_spi_config { SPI_TypeDef *Instance; char *bus_name; IRQn_Type irq_type; struct dma_config *dma_rx, *dma_tx; }; struct stm32_spi_device { rt_uint32_t pin; char *bus_name; char *device_name; }; #define SPI_USING_RX_DMA_FLAG (1<<0) #define SPI_USING_TX_DMA_FLAG (1<<1) /* stm32 spi dirver class */ struct stm32_spi { SPI_HandleTypeDef handle; struct stm32_spi_config *config; struct rt_spi_configuration *cfg; struct { DMA_HandleTypeDef handle_rx; DMA_HandleTypeDef handle_tx; } dma; rt_uint8_t spi_dma_flag; struct rt_spi_bus spi_bus; }; #endif /*__DRV_SPI_H__ */
import React from 'react' import { Link } from 'gatsby' import logo from '../img/logo.png' const Navbar = class extends React.Component { constructor(props) { super(props) this.state = { active: false, navBarActiveClass: '', } } toggleHamburger = () => { // toggle the active boolean in the state this.setState( { active: !this.state.active, }, // after state has been updated, () => { // set the class in state for the navbar accordingly this.state.active ? this.setState({ navBarActiveClass: 'is-active', }) : this.setState({ navBarActiveClass: '', }) } ) } render() { return ( <nav className="navbar is-transparent" role="navigation" aria-label="main navigation"> <div className="navbar-brand"> <p key="but" role="button" className={`navbar-burger burger ${this.state.navBarActiveClass}`} onClick={this.toggleHamburger} onKeyDown={this.toggleHamburger} aria-label="menu" aria-expanded="false" data-target="navbarExampleTransparentExample"> {// eslint-disable-line }<span></span> <span></span> <span></span> </p> </div> <div id="navbarExampleTransparentExample" className={`navbar-menu ${this.state.navBarActiveClass}`}> <div className="navbar-start"> <div className="navbar-item has-dropdown is-hoverable"> <Link className="navbar-link" href="/"> Residential Services </Link> <div className="navbar-dropdown is-boxed"> <Link style={{ fontSize: '1rem', fontWeight: '600', }} className="navbar-item" href="/"> Residential Doors </Link> <hr className="navbar-divider"/> <Link style={{ fontSize: '1rem', fontWeight: '600', }} className="navbar-item" href="/"> Garage Door Openers </Link> <Link className="navbar-item" href="/"> Jack Shaft Openers </Link> <Link className="navbar-item" href="/"> Chain Openers </Link> <Link className="navbar-item" href="/"> Belt Drive Openers </Link> </div> </div> <Link className="navbar-item" href="/commercial"> Commercial </Link> <Link className="navbar-item" href="/gate-repair"> Gate Repair </Link> <Link className="navbar-item" href="/blog"> Blog </Link> <Link className="navbar-item" href="/about"> About </Link> <Link className="navbar-item" href="/contact"> Contact </Link> </div> </div> </nav> ) } } export default Navbar
""" This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ from storage import Storage global_settings = Storage() settings = global_settings # legacy compatibility
$(function () { $(".exclusion_answer").click(function () { if ($(this).prop('checked') == true){ $(this).parent().parent().parent().find('input').prop('disabled', true); $(this).parent().parent().parent().find('input').prop('checked', false); $(this).prop('disabled', false); $(this).prop('checked', true); } else { $(this).parent().parent().parent().find('input').prop('disabled', false); } }); $(".col-sm-12 ._wrapper").each(function() { if ($(this).children(".checkbox:first").length !== 0) { var labelLen = []; $(this).children().children("label").each(function () { labelLen.push($(this).width()); }); calculateColumn(Math.max.apply(this, labelLen), $(this)); } }); function calculateColumn(maxLen, checkBoxParent) { if (checkBoxParent.children(".checkbox").length > 10) { if (window.matchMedia('(min-width: 320px)').matches) { if (maxLen <= 60) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '33.33%', 'float': 'left' }); } else if (maxLen <= 100) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '50%', 'float': 'left' }); } else { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '100%', 'float': 'left' }); } } if (window.matchMedia('(min-width:600px)').matches) { if (maxLen <= 150) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '33.33%', 'float': 'left' }); } else if (maxLen <= 250) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '50%', 'float': 'left' }); } else { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '100%', 'float': 'left' }); } } if (window.matchMedia('(min-width: 1024px)').matches) { if (maxLen <= 250) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '33.33%', 'float': 'left' }); } else if (maxLen <= 400) { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '50%', 'float': 'left' }); } else { checkBoxParent.children(".checkbox").css({ 'display': 'table', 'width': '100%', 'float': 'left' }); } } } } $(".col-sm-12 ._wrapper").each(function() { $(this).closest("._wrapper").find(".qb-form-input-other").prop("disabled", true); $(this).children(".radio:last").children("label").css('margin-bottom', '0px'); $(this).children(".checkbox:last").children("label").css('margin-bottom', '0px'); if ($(this).children(".checkbox:first").length !== 0) { if ($.trim($(this).children(".checkbox:last").text()) === "その他" || $.trim($(this).children(".checkbox:last").text()) === "Other") { $(this).children(".checkbox:last").css({ 'width': '100%' }); } } }); $(document).on("change", "select,input[type='radio']", function () { $(this).closest("._wrapper").find(".qb-form-input-other").prop("disabled", true); if ($.trim($(this).parent().text()) === "その他" || $.trim($(this).parent().text()) === "Other") { var other_input = $(this).closest("._wrapper").find(".qb-form-input-other"); other_input.prop("disabled", !$(this).prop("checked")); } if ($.trim($(this).find(':selected').text()) === "その他" || $.trim($(this).find(':selected').text()) === "Other") { var other_input = $(this).closest("._wrapper").find(".qb-form-input-other"); other_input.prop("disabled", false); } }); $(document).on("change", "input[type='checkbox']", function () { if ($.trim($(this).parent().text()) === "その他" || $.trim($(this).parent().text()) === "Other") { var other_input = $(this).closest("._wrapper").find(".qb-form-input-other"); other_input.prop("disabled", !$(this).prop("checked")); } }); $(".qb-form-input-other").prop("disabled", true); $("select, input[type='checkbox'] , input[type='radio']:checked").trigger("change"); $(".qb-form-input-other:disabled").val(""); $(document).ready(function() { var old_value_arr = vars('old_value_arr'); $(window).keydown(function(event){ if ((event.keyCode == 13) && ($.inArray(event.target, $('input[type=text]'))) >= 0) { event.preventDefault(); return false; } }); //prevent form submit on 'Enter' Key while the target is input text & textarea. $("input[type=text], textarea").each(function(){ var local_storage_value = localStorage.getItem($(this).attr('name')); var old_value = $(this).attr('name') in old_value_arr ? old_value_arr[$(this).attr('name')] : ''; var value = local_storage_value ? local_storage_value : old_value; $(this).val(value); //set local storage value to respective input box $(this).change(function(){ var key = $(this).attr('name'); var value = $(this).val(); localStorage.setItem(key,value); }); //save text input value to local storage. }); $("select").each(function() { if ($(this).hasClass('form-control')) { var selected_value = localStorage.getItem($(this).attr('name')); $(this).children().each(function() { var option = $(this); if (option.val() == selected_value) { option.attr('selected', true); if ((option.text() == 'その他' || option.text() == 'Other') && option.parent().next().hasClass('qb-form-input-other')) { var other_input = $(this).closest("._wrapper").find(".qb-form-input-other"); other_input.prop("disabled", false); } } }); //set local storage value to select box element $(this).change(function() { var key = $(this).attr('name'); var value = $(this).children("option:selected").val(); localStorage.setItem(key, value); }); //save selectbox selected value to local storage } }); $("input[type='radio']").each(function() { var checked_value = localStorage.getItem($(this).attr('name')); if ($(this).attr('value') == checked_value) { $(this).attr('checked', true); if ($(this).parent().next().length > 0 && $(this).parent().next().hasClass('qb-form-input-other')) { $(this).parent().next().attr('disabled', false); } } //set local storage value to radio element $(this).change(function() { var key = $(this).attr('name'); var value = $(this).attr('value'); localStorage.setItem(key, value); }); //save radio checked value to local storage }); $("input[type='checkbox']").each(function() { var checked_items = localStorage.getItem($(this).attr('name')); checked_item_arr = (checked_items) ? JSON.parse(checked_items) : []; var value = $(this).attr('value'); if (checked_item_arr.indexOf(value) >= 0) { $(this).attr('checked', true); if ($(this).parent().next().length > 0 && $(this).parent().next().hasClass('qb-form-input-other')) { $(this).parent().next().attr('disabled', false); } } //set local storage value to checkbox item $(this).change(function() { checked_items = localStorage.getItem($(this).attr('name')); checked_item_arr = (checked_items) ? JSON.parse(checked_items) : []; var key = $(this).attr('name'); var checkbox_value = $(this).attr('value'); if (checked_item_arr.indexOf(checkbox_value) < 0) { checked_item_arr.push(checkbox_value); } else { checked_item_arr = jQuery.grep(checked_item_arr, function(value) { return value != checkbox_value; }); } localStorage.setItem(key, JSON.stringify(checked_item_arr)); }); //save checkbox checked value to local storage }); }); var confirm_submit = true; $('.btn-confirm').on("click", function() { if (confirm_submit) { confirm_submit = false; if ($(this).attr('name') == '回答を送信') { showLoading(); } } else { return false; } }); //prevent double click on form submit. });
// // AFOMediaView.h // AFOPlayer // // Created by xueguang xian on 2017/12/28. // Copyright © 2017年 AFO. All rights reserved. // #import <UIKit/UIKit.h> @protocol AFOMediaViewDelegate @optional - (void)buttonTouchActionDelegate:(BOOL)isSuspended; @end @interface AFOMediaView : UIView - (instancetype)initWithFrame:(CGRect)frame delegate:(id)delegate; - (void)settingMovieImage:(UIImage *)image totalTime:(NSString *)totalTime currentTime:(NSString *)currentTime total:(NSInteger)total current:(NSInteger)current; - (void)settingPlayButtonPause; - (void)settingBottomViewShowOrHidden:(void (^)(UIView *view))block; @end
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var Project_service_1 = require("../Project.service"); var LocalReach_service_1 = require("./LocalReach.service"); var LocalProject_factory_1 = require("../LocalProject.factory"); var ProjectManipulation_component_1 = require("./ProjectManipulation.component"); var RemoteProjectManipulationComponent = /** @class */ (function (_super) { __extends(RemoteProjectManipulationComponent, _super); function RemoteProjectManipulationComponent(projectService, localReachService, localProjectService) { return _super.call(this, projectService, localReachService, localProjectService) || this; } RemoteProjectManipulationComponent = __decorate([ core_1.Component({ selector: 'remote-project-manipulation', template: require('./ProjectManipulation.component.htm') }), __metadata("design:paramtypes", [Project_service_1.ProjectService, LocalReach_service_1.LocalReachService, LocalProject_factory_1.LocalProjectFactory]) ], RemoteProjectManipulationComponent); return RemoteProjectManipulationComponent; }(ProjectManipulation_component_1.ProjectManipulationComponent)); exports.RemoteProjectManipulationComponent = RemoteProjectManipulationComponent; //# sourceMappingURL=RemoteProjectManipulation.component.js.map
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_CAPTIVE_PORTAL_CONTENT_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_ #define COMPONENTS_CAPTIVE_PORTAL_CONTENT_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_ #include "base/macros.h" #include "components/captive_portal/content/captive_portal_service.h" namespace captive_portal { // Triggers a captive portal test on navigations that may indicate a captive // portal has been logged into. Currently only tracks if a page was opened // at a captive portal tab's login page, and triggers checks every navigation // until there's no longer a captive portal, relying on the // CaptivePortalService's throttling to prevent excessive server load. // // TODO(mmenke): If a page has been broken by a captive portal, and it's // successfully reloaded, trigger a captive portal check. class CaptivePortalLoginDetector { public: explicit CaptivePortalLoginDetector( CaptivePortalService* captive_portal_service); ~CaptivePortalLoginDetector(); void OnStoppedLoading(); void OnCaptivePortalResults(CaptivePortalResult previous_result, CaptivePortalResult result); bool is_login_tab() const { return is_login_tab_; } void SetIsLoginTab(); private: CaptivePortalService* captive_portal_service_; // True if this is a login tab. Set manually, automatically cleared once // login is detected. bool is_login_tab_; // Page is on its first load since being tagged as a login tab. Used to // prevent a second captive portal check on the first load of the login page. bool first_login_tab_load_; DISALLOW_COPY_AND_ASSIGN(CaptivePortalLoginDetector); }; } // namespace captive_portal #endif // COMPONENTS_CAPTIVE_PORTAL_CONTENT_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_
import unittest from .context import mlog_extended ExtendedCompiler = mlog_extended.ExtendedCompiler CompilationError = mlog_extended.CompilationError class ControlTestSuite(unittest.TestCase): """Test xcontrol instructions.""" def test_control_actions(self): compiler = ExtendedCompiler() src_text = """ xcontrol generator1 action=toggle status=0 xcontrol generator1 action=enabled status=0 xcontrol cyclone1 action=shoot x=enemyX y=enemyY shoot=1 xcontrol cyclone1 action=shoot x=enemyX y=enemyY shoot=0 xcontrol cyclone1 action=shootp unit=enemy shoot=1 xcontrol cyclone1 action=shootp target=enemy shoot=1 xcontrol sorter1 action=configure config=@copper xcontrol sorter1 action=config config=@lead xcontrol illuminator1 action=color r=255 g=153 b=0 """ ans = """control enabled generator1 0 0 0 0 control enabled generator1 0 0 0 0 control shoot cyclone1 enemyX enemyY 1 0 control shoot cyclone1 enemyX enemyY 0 0 control shootp cyclone1 enemy 1 0 0 control shootp cyclone1 enemy 1 0 0 control configure sorter1 @copper 0 0 0 control configure sorter1 @lead 0 0 0 control color illuminator1 255 153 0 0 """ self.assertEqual(ans.splitlines(), compiler.compile(src_text).splitlines()) if __name__ == '__main__': unittest.main()
# encoding: utf-8 import os import re from datetime import datetime from typing import Tuple import requests from responses import Response from tqdm import tqdm from . import session from ..util import copyfileobj __data_endpoint__ = "data" base_url = f"{session.params.get('api_base_url')}/{__data_endpoint__}" class Data(object): """Provides Data objects for https://api.gdc.cancer.gov/data/ `Data Endpoints` Includes endpoints for file(s) download """ @classmethod def download( cls, uuid: str, path: str = ".", name: str = None ) -> Tuple[Response, str]: """Download file and return the related api response and the file path Parameters --------- uuid : str File UUID path: str Local path where save file (default: current path) name: str Filename. If not provided it will be saved with UUID as name Returns ------- tuple response, filename absolute path """ url = f"{base_url}/{uuid}" local_filename = name if name else uuid with requests.get(url, stream=True) as r: total_size = int(r.headers.get("content-length", 0)) bar = tqdm(total=total_size, unit="iB", unit_scale=True) with open(os.path.join(path, local_filename), "wb") as f: copyfileobj(r.raw, f, bar) return r, local_filename @classmethod def download_multiple( cls, uuid_list: list, path: str = "." ) -> Tuple[Response, str]: """Download multiple files and return the related api response and the file path Parameters --------- uuid_list : list List of UUID(s) to save path: str Local path where save file (default: current path) Returns ------- tuple response, filename absolute path """ with requests.post(base_url, stream=True, data={"ids": uuid_list}) as r: d = r.headers["content-disposition"] fname = re.findall("filename=(.+)", d)[0] local_filename = ( fname if fname else f"gdc_download_{datetime.now().strftime('%Y%m%d%H%M%S')}.tar.gz" ) total_size = int(r.headers.get("content-length", 0)) bar = tqdm(total=total_size, unit="iB", unit_scale=True) with open(os.path.join(path, local_filename), "wb") as f: for data in r.iter_content(chunk_size=1024): size = f.write(data) bar.update(size) return r, local_filename
from torchvision import models from torchvision import transforms from PIL import Image import argparse import torch import torchvision import torch.nn as nn import numpy as np # Device configuration device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def load_image(image_path, transform=None, max_size=None, shape=None): """Load an image and convert it to a torch tensor.""" image = Image.open(image_path) if max_size: scale = max_size / max(image.size) size = np.array(image.size) * scale image = image.resize(size.astype(int), Image.ANTIALIAS) if shape: image = image.resize(shape, Image.LANCZOS) if transform: image = transform(image).unsqueeze(0) return image.to(device) class VGGNet(nn.Module): def __init__(self): """Select conv1_1 ~ conv5_1 activation maps.""" super(VGGNet, self).__init__() self.select = ['0', '5', '10', '19', '28'] self.vgg = models.vgg19(pretrained=True).features def forward(self, x): """Extract multiple convolutional feature maps.""" features = [] for name, layer in self.vgg._modules.items(): x = layer(x) if name in self.select: features.append(x) return features def main(config): # Image preprocessing # VGGNet was trained on ImageNet where images are normalized by mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225]. # We use the same normalization statistics here. transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))]) # Load content and style images # Make the style image same size as the content image content = load_image(config.content, transform, max_size=config.max_size) style = load_image(config.style, transform, shape=[content.size(2), content.size(3)]) # Initialize a target image with the content image target = content.clone().requires_grad_(True) optimizer = torch.optim.Adam([target], lr=config.lr, betas=[0.5, 0.999]) vgg = VGGNet().to(device).eval() for step in range(config.total_step): # Extract multiple(5) conv feature vectors target_features = vgg(target) content_features = vgg(content) style_features = vgg(style) style_loss = 0 content_loss = 0 for f1, f2, f3 in zip(target_features, content_features, style_features): # Compute content loss with target and content images content_loss += torch.mean((f1 - f2)**2) # Reshape convolutional feature maps _, c, h, w = f1.size() f1 = f1.view(c, h * w) f3 = f3.view(c, h * w) # Compute gram matrix f1 = torch.mm(f1, f1.t()) f3 = torch.mm(f3, f3.t()) # Compute style loss with target and style images style_loss += torch.mean((f1 - f3)**2) / (c * h * w) # Compute total loss, backprop and optimize loss = content_loss + config.style_weight * style_loss optimizer.zero_grad() loss.backward() optimizer.step() if (step+1) % config.log_step == 0: print ('Step [{}/{}], Content Loss: {:.4f}, Style Loss: {:.4f}' .format(step+1, config.total_step, content_loss.item(), style_loss.item())) if (step+1) % config.sample_step == 0: # Save the generated image denorm = transforms.Normalize((-2.12, -2.04, -1.80), (4.37, 4.46, 4.44)) img = target.clone().squeeze() img = denorm(img).clamp_(0, 1) torchvision.utils.save_image(img, 'output-{}.png'.format(step+1)) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--content', type=str, default='png/content.png') parser.add_argument('--style', type=str, default='png/style.png') parser.add_argument('--max_size', type=int, default=400) parser.add_argument('--total_step', type=int, default=2000) parser.add_argument('--log_step', type=int, default=10) parser.add_argument('--sample_step', type=int, default=500) parser.add_argument('--style_weight', type=float, default=100) parser.add_argument('--lr', type=float, default=0.003) config = parser.parse_args() print(config) main(config) """ python /home/zt/Documents/PytorchLearning/ch07_Neural_style_transfer/Neural_style_transfer.py --content='/home/zt/Documents/PytorchLearning/ch07_Neural_style_transfer/png/content.png' --style='/home/zt/Documents/PytorchLearning/ch07_Neural_style_transfer/data/yuzhou/timg.jpeg' """
from .decision_tree_classifier import DecisionTreeClassifier from .decision_tree_regressor import DecisionTreeRegressor __all__ = [ 'DecisionTreeClassifier', 'DecisionTreeRegressor', ]
from django.contrib.auth.models import User from django.core import mail from django.http import HttpResponseRedirect from django.test import override_settings, RequestFactory, TestCase from django.urls import reverse import json from tests.utils import assert_urls_equivalent from uniauth.models import Institution, InstitutionAccount, LinkedEmail from uniauth.views import _add_institution_account, _get_global_context, \ _login_success, _send_verification_email, get_jwt_tokens_from_session class AddInstitutionAccountTests(TestCase): """ Tests the _add_instituion_account method in views.py """ def setUp(self): self.inst1 = Institution.objects.create(name="Test Uni", slug="test-uni", cas_server_url="https://cas.testuni.edu") self.inst2 = Institution.objects.create(name="Other Inst", slug="other-inst", cas_server_url="https://fed.other-inst.edu") def test_add_institution_account_link_succeeds(self): """ Ensures the method successfully links the new Institution Account to the profile """ user = User.objects.create(username="johndoe") User.objects.create(username="cas-test-uni-jd123") _add_institution_account(user.uniauth_profile, "test-uni", "jd123") linked_accounts = user.uniauth_profile.accounts.all() cas_user1 = User.objects.get(username="cas-test-uni-jd123") self.assertEqual(len(linked_accounts), 1) self.assertEqual(linked_accounts[0].institution, self.inst1) self.assertEqual(linked_accounts[0].cas_id, "jd123") User.objects.create(username="cas-other-inst-john.doe4") _add_institution_account(user.uniauth_profile, "other-inst", "john.doe4") linked_accounts = user.uniauth_profile.accounts.all() cas_user2 = User.objects.get(username="cas-other-inst-john.doe4") self.assertEqual(len(linked_accounts), 2) self.assertEqual(linked_accounts[1].institution, self.inst2) self.assertEqual(linked_accounts[1].cas_id, "john.doe4") class GetGlobalContextTests(TestCase): """ Tests the _get_global_context method in views.py """ def setUp(self): self.factory = RequestFactory() Institution.objects.all().delete() self.inst1 = Institution.objects.create(name="Test Uni", slug="test-uni", cas_server_url="https://cas.testuni.edu") self.inst2 = Institution.objects.create(name="Other Inst", slug="other-inst", cas_server_url="https://fed.other-inst.edu") def test_get_global_context_correct(self): """ Ensure method returns the expected template context """ request = self.factory.get("/accounts/login/", data={"foo": "bar", "next": "/next-page/"}) result = _get_global_context(request) result["institutions"].sort(key=lambda x: x[0]) expected_institutions = [ ("Other Inst", "other-inst", "/accounts/cas-login/other-inst/", "/accounts/link-from-profile/other-inst/"), ("Test Uni", "test-uni", "/accounts/cas-login/test-uni/", "/accounts/link-from-profile/test-uni/"), ] expected_params = "?foo=bar&next=%2Fnext-page%2F" self.assertEqual(sorted(list(result.keys())), ["institutions", "query_params"]) self.assertEqual(result["institutions"], expected_institutions) assert_urls_equivalent(result["query_params"], expected_params, self.assertEqual) class LoginSuccessTests(TestCase): """ Tests the _login_success method in views.py """ factory = RequestFactory() def _run_test(self, username, params_dict, expected_url): user = User.objects.create(username=username) request = self.factory.get("/test/page/", data=params_dict) result = _login_success(request, user, "/next-page/") self.assertEqual(type(result), HttpResponseRedirect) assert_urls_equivalent(result.url, expected_url, self.assertEqual) def test_login_success_correct_destination(self): """ Ensure method returns the correct destination URL, dependent on whether the user has a temporary account """ self._run_test("tmp-abc123", {}, "/accounts/link-to-profile/?next=%2Fnext-page%2F") with self.settings(UNIAUTH_ALLOW_STANDALONE_ACCOUNTS=False): self._run_test("cas-dashed-inst-id123", {}, "/accounts/link-to-profile/?next=%2Fnext-page%2F") with self.settings(UNIAUTH_ALLOW_STANDALONE_ACCOUNTS=True): self._run_test("cas-dashed-inst-id987", {}, "/next-page/") self._run_test("john.doe@hmail.moc", {}, "/next-page/") def test_login_success_preserve_query_params(self): """ Ensure outputted URL preserves query parameters """ self._run_test("tmp-a0b1c2", {"hello": "world"}, "/accounts/link-to-profile/?hello=world&next=%2Fnext-page%2F") self._run_test("tmp-z9y8x7", {"foo": "bar", "next": "/detour/"}, "/accounts/link-to-profile/?foo=bar&next=%2Fnext-page%2F") self._run_test("example@foo.bar", {"hi": "bye"}, "/next-page/?hi=bye") self._run_test("student@inst.edu", {"dead": "beef", "next": "/detour/"}, "/next-page/?dead=beef") @override_settings(UNIAUTH_USE_JWT_AUTH=True) def test_login_success_use_jwt_auth(self): user = User.objects.create(username="student@institution.edu") self.client.force_login(user) session = self.client.session response = self.client.get(reverse('uniauth:login')) self.assertEqual(type(response), HttpResponseRedirect) self.assertTrue(session['jwt-refresh']) self.assertTrue(session['jwt-access']) class SendVerificationEmail(TestCase): """ Tests the _send_verification_email method in views.py """ factory = RequestFactory() @override_settings(UNIAUTH_FROM_EMAIL="uniauth@testsmtp.ml") def test_send_verification_email_correct(self): """ Ensure the subject, to address, and from address for a sent verification email is correct """ user = User.objects.create(username="student") verify_email = LinkedEmail.objects.create(profile=user.uniauth_profile, address="toverify@gmail.com", is_verified=False) request = self.factory.get("/accounts/somepage/", secure=False) _send_verification_email(request, "student@example.edu", verify_email) self.assertEqual(len(mail.outbox), 1) self.assertTrue("verify" in mail.outbox[0].subject.lower()) self.assertTrue("/verify-token/" in mail.outbox[0].body) self.assertEqual(mail.outbox[0].to, ["student@example.edu"]) self.assertEqual(mail.outbox[0].from_email, "uniauth@testsmtp.ml") user2 = User.objects.create(username="otherstud") verify_email2 = LinkedEmail.objects.create( profile=user2.uniauth_profile, address="stud_2@example.edu", is_verified=False) request = self.factory.get("/accounts/otherpage/", secure=True) _send_verification_email(request, "stud_2@example.edu", verify_email2) self.assertEqual(len(mail.outbox), 2) self.assertTrue("verify" in mail.outbox[1].subject.lower()) self.assertTrue("/verify-token/" in mail.outbox[1].body) self.assertEqual(mail.outbox[1].to, ["stud_2@example.edu"]) self.assertEqual(mail.outbox[1].from_email, "uniauth@testsmtp.ml") class GetJWTTokensFromSession(TestCase): """ Tests the get_jwt_tokens_from_session method in views.py """ factory = RequestFactory() FAKE_REFRESH_TOKEN = "refresh.token.string" FAKE_ACCESS_TOKEN = "access.token.string" def _run_test(self, username, session_state, expected_response_status, expected_response_data): user = User.objects.create(username=username) request = self.factory.get("/jwt-tokens/", data={}) request.user = user request.session = session_state response = get_jwt_tokens_from_session(request) self.assertEqual(response.status_code, expected_response_status) self.assertEqual(json.loads(response.content.decode('utf-8')), expected_response_data) def test_get_jwt_tokens_from_session(self): self._run_test("tmp-c65433", {"jwt-refresh": self.FAKE_REFRESH_TOKEN, "jwt-access": self.FAKE_ACCESS_TOKEN}, 200, {"refresh": self.FAKE_REFRESH_TOKEN, "access": self.FAKE_ACCESS_TOKEN}) self._run_test("tmp-a67653", {"jwt-refresh": self.FAKE_REFRESH_TOKEN}, 404, {}) self._run_test("tmp-a65343", {"jwt-access": self.FAKE_ACCESS_TOKEN}, 404, {}) self._run_test("tmp-a75643", {}, 404, {})
import logging import numpy from ..functions import get_subspace, parse_indices from . import abstract logger = logging.getLogger(__name__) class RaggedIndexedSubarray(abstract.CompressedSubarray): """An underlying indexed ragged sub-array.""" def __getitem__(self, indices): """x.__getitem__(indices) <==> x[indices] Returns a numpy array. """ # The compressed array array = self.array # Initialize the full, uncompressed output array with missing # data everywhere uarray = numpy.ma.masked_all(self.shape, dtype=array.dtype) p_indices = [slice(None)] * uarray.ndim compression = self.compression instance_axis = compression["instance_axis"] instance_index = compression["instance_index"] element_axis = compression["i_element_axis"] sample_indices = compression["i_element_indices"] p_indices[instance_axis] = instance_index p_indices[element_axis] = slice(0, len(sample_indices)) uarray[tuple(p_indices)] = array[sample_indices] logger.debug("instance_axis = {}".format(instance_axis)) logger.debug("instance_index = {}".format(instance_index)) logger.debug("element_axis = {}".format(element_axis)) logger.debug("sample_indices = {}".format(sample_indices)) logger.debug("p_indices = {}".format(p_indices)) logger.debug("uarray.shape = {}".format(uarray.shape)) logger.debug("self.array.shape = {}".format(array.shape)) if indices is Ellipsis: return uarray else: logger.debug("indices = {}".format(indices)) indices = parse_indices(self.shape, indices) logger.debug( "parse_indices(self.shape, indices) = {}".format(indices) ) return get_subspace(uarray, indices)
# -*- coding: utf-8 -*- """ Created on Thu Apr 6 12:20:16 2017 @author: tyler """ def get_tibet_24x24_param(): print('inside get_tibet_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'tibet_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':25,'upper_lat':45,'lower_long':65,'upper_long':105} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Tibet-24km' return output_dict def get_test_tibet_24x24_param(): print('inside get_test_tibet_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km_test' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'test_tibet_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':25,'upper_lat':45,'lower_long':65,'upper_long':105} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Test-Tibet-24km' return output_dict def get_sierras_24x24_param(): print('inside get_sierras_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'sierras_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':35,'upper_lat':42,'lower_long':-121,'upper_long':-117} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Sierras_24km' return output_dict def get_alps_24x24_param(): print('inside get_alps_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'alps_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':43,'upper_lat':48.5,'lower_long':5,'upper_long':15} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Alps-24km' return output_dict def get_alberta_24x24_param(): print('inside get_alberta_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'alberta_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':47,'upper_lat':60,'lower_long':-120,'upper_long':-110} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Alberta-24km' return output_dict def get_artic_24x24_param(): print('inside get_artic_24x24_param') output_dict = dict() output_dict['ftp_filename'] = '24km' output_dict['no_snow_planet_name'] = 'dry_planet_24km.asc' output_dict['lat_grid_filename'] = 'imslat_24km.bin' output_dict['lon_grid_filename'] = 'imslon_24km.bin' output_dict['lat_long_area_filename'] = 'artic_lat_long_centroids_area_24km.csv' output_dict['grid_size'] = 1024 output_dict['lat_long_coords'] = {'lower_lat':65,'upper_lat':90,'lower_long':-180,'upper_long':180} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Artic-24km' return output_dict def get_sierras_4x4_param(): print('inside get_sierras_4x4_param') output_dict = dict() output_dict['ftp_filename'] = '4km' output_dict['no_snow_planet_name'] = 'dry_planet_4km.asc' output_dict['lat_grid_filename'] = 'imslat_4km.bin' output_dict['lon_grid_filename'] = 'imslon_4km.bin' output_dict['lat_long_area_filename'] = 'sierras_lat_long_centroids_area_4km.csv' output_dict['grid_size'] = 6144 output_dict['lat_long_coords'] = {'lower_lat':35,'upper_lat':42,'lower_long':-121,'upper_long':-117} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Sierras-4km' return output_dict def get_tibet_4x4_param(): print('inside get_tibet_4x4_param') output_dict = dict() output_dict['ftp_filename'] = '4km' output_dict['no_snow_planet_name'] = 'dry_planet_4km.asc' output_dict['lat_grid_filename'] = 'imslat_4km.bin' output_dict['lon_grid_filename'] = 'imslon_4km.bin' output_dict['lat_long_area_filename'] = 'tibet_lat_long_centroids_area_4km.csv' output_dict['grid_size'] = 6144 output_dict['lat_long_coords'] = {'lower_lat':25,'upper_lat':45,'lower_long':65,'upper_long':105} #set as lower and upper bounds for lat and long output_dict['filename'] = 'Tibet-4km' return output_dict
const fetch = require('node-fetch'); class HTTPCHallenge{ constructor(name, guests, menu){ this.name = name; this.guests = guests this.menu = menu this.id = "" this.url = "https://http-challenge.multiverse-coaches.io/apprentices"; } async sendResponse(url, method, headers=null, body=null) { const response = await fetch(url, { method: method, headers: headers, body: body, }) return response; } async getID(){ const url = this.url; const method = 'POST'; const headers = { "Accept": "application/json", 'Content-Type': 'application/json' }; const body = JSON.stringify({ name: this.name }) try { const response = await this.sendResponse(url, method, headers, body); const text = await response.text() this.id = text.match(/(?<=\/)[a-zA-Z0-9]+(?=')/)[0]; } catch (err) { console.log(`Error whilst fetching URL with Error: ${err.message}.`); } } async sendPeople(){ if(this.id === "") { return; } let formBody = []; const encodedKey = encodeURIComponent('guests'); const encodedValue = encodeURIComponent(this.guests); formBody.push(encodedKey + "=" + encodedValue); formBody = formBody.join("&"); const url = `${this.url}/${this.id}`; const method = 'PATCH'; const headers = { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }; const body = formBody; try { const response = await this.sendResponse(url, method, headers, body); const text = await response.text() console.log(text); } catch(err){ console.log(`Error whilst fetching URL with Error: ${err.message}.`); } } async sendMenu() { if(this.id === "") { return; } const url = `${this.url}/${this.id}/menus?starter=${this.menu['starter']}&main=${this.menu['main']}&dessert=${this.menu['dessert']}` const method = 'GET'; try { const response = await this.sendResponse(url, method); const text = await response.text(); console.log(text); } catch (err) { console.log(`Error whilst fetching URL with Error: ${err.message}.`); } } async doWashingUp(){ if(this.id === "") { return; } const url = `${this.url}/${this.id}`; const method = 'DELETE'; try { const response = await this.sendResponse(url, method); const text = await response.text() console.log(text); } catch(err) { console.log(`Error whilst fetching URL with Error: ${err.message}.`); } } } async function main(){ const name = "james"; const guests = "einstein, attenborough, scoobydoo"; const menus = { starter: "soup", main: "curry", dessert: "tiramasu" }; httpChallenge = new HTTPCHallenge(name, guests, menus); await httpChallenge.getID() await httpChallenge.sendPeople(); await httpChallenge.sendMenu(); await httpChallenge.doWashingUp(); } main();
########################################################## # BASIC CLASSIFICATION FUNCTIONS # ########################################################## # rcATT is a tool to prediction tactics and techniques # from the ATT&CK framework, using multilabel text # classification and post processing. # Version: 1.00 # Author: Valentine Legoy # Date: 2019_10_22 # Important global constants and functions for # classifications: training and prediction. import joblib import pandas as pd from sklearn.svm import LinearSVC from sklearn.multiclass import OneVsRestClassifier from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_selection import chi2, SelectPercentile from nltk.corpus import stopwords import classification_tools.preprocessing as prp import classification_tools.postprocessing as pop ########################################################## # LABELS AND DATAFRAME LISTS AND RELATIONSHIP # ########################################################## TEXT_FEATURES = ["processed"] CODE_TACTICS = ["TA0006","TA0002","TA0040","TA0003","TA0004","TA0008","TA0005","TA0010","TA0007","TA0009","TA0011","TA0001"] NAME_TACTICS = ["Credential Access","Execution","Impact","Persistence","Privilege Escalation","Lateral Movement","Defense Evasion","Exfiltration","Discovery","Collection","Command and Control","Initial Access"] CODE_TECHNIQUES = ["T1066","T1047","T1156","T1113","T1067","T1037","T1033","T1003","T1129","T1492","T1044","T1171","T1014","T1501","T1123","T1133","T1109","T1099","T1069","T1114","T1163","T1025","T1116","T1093","T1178","T1013","T1192","T1489","T1206","T1063","T1080","T1167","T1165","T1137","T1089","T1487","T1214","T1119","T1115","T1103","T1007","T1040","T1135","T1120","T1082","T1071","T1053","T1162","T1176","T1106","T1058","T1202","T1024","T1091","T1005","T1140","T1195","T1190","T1219","T1079","T1036","T1055","T1205","T1218","T1038","T1050","T1010","T1032","T1062","T1182","T1029","T1004","T1009","T1076","T1131","T1181","T1483","T1185","T1021","T1207","T1107","T1145","T1112","T1491","T1155","T1217","T1183","T1085","T1031","T1092","T1222","T1179","T1019","T1042","T1117","T1054","T1108","T1193","T1215","T1101","T1177","T1125","T1144","T1045","T1016","T1198","T1087","T1090","T1059","T1482","T1175","T1020","T1070","T1083","T1138","T1191","T1188","T1074","T1049","T1064","T1051","T1497","T1102","T1104","T1480","T1204","T1196","T1057","T1141","T1041","T1060","T1023","T1026","T1122","T1015","T1212","T1210","T1142","T1199","T1098","T1170","T1048","T1097","T1110","T1001","T1039","T1078","T1073","T1068","T1208","T1027","T1201","T1187","T1486","T1488","T1174","T1002","T1081","T1128","T1056","T1203","T1168","T1100","T1186","T1184","T1095","T1075","T1012","T1030","T1028","T1034","T1499","T1065","T1197","T1088","T1493","T1132","T1500","T1223","T1213","T1194","T1200","T1485","T1130","T1022","T1189","T1498","T1158","T1221","T1134","T1209","T1111","T1159","T1136","T1018","T1046","T1052","T1105","T1084","T1160","T1484","T1220","T1173","T1008","T1096","T1124","T1035","T1086","T1490","T1216","T1094","T1043","T1211","T1127","T1077"] NAME_TECHNIQUES = ["Indicator Removal from Tools","Windows Management Instrumentation",".bash_profile and .bashrc","Screen Capture","Bootkit","Logon Scripts","System Owner/User Discovery","Credential Dumping","Execution through Module Load","Stored Data Manipulation","File System Permissions Weakness","LLMNR/NBT-NS Poisoning and Relay","Rootkit","Systemd Service","Audio Capture","External Remote Services","Component Firmware","Timestomp","Permission Groups Discovery","Email Collection","Rc.common","Data from Removable Media","Code Signing","Process Hollowing","SID-History Injection","Port Monitors","Spearphishing Link","Service Stop","Sudo Caching","Security Software Discovery","Taint Shared Content","Securityd Memory","Startup Items","Office Application Startup","Disabling Security Tools","Disk Structure Wipe","Credentials in Registry","Automated Collection","Clipboard Data","AppInit DLLs","System Service Discovery","Network Sniffing","Network Share Discovery","Peripheral Device Discovery","System Information Discovery","Standard Application Layer Protocol","Scheduled Task","Login Item","Browser Extensions","Execution through API","Service Registry Permissions Weakness","Indirect Command Execution","Custom Cryptographic Protocol","Replication Through Removable Media","Data from Local System","Deobfuscate/Decode Files or Information","Supply Chain Compromise","Exploit Public-Facing Application","Remote Access Tools","Multilayer Encryption","Masquerading","Process Injection","Port Knocking","Signed Binary Proxy Execution","DLL Search Order Hijacking","New Service","Application Window Discovery","Standard Cryptographic Protocol","Hypervisor","AppCert DLLs","Scheduled Transfer","Winlogon Helper DLL","Binary Padding","Remote Desktop Protocol","Authentication Package","Extra Window Memory Injection","Domain Generation Algorithms","Man in the Browser","Remote Services","DCShadow","File Deletion","Private Keys","Modify Registry","Defacement","AppleScript","Browser Bookmark Discovery","Image File Execution Options Injection","Rundll32","Modify Existing Service","Communication Through Removable Media","File Permissions Modification","Hooking","System Firmware","Change Default File Association","Regsvr32","Indicator Blocking","Redundant Access","Spearphishing Attachment","Kernel Modules and Extensions","Security Support Provider","LSASS Driver","Video Capture","Gatekeeper Bypass","Software Packing","System Network Configuration Discovery","SIP and Trust Provider Hijacking","Account Discovery","Connection Proxy","Command-Line Interface","Domain Trust Discovery","Distributed Component Object Model","Automated Exfiltration","Indicator Removal on Host","File and Directory Discovery","Application Shimming","CMSTP","Multi-hop Proxy","Data Staged","System Network Connections Discovery","Scripting","Shared Webroot","Virtualization/Sandbox Evasion","Web Service","Multi-Stage Channels","Execution Guardrails","User Execution","Control Panel Items","Process Discovery","Input Prompt","Exfiltration Over Command and Control Channel","Registry Run Keys / Startup Folder","Shortcut Modification","Multiband Communication","Component Object Model Hijacking","Accessibility Features","Exploitation for Credential Access","Exploitation of Remote Services","Keychain","Trusted Relationship","Account Manipulation","Mshta","Exfiltration Over Alternative Protocol","Pass the Ticket","Brute Force","Data Obfuscation","Data from Network Shared Drive","Valid Accounts","DLL Side-Loading","Exploitation for Privilege Escalation","Kerberoasting","Obfuscated Files or Information","Password Policy Discovery","Forced Authentication","Data Encrypted for Impact","Disk Content Wipe","Password Filter DLL","Data Compressed","Credentials in Files","Netsh Helper DLL","Input Capture","Exploitation for Client Execution","Local Job Scheduling","Web Shell","Process Doppelgänging","SSH Hijacking","Standard Non-Application Layer Protocol","Pass the Hash","Query Registry","Data Transfer Size Limits","Windows Remote Management","Path Interception","Endpoint Denial of Service","Uncommonly Used Port","BITS Jobs","Bypass User Account Control","Transmitted Data Manipulation","Data Encoding","Compile After Delivery","Compiled HTML File","Data from Information Repositories","Spearphishing via Service","Hardware Additions","Data Destruction","Install Root Certificate","Data Encrypted","Drive-by Compromise","Network Denial of Service","Hidden Files and Directories","Template Injection","Access Token Manipulation","Time Providers","Two-Factor Authentication Interception","Launch Agent","Create Account","Remote System Discovery","Network Service Scanning","Exfiltration Over Physical Medium","Remote File Copy","Windows Management Instrumentation Event Subscription","Launch Daemon","Group Policy Modification","XSL Script Processing","Dynamic Data Exchange","Fallback Channels","NTFS File Attributes","System Time Discovery","Service Execution","PowerShell","Inhibit System Recovery","Signed Script Proxy Execution","Custom Command and Control Protocol","Commonly Used Port","Exploitation for Defense Evasion","Trusted Developer Utilities","Windows Admin Shares"] ALL_TTPS = ["TA0006","TA0002","TA0040","TA0003","TA0004","TA0008","TA0005","TA0010","TA0007","TA0009","TA0011","TA0001","T1066","T1047","T1156","T1113","T1067","T1037","T1033","T1003","T1129","T1492","T1044","T1171","T1014","T1501","T1123","T1133","T1109","T1099","T1069","T1114","T1163","T1025","T1116","T1093","T1178","T1013","T1192","T1489","T1206","T1063","T1080","T1167","T1165","T1137","T1089","T1487","T1214","T1119","T1115","T1103","T1007","T1040","T1135","T1120","T1082","T1071","T1053","T1162","T1176","T1106","T1058","T1202","T1024","T1091","T1005","T1140","T1195","T1190","T1219","T1079","T1036","T1055","T1205","T1218","T1038","T1050","T1010","T1032","T1062","T1182","T1029","T1004","T1009","T1076","T1131","T1181","T1483","T1185","T1021","T1207","T1107","T1145","T1112","T1491","T1155","T1217","T1183","T1085","T1031","T1092","T1222","T1179","T1019","T1042","T1117","T1054","T1108","T1193","T1215","T1101","T1177","T1125","T1144","T1045","T1016","T1198","T1087","T1090","T1059","T1482","T1175","T1020","T1070","T1083","T1138","T1191","T1188","T1074","T1049","T1064","T1051","T1497","T1102","T1104","T1480","T1204","T1196","T1057","T1141","T1041","T1060","T1023","T1026","T1122","T1015","T1212","T1210","T1142","T1199","T1098","T1170","T1048","T1097","T1110","T1001","T1039","T1078","T1073","T1068","T1208","T1027","T1201","T1187","T1486","T1488","T1174","T1002","T1081","T1128","T1056","T1203","T1168","T1100","T1186","T1184","T1095","T1075","T1012","T1030","T1028","T1034","T1499","T1065","T1197","T1088","T1493","T1132","T1500","T1223","T1213","T1194","T1200","T1485","T1130","T1022","T1189","T1498","T1158","T1221","T1134","T1209","T1111","T1159","T1136","T1018","T1046","T1052","T1105","T1084","T1160","T1484","T1220","T1173","T1008","T1096","T1124","T1035","T1086","T1490","T1216","T1094","T1043","T1211","T1127","T1077"] STIX_IDENTIFIERS = ["x-mitre-tactic--2558fd61-8c75-4730-94c4-11926db2a263","x-mitre-tactic--4ca45d45-df4d-4613-8980-bac22d278fa5","x-mitre-tactic--5569339b-94c2-49ee-afb3-2222936582c8","x-mitre-tactic--5bc1d813-693e-4823-9961-abf9af4b0e92","x-mitre-tactic--5e29b093-294e-49e9-a803-dab3d73b77dd","x-mitre-tactic--7141578b-e50b-4dcc-bfa4-08a8dd689e9e","x-mitre-tactic--78b23412-0651-46d7-a540-170a1ce8bd5a","x-mitre-tactic--9a4e74ab-5008-408c-84bf-a10dfbc53462","x-mitre-tactic--c17c5845-175e-4421-9713-829d0573dbc9","x-mitre-tactic--d108ce10-2419-4cf9-a774-46161d6c6cfe","x-mitre-tactic--f72804c5-f15a-449e-a5da-2eecd181f813","x-mitre-tactic--ffd5bcee-6e16-4dd2-8eca-7b3beedf33ca","attack-pattern--00d0b012-8a03-410e-95de-5826bf542de6","attack-pattern--01a5a209-b94c-450b-b7f9-946497d91055","attack-pattern--01df3350-ce05-4bdf-bdf8-0a919a66d4a8","attack-pattern--0259baeb-9f63-4c69-bf10-eb038c390688","attack-pattern--02fefddc-fb1b-423f-a76b-7552dd211d4d","attack-pattern--03259939-0b57-482f-8eb5-87c0e0d54334","attack-pattern--03d7999c-1f4c-42cc-8373-e7690d318104","attack-pattern--0a3ead4e-6d47-4ccb-854c-a6a4f9d96b22","attack-pattern--0a5231ec-41af-4a35-83d0-6bdf11f28c65","attack-pattern--0bf78622-e8d2-41da-a857-731472d61a92","attack-pattern--0ca7beef-9bbc-4e35-97cf-437384ddce6a","attack-pattern--0dbf5f1b-a560-4d51-ac1b-d70caab3e1f0","attack-pattern--0f20e3cb-245b-4a61-8a91-2d93f7cb0e9b","attack-pattern--0fff2797-19cb-41ea-a5f1-8a9303b8158e","attack-pattern--1035cdf2-3e5f-446f-a7a7-e8f6d7925967","attack-pattern--10d51417-ee35-4589-b1ff-b6df1c334e8d","attack-pattern--10d5f3b7-6be6-4da5-9a77-0f1e2bbfcc44","attack-pattern--128c55d3-aeba-469f-bd3e-c8996ab4112a","attack-pattern--15dbf668-795c-41e6-8219-f0447c0e64ce","attack-pattern--1608f3e1-598a-42f4-a01a-2e252e81728f","attack-pattern--18d4ab39-12ed-4a16-9fdb-ae311bba4a0f","attack-pattern--1b7ba276-eedc-4951-a762-0ceea2c030ec","attack-pattern--1b84d551-6de8-4b96-9930-d177677c3b1d","attack-pattern--1c338d0f-a65e-4073-a5c1-c06878849f21","attack-pattern--1df0326d-2fbc-4d08-a16b-48365f1e742d","attack-pattern--1f47e2fd-fa77-4f2f-88ee-e85df308f125","attack-pattern--20138b9d-1aac-4a26-8654-a36b6bbf2bba","attack-pattern--20fb2507-d71c-455d-9b6d-6104461cf26b","attack-pattern--2169ba87-1146-4fc7-a118-12b72251db7e","attack-pattern--241814ae-de3f-4656-b49e-f9a80764d4b7","attack-pattern--246fd3c7-f5e3-466d-8787-4c13d9e3b61c","attack-pattern--2715c335-1bf2-4efe-9f18-0691317ff83b","attack-pattern--2ba5aa71-9d15-4b22-b726-56af06d9ad2f","attack-pattern--2c4d4e92-0ccf-4a97-b54c-86d662988a53","attack-pattern--2e0dd10b-676d-4964-acd0-8a404c92b044","attack-pattern--2e114e45-2c50-404c-804a-3af9564d240e","attack-pattern--2edd9d6a-5674-4326-a600-ba56de467286","attack-pattern--30208d3e-0d6b-43c8-883e-44462a514619","attack-pattern--30973a08-aed9-4edf-8604-9084ce1b5c4f","attack-pattern--317fefa6-46c7-4062-adb6-2008cf6bcb41","attack-pattern--322bad5a-1c49-4d23-ab79-76d641794afa","attack-pattern--3257eb21-f9a7-4430-8de1-d8b6e288f529","attack-pattern--3489cfc5-640f-4bb3-a103-9137b97de79f","attack-pattern--348f1eef-964b-4eb6-bb53-69b3dcb0c643","attack-pattern--354a7f88-63fb-41b5-a801-ce3b377b36f1","attack-pattern--355be19c-ffc9-46d5-8d50-d6a036c675b6","attack-pattern--35dd844a-b219-4e2b-a6bb-efa9a75995a9","attack-pattern--36675cd3-fe00-454c-8516-aebecacbe9d9","attack-pattern--389735f1-f21c-4208-b8f0-f8031e7169b8","attack-pattern--391d824f-0ef1-47a0-b0ee-c59a75e27670","attack-pattern--39a130e1-6ab7-434a-8bd2-418e7d9d6427","attack-pattern--3b0e52ce-517a-4614-a523-1bd5deef6c5e","attack-pattern--3b3cbbe0-6ed3-4334-b543-3ddfd8c5642d","attack-pattern--3b744087-9945-4a6f-91e8-9dbceda417a4","attack-pattern--3c4a2599-71ee-4405-ba1e-0e28414b4bc5","attack-pattern--3ccef7ae-cb5e-48f6-8302-897105fbf55c","attack-pattern--3f18edba-28f4-4bb9-82c3-8aa60dcac5f7","attack-pattern--3f886f2a-874f-4333-b794-aa6075009b1c","attack-pattern--4061e78c-1284-44b4-9116-73e4ac3912f7","attack-pattern--428ca9f8-0e33-442a-be87-f869cb4cf73e","attack-pattern--42e8de7b-37b2-4258-905a-6897815e58e0","attack-pattern--43e7dc91-05b2-474c-b9ac-2ed4fe101f4d","attack-pattern--451a9977-d255-43c9-b431-66de80130c8c","attack-pattern--457c7820-d331-465a-915e-42f85500ccc4","attack-pattern--46944654-fcc1-4f63-9dad-628102376586","attack-pattern--478aa214-2ca7-4ec0-9978-18798e514790","attack-pattern--4ae4f953-fe58-4cc8-a327-33257e30a830","attack-pattern--4b74a1d4-b0e9-4ef1-93f1-14ecc6e2f5b5","attack-pattern--4be89c7c-ace6-4876-9377-c8d54cef3d63","attack-pattern--4bf5845d-a814-4490-bc5c-ccdee6043025","attack-pattern--4eeaf8a9-c86b-4954-a663-9555fb406466","attack-pattern--514ede4c-78b3-4d78-a38b-daddf6217a79","attack-pattern--519630c5-f03f-4882-825c-3af924935817","attack-pattern--51dea151-0898-4a45-967c-3ebee0420484","attack-pattern--52d40641-c480-4ad5-81a3-c80ccaddf82d","attack-pattern--52f3d5a6-8a0f-4f82-977e-750abf90d0b0","attack-pattern--54456690-84de-4538-9101-643e26437e09","attack-pattern--544b0346-29ad-41e1-a808-501bb4193f47","attack-pattern--54a649ff-439a-41a4-9856-8d144a2551ba","attack-pattern--564998d8-ab3e-4123-93fb-eccaa6b9714a","attack-pattern--56fca983-1cf1-4fd1-bda0-5e170a37ab59","attack-pattern--56ff457d-5e39-492b-974c-dfd2b8603ffe","attack-pattern--57340c81-c025-4189-8fa0-fc7ede51bae4","attack-pattern--5909f20f-3c39-4795-be06-ef1ea40d350b","attack-pattern--5ad95aaa-49c1-4784-821d-2e83f47b079b","attack-pattern--5e4a2073-9643-44cb-a0b5-e7f4048446c7","attack-pattern--62166220-e498-410f-a90a-19d4339d4e99","attack-pattern--62b8c999-dcc0-4755-bd69-09442d9359f5","attack-pattern--62dfd1ca-52d5-483c-a84b-d6e80bf94b7b","attack-pattern--64196062-5210-42c3-9a02-563a0d1797ef","attack-pattern--65917ae0-b854-4139-83fe-bf2441cf0196","attack-pattern--66f73398-8394-4711-85e5-34c8540b22a5","attack-pattern--6856ddd6-2df3-4379-8b87-284603c189c3","attack-pattern--68c96494-1a50-403e-8844-69a6af278c68","attack-pattern--68f7e3a1-f09f-4164-9a62-16b648a0dd5a","attack-pattern--6a5848a8-6201-4a2c-8a6a-ca5af8c6f3df","attack-pattern--6aabc5ec-eae6-422c-8311-38d45ee9838a","attack-pattern--6aac77c4-eaf2-4366-8c13-ce50ab951f38","attack-pattern--6be14413-578e-46c1-8304-310762b3ecd5","attack-pattern--6c174520-beea-43d9-aac6-28fb77f3e446","attack-pattern--6e6845c2-347a-4a6f-a2d1-b74a18ebd352","attack-pattern--6faf650d-bf31-4eb4-802d-1000cf38efaf","attack-pattern--6fb6408c-0db3-41d9-a3a1-a32e5f16454e","attack-pattern--6ff403bc-93e3-48be-8687-e102fdba8c88","attack-pattern--707399d6-ab3e-4963-9315-d9d3818cd6a0","attack-pattern--72b5ef57-325c-411b-93ca-a3ca6fa17e31","attack-pattern--72b74d71-8169-42aa-92e0-e7b04b9f5a08","attack-pattern--731f4f55-b6d0-41d1-a7a9-072a66389aea","attack-pattern--7385dfaf-6886-4229-9ecd-6fd678040830","attack-pattern--767dbf9e-df3f-45cb-8998-4903ab5f80c0","attack-pattern--772bc7a8-a157-42cc-8728-d648e25c7fe7","attack-pattern--774a3188-6ba9-4dc4-879d-d54ee48a5ce9","attack-pattern--799ace7f-e227-4411-baa0-8868704f2a69","attack-pattern--7bc57495-ea59-4380-be31-a64af124ef18","attack-pattern--7c93aa74-4bc0-4a9e-90ea-f25f86301566","attack-pattern--7d6f590f-544b-45b4-9a42-e0805f342af3","attack-pattern--7d751199-05fa-4a72-920f-85df4506c76c","attack-pattern--7dd95ff6-712e-4056-9626-312ea4ab4c5e","attack-pattern--7e150503-88e7-4861-866b-ff1ac82c4475","attack-pattern--7fd87010-3a00-4da3-b905-410525e8ec44","attack-pattern--804c042c-cfe6-449e-bc1a-ba0a998a70db","attack-pattern--82caa33e-d11a-433a-94ea-9b5a5fbef81d","attack-pattern--830c9528-df21-472c-8c14-a036bf17d665","attack-pattern--84e02621-8fdf-470f-bd58-993bb6a89d91","attack-pattern--853c4192-4311-43e1-bfbb-b11b14911852","attack-pattern--8c32eb4d-805f-4fc5-bf60-c4d476c131b5","attack-pattern--8df54627-376c-487c-a09c-7d2b5620f56e","attack-pattern--8f4a33ec-8b1f-4b80-a2f6-642b2e479580","attack-pattern--91ce1ede-107f-4d8b-bf4c-735e8789c94b","attack-pattern--92d7da27-2d91-488e-a00c-059dc162766d","attack-pattern--9422fc14-1c43-410d-ab0f-a709b76c72dc","attack-pattern--970cdb5c-02fb-4c38-b17e-d6327cf3c810","attack-pattern--99709758-2b96-48f2-a68a-ad7fbd828091","attack-pattern--9b52fca7-1a36-4da0-b62d-da5bd83b4d69","attack-pattern--9b99b83a-1aac-4e29-b975-b374950551a3","attack-pattern--9c306d8d-cde7-4b4c-b6e8-d0bb16caca36","attack-pattern--9db0cf3a-a3c9-4012-8268-123b9db6fd82","attack-pattern--9e09ddb2-1746-4448-9cad-7f8b41777d6d","attack-pattern--9fa07bef-9c81-421e-a8e5-ad4366c5a925","attack-pattern--a10641f4-87b4-45a3-a906-92a149cb2c27","attack-pattern--a127c32c-cbb0-4f9d-be07-881a792408ec","attack-pattern--a19e86f8-1c0a-4fea-8407-23b73d615776","attack-pattern--a257ed11-ff3b-4216-8c9d-3938ef57064c","attack-pattern--a93494bb-4b80-4ea1-8695-3236a49916fd","attack-pattern--ad255bfe-a9e6-4b52-a258-8d3462abe842","attack-pattern--ae676644-d2d2-41b7-af7e-9bed1b55898c","attack-pattern--b17a1a56-e99c-403c-8948-561df0cffe81","attack-pattern--b2001907-166b-4d71-bb3c-9d26c871de09","attack-pattern--b21c3b2d-02e6-45b1-980b-e69051040839","attack-pattern--b39d03cb-7b98-41c4-a878-c40c1a913dc0","attack-pattern--b3d682b6-98f2-4fb0-aa3b-b4df007ca70a","attack-pattern--b6075259-dba3-44e9-87c7-e954f37ec0d5","attack-pattern--b77cf5f3-6060-475d-bd60-40ccbf28fdc2","attack-pattern--b80d107d-fa0d-4b60-9684-b0433e8bdba0","attack-pattern--b82f7d37-b826-4ec9-9391-8e121c78aed7","attack-pattern--b8c5c9dd-a662-479d-9428-ae745872537c","attack-pattern--b9f5dbe2-4c55-4fc5-af2e-d42c1d182ec4","attack-pattern--ba8e391f-14b5-496f-81f2-2d5ecd646c1c","attack-pattern--bb0e0cb5-f3e4-4118-a4cb-6bf13bfbc9f2","attack-pattern--bb5a00de-e086-4859-a231-fa793f6797e2","attack-pattern--be2dcee9-a7a7-4e38-afd6-21b31ecc3d63","attack-pattern--c0a384a4-9a25-40e1-97b6-458388474bc8","attack-pattern--c16e5409-ee53-4d79-afdc-4099dc9292df","attack-pattern--c1a452f3-6499-4c12-b7e9-a6a0a102af76","attack-pattern--c1b11bf7-c68e-4fbf-a95b-28efbe7953bb","attack-pattern--c21d5a77-d422-4a69-acd7-2c53c1faa34b","attack-pattern--c23b740b-a42b-47a1-aec2-9d48ddd547ff","attack-pattern--c32f7008-9fea-41f7-8366-5eb9b74bd896","attack-pattern--c3888c54-775d-4b2f-b759-75a2ececcbfd","attack-pattern--c3bce4f4-9795-46c6-976e-8676300bbc39","attack-pattern--c4ad009b-6e13-4419-8d21-918a1652de02","attack-pattern--c675646d-e204-4aa8-978d-e3d6d65885c4","attack-pattern--c848fcf7-6b62-4bde-8216-b6c157d48da0","attack-pattern--c8e87b83-edbb-48d4-9295-4974897525b7","attack-pattern--ca1a3f50-5ebd-41f8-8320-2c7d6a6e88be","attack-pattern--cc1e737c-236c-4e3b-83ba-32039a626ef8","attack-pattern--cc7b8c4e-9be0-47ca-b0bb-83915ec3ee2f","attack-pattern--cf7b3a06-8b42-4c33-bbe9-012120027925","attack-pattern--d21a2069-23d5-4043-ad6d-64f6b644cb1a","attack-pattern--d28ef391-8ed4-45dc-bc4a-2f43abf54416","attack-pattern--d3df754e-997b-4cf9-97d4-70feb3120847","attack-pattern--d40239b3-05ff-46d8-9bdd-b46d13463ef9","attack-pattern--d45a3d09-b3cf-48f4-9f0f-f521ee5cb05c","attack-pattern--d519cfd5-f3a8-43a9-a846-ed0bb40672b1","attack-pattern--d54416bd-0803-41ca-870a-ce1af7c05638","attack-pattern--d742a578-d70e-4d0e-96a6-02a9c30204e6","attack-pattern--d74c4a7e-ffbf-432f-9365-7ebf1f787cab","attack-pattern--dc27c2ec-c5f9-4228-ba57-d67b590bda93","attack-pattern--dc31fe1e-d722-49da-8f5f-92c7b5aff534","attack-pattern--dcaa092b-7de9-4a21-977f-7fcb77e89c48","attack-pattern--dce31a00-1e90-4655-b0f9-e2e71a748a87","attack-pattern--dd43c543-bb85-4a6f-aa6e-160d90d06a49","attack-pattern--dd901512-6e37-4155-943b-453e3777b125","attack-pattern--e01be9c5-e763-4caf-aeb7-000b416aef67","attack-pattern--e358d692-23c0-4a31-9eb6-ecc13a8d7735","attack-pattern--e3a12395-188d-4051-9a16-ea8e14d07b88","attack-pattern--e6415f09-df0e-48de-9aba-928c902b7549","attack-pattern--e6919abc-99f9-4c6c-95a5-14761e7b2add","attack-pattern--e906ae4d-1d3a-4675-be23-22f7311c0da4","attack-pattern--e99ec083-abdd-48de-ad87-4dbf6f8ba2a4","attack-pattern--ebb42bbe-62d7-47d7-a55f-3b08b61d792d","attack-pattern--ebbe170d-aa74-4946-8511-9921243415a3","attack-pattern--edbe24e9-aec4-4994-ac75-6a6bc7f1ddd0","attack-pattern--f24faf46-3b26-4dbb-98f2-63460498e433","attack-pattern--f2d44246-91f1-478a-b6c8-1227e0ca109d","attack-pattern--f3c544dc-673c-4ef3-accb-53229f1ae077","attack-pattern--f44731de-ea9f-406d-9b83-30ecbb9b4392","attack-pattern--f4882e23-8aa7-4b12-b28a-b349c12ee9e0","attack-pattern--f5d8eed6-48a9-4cdf-a3d7-d1ffa99c3d2a","attack-pattern--f6fe9070-7a65-49ea-ae72-76292f42cebe","attack-pattern--f72eb8a8-cd4c-461d-a814-3f862befbf00","attack-pattern--f879d51c-5476-431c-aedf-f14d207e4d1e","attack-pattern--fe926152-f431-4baf-956c-4ad3cb0bf23b","attack-pattern--ff25900d-76d5-449b-a351-8824e62fc81b","attack-pattern--ffe742ed-9100-4686-9e00-c331da544787"] TACTICS_TECHNIQUES_RELATIONSHIP_DF = pd.DataFrame({"TA0001":pd.Series(["T1133","T1192","T1091","T1195","T1190","T1193","T1199","T1078","T1194","T1200","T1189"]), "TA0002":pd.Series(["T1047","T1129","T1121","T1053","T1106","T1218","T1153","T1152","T1155","T1085","T1117","T1177","T1059","T1191","T1064","T1204","T1196","T1072","T1170","T1061","T1154","T1203","T1168","T1028","T1223","T1151","T1220","T1173","T1035","T1086","T1216","T1118","T1127"]), "TA0003":pd.Series(["T1156","T1067","T1037","T1161","T1150","T1044","T1501","T1133","T1109","T1163","T1013","T1180","T1165","T1137","T1103","T1053","T1162","T1176","T1058","T1205","T1038","T1050","T1062","T1182","T1004","T1131","T1152","T1183","T1031","T1179","T1019","T1042","T1164","T1108","T1215","T1101","T1177","T1198","T1138","T1060","T1023","T1122","T1015","T1098","T1157","T1078","T1154","T1128","T1168","T1166","T1100","T1034","T1197","T1158","T1209","T1159","T1136","T1084","T1160"]), "TA0004":pd.Series(["T1150","T1044","T1178","T1013","T1206","T1165","T1103","T1053","T1058","T1055","T1038","T1050","T1182","T1181","T1183","T1179","T1138","T1015","T1169","T1157","T1078","T1068","T1166","T1100","T1034","T1088","T1134","T1160"]), "TA0005":pd.Series(["T1066","T1143","T1150","T1148","T1006","T1014","T1109","T1099","T1116","T1093","T1121","T1089","T1202","T1140","T1036","T1055","T1205","T1218","T1038","T1009","T1181","T1152","T1207","T1107","T1112","T1183","T1085","T1222","T1117","T1054","T1108","T1144","T1045","T1198","T1070","T1191","T1064","T1497","T1102","T1480","T1196","T1122","T1149","T1170","T1078","T1073","T1027","T1186","T1197","T1088","T1147","T1500","T1223","T1146","T1130","T1158","T1221","T1134","T1151","T1126","T1484","T1220","T1096","T1216","T1118","T1211","T1127"]), "TA0006":pd.Series(["T1003","T1171","T1167","T1214","T1040","T1139","T1145","T1179","T1141","T1212","T1142","T1098","T1110","T1208","T1187","T1174","T1081","T1056","T1111"]), "TA0007":pd.Series(["T1033","T1069","T1063","T1007","T1040","T1135","T1120","T1082","T1010","T1217","T1016","T1087","T1482","T1083","T1049","T1497","T1057","T1201","T1012","T1018","T1046","T1124"]), "TA0008":pd.Series(["T1037","T1080","T1017","T1091","T1076","T1021","T1155","T1175","T1051","T1072","T1210","T1097","T1184","T1075","T1028","T1105","T1077"]), "TA0009":pd.Series(["T1113","T1123","T1114","T1025","T1119","T1115","T1005","T1185","T1125","T1074","T1039","T1056","T1213"]), "TA0010":pd.Series(["T1029","T1011","T1020","T1041","T1048","T1002","T1030","T1022","T1052"]), "TA0011":pd.Series(["T1172","T1071","T1024","T1219","T1079","T1205","T1032","T1483","T1092","T1090","T1188","T1102","T1104","T1026","T1001","T1095","T1065","T1132","T1105","T1008","T1094","T1043"]), "TA0040":pd.Series(["T1492","T1489","T1487","T1491","T1486","T1488","T1499","T1494","T1493","T1496","T1485","T1498","T1495","T1490"]) }) ########################################################## # RETRAIN AND PREDICT FUNCTIONS # ########################################################## def train(cmd): """ Train again rcATT with a new dataset """ # stopwords with additional words found during the development stop_words = stopwords.words('english') new_stop_words = ["'ll", "'re", "'ve", 'ha', 'wa',"'d", "'s", 'abov', 'ani', 'becaus', 'befor', 'could', 'doe', 'dure', 'might', 'must', "n't", 'need', 'onc', 'onli', 'ourselv', 'sha', 'themselv', 'veri', 'whi', 'wo', 'would', 'yourselv'] stop_words.extend(new_stop_words) # load all possible data train_data_df = pd.read_csv('classification_tools/data/training_data_original.csv', encoding = "ISO-8859-1") train_data_added = pd.read_csv('classification_tools/data/training_data_added.csv', encoding = "ISO-8859-1") train_data_df.append(train_data_added, ignore_index = True) train_data_df = prp.processing(train_data_df) reports = train_data_df[TEXT_FEATURES] tactics = train_data_df[CODE_TACTICS] techniques = train_data_df[CODE_TECHNIQUES] if cmd: pop.print_progress_bar(0) # Define a pipeline combining a text feature extractor with multi label classifier for tactics prediction pipeline_tactics = Pipeline([ ('columnselector', prp.TextSelector(key = 'processed')), ('tfidf', TfidfVectorizer(tokenizer = prp.LemmaTokenizer(), stop_words = stop_words, max_df = 0.90)), ('selection', SelectPercentile(chi2, percentile = 50)), ('classifier', OneVsRestClassifier(LinearSVC(penalty = 'l2', loss = 'squared_hinge', dual = True, class_weight = 'balanced'), n_jobs = 1)) ]) # train the model for tactics pipeline_tactics.fit(reports, tactics) if cmd: pop.print_progress_bar(2) # Define a pipeline combining a text feature extractor with multi label classifier for techniques prediction pipeline_techniques = Pipeline([ ('columnselector', prp.TextSelector(key = 'processed')), ('tfidf', TfidfVectorizer(tokenizer = prp.StemTokenizer(), stop_words = stop_words, min_df = 2, max_df = 0.99)), ('selection', SelectPercentile(chi2, percentile = 50)), ('classifier', OneVsRestClassifier(LinearSVC(penalty = 'l2', loss = 'squared_hinge', dual = False, max_iter = 1000, class_weight = 'balanced'), n_jobs = 1)) ]) # train the model for techniques pipeline_techniques.fit(reports, techniques) if cmd: pop.print_progress_bar(4) pop.find_best_post_processing(cmd) #Save model joblib.dump(pipeline_tactics, 'classification_tools/data/pipeline_tactics.joblib') joblib.dump(pipeline_techniques, 'classification_tools/data/pipeline_techniques.joblib') def predict(report_to_predict, post_processing_parameters): """ Predict tactics and techniques from a report in a txt file. """ # loading the models pipeline_tactics = joblib.load('classification_tools/data/pipeline_tactics.joblib') pipeline_techniques = joblib.load('classification_tools/data/pipeline_techniques.joblib') report = prp.processing(pd.DataFrame([report_to_predict], columns = ['Text']))[TEXT_FEATURES] # predictions predprob_tactics = pipeline_tactics.decision_function(report) pred_tactics = pipeline_tactics.predict(report) predprob_techniques = pipeline_techniques.decision_function(report) pred_techniques = pipeline_techniques.predict(report) if post_processing_parameters[0] == "HN": # hanging node thresholds retrieval and hanging node performed on predictions if in parameters pred_techniques = pop.hanging_node(pred_tactics, predprob_tactics, pred_techniques, predprob_techniques, post_processing_parameters[1][0], post_processing_parameters[1][1]) elif post_processing_parameters[0] == "CP": # confidence propagation performed on prediction if in parameters pred_techniques, predprob_techniques = pop.confidence_propagation(predprob_tactics, pred_techniques, predprob_techniques) return pred_tactics, predprob_tactics, pred_techniques, predprob_techniques
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality of the software # licensed hereunder. You may use the software subject to the license # terms below provided that you ensure that this notice is replicated # unmodified and in its entirety in all distributions of the software, # modified or unmodified, in source code or in binary form. # # Copyright (c) 2006-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer; # redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution; # neither the name of the copyright holders nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Lisa Hsu from __future__ import print_function from __future__ import absolute_import from m5.defines import buildEnv from m5.objects import * # Base implementations of L1, L2, IO and TLB-walker caches. There are # used in the regressions and also as base components in the # system-configuration scripts. The values are meant to serve as a # starting point, and specific parameters can be overridden in the # specific instantiations. class L1Cache(Cache): assoc = 2 tag_latency = 2 data_latency = 2 response_latency = 2 mshrs = 4 tgts_per_mshr = 20 class L1_ICache(L1Cache): is_read_only = True # Writeback clean lines as well writeback_clean = True class L1_DCache(L1Cache): pass class L2Cache(Cache): assoc = 8 tag_latency = 20 data_latency = 20 response_latency = 20 mshrs = 20 tgts_per_mshr = 12 write_buffers = 8 class IOCache(Cache): assoc = 8 tag_latency = 50 data_latency = 50 response_latency = 50 mshrs = 20 size = '1kB' tgts_per_mshr = 12 class PageTableWalkerCache(Cache): assoc = 2 tag_latency = 2 data_latency = 2 response_latency = 2 mshrs = 10 size = '1kB' tgts_per_mshr = 12 # the x86 table walker actually writes to the table-walker cache if buildEnv['TARGET_ISA'] == 'x86': is_read_only = False else: is_read_only = True # Writeback clean lines as well writeback_clean = True
#include <emote.h> EMOTE( "~Name ~verblisten attentively.", "~Name ~verblisten carefully to ~targ." )
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ で生成されたインクルード ファイルです。 // 次で使用: SolutionDefineTestCPP.rc #define IDS_APP_TITLE 103 #define IDR_MAINFRAME 128 #define IDD_SOLUTIONDEFINETESTCPP_DIALOG 102 #define IDD_ABOUTBOX 103 #define IDM_ABOUT 104 #define IDM_EXIT 105 #define IDI_SOLUTIONDEFINETESTCPP 107 #define IDI_SMALL 108 #define IDC_SOLUTIONDEFINETESTCPP 109 #define IDC_MYICON 2 #ifndef IDC_STATIC #define IDC_STATIC -1 #endif // 新しいオブジェクトの次の既定値 // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 130 #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 110 #endif #endif
// // AAPLAppDelegate.h // APPLAdvancedCollection // // Created by Danil Zvyagintsev on 08/21/2015. // Copyright (c) 2015 Danil Zvyagintsev. All rights reserved. // @import UIKit; @interface AAPLAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that has become a de facto standard. * * * * Help yourself get started quickly and support the FreeRTOS * * project by purchasing a FreeRTOS tutorial book, reference * * manual, or both from: http://www.FreeRTOS.org/Documentation * * * * Thank you! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< FreeRTOS 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. Full license text is available from the following link: http://www.freertos.org/a00114.html 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef PORTMACRO_H #define PORTMACRO_H #ifdef __cplusplus extern "C" { #endif /*----------------------------------------------------------- * Port specific definitions. * * The settings in this file configure FreeRTOS correctly for the * given hardware and compiler. * * These settings should not be altered. *----------------------------------------------------------- */ /* Type definitions. */ #define portCHAR char #define portFLOAT float #define portDOUBLE double #define portLONG long #define portSHORT short #define portSTACK_TYPE uint32_t #define portBASE_TYPE long typedef portSTACK_TYPE StackType_t; typedef long BaseType_t; typedef unsigned long UBaseType_t; #if( configUSE_16_BIT_TICKS == 1 ) typedef uint16_t TickType_t; #define portMAX_DELAY ( TickType_t ) 0xffff #else typedef uint32_t TickType_t; #define portMAX_DELAY ( TickType_t ) 0xffffffffUL #endif /*-----------------------------------------------------------*/ /* Architecture specifics. */ #define portSTACK_GROWTH ( -1 ) #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) #define portBYTE_ALIGNMENT 8 /*-----------------------------------------------------------*/ /* Scheduler utilities. */ extern void vPortYield( void ); #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) #define portYIELD() vPortYield() #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) /*-----------------------------------------------------------*/ /* Critical section management. */ extern void vPortEnterCritical( void ); extern void vPortExitCritical( void ); extern uint32_t ulSetInterruptMaskFromISR( void ) __attribute__((naked)); extern void vClearInterruptMaskFromISR( uint32_t ulMask ) __attribute__((naked)); #define portSET_INTERRUPT_MASK_FROM_ISR() ulSetInterruptMaskFromISR() #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vClearInterruptMaskFromISR( x ) #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ) #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ) #define portENTER_CRITICAL() vPortEnterCritical() #define portEXIT_CRITICAL() vPortExitCritical() /*-----------------------------------------------------------*/ /* Task function macros as described on the FreeRTOS.org WEB site. */ #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portNOP() #ifdef __cplusplus } #endif #endif /* PORTMACRO_H */
#include "radix_tree.h" #include <stdlib.h> #include <stdio.h> #define RT_BRANCH_FACTOR_BIT (6) #define RT_BRANCH_FACTOR (1 << RT_BRANCH_FACTOR_BIT) #define RT_BRANCH_FACTOR_MASK (RT_BRANCH_FACTOR - 1) #define RT_MAX_HEIGHT (11) // div_round_up (64, 6) int initialized = 0; int max_height; static unsigned long max_index [RT_MAX_HEIGHT]; struct radix_node { unsigned int height; unsigned int offset; // for shrinking unsigned int child_count; union { struct radix_node *parent; struct list_head head; // for radix tree deletion }; struct radix_node *slots [RT_BRANCH_FACTOR]; }; static inline long div_round_up (long n, long d) { long tmp = n + d - 1; return tmp / d; } static inline void initialize_max_index (void) { max_height = (int) div_round_up (sizeof (unsigned long) << 3, RT_BRANCH_FACTOR_BIT); int i; unsigned long last = 1; //puts ("max index -----"); for (i = 0; i < max_height; ++i) { max_index[i] = last << RT_BRANCH_FACTOR_BIT; last = max_index[i]; --max_index[i]; //printf ("%lu\n", max_index[i]); } } static inline struct radix_data_node * new_radix_data_node (unsigned long key, void *data) { struct radix_data_node *retval = (struct radix_data_node*) malloc (sizeof (struct radix_data_node)); if (retval == NULL) return NULL; retval->key = key; retval->data = data; INIT_LIST_HEAD (&retval->iter_head); return retval; } static inline struct radix_node * new_radix_node (struct radix_node *parent, unsigned int height, unsigned int offset) { struct radix_node *retval = (struct radix_node*) malloc (sizeof (struct radix_node)); if (retval == NULL) return NULL; int i; struct radix_node **slots = retval->slots; for (i = 0; i < RT_BRANCH_FACTOR; ++i) slots[i] = NULL; retval->height = height; retval->offset = offset; retval->child_count = 0; retval->parent = parent; return retval; } struct radix_tree * new_radix_tree () { struct radix_tree *retval = (struct radix_tree*) malloc (sizeof (struct radix_tree)); if (retval == NULL) return NULL; if (!initialized) { initialize_max_index (); initialized = 1; } retval->size = 0; retval->root = new_radix_node (NULL, 0, 0); INIT_LIST_HEAD (&retval->head); if (retval->root == NULL) { free (retval); retval = NULL; } return retval; } static inline void delete_radix_data_node (struct radix_data_node *data) { list_del (&data->iter_head); free (data); } static inline void delete_radix_node (struct radix_node *node) { free (node); } // BFS delete, no recursion void delete_radix_tree (struct radix_tree * tree) { struct radix_node * node, *slot, **slots; struct list_head rhead = LIST_HEAD_INIT (rhead); int i; node = tree->root; // empty tree, don't traverse if (node == NULL) goto out_skip_traversal; // enqueue root node list_add_tail (&node->head, &rhead); // while queue is not empty while (rhead.next != &rhead) { // pop head node = container_of (rhead.next, struct radix_node, head); list_del (&node->head); slots = node->slots; if (node->height > 0) { for (i = 0, slot = slots[i]; i < RT_BRANCH_FACTOR; ++i, slot = slots[i]) if (slot) { list_add_tail (&slot->head, &rhead); } } else if (node->height == 0) { // if node->height == 0 -> children are data node, free the struct for (i = 0, slot = slots[i]; i < RT_BRANCH_FACTOR; ++i, slot = slots[i]) if (slot) { free (slot); } } // else { TODO: dump some shits to debug this damn thing; } free (node); } out_skip_traversal: free (tree); } static inline struct radix_node * _rt_extend (struct radix_node *root) { struct radix_node *retval = new_radix_node (NULL, root->height + 1, 0); if (retval == NULL) return NULL; retval->slots[0] = root; ++retval->child_count; root->parent = retval; return retval; } /** * shrink the tree from the leaf nodes */ static inline void _rt_shrink_node (struct radix_node *node) { struct radix_node *parent; /** * Only shrink radix node without children */ while (node->child_count == 0) { parent = node->parent; if (parent == NULL) return; parent->slots[node->offset] = NULL; --parent->child_count; delete_radix_node (node); node = parent; } } /** * reduce tree height by shrinking from the root node */ static inline void _rt_shrink_tree (struct radix_tree *tree) { struct radix_node *rnode = tree->root; /** * 1. Only shrink non-leaf root * 2. Don't shrink branching root * 3. Only shrink when root acts as zero prefix */ while (rnode->height > 0 && rnode->child_count == 1 && rnode->slots[0] != NULL) { tree->root = rnode->slots[0]; delete_radix_node (rnode); rnode = tree->root; } } void * radix_tree_insert (struct radix_tree *tree, unsigned long key, void *data) { void * retval = NULL; struct radix_data_node *dnode; struct radix_node *parent, *slot, **slots; register unsigned int height, index, shift; slot = tree->root; while (key > max_index[slot->height]) { slot = _rt_extend (slot); if (slot == NULL) { // TODO: Why ??? No memory ??? puts ("no memory"); goto out_error_extend; } tree->root = slot; } parent = tree->root; slot = NULL; slots = parent->slots; height = parent->height; shift = height * RT_BRANCH_FACTOR_BIT; while (height > 0) { index = (key >> shift) & RT_BRANCH_FACTOR_MASK; slot = slots[index]; if (slot == NULL) { // grow slot slot = new_radix_node (parent, height - 1, index); if (slot == NULL) { // TODO: Fuck the memory problem puts ("no memory"); goto out_error; } else { slots[index] = slot; ++parent->child_count; } } // move down a level; slots = slot->slots; parent = slot; shift -= RT_BRANCH_FACTOR_BIT; --height; } index = key & RT_BRANCH_FACTOR_MASK; if (slots[index] == NULL) { // insert if not exist dnode = new_radix_data_node (key, data); if (dnode == NULL) { // TODO: Fuck the memory problem puts ("no memory"); goto out_error; } else { ++parent->child_count; ++tree->size; slots[index] = (struct radix_node*) dnode; list_add_tail (&dnode->iter_head, &tree->head); } } retval = slots[index]; out: return retval; out_error: _rt_shrink_node (parent); out_error_extend: _rt_shrink_tree (tree); retval = NULL; goto out; } static inline struct radix_node * _rt_find_slot (struct radix_tree *tree, unsigned long key) { struct radix_node *retval = NULL; struct radix_node *slot, **slots; register unsigned int height, index, shift; if (key > max_index[tree->root->height]) goto out; slot = tree->root; slots = slot->slots; height = slot->height; shift = height * RT_BRANCH_FACTOR_BIT; while (height > 0) { index = (key >> shift) & RT_BRANCH_FACTOR_MASK; slot = slots[index]; if (slot == NULL) goto out; slots = slot->slots; shift -= RT_BRANCH_FACTOR_BIT; --height; } retval = slot; out: return retval; } struct radix_data_node * radix_tree_find (struct radix_tree *tree, unsigned long key) { struct radix_data_node *retval = NULL; struct radix_node *slot; unsigned int index; slot = _rt_find_slot (tree, key); if (slot == NULL) goto out; index = key & RT_BRANCH_FACTOR_MASK; retval = (struct radix_data_node *) slot->slots[index]; out: return retval; } // return the data associated with the key void * radix_tree_delete (struct radix_tree *tree, unsigned long key) { void * retval = NULL; unsigned int index; struct radix_data_node *dnode; struct radix_node *slot = _rt_find_slot (tree, key); if (slot == NULL) goto out; index = key & RT_BRANCH_FACTOR_MASK; dnode = (struct radix_data_node *) slot->slots[index]; if (dnode == NULL) goto out; retval = dnode->data; delete_radix_data_node (dnode); slot->slots[index] = NULL; --slot->child_count; _rt_shrink_node (slot); _rt_shrink_tree (tree); out: return retval; } // DFS radix tree dump void radix_tree_dfs_dump (struct radix_node *node, unsigned long prefix) { struct radix_node **slots = node->slots, *slot; unsigned int height = node->height; int i, j, k; for (i = 0; i < RT_BRANCH_FACTOR; ++i) { slot = slots[i]; if (slot) { if (height > 0) { // internal nodes radix_tree_dfs_dump (slot, prefix | (i << (RT_BRANCH_FACTOR_BIT * height))); } else { // leaf node, data node struct radix_data_node * dnode = (struct radix_data_node *) slot; prefix |= i; printf ("0x%lx->(0x%lx, %p)\n", prefix, dnode->key, dnode->data); } } } } void radix_tree_dump (struct radix_tree *tree) { struct radix_node * node, *slot, **slots; struct list_head rhead = LIST_HEAD_INIT (rhead); int i, empty; node = tree->root; radix_tree_dfs_dump (node, 0); }
// ============================================================================ // Copyright (c) 2013, FORTH-ICS / CARV // (Foundation for Research & Technology -- Hellas, // Institute of Computer Science, // Computer Architecture & VLSI Systems Laboratory) // // 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. // // ============================================================================ // The code in this file is derived from the MMA version 1.0 project, which // was licensed under the following copyright: // // Copyright (c) 2011, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory // Written by Spyros Lyberis <lymperis1@llnl.gov> // LLNL-CODE-637218, OCEC-13-184 // All rights reserved. // // This file is part of MMA, version 1.0. // For details, please see http://myrmics.com/download.php // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // - Redistributions of source code must retain the above copyright notice, // this list of conditions and the disclaimer below. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the disclaimer (as noted below) in the // documentation and/or other materials provided with the distribution. // - Neither the name of the LLNS/LLNL nor the names of its contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, // THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Additional BSD Notice // // 1. This notice is required to be provided under our contract with the U.S. // Department of Energy (DOE). This work was produced at Lawrence Livermore // National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. // 2. Neither the United States Government nor Lawrence Livermore National // Security, LLC nor any of their employees, makes any warranty, express or // implied, or assumes any liability or responsibility for the accuracy, // completeness, or usefulness of any information, apparatus, product, or // process disclosed, or represents that its use would not infringe // privately-owned rights. // 3. Also, reference herein to any specific commercial products, process, or // services by trade name, trademark, manufacturer or otherwise does not // necessarily constitute or imply its endorsement, recommendation, or // favoring by the United States Government or Lawrence Livermore National // Security, LLC. The views and opinions of authors expressed herein do not // necessarily state or reflect those of the United States Government or // Lawrence Livermore National Security, LLC, and shall not be used for // advertising or product endorsement purposes. // // ==========================[ Static Information ]=========================== // // Author : Spyros Lyberis // Abstract : Header file for memory management layer functionality // // =============================[ CVS Variables ]============================= // // File name : $RCSfile: memory_management.h,v $ // CVS revision : $Revision: 1.41 $ // Last modified : $Date: 2013/07/05 15:41:14 $ // Last author : $Author: zakkak $ // // =========================================================================== #ifndef _MEMORY_MANAGEMENT_H #define _MEMORY_MANAGEMENT_H #include <kernel_toolset.h> #include <processing.h> #include <noc.h> #include <fmpi.h> #include <types.h> // Basic defines. Keep MM_ALLOC_ALIGN to cache-line boundaries -- our DMA // engines depend on it. Also, keep MM_PAGE_SIZE to 1 MB for Formic boards // if you plan to use TLB. ARM supports 1 MB (sections) and also some // different pages. The slab size can be anything in between, but keep it // a power of 2 and a multiple of MM_ALLOC_ALIGN. #define MM_ALLOC_ALIGN 64 // 64-B memory objects alignment #define MM_SLAB_SIZE 4096 // 4-KB slab size #define MM_PAGE_SIZE 0x100000 // 1-MB page size // =========================================================================== // Memory Map for Myrmics targets // =========================================================================== #ifdef MYRMICS // --- ARM Memory Map -------------------------------------------------------- // Virtual addresses #define MM_ARM_VA_CODE_PAGE 0x00000000 // Match with arch/arm/init.c #define MM_ARM_VA_STACK_PAGE 0x00100000 // Match with arch/arm/boot.s #define MM_ARM_VA_PAGE_TABLE 0x00200000 #define MM_ARM_VA_PRINT_LOCK 0x002FFFFC #define MM_ARM_VA_USER_BASE 0x00300000 #define MM_ARM_USER_SIZE (93 * 1024 * 1024) // 93 MB total space // 0x05F00000 // Last user space page #define MM_ARM_VA_DEV0_PAGE 0x10000000 // Match with peripheral reg #define MM_ARM_VA_DEV1_PAGE 0x1E000000 // addresses in arch/arm/* #define MM_ARM_VA_KERNEL_BASE 0x84000000 #define MM_ARM_KERNEL_SIZE (112 * 1024 * 1024) // 112 MB per core // 0x9FF00000 // Last page of core #3 kernel #define MM_ARM_VA_ARS0_PAGE 0xFFC00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS1_PAGE 0xFFD00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS2_PAGE 0xFFE00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS3_PAGE 0xFFF00000 // Match with include/ars_regs.h // Hardwired physical addresses. Note that code/stacks are in the middle // of the physical address space because that's the point that is remapped to // 0x0 during boot. User space is mapped below the code/stacks, kernel space // is mapped above the code/stacks. // // WARNING: Make sure the ar_virt_to_phys() macro in arch.h is up-to-date #define MM_ARM_PA_DEV0_PAGE 0x10000000 #define MM_ARM_PA_DEV1_PAGE 0x1E000000 #define MM_ARM_PA_USER_BASE 0x60300000 // 0x65F00000 // Last user space page #define MM_ARM_PA_CODE_PAGE 0x80000000 #define MM_ARM_PA_STACK_PAGE 0x80100000 #define MM_ARM_PA_PAGE_TABLE 0x80200000 // 0x83F00000 // 64-MB remap section ends here #define MM_ARM_PA_KERNEL_BASE 0x84000000 // 0x9FF00000 // Last page of core #3 kernel #define MM_ARM_PA_ARS0_PAGE 0xFFC00000 // WARNING: If these ever change, #define MM_ARM_PA_ARS1_PAGE 0xFFD00000 // update ar_virt_to_phys(). #define MM_ARM_PA_ARS2_PAGE 0xFFE00000 // Also make all arch funcs #define MM_ARM_PA_ARS3_PAGE 0xFFF00000 // that use ARM peripheral // addresses to call // ar_virt_to_phys() -- // now we don't do that. // --------------------------------------------------------------------------- // --- MicroBlaze Memory Map ------------------------------------------------- // Virtual addresses #define MM_MB_VA_CODE_PAGE 0x00000000 // Match with arch/mb/init.c #define MM_MB_VA_STACK_PAGE 0x00100000 // Match with arch/mb/boot.s and #define MM_MB_VA_PRINT_BUF 0x00200000 // arch/mb/init.c #define MM_MB_PRINT_BUF_SIZE (4 * 1024) // 4 KB per core // 0x00208000 // next available after print buf #define MM_MB_VA_USER_BASE 0x00300000 #define MM_MB_USER_SIZE (93 * 1024 * 1024) // 93 MB total space // 0x05F00000 // last user space page #define MM_MB_VA_KERNEL_BASE 0x06000000 #define MM_MB_KERNEL_SIZE (4 * 1024 * 1024) // 4 MB per core // 0x07F00000 // last page of core #7 kernel // 0xFFF00000 // MBS page (private per core) // For the moment, TLB is in bypass mode and maps these 1-1 to the same // physical addresses, so we do not define MM_PA_* macros here. // --------------------------------------------------------------------------- // Common names #ifdef ARCH_ARM #define MM_VA_USER_BASE MM_ARM_VA_USER_BASE #define MM_PA_USER_BASE MM_ARM_PA_USER_BASE #define MM_USER_SIZE MM_ARM_USER_SIZE #define MM_VA_KERNEL_BASE MM_ARM_VA_KERNEL_BASE #define MM_PA_KERNEL_BASE MM_ARM_PA_KERNEL_BASE #define MM_KERNEL_SIZE MM_ARM_KERNEL_SIZE #endif #ifdef ARCH_MB #define MM_VA_USER_BASE MM_MB_VA_USER_BASE #define MM_PA_USER_BASE MM_MB_PA_USER_BASE #define MM_USER_SIZE MM_MB_USER_SIZE #define MM_VA_KERNEL_BASE MM_MB_VA_KERNEL_BASE #define MM_PA_KERNEL_BASE MM_MB_PA_KERNEL_BASE #define MM_KERNEL_SIZE MM_MB_KERNEL_SIZE #endif #endif // MYRMICS ifdef // =========================================================================== // Memory Map for FMPI targets // =========================================================================== #ifdef FMPI // --- ARM Memory Map -------------------------------------------------------- // Virtual addresses #define MM_ARM_VA_CODE_PAGE 0x00000000 // Match with arch/arm/init.c #define MM_ARM_VA_STACK_PAGE 0x00100000 // Match with arch/arm/boot.s #define MM_ARM_VA_PAGE_TABLE 0x00200000 #define MM_ARM_VA_PRINT_LOCK 0x002FFFFC #define MM_ARM_VA_DEV0_PAGE 0x10000000 // Match with peripheral reg #define MM_ARM_VA_DEV1_PAGE 0x1E000000 // addresses in arch/arm/* #define MM_ARM_VA_KERNEL_BASE 0x20000000 #define MM_ARM_KERNEL_SIZE (128 * 1024 * 1024) // 128 MB per core // 0x3FF00000 // Last page of core #3 kernel #define MM_ARM_VA_ARS0_PAGE 0xFFC00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS1_PAGE 0xFFD00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS2_PAGE 0xFFE00000 // Match with include/ars_regs.h #define MM_ARM_VA_ARS3_PAGE 0xFFF00000 // Match with include/ars_regs.h // Hardwired physical addresses. Note that code/stacks are in the middle // of the physical address space because that's the point that is remapped to // 0x0 during boot. User space is mapped below the code/stacks, kernel space // is mapped above the code/stacks. // // WARNING: Make sure the ar_virt_to_phys() macro in arch.h is up-to-date #define MM_ARM_PA_DEV0_PAGE 0x10000000 #define MM_ARM_PA_DEV1_PAGE 0x1E000000 #define MM_ARM_PA_KERNEL_BASE 0x60000000 // 0x7FF00000 // Last page of core #3 kernel #define MM_ARM_PA_CODE_PAGE 0x80000000 #define MM_ARM_PA_STACK_PAGE 0x80100000 #define MM_ARM_PA_PAGE_TABLE 0x80200000 // 0x83F00000 // 64-MB remap section ends here #define MM_ARM_PA_ARS0_PAGE 0xFFC00000 // WARNING: If these ever change, #define MM_ARM_PA_ARS1_PAGE 0xFFD00000 // update ar_virt_to_phys(). #define MM_ARM_PA_ARS2_PAGE 0xFFE00000 // Also make all arch funcs #define MM_ARM_PA_ARS3_PAGE 0xFFF00000 // that use ARM peripheral // addresses to call // ar_virt_to_phys() -- // now we don't do that. // --------------------------------------------------------------------------- // --- MicroBlaze Memory Map ------------------------------------------------- // Virtual addresses #define MM_MB_VA_CODE_PAGE 0x00000000 // Match with arch/mb/init.c #define MM_MB_VA_STACK_PAGE 0x00100000 // Match with arch/mb/boot.s and #define MM_MB_VA_PRINT_BUF 0x00200000 // arch/mb/init.c #define MM_MB_PRINT_BUF_SIZE (4 * 1024) // 4 KB per core // 0x00208000 // next available after print buf #define MM_MB_VA_KERNEL_BASE 0x00800000 #define MM_MB_KERNEL_SIZE (15 * 1024 * 1024) // 15 MB per core // 0x07F00000 // last page of core #7 kernel // 0xFFF00000 // MBS page (private per core) // For the moment, TLB is in bypass mode and maps these 1-1 to the same // physical addresses, so we do not define MM_PA_* macros here. // --------------------------------------------------------------------------- // Common names #ifdef ARCH_ARM #define MM_VA_KERNEL_BASE MM_ARM_VA_KERNEL_BASE #define MM_PA_KERNEL_BASE MM_ARM_PA_KERNEL_BASE #define MM_KERNEL_SIZE MM_ARM_KERNEL_SIZE #endif #ifdef ARCH_MB #define MM_VA_KERNEL_BASE MM_MB_VA_KERNEL_BASE #define MM_PA_KERNEL_BASE MM_MB_PA_KERNEL_BASE #define MM_KERNEL_SIZE MM_MB_KERNEL_SIZE #endif #endif // FMPI ifdef // Macros to get the per-core address limits static inline unsigned int mm_va_kernel_base(int cid) { return MM_VA_KERNEL_BASE + cid * MM_KERNEL_SIZE; } #ifdef ARCH_ARM static inline unsigned int mm_pa_kernel_base(int cid) { return MM_PA_KERNEL_BASE + cid * MM_KERNEL_SIZE; } #endif // =========================================================================== // Slab allocator // =========================================================================== // Bit fields of pointers returned by alloc functions #define MM_TRIES_POINTER_MSB 31 // Set for 32-bit mem allocations #define MM_TRIES_POINTER_LSB 12 // Set for 4-KB slabs // Bit fields of slot sizes supported by alloc functions #define MM_TRIES_SLOT_MSB 31 // Set for 32-bit requests #define MM_TRIES_SLOT_LSB 6 // Set for 64-B aligned slots // Bootstap and preallocation sizes #define MM_BOOTSTRAP_MAX_SLOT 896 // Max allocation length of objects at // bootstrap (MM_ALLOC_ALIGN multiple) #define MM_BOOTSTRAP_SLABS_STEP 16 // Slabs per slot size at bootstrap. // Also, this is the preferred number // of slabs taken from the free pool // and given to the partial pool (for // small sizes, if enough are available) #define MM_KERNEL_MIN_EMPTY 4 // For the kernel slab pool, minimum // number of preallocated empty slabs // for small slots ( < MM_SLAB_SIZE). #define MM_MAX_DEFERRED_FREES 64 // For the kernel slab pool, maximum // number of kt_frees that must be // done later, because we're busy // servicing another free // Examples of slab state usage and bitmaps. Examples assume slab size = 4096. // // Example 1: slot_size = 128, means 32 full slots per slab (128 x 32 = 4096). // bitmap_size = 32, offset = 0. Slots: 0, 128, 256, ... , 4032. // Slab has nothing to do with adjacent slabs, so num_slabs = 1. // // Example 2a: slot_size = 1536, offset = 0. It means that: the first object // starts at 0 and fits fully. The second at 1536 and fits. The // third starts at 3072 and does not fit fully. Still, // bitmap_size = 3 (because 3 objects can _start_ here). If the // last slot is not used, bitmap[2] = 0 and num_slabs = 1. // // Example 2b: (continues from ex. 2a above). If the 3rd object of ex. 2a is // filled, it implies an adjacent slab has been found and used. // This adjacent slab will have: slot_size = 1536, offset = 512, // trailer_bit = 1. Its first _start_ of an object will be at 512 // and will be represented by bitmap[0]. The leftover object status // is represented by trailer_bit. bitmap_size = 3 again, because // three objects can start here (obj. 512, 2048, 3584). Note that // the previous slab will have bitmap[2] = 1 and num_slabs = 2 in // this case. // // Example 3: slot_size = 10048, offset = 0. Now bitmap_size = 1, because // only a single slot can start here (at offset 0). If this slot // is filled, _two_ adjacent slabs must be used. On this slab, // bitmap[0] = 1 and num_slabs = 3 (meaning this slab, the 2nd // one and part of the 3rd one). Note that for the 2nd slab // there is no accounting info anywhere anymore, except the // num_slabs in the 1st slab (and that's why we're doing this: // so if someone allocates 128MB, we only create a single slab // entry with num_slabs = 32768). Also note that the 3rd slab // will have trailer_bit = 1 and offset = 1856 (because // 4096 + 4096 + 1586 = 10048) and its bitmap_size = 1, because // a single new 10048 slot can start there. // Data structures typedef enum { SLAB_EMPTY, // All slots empty SLAB_PARTIAL, // Some slots available SLAB_FULL // All slots full } MmSlabState; typedef struct MmSlabStruct MmSlab; struct MmSlabStruct { unsigned int bitmap[MM_SLAB_SIZE / // Bitmap of allocated/free slots. Bits MM_ALLOC_ALIGN / // set to 1 indicate free objects. Slot 8 / 4]; // 0 is represented by bitmap[0] LSB. char bitmap_size; // Exact bitmap bits used, based on slot // size (array above is sized for the // worst case) char trailer_bit; // Status bit of leftover object from // previous adjacent slab(s). As with // bitmap, 1 means free. This field // makes sense only when offset > 0. MmSlabState state; // Slab state int free_slots; // Number of free slots, not including // trailer (if any). Max is bitmap_size. size_t address; // Starting address (MM_SLAB_SIZE // aligned) of the slab int slot_size; // Size of slots in this slab // (MM_ALLOC_ALIGN aligned) int offset; // Offset of the first _start_ of a // slot found in this slab. Examples: // - offset == 0 => bitmap[0] shows the // first slot status, starting at 0. // - offset == 64 => trailer_bit shows // the status of an object starting // at adjacently previous slab(s), // bitmap[0] shows the first start of // a slot beginning at byte 64. int num_slabs; // Number of MM_SLAB_SIZE units // used by the last slot. If 1, means // that the slot does not span to // adjacent slabs (its end is aligned). // If e.g. 3, it means last slot starts // here, covers the whole next adj. slab // and ends at the next one. // If state == EMPTY, num_slabs shows // how many adjacent slabs are free // including this one. MmSlab *prev; // Linked list pointers for partial MmSlab *next; // slabs (siblings with same slot_size) }; typedef struct { MmSlab *head; // Partial list head int num_members; // Number of all members in the list int num_empty_members; // Number of empty members in the list size_t used_slots; // Total used slots by all members size_t free_slots; // Total free slots in all members. // Note that this is inaccurate in case // of preallocated empty slabs in // conjuction with non-aligned slots. } MmSlabPartialHead; typedef struct MmSlabPoolStruct MmSlabPool; struct MmSlabPoolStruct { int is_kernel; // If 1, this is the kernel slab pool MmSlabPool *metadata_pool; // Slab pool used for metadata Trie *used_slabs; // Partial or full slabs // (key: address, data: MmSlab *) Trie *partial_slabs; // Partial slabs (key: slot_size, // data: MmSlabPartialHead *) Trie *free_slabs; // Free slabs (key: address, // data: MmSlab *) size_t used_space; // Total pool used space size_t free_space; // Total pool free space }; // Exported functions extern MmSlabPool *mm_slab_create_pool(MmSlabPool *metadata_pool, size_t adr, int num_slabs, int is_kernel); extern int mm_slab_destroy_pool(MmSlabPool *pool, int complete_destruction); extern int mm_slab_reduce_pool(MmSlabPool *pool, int num_slabs, size_t *ret_adr); extern int mm_slab_expand_pool(MmSlabPool *pool, size_t adr, int num_slabs); extern int mm_slab_alloc_slot(MmSlabPool *pool, int size, size_t *ret_adr); extern int mm_slab_free_slot(MmSlabPool *pool, size_t adr); extern int mm_slab_query_pointer(MmSlabPool *pool, size_t adr); extern int mm_slab_query_pool(MmSlabPool *pool, int pack_options, int default_location, Trie *exception_locations, int *alloc_num_elements, int *num_elements, int **sizes, size_t **addresses); // Debugging functions #if 0 void mm_slab_dbg_pool_print(MmSlabPool *pool); void mm_slab_dbg_pool_dotty(MmSlabPool *pool, char *filename); #endif // =========================================================================== // Local region-based memory allocation // =========================================================================== // Both of the below must be powers of 2. #define MM_ADR_RANGE_CHUNK_MAX 256 // Max slabs to give to regions when // no memory pressure (initially): // 1 MB #define MM_ADR_RANGE_CHUNK_MIN 32 // Min slabs to give to regions under // memory pressure, before asking for // more memory: 128 KB #define MM_AGGRESSIVE_PAGE_REQUESTS // Uncomment this to enable the // multiplier of page requests which // anticipates scheduler level. This // result in fewer messages, but in // cases with too many schedulers // and/or too little memory, it // leads to faster out-of-memory // situations. #define MM_LOCAL_FREE_PAGES_MAX 8 // Max and min pages to retain in the // local scheduler free pool before // returning pages back / asking #define MM_LOCAL_FREE_PAGES_MIN 2 // for more pages to / from parent. // Higher-level schedulers will trade // in multiples of these, according // to level. #define MM_LOCAL_FREE_RIDS_MAX 1024 // Number or region IDs to retain // in local scheduler free pool // before returning IDs back / asking #define MM_LOCAL_FREE_RIDS_MIN 64 // for more IDs to / from parent. // Higher-level schedulers will trade // in multiples of these, according // to level. // Region IDs size and type. Note that we use signed integers for things like // "number of region IDs", so don't max the following to full unsigned size. #define MM_TRIES_RID_MSB 30 // Region ID tries max bit position #define MM_MAX_RID 0x7FFFFFFF // Maximum region ID allowable, // according to the above MSB // For region packing, number of high bits that will be used in the size // array entries to indicate the location of the data and any option bits. Note // that MM_PACK_LOCATION_BITS must be big enough to hold the log2 of the number // of cores, and MM_PACK_SIZE_BITS restricts the maximum DMA size. // // The same structure is used for the DMA sizes array in the task descriptor. #define MM_PACK_OPTION_BITS 2 // All set for 32-bit archs #define MM_PACK_LOCATION_BITS 10 #define MM_PACK_SIZE_BITS 20 #define MM_PACK_OPTION_RW 1 // Both must fit in MM_PACK_OPTION_BITS #define MM_PACK_OPTION_RO 2 typedef struct MmRgnTreeNodeStruct MmRgnTreeNode; typedef struct { rid_t rid; // Starting region ID int num_rids; // Number of IDs int sched_id; // Owner scheduler (for used_rids only; free // rids have -1 here). It always refers to // ourself or one of our next-level children // schedulers. } MmRgnRidRange; typedef struct { size_t address; // Starting address int num_slabs; // Number of slabs MmRgnTreeNode *node; // Region node (for local and used ranges only; // free ranges as well as delegated ranges have // NULL here) int sched_id; // Owner scheduler (for used_ranges only; // free ranges have -1 here). It always refers // to ourself or one of our next-level children // schedulers. } MmRgnAdrRange; struct MmRgnTreeNodeStruct { rid_t id; // Region ID MmSlabPool *pool; // Slab pool, or NULL, if region is remote // (managed by another scheduler) MmRgnAdrRange **ranges; // Array of used address ranges (or NULL if // region is remote) int num_ranges; // Number of ranges in the array rid_t parent_id; // Parent region ID rid_t *children_ids; // Children region IDs int num_children; // Number of children regions List *dep_queue; // Dependency queue for region (data: PrDep *) Trie *obj_dep_queues; // Dependency queue holders for objects that // belong to the region and are specifically // named as task dependencies (key: obj ptr, // data: PrObjDep *) int children_enqs_ro; // How many task enqueues we have sent to our // direct region children for read-only access int children_enqs_rw; // As above, for read/write access int obj_enqs_ro; // How many task enqueues we have sent to // our object children for read-only access int obj_enqs_rw; // As above, for read/write access int parent_enqs_ro; // How many task enqueues we have received by // our parent since the last time we reported // we were empty for read-only access int parent_enqs_rw; // As above, for read/write access int location; // Core ID of the last writer of the whole // region (minus possible exceptions of // objects found in obj_locations) Trie *obj_locations; // Core ID of the last writer for objects // that were separated from the rest of the // region, because some task(s) named them as // explicit dependencies (key: obj ptr, // data: core ID) }; // Exported functions extern int mm_region_init(int top_level); extern int mm_region_create_region(rid_t parent, int remote_mode, int remote_location, int level_hint, rid_t *ret_rid); extern int mm_region_update_parent(rid_t parent, rid_t child, int add_mode); extern int mm_region_destroy_region(rid_t region, rid_t **ret_err_regions, int *ret_num_err_regions, int *ret_num_frees); extern int mm_region_alloc_object(rid_t region, size_t size, void **ret_ptr); extern int mm_region_free_object(void *ptr); extern int mm_region_query_region(rid_t region, rid_t *ret_par_rid); extern int mm_region_query_pointer(void *ptr, size_t *ret_size, rid_t *ret_rid); extern int mm_region_pack_region(rid_t region, int pack_options, int recurse, int *alloc_num_elements, int *num_elements, size_t **addresses, int **sizes, rid_t **ret_err_children, int *ret_num_err_children); extern int mm_region_add_rid_range(Trie *t, int sched_id, rid_t rid, int num_rids, MmRgnRidRange **ret_range); extern int mm_region_reduce_rid_range(Trie *t, MmRgnRidRange *range, rid_t rid, int num_rids, MmRgnRidRange **ret_new); extern int mm_region_get_rid_range(int num_rids, size_t *ret_rid); extern int mm_region_add_adr_range(Trie *t, MmRgnTreeNode *node, int sched_id, size_t adr, int num_slabs, MmRgnAdrRange **ret_range); extern int mm_region_reduce_adr_range(Trie *t, MmRgnAdrRange *range, size_t adr, int num_slabs, MmRgnAdrRange **ret_new); extern int mm_region_get_adr_range(int min_slabs, size_t *ret_adr, int *ret_num_slabs); // Debugging functions #if 0 void mm_region_dbg_rtree_dotty(MmRgnTreeNode *root, char *filename); void mm_region_dbg_print_all(); #endif // =========================================================================== // Distributed region-based memory allocation // =========================================================================== extern int mm_distr_object_sched_id(void *ptr); extern int mm_distr_region_sched_id(rid_t region); extern int mm_distr_get_pages(int num_pages); extern int mm_distr_get_rids(int num_rids); extern int mm_distr_alloc(size_t size, rid_t region); extern int mm_distr_balloc(size_t size, rid_t region, int num_elements); extern int mm_distr_free(void *ptr); extern int mm_distr_ralloc(rid_t parent, int level_hint); extern int mm_distr_ralloc_orphan(rid_t parent, int src_core_id); extern int mm_distr_rfree(rid_t region, int update_remote_parent); extern int mm_distr_rfree_update_parent(rid_t parent, rid_t child); extern int mm_distr_pack(rid_t *regions, int *region_options, int num_regions, void **objects, int *object_options, int num_objects, int **ret_msg_ids, int *ret_num_messages, void **ret_error_ptr); extern int mm_distr_query_pointer(void *ptr); // =========================================================================== // Top-level memory allocation // =========================================================================== // Load balancing reporting granularity #define MM_LOAD_REPORT_CHANGE 0.10 // Percentile (0...1) change of // regions load in order to generate // a new load balance message // Exported functions extern void mm_user_init(PrRole role); extern int mm_alloc(PrMsgReq *req, void **ret_ptr); extern int mm_balloc(PrMsgReq *req, PrEvtHookBalloc **state); extern int mm_free(PrMsgReq *req); extern int mm_ralloc(PrMsgReq *req, rid_t *ret_region); extern int mm_ralloc_orphan(PrMsgReq *req, rid_t *ret_region); extern int mm_ralloc_update_parent(PrMsgReq *stored_req, PrMsgReply *child_reply); extern int mm_rfree(PrMsgReq *req); extern int mm_rfree_update_parent(PrMsgReq *req); extern int mm_pack(PrMsgReq *req, PrTaskDescr *task, PrEvtHookPack **state); extern int mm_query_pointer(PrMsgReq *req, size_t *ret_size, rid_t *ret_rid); extern int mm_get_pages(PrMsgReq *req, size_t *ret_adr); extern int mm_insert_free_pages(size_t adr, int num_pages); extern int mm_get_rids(PrMsgReq *req, size_t *ret_base); extern int mm_insert_free_rids(size_t base, int num_rids); // =========================================================================== // Global context variable (unique per kernel and core ID) // =========================================================================== typedef struct { // Debug tracing unsigned int *dbg_trc_data; // Trace data array int dbg_trc_idx; // Current trace index unsigned int dbg_trc_time_start; // Local timer upon trace initialization int dbg_trc_offset; // Timer offset to the top-level scheduler // during initialization // Debug statistics unsigned int *dbg_stats_data; // Array of statistics data unsigned int dbg_stats_last_tmr; // Timer value at the time of the last // call to dbg_stats() // Filesystem #ifdef ARCH_ARM unsigned int fs_flash_num_sectors; unsigned int fs_num_blocks; unsigned int fs_max_inodes; struct fs_current_state_struct *fs_state; struct fs_fdesc_struct *fs_fdesc; // Size FS_MAX_DESCRIPTORS #endif // Network-on-chip NocMode noc_mode; // Network-on-chip communication mode List *noc_cnt_free; // Free list of available hardware counters // (data: int (type casted directly to the // hardware counter nr.)) void *noc_send_buf; // Single NOC_MESSAGE_SIZE bytes buffer // for NOC_MODE_MAILBOX_ONLY send mode void *noc_recv_buf; // Single NOC_MESSAGE_SIZE bytes buffer // for NOC_MODE_MAILBOX_ONLY receive mode int noc_msg_core_id; // When -1, no message is being prepared. // When >= 0, contains the destination core // ID to be used with noc_msg_send(). NocCreditMode **noc_credits; // Per-core array of fields for credit-based // noc modes. If NULL, we don't exchange // messages with this core ID. NocCreditMode **noc_credits_poll; // A smaller array consisting of only the // non-NULL entries of the noc_credits one, // i.e. one entry per communicating peer. // The two arrays point to the same // entries, but we need both for fast // indexing and polling in the two // credit-based modes. int noc_num_peers; // Number of communicating peers (and size // of the noc_credits_poll array) int noc_poll_rr; // First round-robin based position to poll // in the credit_only noc mode List *noc_active_dmas; // List of in-progress DMAs we're doing // (data: NocDma *) #ifdef NOC_WARN_OUT_OF_CREDITS int noc_cred_warned; // When 1, we have already warned once per // core we encountered an out-of-credits // situation (which may lead to deadlock) #endif // Slab allocator & kernel heap management int mm_alloc_bootstrap; // When 1, mem allocations are still in // dummy mode (mem initialization under way) int mm_frees_bootstrap; // When 1, mem frees are still in // dummy mode (mem initialization under way) MmSlabPool *mm_kernel_pool; // Kernel objects slab pool int mm_recursion_depth; // Kernel pool malloc recursion counter int mm_prealloc_flags // Array of flags, marking which slot size [MM_SLAB_SIZE / // is low on (kernel pool) preallocated MM_ALLOC_ALIGN]; // slabs int mm_prealloc_needed; // When 1, preallocation is needed (one of // the above flags is set) int mm_busy_freeing; // For the kernel pool, flag saying we're // currently freeing something size_t *mm_defer_frees; // For the kernel pool, pointers that need // to be freed later int mm_num_defer_frees; // Number in the above array // Region management (schedulers only) MmRgnTreeNode *mm_region_tree; // Root of our region (sub)tree Trie *mm_used_rids; // Region ID ranges that are used/delegated // (key: rid, data: MmRgnRidRange *) Trie *mm_free_rids; // Region ID ranges that are still free // (key: rid, data: MmRgnRidRange *) Trie *mm_used_ranges; // Address ranges that are used/delegated // (key: address, data: MmRgnAdrRange *) Trie *mm_free_ranges; // Address ranges that are still free // (key: address, data: MmRgnAdrRange *) int mm_free_num_slabs; // Total free slabs present in // mm_free_ranges trie int mm_free_num_rids; // Total free region IDs present in // mm_free_rids trie Trie *mm_local_rids; // Locally handled region IDs // (key: rid, data: MmRgnTreeNode *) int mm_range_chunk; // Current number of slabs allocated to // new regions (or regions that ask for // more memory); lies between // MM_ADR_RANGE_CHUNK_{MIN, MAX} rid_t mm_last_harvest; // Last searched region for harvesting // free slabs of mm_range_chunk. If 0, // harvest has never happened. int mm_load_rrobin; // Round-robin variable for same-load // load balancing decisions int mm_current_load; // Our current memory region load value, // including all our children values int mm_reported_load; // Last regions load value we have reported // to our parent int *mm_children_load; // Number of regions handled by our // children schedulers. Periodically // updated. // Processing layer int pr_core_id; // System-wise unique core ID int pr_num_cores; // Total number of active system cores PrRole pr_role; // Core role (Scheduler or Worker) int *pr_core_bid_cid; // Mappings of core IDs to arch bid/cid int *pr_core_work_ids; // Mappings of core IDs to worker IDs int *pr_core_sched_ids; // Mappings of core IDs to scheduler IDs int *pr_core_child_idx; // Mappings of core IDs to children indices int *pr_work_core_ids; // Mappings of worker IDs to core IDs int *pr_sched_core_ids; // Mappings of scheduler IDs to core IDs int *pr_core_route; // Routing table: y = pr_core_route[x] // specifies that messages ultimately // going to core ID x should be forwarded // to (parent or child) core ID y as the // next hop int pr_num_schedulers; // Total number of schedulers int pr_num_workers; // Total number of workers int pr_worker_id; // Worker: which worker are we out // of num_workers int pr_scheduler_id; // Scheduler: which scheduler are we // out of num_schedulers int pr_parent_sched_id; // Scheduler ID of our parent scheduler // (if we're a scheduler) or the scheduler // responsible for us (if we're a worker), // or -1 if we're the top level scheduler int pr_scheduler_level; // Scheduler: level in hierarchy. // 0 is lowest-level scheduler who has // workers as children. int *pr_children; // Scheduler: children core IDs int pr_num_children; // Scheduler: number of children // (workers, for level 0 schedulers, or // lev n-1 schedulers for lev n schedulers) int pr_cur_epoch; // Worker: current L2 Epoch func_t **pr_task_table; // Task table of application to be run List *pr_ready_queue; // Worker: tasks assigned to us to be run // (data: PrTaskDescr *) int pr_spawn_pending; // Worker: if 1, a spawn request is pending // to our task scheduler Trie *pr_tasks; // Scheduler: tasks we're responsible for // (key: task ID, data: PrTaskDescr *) int pr_avail_task_id; // Scheduler: next available task ID // (does not include the scheduler ID) int pr_sched_rr; // Scheduler: index of last child for // round-robin scheduling int pr_load_vs_locality;// Scheduler: load score percentage vs. // locality score for task scheduling. // A value of 100 means consider only load // balance score, a value of 0 means // consider only locality score. int pr_cur_sched_load; // Scheduler: Our current scheduled task // load value, i.e. how many tasks are // handled by schedulers in this subtree. int pr_cur_run_load; // Scheduler: Our current running task load // value, i.e. how many tasks are currently // running by workers in this subtree. int pr_rep_sched_load; // Scheduler: Last scheduled task load // value we have reported to our parent int pr_rep_run_load; // Scheduler: Last running task load // value we have reported to our parent int *pr_chld_sched_load;// Scheduler: Scheduled task load value of // our children schedulers (periodically // updated) int *pr_chld_run_load; // Scheduler: Running task load value of // our children (periodically updated if // we're a non-leaf scheduler, faithfully // updated if we are a leaf scheduler) int pr_main_finished; // Top-level scheduler only: set to 1 when // main task has been collected // Messaging/events int pr_message_id; // Per-core unique message ID Trie *pr_pending_events; // Events we couldn't handle immediately // (key: OUR req_id, data: PrEvtPending *) List *pr_incomplete_req; // Incoming multi-part requests // (data: PrMultiPartReq) int pr_pages_msg_id; // If > 0, there is an ongoing request // to get more pages and this is the message // ID for it int pr_rids_msg_id; // If > 0, there is an ongoing request // to get more region IDs and this is the // message ID for it // Video Demos stuff int vid_demo_in_bid; // Arch-level board ID of video input core int vid_demo_in_cid; // Arch-level core ID of video input core int vid_demo_out_bid; // Arch-level board ID of video output core int vid_demo_out_cid; // Arch-level core ID of video output core // FMPI context #ifdef FMPI FMPI_Context *fmpi; #endif } Context; // Exported macro to get the single context structure. This is at a known // location: it is allocated at bootstrap and never moved. Find nearest // MM_ALLOC_ALIGN size and return its bootstrap address. static inline Context *mm_get_context(int cid) { if (sizeof(Context) & (MM_ALLOC_ALIGN - 1)) { return (Context *) (mm_va_kernel_base(cid) + MM_BOOTSTRAP_SLABS_STEP * MM_SLAB_SIZE * (sizeof(Context) / MM_ALLOC_ALIGN)); } else { return (Context *) (mm_va_kernel_base(cid) + MM_BOOTSTRAP_SLABS_STEP * MM_SLAB_SIZE * (sizeof(Context) / MM_ALLOC_ALIGN - 1)); } } #endif
import React from "react"; import { PhoneFilled } from "@ant-design/icons"; import * as Styled from "./style"; const Contact = () => ( <Styled.Container> <Styled.Title> Fale comigo <PhoneFilled /> </Styled.Title> <h3>dianaregina22@outlook.com.br</h3> <h3>(11) 954660546</h3> </Styled.Container> ); export default Contact;
'use strict'; // Enforce use of strict verion of JavaScript /* @Doc Config.js is a Module used to create and export configuration variables, and allow users to use variables read from the envrionmental variables. */ // See if any additional acceptable environmental variables injected, Overwrite existing defaults if available. module.exports.port = process.env.port || 80;
/* Copyright 2018, 2019 New Vector Ltd Copyright 2019, 2020 The Matrix.org Foundation C.I.C. 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. */ import React from 'react'; import FileSaver from 'file-saver'; import * as sdk from '../../../../index'; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import PropTypes from 'prop-types'; import { scorePassword } from '../../../../utils/PasswordScorer'; import { _t } from '../../../../languageHandler'; import { accessSecretStorage } from '../../../../CrossSigningManager'; import SettingsStore from '../../../../settings/SettingsStore'; const PHASE_PASSPHRASE = 0; const PHASE_PASSPHRASE_CONFIRM = 1; const PHASE_SHOWKEY = 2; const PHASE_KEEPITSAFE = 3; const PHASE_BACKINGUP = 4; const PHASE_DONE = 5; const PHASE_OPTOUT_CONFIRM = 6; const PASSWORD_MIN_SCORE = 4; // So secure, many characters, much complex, wow, etc, etc. const PASSPHRASE_FEEDBACK_DELAY = 500; // How long after keystroke to offer passphrase feedback, ms. // XXX: copied from ShareDialog: factor out into utils function selectText(target) { const range = document.createRange(); range.selectNodeContents(target); const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range); } /* * Walks the user through the process of creating an e2e key backup * on the server. */ export default class CreateKeyBackupDialog extends React.PureComponent { static propTypes = { secureSecretStorage: PropTypes.bool, onFinished: PropTypes.func.isRequired, } constructor(props) { super(props); this._recoveryKeyNode = null; this._keyBackupInfo = null; this._setZxcvbnResultTimeout = null; this.state = { secureSecretStorage: props.secureSecretStorage, phase: PHASE_PASSPHRASE, passPhrase: '', passPhraseConfirm: '', copied: false, downloaded: false, zxcvbnResult: null, setPassPhrase: false, }; if (this.state.secureSecretStorage === undefined) { this.state.secureSecretStorage = SettingsStore.isFeatureEnabled("feature_cross_signing"); } // If we're using secret storage, skip ahead to the backing up step, as // `accessSecretStorage` will handle passphrases as needed. if (this.state.secureSecretStorage) { this.state.phase = PHASE_BACKINGUP; } } componentDidMount() { // If we're using secret storage, skip ahead to the backing up step, as // `accessSecretStorage` will handle passphrases as needed. if (this.state.secureSecretStorage) { this._createBackup(); } } componentWillUnmount() { if (this._setZxcvbnResultTimeout !== null) { clearTimeout(this._setZxcvbnResultTimeout); } } _collectRecoveryKeyNode = (n) => { this._recoveryKeyNode = n; } _onCopyClick = () => { selectText(this._recoveryKeyNode); const successful = document.execCommand('copy'); if (successful) { this.setState({ copied: true, phase: PHASE_KEEPITSAFE, }); } } _onDownloadClick = () => { const blob = new Blob([this._keyBackupInfo.recovery_key], { type: 'text/plain;charset=us-ascii', }); FileSaver.saveAs(blob, 'recovery-key.txt'); this.setState({ downloaded: true, phase: PHASE_KEEPITSAFE, }); } _createBackup = async () => { const { secureSecretStorage } = this.state; this.setState({ phase: PHASE_BACKINGUP, error: null, }); let info; try { if (secureSecretStorage) { await accessSecretStorage(async () => { info = await MatrixClientPeg.get().prepareKeyBackupVersion( null /* random key */, { secureSecretStorage: true }, ); info = await MatrixClientPeg.get().createKeyBackupVersion(info); }); } else { info = await MatrixClientPeg.get().createKeyBackupVersion( this._keyBackupInfo, ); } await MatrixClientPeg.get().scheduleAllGroupSessionsForBackup(); this.setState({ phase: PHASE_DONE, }); } catch (e) { console.error("Error creating key backup", e); // TODO: If creating a version succeeds, but backup fails, should we // delete the version, disable backup, or do nothing? If we just // disable without deleting, we'll enable on next app reload since // it is trusted. if (info) { MatrixClientPeg.get().deleteKeyBackupVersion(info.version); } this.setState({ error: e, }); } } _onCancel = () => { this.props.onFinished(false); } _onDone = () => { this.props.onFinished(true); } _onOptOutClick = () => { this.setState({phase: PHASE_OPTOUT_CONFIRM}); } _onSetUpClick = () => { this.setState({phase: PHASE_PASSPHRASE}); } _onSkipPassPhraseClick = async () => { this._keyBackupInfo = await MatrixClientPeg.get().prepareKeyBackupVersion(); this.setState({ copied: false, downloaded: false, phase: PHASE_SHOWKEY, }); } _onPassPhraseNextClick = () => { this.setState({phase: PHASE_PASSPHRASE_CONFIRM}); } _onPassPhraseKeyPress = async (e) => { if (e.key === 'Enter') { // If we're waiting for the timeout before updating the result at this point, // skip ahead and do it now, otherwise we'll deny the attempt to proceed // even if the user entered a valid passphrase if (this._setZxcvbnResultTimeout !== null) { clearTimeout(this._setZxcvbnResultTimeout); this._setZxcvbnResultTimeout = null; await new Promise((resolve) => { this.setState({ zxcvbnResult: scorePassword(this.state.passPhrase), }, resolve); }); } if (this._passPhraseIsValid()) { this._onPassPhraseNextClick(); } } } _onPassPhraseConfirmNextClick = async () => { this._keyBackupInfo = await MatrixClientPeg.get().prepareKeyBackupVersion(this.state.passPhrase); this.setState({ setPassPhrase: true, copied: false, downloaded: false, phase: PHASE_SHOWKEY, }); } _onPassPhraseConfirmKeyPress = (e) => { if (e.key === 'Enter' && this.state.passPhrase === this.state.passPhraseConfirm) { this._onPassPhraseConfirmNextClick(); } } _onSetAgainClick = () => { this.setState({ passPhrase: '', passPhraseConfirm: '', phase: PHASE_PASSPHRASE, zxcvbnResult: null, }); } _onKeepItSafeBackClick = () => { this.setState({ phase: PHASE_SHOWKEY, }); } _onPassPhraseChange = (e) => { this.setState({ passPhrase: e.target.value, }); if (this._setZxcvbnResultTimeout !== null) { clearTimeout(this._setZxcvbnResultTimeout); } this._setZxcvbnResultTimeout = setTimeout(() => { this._setZxcvbnResultTimeout = null; this.setState({ // precompute this and keep it in state: zxcvbn is fast but // we use it in a couple of different places so no point recomputing // it unnecessarily. zxcvbnResult: scorePassword(this.state.passPhrase), }); }, PASSPHRASE_FEEDBACK_DELAY); } _onPassPhraseConfirmChange = (e) => { this.setState({ passPhraseConfirm: e.target.value, }); } _passPhraseIsValid() { return this.state.zxcvbnResult && this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE; } _renderPhasePassPhrase() { const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); let strengthMeter; let helpText; if (this.state.zxcvbnResult) { if (this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE) { helpText = _t("Great! This passphrase looks strong enough."); } else { const suggestions = []; for (let i = 0; i < this.state.zxcvbnResult.feedback.suggestions.length; ++i) { suggestions.push(<div key={i}>{this.state.zxcvbnResult.feedback.suggestions[i]}</div>); } const suggestionBlock = <div>{suggestions.length > 0 ? suggestions : _t("Keep going...")}</div>; helpText = <div> {this.state.zxcvbnResult.feedback.warning} {suggestionBlock} </div>; } strengthMeter = <div> <progress max={PASSWORD_MIN_SCORE} value={this.state.zxcvbnResult.score} /> </div>; } return <div> <p>{_t( "<b>Warning</b>: You should only set up key backup from a trusted computer.", {}, { b: sub => <b>{sub}</b> }, )}</p> <p>{_t( "We'll store an encrypted copy of your keys on our server. " + "Protect your backup with a passphrase to keep it secure.", )}</p> <p>{_t("For maximum security, this should be different from your account password.")}</p> <div className="mx_CreateKeyBackupDialog_primaryContainer"> <div className="mx_CreateKeyBackupDialog_passPhraseContainer"> <input type="password" onChange={this._onPassPhraseChange} onKeyPress={this._onPassPhraseKeyPress} value={this.state.passPhrase} className="mx_CreateKeyBackupDialog_passPhraseInput" placeholder={_t("Enter a passphrase...")} autoFocus={true} /> <div className="mx_CreateKeyBackupDialog_passPhraseHelp"> {strengthMeter} {helpText} </div> </div> </div> <DialogButtons primaryButton={_t('Next')} onPrimaryButtonClick={this._onPassPhraseNextClick} hasCancel={false} disabled={!this._passPhraseIsValid()} /> <details> <summary>{_t("Advanced")}</summary> <p><button onClick={this._onSkipPassPhraseClick} > {_t("Set up with a Recovery Key")} </button></p> </details> </div>; } _renderPhasePassPhraseConfirm() { const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); let matchText; if (this.state.passPhraseConfirm === this.state.passPhrase) { matchText = _t("That matches!"); } else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) { // only tell them they're wrong if they've actually gone wrong. // Security concious readers will note that if you left riot-web unattended // on this screen, this would make it easy for a malicious person to guess // your passphrase one letter at a time, but they could get this faster by // just opening the browser's developer tools and reading it. // Note that not having typed anything at all will not hit this clause and // fall through so empty box === no hint. matchText = _t("That doesn't match."); } let passPhraseMatch = null; if (matchText) { passPhraseMatch = <div className="mx_CreateKeyBackupDialog_passPhraseMatch"> <div>{matchText}</div> <div> <AccessibleButton element="span" className="mx_linkButton" onClick={this._onSetAgainClick}> {_t("Go back to set it again.")} </AccessibleButton> </div> </div>; } const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); return <div> <p>{_t( "Please enter your passphrase a second time to confirm.", )}</p> <div className="mx_CreateKeyBackupDialog_primaryContainer"> <div className="mx_CreateKeyBackupDialog_passPhraseContainer"> <div> <input type="password" onChange={this._onPassPhraseConfirmChange} onKeyPress={this._onPassPhraseConfirmKeyPress} value={this.state.passPhraseConfirm} className="mx_CreateKeyBackupDialog_passPhraseInput" placeholder={_t("Repeat your passphrase...")} autoFocus={true} /> </div> {passPhraseMatch} </div> </div> <DialogButtons primaryButton={_t('Next')} onPrimaryButtonClick={this._onPassPhraseConfirmNextClick} hasCancel={false} disabled={this.state.passPhrase !== this.state.passPhraseConfirm} /> </div>; } _renderPhaseShowKey() { let bodyText; if (this.state.setPassPhrase) { bodyText = _t( "As a safety net, you can use it to restore your encrypted message " + "history if you forget your Recovery Passphrase.", ); } else { bodyText = _t("As a safety net, you can use it to restore your encrypted message history."); } return <div> <p>{_t( "Your recovery key is a safety net - you can use it to restore " + "access to your encrypted messages if you forget your passphrase.", )}</p> <p>{_t( "Keep your recovery key somewhere very secure, like a password manager (or a safe).", )}</p> <p>{bodyText}</p> <div className="mx_CreateKeyBackupDialog_primaryContainer"> <div className="mx_CreateKeyBackupDialog_recoveryKeyHeader"> {_t("Your Recovery Key")} </div> <div className="mx_CreateKeyBackupDialog_recoveryKeyContainer"> <div className="mx_CreateKeyBackupDialog_recoveryKey"> <code ref={this._collectRecoveryKeyNode}>{this._keyBackupInfo.recovery_key}</code> </div> <div className="mx_CreateKeyBackupDialog_recoveryKeyButtons"> <button className="mx_Dialog_primary" onClick={this._onCopyClick}> {_t("Copy to clipboard")} </button> <button className="mx_Dialog_primary" onClick={this._onDownloadClick}> {_t("Download")} </button> </div> </div> </div> </div>; } _renderPhaseKeepItSafe() { let introText; if (this.state.copied) { introText = _t( "Your recovery key has been <b>copied to your clipboard</b>, paste it to:", {}, {b: s => <b>{s}</b>}, ); } else if (this.state.downloaded) { introText = _t( "Your recovery key is in your <b>Downloads</b> folder.", {}, {b: s => <b>{s}</b>}, ); } const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); return <div> {introText} <ul> <li>{_t("<b>Print it</b> and store it somewhere safe", {}, {b: s => <b>{s}</b>})}</li> <li>{_t("<b>Save it</b> on a USB key or backup drive", {}, {b: s => <b>{s}</b>})}</li> <li>{_t("<b>Copy it</b> to your personal cloud storage", {}, {b: s => <b>{s}</b>})}</li> </ul> <DialogButtons primaryButton={_t("OK")} onPrimaryButtonClick={this._createBackup} hasCancel={false}> <button onClick={this._onKeepItSafeBackClick}>{_t("Back")}</button> </DialogButtons> </div>; } _renderBusyPhase(text) { const Spinner = sdk.getComponent('views.elements.Spinner'); return <div> <Spinner /> </div>; } _renderPhaseDone() { const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); return <div> <p>{_t( "Your keys are being backed up (the first backup could take a few minutes).", )}</p> <DialogButtons primaryButton={_t('OK')} onPrimaryButtonClick={this._onDone} hasCancel={false} /> </div>; } _renderPhaseOptOutConfirm() { const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); return <div> {_t( "Without setting up Secure Message Recovery, you won't be able to restore your " + "encrypted message history if you log out or use another session.", )} <DialogButtons primaryButton={_t('Set up Secure Message Recovery')} onPrimaryButtonClick={this._onSetUpClick} hasCancel={false} > <button onClick={this._onCancel}>I understand, continue without</button> </DialogButtons> </div>; } _titleForPhase(phase) { switch (phase) { case PHASE_PASSPHRASE: return _t('Secure your backup with a passphrase'); case PHASE_PASSPHRASE_CONFIRM: return _t('Confirm your passphrase'); case PHASE_OPTOUT_CONFIRM: return _t('Warning!'); case PHASE_SHOWKEY: return _t('Recovery key'); case PHASE_KEEPITSAFE: return _t('Keep it safe'); case PHASE_BACKINGUP: return _t('Starting backup...'); case PHASE_DONE: return _t('Success!'); default: return _t("Create Key Backup"); } } render() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); let content; if (this.state.error) { const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); content = <div> <p>{_t("Unable to create key backup")}</p> <div className="mx_Dialog_buttons"> <DialogButtons primaryButton={_t('Retry')} onPrimaryButtonClick={this._createBackup} hasCancel={true} onCancel={this._onCancel} /> </div> </div>; } else { switch (this.state.phase) { case PHASE_PASSPHRASE: content = this._renderPhasePassPhrase(); break; case PHASE_PASSPHRASE_CONFIRM: content = this._renderPhasePassPhraseConfirm(); break; case PHASE_SHOWKEY: content = this._renderPhaseShowKey(); break; case PHASE_KEEPITSAFE: content = this._renderPhaseKeepItSafe(); break; case PHASE_BACKINGUP: content = this._renderBusyPhase(); break; case PHASE_DONE: content = this._renderPhaseDone(); break; case PHASE_OPTOUT_CONFIRM: content = this._renderPhaseOptOutConfirm(); break; } } return ( <BaseDialog className='mx_CreateKeyBackupDialog' onFinished={this.props.onFinished} title={this._titleForPhase(this.state.phase)} hasCancel={[PHASE_PASSPHRASE, PHASE_DONE].includes(this.state.phase)} > <div> {content} </div> </BaseDialog> ); } }
import traceback import math from discord.ext import commands import discord.errors async def handle_error(ctx, err): can_send = ctx.channel.permissions_for(ctx.me).send_messages if not can_send: await react_or_false(ctx, ("\U0001f507",)) if isinstance(err, commands.errors.CommandOnCooldown): if not await react_or_false(ctx, ("\u23f0",)) and can_send: await ctx.send("\u23f0 " + str(err)) return if isinstance(err, commands.UserInputError) and can_send: await ctx.send("\u274c Bad argument: {}".format(' '.join(err.args))) elif isinstance(err, commands.errors.CheckFailure) and can_send: if ctx.command.hidden: return await react_or_false(ctx, ("\u2753",)) await ctx.send("\u274c Check failure. " + str(err)) elif isinstance(err, commands.errors.CommandNotFound): await react_or_false(ctx, ("\u2753",)) else: content = "\u274c Error occurred while handling the command." if isinstance(err, commands.errors.CommandInvokeError): if isinstance(err.original, discord.errors.HTTPException): content = None if content: await ctx.send(content) if ctx.command.name == 'debug': return ctx.bot.logger.error("{}.{}".format(err.__class__.__module__, err.__class__.__name__)) ctx.bot.logger.trace("".join(traceback.format_exception(type(err), err, err.__traceback__))) ctx.bot.logger.trace("".join(traceback.format_exception(type(err), err.__cause__, err.__cause__.__traceback__))) async def react_or_false(ctx, reactions=("\u2705",)): if ctx.channel.permissions_for(ctx.me).add_reactions: for r in reactions: try: await ctx.message.add_reaction(r) except: continue return True return False def ci_score(ratings: list): pos = sum([ratings[i] * i / (len(ratings) - 1) for i in range(1, len(ratings))]) n = sum([i for i in ratings]) return ci(pos, n) * 10 def ci(pos, n): z = 1.96 phat = 1.0 * pos / n return (phat + z * z / (2 * n) - z * math.sqrt((phat * (1 - phat) + z * z / (4 * n)) / n)) / (1 + z * z / n) class AppendOrSend: def __init__(self, channel: discord.abc.Messageable): self.data = "" self.channel = channel async def append(self, arg: str): if not isinstance(arg, str): arg = str(arg) if len(self.data) + len(arg) > 2000: await self.channel.send(self.data) self.data = arg else: self.data += arg async def flush(self): await self.channel.send(self.data) self.data = "" def clamp(minimum, value, maximum): return min(maximum, max(minimum, value))
// Copyright (c) 2018 The WINCASHCOIN developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef WINCASHCOIN_DETERMINISTICMINT_H #define WINCASHCOIN_DETERMINISTICMINT_H #include <libzerocoin/Denominations.h> #include <uint256.h> #include <serialize.h> //struct that is safe to store essential mint data, without holding any information that allows for actual spending (serial, randomness, private key) class CDeterministicMint { private: uint8_t nVersion; uint32_t nCount; uint256 hashSeed; uint256 hashSerial; uint256 hashStake; uint256 hashPubcoin; uint256 txid; int nHeight; libzerocoin::CoinDenomination denom; bool isUsed; public: CDeterministicMint(); CDeterministicMint(uint8_t nVersion, const uint32_t& nCount, const uint256& hashSeed, const uint256& hashSerial, const uint256& hashPubcoin, const uint256& hashStake); libzerocoin::CoinDenomination GetDenomination() const { return denom; } uint32_t GetCount() const { return nCount; } int GetHeight() const { return nHeight; } uint256 GetSeedHash() const { return hashSeed; } uint256 GetSerialHash() const { return hashSerial; } uint256 GetStakeHash() const { return hashStake; } uint256 GetPubcoinHash() const { return hashPubcoin; } uint256 GetTxHash() const { return txid; } uint8_t GetVersion() const { return nVersion; } bool IsUsed() const { return isUsed; } void SetDenomination(const libzerocoin::CoinDenomination denom) { this->denom = denom; } void SetHeight(const int& nHeight) { this->nHeight = nHeight; } void SetNull(); void SetStakeHash(const uint256& hashStake) { this->hashStake = hashStake; } void SetTxHash(const uint256& txid) { this->txid = txid; } void SetUsed(const bool isUsed) { this->isUsed = isUsed; } std::string ToString() const; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); READWRITE(nCount); READWRITE(hashSeed); READWRITE(hashSerial); READWRITE(hashStake); READWRITE(hashPubcoin); READWRITE(txid); READWRITE(nHeight); READWRITE(denom); READWRITE(isUsed); }; }; #endif //WINCASHCOIN_DETERMINISTICMINT_H
// // CFDanmaku.h // 31- CFDanmakuDemo // // Created by 于 传峰 on 15/7/9. // Copyright (c) 2015年 于 传峰. All rights reserved. // #import <UIKit/UIKit.h> typedef enum : NSInteger { CFDanmakuPositionNone = 0, CFDanmakuPositionCenterTop, CFDanmakuPositionCenterBottom } CFDanmakuPosition; @interface CFDanmaku : NSObject // 对应视频的时间戳 @property(nonatomic, assign) NSTimeInterval timePoint; // 弹幕内容 @property(nonatomic, copy) NSAttributedString* contentStr; // 弹幕类型(如果不设置 默认情况下只是从右到左滚动) @property(nonatomic, assign) CFDanmakuPosition position; @end
#ifndef MSCKF_MONO_SENSOR_TYPES_H_ #define MSCKF_MONO_SENSOR_TYPES_H_ #include <Eigen/Dense> #include <Eigen/Geometry> #include <vector> namespace msckf_mono { template <typename _Scalar> using Quaternion = Eigen::Quaternion<_Scalar>; template <typename _Scalar> using Matrix3 = Eigen::Matrix<_Scalar, 3, 3>; template <typename _Scalar> using Matrix4 = Eigen::Matrix<_Scalar, 4, 4>; template <typename _Scalar> using MatrixX = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>; template <typename _Scalar> using RowVector3 = Eigen::Matrix<_Scalar, 1, 3>; template <typename _Scalar> using Vector2 = Eigen::Matrix<_Scalar, 2, 1>; template <typename _Scalar> using Vector3 = Eigen::Matrix<_Scalar, 3, 1>; template <typename _Scalar> using Vector4 = Eigen::Matrix<_Scalar, 4, 1>; template <typename _Scalar> using VectorX = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>; template <typename _Scalar> using Point = Vector3<_Scalar>; template <typename _Scalar> using GyroscopeReading = Vector3<_Scalar>; template <typename _Scalar> using AccelerometerReading = Vector3<_Scalar>; template <typename _Scalar> using Isometry3 = Eigen::Transform<_Scalar,3,Eigen::Isometry>; template <typename _Scalar> struct Camera { EIGEN_MAKE_ALIGNED_OPERATOR_NEW _Scalar c_u, c_v, f_u, f_v, b; Quaternion<_Scalar> q_CI; Point<_Scalar> p_C_I; }; template <typename _Scalar> struct camState { EIGEN_MAKE_ALIGNED_OPERATOR_NEW Point<_Scalar> p_C_G; Quaternion<_Scalar> q_CG; _Scalar time; int state_id; int last_correlated_id; std::vector<size_t> tracked_feature_ids; }; template <typename _Scalar> struct imuState { EIGEN_MAKE_ALIGNED_OPERATOR_NEW; Point<_Scalar> p_I_G, p_I_G_null; Vector3<_Scalar> v_I_G, b_g, b_a, g, v_I_G_null; Quaternion<_Scalar> q_IG, q_IG_null; }; template <typename _Scalar> struct imuReading { EIGEN_MAKE_ALIGNED_OPERATOR_NEW GyroscopeReading<_Scalar> omega; AccelerometerReading<_Scalar> a; _Scalar dT; }; template <typename _Scalar> struct noiseParams { EIGEN_MAKE_ALIGNED_OPERATOR_NEW _Scalar u_var_prime, v_var_prime; Eigen::Matrix<_Scalar, 12, 12> Q_imu; Eigen::Matrix<_Scalar, 15, 15> initial_imu_covar; }; template <typename _Scalar> struct MSCKFParams { _Scalar max_gn_cost_norm, min_rcond, translation_threshold; _Scalar redundancy_angle_thresh, redundancy_distance_thresh; int min_track_length, max_track_length, max_cam_states; }; template <typename _Scalar> struct featureTrackToResidualize { size_t feature_id; std::vector<Vector2<_Scalar>, Eigen::aligned_allocator<Vector2<_Scalar>>> observations; std::vector<camState<_Scalar>> cam_states; std::vector<size_t> cam_state_indices; bool initialized; Vector3<_Scalar> p_f_G; featureTrackToResidualize() : initialized(false) {} }; template <typename _Scalar> struct featureTrack { size_t feature_id; std::vector<Vector2<_Scalar>, Eigen::aligned_allocator<Vector2<_Scalar>>> observations; std::vector<size_t> cam_state_indices; // state_ids of cam states corresponding to observations bool initialized = false; Vector3<_Scalar> p_f_G; }; } #endif
# -*- coding=utf-8 -*- # library: jionlp # author: dongrixinyu # license: Apache License 2.0 # Email: dongrixinyu.89@163.com # github: https://github.com/dongrixinyu/JioNLP # description: Preprocessing tool for Chinese NLP """ 给定一篇中文文本,确定其归属地。主要应用在新闻领域,确定新闻的发生地 注意事项: 1、该方法主要应用于舆情分析与统计 2、该方法采用了北大分词器 pkuseg,采用词性标注得到的地名 ns 进行统计计算 因此,方法的计算效果和性能 90% 程度上受到分词器影响。 3、该方法抽取结果中,排序靠后的地址可能存在错误,如,原文中出现“北京朝阳”, 而结果中返回了 {'province': '辽宁省', 'city': '朝阳市', 'county': '朝阳县'} 因此,当有多个地址返回时,排序靠后的地址往往可靠性低。 4、在新闻领域,其归属地往往由 1~3 个国内城市或国家构成,这是分析大量新闻 得出的结论,极少有某篇新闻涉及到诸多国家或城市。因此,返回的地址中,可 靠性较高的是前三个地址,在应用时也可仅考虑前三个重要的地址。 5、国内地名未考虑乡镇级,国外地名未考虑洲、州、邦、县级;地名未考虑海洋、 山形、河流、楼宇等,此类地址全部存入 others 字段,方便后续的处理。 6、文本中,存在“中国”二字,而不存在具体的城市、省份的情况,往往为外交新闻, 因此,在 foreign 字段中,也可能出现“中国”,而 domestic 为空。 7、地名词典仍有扩充和改进的空间。 8、仍需增加一些规则,如“北京时间”不能计入地名计算,往往分词器无法判断; “日美同盟”中需要分别考虑日本、美国,此类简称也无法考虑。 9、返回结果中,第一个地址属于文本的归属地的正确率为 93%。 """ import copy import collections try: import spacy_pkuseg as pkuseg except: import pkuseg from jionlp.dictionary.dictionary_loader import china_location_loader from jionlp.dictionary.dictionary_loader import world_location_loader class LocationRecognizer(object): """ 地域识别,识别出一篇文本中主要涉及的地址,即返回一篇文本的归属地, 返回的结果具体到地级市,国外具体到城市 具体假设为,每一个句子仅识别一个地址,然后统计所有的结果 计算方法: 1、对文本做分词与词性标注(默认使用北大工具 pkuseg),找出其中地名词汇,统计词频; 2、对所有地名词汇进行扩充,如,将“广州”扩展成 {'province': '广东省', 'city': '广州市', 'county': None}; 3、将存在上下级关系的地名进行合并,如“西藏”和“拉萨”,同属于一个地址,则进行合并, {'province': '西藏', 'city': '拉萨', 'county': None}; 4、统计国内、国外、以及无法归纳的地址,按频次排序返回。 Args: text(str): 输入的文本,一般是网络新闻文本 Returns: dict: 地名结果,包含若干字段,见如下示例。地名分为国内和国外两部分,其中国内 按照省、市、县,国外按照国家、市的结构进行返回。每个分别默认返回最佳的结 果。如两个国家城市具有同样的权重,则同时返回。返回数量可以使用参数调节。 除此之外,仍有一些地名无法用地名行政区划进行匹配,则在 Addition 字段进 行返回。 Examples: >>> text = '成都市召开了中日韩三国峰会,中国、日本、韩国三国首脑,' '日本东京和尚家村缔结了互帮互助...' >>> print(jio.recognize_location(text)) { 'domestic': [ [ { 'province': '四川省', 'city': '成都市', 'county': None }, 1 ] ], 'foreign': [ [ { 'country': '日本', 'city': '东京' }, 3 ], [ { 'country': '韩国', 'city': None }, 1 ] ], 'others': [ '尚家村', '印度洋', '羽田机场', '直布罗陀海峡' ] } """ def __init__(self): self.pkuseg = None def _prepare(self): self.pkuseg = pkuseg.pkuseg(postag=True) china_loc = china_location_loader() world_loc = world_location_loader() self._mapping_china_location(china_loc) self._mapping_world_location(world_loc) def _mapping_china_location(self, china_loc): # 整理行政区划码映射表 self.china_administrative_map_list = list() # 地址别称 for prov in china_loc: if prov.startswith('_'): continue self.china_administrative_map_list.append( [[prov, china_loc[prov]['_alias']], [None, None], [None, None]]) for city in china_loc[prov]: if city.startswith('_'): continue self.china_administrative_map_list.append( [[prov, china_loc[prov]['_alias']], [city, china_loc[prov][city]['_alias']], [None, None]]) for county in china_loc[prov][city]: if county.startswith('_'): continue self.china_administrative_map_list.append( [[prov, china_loc[prov]['_alias']], [city, china_loc[prov][city]['_alias']], [county, china_loc[prov][city][county]['_alias']]]) def _mapping_world_location(self, world_loc): # 整理国外行政区划映射表 world_administrative_map_list = list() for continent in world_loc: for country in world_loc[continent]: cities = [world_loc[continent][country]['capital']] if 'main_city' in world_loc[continent][country]: cities.extend(world_loc[continent][country]['main_city']) world_administrative_map_list.append( [[country, world_loc[continent][country]['full_name']], None]) for city in cities: world_administrative_map_list.append( [[country, world_loc[continent][country]['full_name']], city]) self.world_administrative_map_list = world_administrative_map_list def get_china_candidates(self, location): """ 从地址中获取所有可能涉及到的候选地址, 如给定,朝阳,匹配得到 [ {'province': '北京市', 'city': '北京市', 'county': '朝阳区'}, {'province': '辽宁省', 'city': '朝阳市', 'county': None}, {'province': '辽宁省', 'city': '朝阳市', 'county': '朝阳县'}, {'province': '吉林省', 'city': '长春市', 'county': '朝阳区'} ] 存在一个地址对应多个详细地址的情况,如 朝阳,匹配得到 北京朝阳,辽宁朝阳,吉林长春朝阳 此种情况下需要全部返回。 """ if self.china_administrative_map_list is None: self._prepare() level_list = ['province', 'city', 'county'] candidate_admin_list = list() # 候选列表 for admin_item in self.china_administrative_map_list: count = 0 for idx, name_item in enumerate(admin_item): match_flag = False for name in name_item: # 别名与全名任意匹配一个 if name is not None and name == location: match_flag = True break if match_flag: count += 1 # offset 中的每一个元素,分别指示省、市、县三级是否被匹配 offset_list = [1 if i <= idx else 0 for i in range(3)] if count > 0: cur_item = dict() for level, offset, name in zip(level_list, offset_list, admin_item): if offset == 1: cur_item.update({level: name[0]}) else: cur_item.update({level: None}) if cur_item not in candidate_admin_list: candidate_admin_list.append(cur_item) # TODO # 当这里已有结果后,若不是有歧义的地名,如辽宁朝阳,北京朝阳等之外,可以直接跳出循环 # 返回结果即可,可以大大加快计算速度,待总结 return candidate_admin_list def get_world_candidates(self, location): """ 给定一个地址字符串,找出其中的候选地址, 如给定 科伦坡,匹配得到 [{'country': '斯里兰卡', 'city': '科伦坡'}] """ if self.world_administrative_map_list is None: self._prepare() level_list = ['country', 'city'] candidate_admin_list = list() # 候选列表 for admin_item in self.world_administrative_map_list: count = 0 for idx, name_item in enumerate(admin_item): match_flag = False if idx == 0: # 国家名 for name in name_item: # 别名与全名任意匹配一个 if name is not None and name == location: match_flag = True break elif idx == 1: # 城市名 if name_item is not None: if name_item in [location, location.replace('市', '')]: # 兼顾到国外地名未提各类别名的情况 match_flag = True else: raise ValueError if match_flag: count += 1 # offset 中的每一个元素,分别指示国家、城市是否被匹配 offset_list = [1 if i <= idx else 0 for i in range(2)] if count > 0: cur_item = dict() for level, offset, name in zip(level_list, offset_list, admin_item): if offset == 1: if type(name) is list: cur_item.update({level: name[0]}) elif type(name) is str: cur_item.update({level: name}) else: cur_item.update({level: None}) if cur_item not in candidate_admin_list: candidate_admin_list.append(cur_item) # TODO: # 世界地名较少有重复的城市名称,因此可以考虑当匹配后,直接跳出循环 return candidate_admin_list @staticmethod def _combine_china_locations(china_combine_list, cur_location): """ 给定一个匹配的地名列表,以及一个当前的待合并地址, 将当前的地址放入地名列表,须注意与该合并的地址进行合并。 china_combine_list: 结构如下 [[{'province': '江苏省', 'city': '南京市', 'county': '鼓楼区'}, 2, True], [{'province': '河南省', 'city': '开封市', 'county': '鼓楼区'}, 1, True], [{'province': '河南省', 'city': None, 'county': '鼓楼区'}, 6, False]] 其中 数字代表出现的频次,True 代表可以作为地址结果进行返回, False 表示不可以作为最终结果返回 cur_location: 结构如下: [{'province': '河南省', 'city': '开封市', 'county': None}, 8] """ if len(china_combine_list) == 0: cur_location.append(True) china_combine_list.append(cur_location) return china_combine_list combine_flag = False for item in china_combine_list: cur_combine_flag = True if item[0]['province'] is not None and cur_location[0]['province'] is not None: if item[0]['province'] != cur_location[0]['province']: cur_combine_flag = False if item[0]['city'] is not None and cur_location[0]['city'] is not None: if item[0]['city'] != cur_location[0]['city']: cur_combine_flag = False if item[0]['county'] is not None and cur_location[0]['county'] is not None: if item[0]['county'] != cur_location[0]['county']: cur_combine_flag = False if cur_combine_flag: # 可以合并了,因为都一样的公共部分 # 将较短的一个地名设置为 False,频次取两者最大值 none_num = len([i for i in list(item[0].values()) if i is None]) cur_none_num = len([i for i in list(cur_location[0].values()) if i is None]) if none_num < cur_none_num: # 当前进入的地址较短,不作为最终结果 item[1] = item[1] + cur_location[1] cur_location.append(False) combine_flag = True # 在计算最末将该地址添加进去 else: # 替换掉该条较短的地址,作为最终结果 item[2] = False cur_location[1] = item[1] + cur_location[1] cur_location.append(True) combine_flag = True if combine_flag: china_combine_list.append(cur_location) else: # 并无合并,但是仍需加在所有结果的末尾 cur_location.append(True) china_combine_list.append(cur_location) return china_combine_list @staticmethod def _combine_world_locations(world_combine_list, cur_location): """ 给定一个匹配的地名列表,以及一个当前的待合并地址, 将当前的地址放入地名列表,须注意与该合并的地址进行合并。 world_combine_list: 结构如下 [[{'country': '美国', 'city': '华盛顿'}, 2, True], [{'country': '斯里兰卡', 'city': '科伦坡'}, 1, True], [{'country': '斯里兰卡', 'city': None}, 6, False]] 其中 数字代表出现的频次,True 代表可以作为地址结果进行返回, False 表示不可以作为最终结果返回 cur_location: 结构如下: [{'country': '日本', 'city': None}, 8] """ if len(world_combine_list) == 0: cur_location.append(True) world_combine_list.append(cur_location) return world_combine_list combine_flag = False for item in world_combine_list: cur_combine_flag = True if item[0]['country'] is not None and cur_location[0]['country'] is not None: if item[0]['country'] != cur_location[0]['country']: cur_combine_flag = False if item[0]['city'] is not None and cur_location[0]['city'] is not None: if item[0]['city'] != cur_location[0]['city']: cur_combine_flag = False if cur_combine_flag: # 可以合并了,因为都一样的公共部分 # 将较短的一个地名设置为 False,频次取两者最大值 none_num = len([i for i in list(item[0].values()) if i is None]) cur_none_num = len([i for i in list(cur_location[0].values()) if i is None]) if none_num < cur_none_num: # 当前进入的地址较短,不作为最终结果 item[1] = item[1] + cur_location[1] cur_location.append(False) combine_flag = True # 在计算最末将该地址添加进去 else: # 替换掉该条较短的地址,作为最终结果 item[2] = False cur_location[1] = item[1] + cur_location[1] cur_location.append(True) combine_flag = True if combine_flag: world_combine_list.append(cur_location) else: # 并无合并,但是仍需加在所有结果的末尾 cur_location.append(True) world_combine_list.append(cur_location) return world_combine_list def __call__(self, text, top_k='default'): if self.pkuseg is None: self._prepare() final_res = {'domestic': None, 'foreign': None, 'others': None} text_pos_seg = self.pkuseg.cut(text) text_location = [item[0] for item in text_pos_seg if item[1] == 'ns'] if len(text_location) == 0: return {'domestic': None, 'foreign': None, 'others': None} location_count = dict(collections.Counter(text_location).most_common()) not_matched_list = copy.deepcopy(location_count) # 统计未匹配地址 # 中国国内部分 china_combine_list = list() # 将若干中国地名合并 for location, count in location_count.items(): china_candidates = self.get_china_candidates(location) if len(china_candidates) > 0: # 匹配到地址 not_matched_list.pop(location) # 从未匹配词典中删除 # 此时,未知 郑州 和 金水区 是对应的上下级映射关系,需要进行关联 for china_candidate in china_candidates: china_combine_list = self._combine_china_locations( china_combine_list, [china_candidate, count]) domestic_locations = sorted( [item[:2] for item in china_combine_list if item[-1]], key=lambda i: i[1], reverse=True) # 世界部分 world_combine_list = list() # 将若干世界地名合并 for location, count in location_count.items(): world_candidates = self.get_world_candidates(location) if len(world_candidates) > 0: # 匹配到地址 if location in not_matched_list: not_matched_list.pop(location) # 从未匹配词典中删除 # 此时,未知 斯里兰卡 和 科伦坡 是对应的上下级映射关系,需要进行关联 for world_candidate in world_candidates: world_combine_list = self._combine_world_locations( world_combine_list, [world_candidate, count]) foreign_locations = sorted( [item[:2] for item in world_combine_list if item[-1]], key=lambda i:i[1], reverse=True) if len(domestic_locations) > 0: if top_k == 'default': final_res['domestic'] = domestic_locations[:3] else: final_res['domestic'] = domestic_locations[:top_k] if len(foreign_locations) > 0: if top_k == 'default': final_res['foreign'] = foreign_locations[:3] else: final_res['foreign'] = foreign_locations[:top_k] if len(not_matched_list) > 0: final_res['others'] = not_matched_list return final_res if __name__ == '__main__': import json lr = LocationRecognizer() text = '中国海军和平方舟医院船首访多米尼加。新华社圣多明各11月1日电(记者吴昊 江山)执行“和谐使命-2018”任务的中国海军和平方舟医院船11月1日抵达圣多明各港,开始对多米尼加进行为期8天的友好访问。多米尼加地处加勒比海,今年5月1日,与中国正式建交。这是两国建交以来,中国海军舰艇首次访多。当地时间1日上午7时30分许,和平方舟缓缓驶进圣多明各港。停泊在港内的多海军舰艇悬挂满旗,舰员在甲板分区列队,随着一长声鸣笛,整齐敬礼,表达热烈欢迎。和平方舟悬挂满旗致谢,鸣笛一长声还礼,海军官兵行举手礼致敬。8时许,和平方舟停靠圣多明各港码头,多方举行热烈欢迎仪式,多海军军乐队分别演奏两国国歌,官兵代表向“和谐使命-2018”任务指挥员敬献鲜花。多军政官员,中国驻多使馆临时代办张步新 率使馆工作人员、华侨华人、中资机构代表等在码头迎接。仪式结束后,多军政官员、华侨华人等登船参观。当天下午,和平方舟主平台全面展开,进行诊疗活动。多米尼加是和平方舟 入列以来访问的第41个国家,也是此次任务的第九站。访问期间,“和谐使命-2018”任务指挥员将拜会多军政要员,和平方舟将开展联合诊疗、文化联谊、设备维修等系列活动。' res = lr(text) print(json.dumps(res, ensure_ascii=False, indent=4, separators=(',', ':')))
#!/usr/bin/env python3 import sys import json from cvra_bootloader import utils def parse_commandline_args(): """ Parses the program commandline arguments. Args must be an array containing all arguments. """ epilog = ''' The configuration file must contained a JSON-encoded map. Example: "{"name":"foo"}". ''' parser = utils.ConnectionArgumentParser(description='Update config (key/value pairs) on a board', epilog=epilog) parser.add_argument("-c", "--config", help="JSON file to load config from (default stdin)", type=open, default=sys.stdin, dest='file') parser.add_argument("ids", metavar='DEVICEID', nargs='+', type=int, help="Device IDs to flash") return parser.parse_args() def main(): args = parse_commandline_args() config = json.loads(args.file.read()) if "ID" in config.keys(): print("This tool cannot be used to change node IDs.") print("Use bootloader_change_id.py instead.") sys.exit(1) connection = utils.open_connection(args) utils.config_update_and_save(connection, config, args.ids) if __name__ == "__main__": main()
""" Django settings for main project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'u4o52g!xn%y3q8(^wj#1dy)5#a+!yjg)#&g%psrhewt-(#=)cq' #not kept secret for now, since it is a sample project # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'landingPage.apps.LandingpageConfig', #manually added ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'main.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'main.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console': { 'class': 'logging.StreamHandler', }, }, 'root': { 'handlers': ['console'], 'level': 'INFO', }, } # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.1/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static')
""" Author: Thomas G. Close (tclose@oist.jp) Copyright: 2012-2014 Thomas G. Close. License: This file is part of the "NineLine" package, which is released under the MIT Licence, see LICENSE for details. """ # from pype9.utils.mpi import mpi_comm import os.path import nineml import ninemlcatalog from argparse import ArgumentTypeError import pype9.utils.logging.handlers.sysout # @UnusedImport CATALOG_PREFIX = 'catalog://' def existing_file(fname): if not os.path.isfile(fname): raise ArgumentTypeError( "'{}' does not refer to an existing file".format(fname)) return fname def nineml_document(doc_path): if doc_path.startswith(CATALOG_PREFIX): model = ninemlcatalog.load(doc_path[len(CATALOG_PREFIX):]) else: if (not doc_path.startswith('/') and not doc_path.startswith('./') and not doc_path.startswith('../')): doc_path = './' + doc_path model = nineml.read(doc_path, relative_to=os.getcwd()) return model def nineml_model(model_path): model = nineml_document(model_path) if isinstance(model, nineml.Document): model = model.as_network( os.path.splitext(os.path.basename(model_path))[0]) return model # Might be useful so have kept it here # # class randomseed(int): # # """ # Automatically generates unique random seeds if none are provided, as well # as ensuring that unique seeds are passed to each MPI process # # Parameters # ---------- # arg : int # An existing seed to use # mirror_mpi: bool # Flags whether the seeds should be the same on different # MPI nodes or not # """ # counter = 0 # # def __new__(cls, arg=None, mirror_mpi=False): # if arg is None or arg == 'None' or int(arg) == 0: # seed = int(time.time() * 256) + cls.counter # cls.counter += 1 # else: # seed = int(arg) # # Ensure a different seed gets used on each MPI node # if not mirror_mpi: # seed = seed * mpi_comm.size + mpi_comm.rank # return cls(seed)
import React, { Component } from "react"; import "../../../node_modules/bootstrap/dist/css/bootstrap.min.css"; import "../../css/frameworks/normalize.css"; // Things to consider // - use classNameName instead of className // - self closing tag must be closed with a slash // - example: <img /> // - this is not html, it is jsx // - all styles must follow camelCase format // - background-color becomes backgroundColor // - onclick becomes onClick // - you can use {} inside of attributes and text nodes // - inside the curly you can put any js expressions // - You can add example image using this link // - https://picsum.photos/width/height // - Be sure to change the width and height class SideBar extends Component { constructor(props) { super(props); this.state = {}; // any method using this keyword must bind // example: this.method = this.method.bind(this) } componentDidMount() { // Things to do when the component is first rendered into the dom } componentWillUnmount() { // Things to do when the component is removed } render() { return ( <nav className="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#"> Idea-Connect </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" > <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" href="#"> Home <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> Idea </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> DashBoard </a> </li> <li class="nav-item"> <a class="nav-link" href="#"> Contact Us </a> </li> </ul> <form class="form-inline my-2 my-lg-0"> <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" /> <button class="btn btn-outline-success my-2 my-sm-0" type="submit"> Search Idea </button> </form> </div> </nav> ); } } export default SideBar;
import pandas import matplotlib.pyplot as plt def config_plot(): plt.rcParams['figure.figsize'] = [12, 8] plt.rcParams['figure.dpi'] = 100 def load_covid() -> pandas.DataFrame: df = load_covid_raw() fixed_df = df.drop(labels=["Province/State", "Lat", "Long"], axis=1) return fixed_df.groupby("Country/Region").sum().transpose() def load_covid_raw() -> pandas.DataFrame: csv = "https://github.com/CSSEGISandData/COVID-19/raw/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv" return pandas.read_csv(csv) def get_worst(df: pandas.DataFrame, count): return df.sum().sort_values().take(range(-count, 0)).index
#ifndef __SOUNDBANK_H__ #define __SOUNDBANK_H__ #include <string> #include <vector> class AudioEvent; class SoundBank { public: std::vector<AudioEvent*> events; std::string name; std::string path; unsigned int id = 0; }; #endif //__SOUNDBANK_H__
import { cloneMock, mockCollection } from '../mocks/entities' import sinon from 'sinon' import { expect } from 'chai' export function entityWrappedTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const entity = wrapperMethod(makeRequest, entityMock) expect(entity.toPlainObject()).eql(entityMock) } export function entityCollectionWrappedTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const collection = mockCollection(entityMock) const entity = wrapperMethod(makeRequest, collection) expect(entity.toPlainObject()).eql(collection) } export async function entityPatchTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const entity = wrapperMethod(makeRequest, entityMock) const response = await entity.patch([]) expect(response.toPlainObject, 'response is wrapped').to.be.ok } export async function entityUpdateTest(setup, { wrapperMethod }) { await entityActionTest(setup, { wrapperMethod, actionMethod: 'update' }) } export async function entityCollectionActionTest(setup, { wrapperMethod, actionMethod }) { const { makeRequest, entityMock } = setup(Promise.resolve({ items: [] })) const entity = wrapperMethod(makeRequest, entityMock) return entity[actionMethod]().then((response) => { expect(response.toPlainObject, 'response is wrapped').to.be.ok }) } export async function entityActionTest(setup, { wrapperMethod, actionMethod }) { const { makeRequest, entityMock } = setup() const entity = wrapperMethod(makeRequest, entityMock) const response = await entity[actionMethod]() expect(response.toPlainObject, 'response is wrapped').to.be.ok } export async function entityDeleteTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const entity = wrapperMethod(makeRequest, entityMock) expect(await entity.delete()).to.not.throw } export async function entityPublishTest(setup, { wrapperMethod }) { await entityActionTest(setup, { wrapperMethod, actionMethod: 'publish' }) } export async function failingActionTest(setup, { wrapperMethod, actionMethod }) { const error = cloneMock('error') const { makeRequest, entityMock } = setup(Promise.reject(error)) const entity = wrapperMethod(makeRequest, entityMock) await expect(entity[actionMethod]()).to.eventually.be.rejectedWith(error) } export async function failingVersionActionTest(setup, { wrapperMethod, actionMethod }) { const error = cloneMock('error') const { makeRequest, entityMock } = setup(Promise.reject(error)) entityMock.sys.version = 2 const entity = wrapperMethod(makeRequest, entityMock) await expect(entity[actionMethod]()).to.eventually.be.rejectedWith(error) } export async function isPublishedTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const unpublishedEntity = wrapperMethod(makeRequest, entityMock) expect(unpublishedEntity.isPublished(), 'entity initially unpublished').to.be.false entityMock.sys.publishedVersion = 2 const publishedEntity = wrapperMethod(makeRequest, entityMock) expect(publishedEntity.isPublished(), 'entity is now published').to.be.true } export async function isUpdatedTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const unpublishedEntity = wrapperMethod(makeRequest, entityMock) expect(unpublishedEntity.isUpdated(), 'entity not published').to.be.false entityMock.sys.publishedVersion = 2 entityMock.sys.version = 3 const unchangedEntity = wrapperMethod(makeRequest, entityMock) expect(unchangedEntity.isUpdated(), 'entity initially unchanged').to.be.false entityMock.sys.version = 5 const changedEntity = wrapperMethod(makeRequest, entityMock) expect(changedEntity.isUpdated(), 'entity is now updated').to.be.true } export async function isDraftTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const unpublishedEntity = wrapperMethod(makeRequest, entityMock) expect(unpublishedEntity.isDraft(), 'entity is in draft mode').to.be.true entityMock.sys.publishedVersion = 2 entityMock.sys.version = 3 const unchangedEntity = wrapperMethod(makeRequest, entityMock) expect(unchangedEntity.isDraft(), 'entity is now published').to.be.false } export async function isArchivedTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const unarchivedEntity = wrapperMethod(makeRequest, entityMock) expect(unarchivedEntity.isArchived(), 'entity initially unarchived').to.be.false entityMock.sys.archivedVersion = 2 const archivedEntity = wrapperMethod(makeRequest, entityMock) expect(archivedEntity.isArchived(), 'entity is now archived').to.be.true } export async function omitAndDeleteFieldTest(setup, { wrapperMethod }) { let { makeRequest, entityMock } = setup() entityMock.fields = [ { id: 'title', name: 'Title', value: 'myTitle', omitted: false, deleted: false, }, ] /* Since this method calls update() 2x, first call needs to return a properly wrapped entity. */ const plainEntity = wrapperMethod(makeRequest, entityMock) makeRequest = sinon.stub().returns(Promise.resolve(plainEntity)) const entity = wrapperMethod(makeRequest, entityMock) return entity.omitAndDeleteField('title').then((response) => { expect(response.toPlainObject, 'response is wrapped').to.be.ok expect( makeRequest.args[0][0].payload.fields.find((field) => field.id === 'title').omitted ).equals(true, 'omitted was set to true in the first update') expect( makeRequest.args[1][0].payload.fields.find((field) => field.id === 'title').deleted ).equals(true, 'deleted was set to true in the first update') }) } export async function failingOmitAndDeleteFieldTest(setup, { wrapperMethod }) { const { makeRequest, entityMock } = setup() const entity = wrapperMethod(makeRequest, entityMock) return entity.omitAndDeleteField('doesntExist').catch((r) => { expect(r, "throws an error when field doesn't exist").to.be.ok }) }
from unittest import TestCase import numpy as np import pandas as pd from copulas.multivariate.tree import Tree, TreeTypes from copulas.univariate.kde import KDEUnivariate class TestCenterTree(TestCase): def setUp(self): self.data = pd.read_csv('data/iris.data.csv') self.tau_mat = self.data.corr(method='kendall').values self.u_matrix = np.empty(self.data.shape) count = 0 for col in self.data: uni = KDEUnivariate() uni.fit(self.data[col]) self.u_matrix[:, count] = [uni.cumulative_distribution(x) for x in self.data[col]] count += 1 self.tree = Tree(TreeTypes.CENTER) self.tree.fit(0, 4, self.tau_mat, self.u_matrix) def test_first_tree(self): """ Assert 0 is the center node""" assert self.tree.edges[0].L == 0 def test_first_tree_likelihood(self): """ Assert first tree likehood is correct""" uni_matrix = np.array([[0.1, 0.2, 0.3, 0.4]]) value, new_u = self.tree.get_likelihood(uni_matrix) expected = -0.19988720707143634 assert abs(value - expected) < 10E-3 def test_get_constraints(self): """ Assert get constraint gets correct neighbor nodes""" self.tree._get_constraints() assert self.tree.edges[0].neighbors == [1, 2] assert self.tree.edges[1].neighbors == [0, 2] def test_get_tau_matrix(self): """ Assert none of get tau matrix is NaN """ self.tau = self.tree.get_tau_matrix() test = np.isnan(self.tau) self.assertFalse(test.all()) def test_second_tree_likelihood(self): """ Assert second tree likelihood is correct """ tau = self.tree.get_tau_matrix() second_tree = Tree(TreeTypes.CENTER) second_tree.fit(1, 3, tau, self.tree) uni_matrix = np.array([[0.1, 0.2, 0.3, 0.4]]) first_value, new_u = self.tree.get_likelihood(uni_matrix) second_value, out_u = second_tree.get_likelihood(new_u) expected = 0.540089320412914 assert abs(second_value - expected) < 10E-3
/* @flow */ import config from '../config' import Watcher from '../observer/watcher' import { mark, measure } from '../util/perf' import { createEmptyVNode } from '../vdom/vnode' import { updateComponentListeners } from './events' import { resolveSlots } from './render-helpers/resolve-slots' import { toggleObserving } from '../observer/index' import { pushTarget, popTarget } from '../observer/dep' import { warn, noop, remove, emptyObject, validateProp, invokeWithErrorHandling } from '../util/index' export let activeInstance: any = null export let isUpdatingChildComponent: boolean = false export function setActiveInstance(vm: Component) { const prevActiveInstance = activeInstance activeInstance = vm return () => { activeInstance = prevActiveInstance } } export function initLifecycle (vm: Component) { // 自定义options选项 它就是 vm.$options的引用 const options = vm.$options // locate first non-abstract parent let parent = options.parent // 当前实例的父实例 if (parent && !options.abstract) { while (parent.$options.abstract && parent.$parent) { parent = parent.$parent } parent.$children.push(vm) } vm.$parent = parent vm.$root = parent ? parent.$root : vm vm.$children = [] vm.$refs = {} vm._watcher = null vm._inactive = null vm._directInactive = false vm._isMounted = false vm._isDestroyed = false vm._isBeingDestroyed = false } /** * 在Vue.prototype 中添加三个方法 _update $forceUpdate $destroy * @param {*} Vue */ export function lifecycleMixin (Vue: Class<Component>) { Vue.prototype._update = function (vnode: VNode, hydrating?: boolean) { const vm: Component = this const prevEl = vm.$el const prevVnode = vm._vnode const restoreActiveInstance = setActiveInstance(vm) vm._vnode = vnode // Vue.prototype.__patch__ is injected in entry points // based on the rendering backend used. if (!prevVnode) { // initial render vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */) } else { // updates vm.$el = vm.__patch__(prevVnode, vnode) } restoreActiveInstance() // update __vue__ reference if (prevEl) { prevEl.__vue__ = null } if (vm.$el) { vm.$el.__vue__ = vm } // if parent is an HOC, update its $el as well if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { vm.$parent.$el = vm.$el } // updated hook is called by the scheduler to ensure that children are // updated in a parent's updated hook. } Vue.prototype.$forceUpdate = function () { const vm: Component = this if (vm._watcher) { vm._watcher.update() } } Vue.prototype.$destroy = function () { const vm: Component = this if (vm._isBeingDestroyed) { return } callHook(vm, 'beforeDestroy') vm._isBeingDestroyed = true // remove self from parent const parent = vm.$parent if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { remove(parent.$children, vm) } // teardown watchers if (vm._watcher) { vm._watcher.teardown() } let i = vm._watchers.length while (i--) { vm._watchers[i].teardown() } // remove reference from data ob // frozen object may not have observer. if (vm._data.__ob__) { vm._data.__ob__.vmCount-- } // call the last hook... vm._isDestroyed = true // invoke destroy hooks on current rendered tree vm.__patch__(vm._vnode, null) // fire destroyed hook callHook(vm, 'destroyed') // turn off all instance listeners. vm.$off() // remove __vue__ reference if (vm.$el) { vm.$el.__vue__ = null } // release circular reference (#6759) if (vm.$vnode) { vm.$vnode.parent = null } } } export function mountComponent ( vm: Component, el: ?Element, hydrating?: boolean ): Component { vm.$el = el if (!vm.$options.render) { vm.$options.render = createEmptyVNode if (process.env.NODE_ENV !== 'production') { /* istanbul ignore if */ if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || vm.$options.el || el) { warn( 'You are using the runtime-only build of Vue where the template ' + 'compiler is not available. Either pre-compile the templates into ' + 'render functions, or use the compiler-included build.', vm ) } else { warn( 'Failed to mount component: template or render function not defined.', vm ) } } } callHook(vm, 'beforeMount') let updateComponent /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && config.performance && mark) { updateComponent = () => { const name = vm._name const id = vm._uid const startTag = `vue-perf-start:${id}` const endTag = `vue-perf-end:${id}` mark(startTag) const vnode = vm._render() mark(endTag) measure(`vue ${name} render`, startTag, endTag) mark(startTag) vm._update(vnode, hydrating) mark(endTag) measure(`vue ${name} patch`, startTag, endTag) } } else { updateComponent = () => { vm._update(vm._render(), hydrating) } } // we set this to vm._watcher inside the watcher's constructor // since the watcher's initial patch may call $forceUpdate (e.g. inside child // component's mounted hook), which relies on vm._watcher being already defined new Watcher(vm, updateComponent, noop, { before () { if (vm._isMounted && !vm._isDestroyed) { callHook(vm, 'beforeUpdate') } } }, true /* isRenderWatcher */) hydrating = false // manually mounted instance, call mounted on self // mounted is called for render-created child components in its inserted hook if (vm.$vnode == null) { vm._isMounted = true callHook(vm, 'mounted') } return vm } export function updateChildComponent ( vm: Component, propsData: ?Object, listeners: ?Object, parentVnode: MountedComponentVNode, renderChildren: ?Array<VNode> ) { if (process.env.NODE_ENV !== 'production') { isUpdatingChildComponent = true } // determine whether component has slot children // we need to do this before overwriting $options._renderChildren. // check if there are dynamic scopedSlots (hand-written or compiled but with // dynamic slot names). Static scoped slots compiled from template has the // "$stable" marker. const newScopedSlots = parentVnode.data.scopedSlots const oldScopedSlots = vm.$scopedSlots const hasDynamicScopedSlot = !!( (newScopedSlots && !newScopedSlots.$stable) || (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) || (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ) // Any static slot children from the parent may have changed during parent's // update. Dynamic scoped slots may also have changed. In such cases, a forced // update is necessary to ensure correctness. const needsForceUpdate = !!( renderChildren || // has new static slots vm.$options._renderChildren || // has old static slots hasDynamicScopedSlot ) vm.$options._parentVnode = parentVnode vm.$vnode = parentVnode // update vm's placeholder node without re-render if (vm._vnode) { // update child tree's parent vm._vnode.parent = parentVnode } vm.$options._renderChildren = renderChildren // update $attrs and $listeners hash // these are also reactive so they may trigger child update if the child // used them during render vm.$attrs = parentVnode.data.attrs || emptyObject vm.$listeners = listeners || emptyObject // update props if (propsData && vm.$options.props) { toggleObserving(false) const props = vm._props const propKeys = vm.$options._propKeys || [] for (let i = 0; i < propKeys.length; i++) { const key = propKeys[i] const propOptions: any = vm.$options.props // wtf flow? props[key] = validateProp(key, propOptions, propsData, vm) } toggleObserving(true) // keep a copy of raw propsData vm.$options.propsData = propsData } // update listeners listeners = listeners || emptyObject const oldListeners = vm.$options._parentListeners vm.$options._parentListeners = listeners updateComponentListeners(vm, listeners, oldListeners) // resolve slots + force update if has children if (needsForceUpdate) { vm.$slots = resolveSlots(renderChildren, parentVnode.context) vm.$forceUpdate() } if (process.env.NODE_ENV !== 'production') { isUpdatingChildComponent = false } } function isInInactiveTree (vm) { while (vm && (vm = vm.$parent)) { if (vm._inactive) return true } return false } export function activateChildComponent (vm: Component, direct?: boolean) { if (direct) { vm._directInactive = false if (isInInactiveTree(vm)) { return } } else if (vm._directInactive) { return } if (vm._inactive || vm._inactive === null) { vm._inactive = false for (let i = 0; i < vm.$children.length; i++) { activateChildComponent(vm.$children[i]) } callHook(vm, 'activated') } } export function deactivateChildComponent (vm: Component, direct?: boolean) { if (direct) { vm._directInactive = true if (isInInactiveTree(vm)) { return } } if (!vm._inactive) { vm._inactive = true for (let i = 0; i < vm.$children.length; i++) { deactivateChildComponent(vm.$children[i]) } callHook(vm, 'deactivated') } } /** * * @param {*} vm 实例对象 * @param {*} hook // 调用的生命周期的名字 */ export function callHook (vm: Component, hook: string) { // #7573 disable dep collection when invoking lifecycle hooks pushTarget() const handlers = vm.$options[hook] const info = `${hook} hook` if (handlers) { for (let i = 0, j = handlers.length; i < j; i++) { invokeWithErrorHandling(handlers[i], vm, null, vm, info) } } if (vm._hasHookEvent) { vm.$emit('hook:' + hook) } popTarget() }
/** * * GigListItem.js * * This container renders our gig list items, displaying the company icon, * gig type, description, promo code and links to review websites and the * sign up website */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import ListItem from 'components/ListItem'; import P from './P'; import A from './A'; import Wrapper from './Wrapper'; import Spacing from './Spacing'; import Header from './Header'; import Promo from './Promo'; export function GigsListItem(props) { const { item } = props; const images = require.context('../../images/Logos', true); let logo = images(`./nw.png`); try { logo = images(`./${item.id}.png`); } catch { logo = images(`./nw.png`); } const content = ( <React.Fragment> <A href={`/gigs/${item.id}`}> <Spacing> <Wrapper> <Header image={logo} name={item.gig} /> <P>{item.description}</P> {item.apppromo || item.jobpromo ? <Promo item={item} /> : null} </Wrapper> </Spacing> </A> </React.Fragment> ); // Render the content into a list item return <ListItem key={`gig-list-item-${item.id}`} item={content} />; } GigsListItem.propTypes = { item: PropTypes.object, }; function mapDispatchToProps(dispatch) { return { dispatch, }; } export default connect( null, mapDispatchToProps, )(GigsListItem);
import yaml import netaddr import os import log as logging LOG = logging.getLogger("net-init-opencontrail") config_path = os.path.join(os.path.dirname(__file__), "network.cfg") def setup_bondings(bond_mappings): print bond_mappings def add_vlan_link(interface, ifname, vlan_id): LOG.info("add_vlan_link enter") cmd = "ip link add link %s name %s type vlan id %s; " % (ifname, interface, vlan_id) cmd += "ip link set %s up; ip link set %s up" % (interface, ifname) LOG.info("add_vlan_link: cmd=%s" % cmd) os.system(cmd) #def add_ovs_port(ovs_br, ifname, uplink, vlan_id=None): # LOG.info("add_ovs_port enter") # cmd = "ovs-vsctl --may-exist add-port %s %s" % (ovs_br, ifname) # if vlan_id: # cmd += " tag=%s" % vlan_id # cmd += " -- set Interface %s type=internal;" % ifname # cmd += "ip link set dev %s address `ip link show %s |awk '/link\/ether/{print $2}'`;" \ # % (ifname, uplink) # cmd += "ip link set %s up;" % ifname # LOG.info("add_ovs_port: cmd=%s" % cmd) # os.system(cmd) def setup_intfs(sys_intf_mappings, uplink_map): LOG.info("setup_intfs enter") for intf_name, intf_info in sys_intf_mappings.items(): if intf_info["type"] == "vlan": add_vlan_link(intf_name, intf_info["interface"], intf_info["vlan_tag"]) # elif intf_info["type"] == "ovs": # add_ovs_port( # intf_info["interface"], # intf_name, # uplink_map[intf_info["interface"]], # vlan_id=intf_info.get("vlan_tag")) else: pass def setup_ips(ip_settings, sys_intf_mappings): LOG.info("setup_ips enter") for intf_info in ip_settings.values(): network = netaddr.IPNetwork(intf_info["cidr"]) if sys_intf_mappings[intf_info["name"]]["type"] == "ovs": intf_name = intf_info["name"] else: intf_name = intf_info["alias"] if "gw" in intf_info: continue cmd = "ip addr add %s/%s brd %s dev %s;" \ % (intf_info["ip"], intf_info["netmask"], str(network.broadcast),intf_name) # if "gw" in intf_info: # cmd += "route del default;" # cmd += "ip route add default via %s dev %s" % (intf_info["gw"], intf_name) LOG.info("setup_ips: cmd=%s" % cmd) os.system(cmd) def setup_ips_new(config): LOG.info("setup_ips_new enter") network = netaddr.IPNetwork(config["ip_settings"]["br-prv"]["cidr"]) intf_name = config["provider_net_mappings"][0]["interface"] cmd = "ip addr add %s/%s brd %s dev %s;" \ % (config["ip_settings"]["br-prv"]["ip"], config["ip_settings"]["br-prv"]["netmask"], str(network.broadcast), intf_name) # cmd = "ip link set br-ex up;" # cmd += "ip addr add %s/%s brd %s dev %s;" \ # % (config["ip_settings"]["br-prv"]["ip"], config["ip_settings"]["br-prv"]["netmask"], str(network.broadcast), 'br-ex') cmd += "route del default;" cmd += "ip route add default via %s dev %s" % (config["ip_settings"]["br-prv"]["gw"], intf_name) # cmd += "ip route add default via %s dev %s" % (config["ip_settings"]["br-prv"]["gw"], 'br-ex') LOG.info("setup_ips_new: cmd=%s" % cmd) os.system(cmd) def remove_ovs_kernel_mod(config): LOG.info("remove_ovs_kernel_mod enter") cmd = "rmmod vport_vxlan; rmmod openvswitch;" LOG.info("remove_ovs_kernel_mod: cmd=%s" % cmd) os.system(cmd) def main(config): uplink_map = {} setup_bondings(config["bond_mappings"]) remove_ovs_kernel_mod(config) for provider_net in config["provider_net_mappings"]: uplink_map[provider_net['name']] = provider_net['interface'] setup_intfs(config["sys_intf_mappings"], uplink_map) setup_ips(config["ip_settings"], config["sys_intf_mappings"]) setup_ips_new(config) if __name__ == "__main__": config = yaml.load(open(config_path)) main(config)
import time from opcua import Client from colorama.ansi import Fore from uteis import * # ip local do cliente url = 'opc.tcp://localhost:4840' client = Client(url) client.connect() print(Fore.GREEN, 'cliente conectado') print(' client connected ', Fore.RESET) dadoslista = [] dadosLinhas =[] while True: Dados = client.get_node('ns=2;i=2') dados = Dados.get_value() if dados == 'linha': print('--------------------') if dadosLinhas: dadoslista.append(list(dadosLinhas)) dadosLinhas.clear() elif dados == 'fim': if dadoslista: u.mostrarMatriz(dadoslista) dadoslista.clear() continue else: if str(dados) != '0': dadosLinhas.append(dados) time.sleep(0.1)
#!/usr/bin/env python3 import os import argparse import re import io import pysam def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--vcf-in', '-i', dest='input', type=str) parser.add_argument('--out-pattern', '-o', dest='output', type=str) parser.add_argument('--chromosomes', '-c', dest='chrom', default='"^chr[0-9]+$"') args = parser.parse_args() return args def main(): args = parse_args() chrom_match = re.compile(args.chrom.strip('"')) with pysam.VariantFile(args.input) as vcf: collected_chroms = [c for c in vcf.header.contigs if chrom_match(c) is not None] call = 'bcftools view --regions {} --output-type v --output-file {} {}' for c in collected_chroms: out_file = args.output.strip('"').format(c) out_path = os.path.dirname(out_file) os.makedirs(out_path, exist_ok=True) tmp = call.format(c, out_file, args.input) try: out = subprocess.check_output(tmp, stderr=subprocess.STDOUT, shell=True, executable='/bin/bash') except subprocess.CalledProcessError as spe: raise RuntimeError(spe.output.decode('utf-8')) print(sorted(collected_chroms)) return 0 if __name__ == '__main__': main()
"""Trainer Class @author: vasudevgupta """ import tensorflow as tf from pathlib import Path import logging from tf_lightning.trainer.training_loop import TrainingLoop from tf_lightning.trainer.trainer_config import TrainerConfig logger = logging.getLogger(__name__) class Trainer(TrainerConfig, TrainingLoop): # if specifying load_dir, it will load_ckpt else it won't load ckpt load_dir = '' # if loading ckpt, use this ard to check whether all saved objects are restored assert_consumed = False def __init__(self, **kwargs): """ If you won't specify the checkpoint object; nothing will be saved If you are specifying the checkpoint, every single checkpoint will be saved But if you want to save only final checkpoint, specify `save_every_ckpt` to True """ # You can change the args specified above for attr in kwargs: assert(attr in self.default_attrs) setattr(self, attr, kwargs[attr]) super().__init__() def fit(self, lightning_module, lightning_data_module): # preparing dataset lightning_data_module.prepare_data() lightning_data_module.setup() if not self.enable_distributed_training: tr_dataset = lightning_data_module.train_dataloader() val_dataset = lightning_data_module.val_dataloader() # Inside TrainingLoop super().fit(lit_module=lightning_module) # testing mode if self.fast_dev_run: tr_dataset = tr_dataset.take(1) val_dataset = val_dataset.take(1) self.overwrite_config_for_fast_dev_run() if self.load_dir: self.load_from_checkpoint(Path(self.lightning_base_dir, self.load_dir), self.assert_consumed) # finally, just training history = self.train(tr_dataset, val_dataset) return history def overwrite_config_for_fast_dev_run(self): print("[fast-dev-run mode enabled] :: Model will run on single batch, ckpts won't be saved/loaded") self.save_only_final_ckpts = False self.save_every_ckpt = False self.epochs = self.start_epoch self.load_dir = '' @classmethod def add_argparse_args(cls, parser): for attr in cls.default_attrs: parser.add_argument( f'--{attr}', type=type(getattr(cls, attr)), default=getattr(cls, attr)) return parser @classmethod def from_argparse_args(cls, args, **kwargs): """ If you wish to over-write some of the args passed through Terminal, use this kwargs Useful especially in case of defining checkpoint object """ args_dictn = {} for attr in cls.default_attrs: if hasattr(args, attr): value = getattr(args, attr) args_dictn.update({attr: value}) # over-writing over args passed using Terminal args_dictn.update(kwargs) if 'checkpoint' not in args_dictn: print('==========You are not passing checkpoint object============') return cls(**args_dictn)
from functools import partial from hashlib import sha1 from os import environ, path from distutils import version from subprocess import DEVNULL, PIPE, CalledProcessError, check_output, check_call, run import platform import warnings import sys import time import numpy.ctypeslib as npct from codepy.jit import compile_from_string from codepy.toolchain import GCCToolchain from devito.archinfo import AMDGPUX, NVIDIAX, SKX, POWER8, POWER9 from devito.exceptions import CompilationError from devito.logger import debug, warning, error from devito.parameters import configuration from devito.tools import (as_tuple, change_directory, filter_ordered, memoized_meth, make_tempdir) __all__ = ['GNUCompiler'] def sniff_compiler_version(cc): """ Detect the compiler version. Adapted from: :: https://github.com/OP2/PyOP2/ """ try: res = run([cc, "--version"], stdout=PIPE, stderr=DEVNULL) ver = res.stdout.decode("utf-8") if not ver: return version.LooseVersion("unknown") except UnicodeDecodeError: return version.LooseVersion("unknown") except FileNotFoundError: error("The `%s` compiler isn't available on this system" % cc) sys.exit(1) if ver.startswith("gcc"): compiler = "gcc" elif ver.startswith("clang"): compiler = "clang" elif ver.startswith("Apple LLVM"): compiler = "clang" elif ver.startswith("icc"): compiler = "icc" elif ver.startswith("pgcc"): compiler = "pgcc" else: compiler = "unknown" ver = version.LooseVersion("unknown") if compiler in ["gcc", "icc"]: try: # gcc-7 series only spits out patch level on dumpfullversion. res = run([cc, "-dumpfullversion"], stdout=PIPE, stderr=DEVNULL) ver = res.stdout.decode("utf-8") ver = '.'.join(ver.strip().split('.')[:3]) if not ver: res = run([cc, "-dumpversion"], stdout=PIPE, stderr=DEVNULL) ver = res.stdout.decode("utf-8") ver = '.'.join(ver.strip().split('.')[:3]) if not ver: return version.LooseVersion("unknown") ver = version.StrictVersion(ver) except UnicodeDecodeError: pass # Pure integer versions (e.g., ggc5, rather than gcc5.0) need special handling try: ver = version.StrictVersion(float(ver)) except TypeError: pass return ver def sniff_mpi_distro(mpiexec): """ Detect the MPI version. """ try: ver = check_output([mpiexec, "--version"]).decode("utf-8") if "open-mpi" in ver: return 'OpenMPI' elif "HYDRA" in ver: return 'MPICH' except (CalledProcessError, UnicodeDecodeError): pass return 'unknown' class Compiler(GCCToolchain): """ Base class for all compiler classes. The base class defaults all compiler specific settings to empty lists. Preset configurations can be built by inheriting from `Compiler` and setting specific flags to the desired values, e.g.: .. code-block:: python def class MyCompiler(Compiler): def __init__(self): self.cc = 'mycompiler' self.cflags += ['list', 'of', 'all', 'compiler', 'flags'] The flags that can be set are: * :data:`self.cc` * :data:`self.cflag` * :data:`self.ldflags` * :data:`self.include_dirs` * :data:`self.libraries` * :data:`self.library_dirs` * :data:`self.defines` * :data:`self.src_ext` * :data:`self.so_ext` * :data:`self.undefines` Parameters ---------- suffix : str, optional The JIT compiler version to be used. For example, assuming ``CC=gcc`` and ``suffix='4.9'``, the ``gcc-4.9`` will be used as JIT compiler. cpp : bool, optional If True, JIT compile using a C++ compiler. Defaults to False. mpi : bool, optional If True, JIT compile using an MPI compiler. Defaults to False. language : str, optional The target language for shared-memory parallelism. Defaults to 'C'. platform : Platform, optional The target Platform on which the JIT compiler will be used. """ fields = {'cc', 'ld'} def __init__(self, **kwargs): super(Compiler, self).__init__(**kwargs) self.__lookup_cmds__() self.suffix = kwargs.get('suffix') if not kwargs.get('mpi'): self.cc = self.CC if kwargs.get('cpp', False) is False else self.CXX self.cc = self.cc if self.suffix is None else ('%s-%s' % (self.cc, self.suffix)) else: self.cc = self.MPICC if kwargs.get('cpp', False) is False else self.MPICXX self.ld = self.cc # Wanted by the superclass self.cflags = ['-O3', '-g', '-fPIC', '-Wall', '-std=c99'] self.ldflags = ['-shared'] self.include_dirs = [] self.libraries = ['m'] self.library_dirs = [] self.defines = [] self.undefines = [] self.src_ext = 'c' if kwargs.get('cpp', False) is False else 'cpp' if platform.system() == "Linux": self.so_ext = '.so' elif platform.system() == "Darwin": self.so_ext = '.dylib' elif platform.system() == "Windows": self.so_ext = '.dll' else: raise NotImplementedError("Unsupported platform %s" % platform) if self.suffix is not None: try: self.version = version.StrictVersion(str(float(self.suffix))) except (TypeError, ValueError): self.version = version.LooseVersion(self.suffix) else: # Knowing the version may still be useful to pick supported flags self.version = sniff_compiler_version(self.CC) def __new_from__(self, **kwargs): """ Create a new Compiler from an existing one, inherenting from it the flags that are not specified via ``kwargs``. """ return self.__class__(suffix=kwargs.pop('suffix', self.suffix), mpi=kwargs.pop('mpi', configuration['mpi']), **kwargs) @memoized_meth def get_jit_dir(self): """A deterministic temporary directory for jit-compiled objects.""" return make_tempdir('jitcache') @memoized_meth def get_codepy_dir(self): """A deterministic temporary directory for the codepy cache.""" return make_tempdir('codepy') def load(self, soname): """ Load a compiled shared object. Parameters ---------- soname : str Name of the .so file (w/o the suffix). Returns ------- obj The loaded shared object. """ return npct.load_library(str(self.get_jit_dir().joinpath(soname)), '.') def save(self, soname, binary): """ Store a binary into a file within a temporary directory. Parameters ---------- soname : str Name of the .so file (w/o the suffix). binary : obj The binary data. """ sofile = self.get_jit_dir().joinpath(soname).with_suffix(self.so_ext) if sofile.is_file(): debug("%s: `%s` was not saved in `%s` as it already exists" % (self, sofile.name, self.get_jit_dir())) else: with open(str(sofile), 'wb') as f: f.write(binary) debug("%s: `%s` successfully saved in `%s`" % (self, sofile.name, self.get_jit_dir())) def make(self, loc, args): """Invoke the ``make`` command from within ``loc`` with arguments ``args``.""" hash_key = sha1((loc + str(args)).encode()).hexdigest() logfile = path.join(self.get_jit_dir(), "%s.log" % hash_key) errfile = path.join(self.get_jit_dir(), "%s.err" % hash_key) with change_directory(loc): with open(logfile, "w") as lf: with open(errfile, "w") as ef: command = ['make'] + args lf.write("Compilation command:\n") lf.write(" ".join(command)) lf.write("\n\n") try: check_call(command, stderr=ef, stdout=lf) except CalledProcessError as e: raise CompilationError('Command "%s" return error status %d. ' 'Unable to compile code.\n' 'Compile log in %s\n' 'Compile errors in %s\n' % (e.cmd, e.returncode, logfile, errfile)) debug("Make <%s>" % " ".join(args)) def jit_compile(self, soname, code): """ JIT compile some source code given as a string. This function relies upon codepy's ``compile_from_string``, which performs caching of compilation units and avoids potential race conditions due to multiple processing trying to compile the same object. Parameters ---------- soname : str Name of the .so file (w/o the suffix). code : str The source code to be JIT compiled. """ target = str(self.get_jit_dir().joinpath(soname)) src_file = "%s.%s" % (target, self.src_ext) cache_dir = self.get_codepy_dir().joinpath(soname[:7]) if configuration['jit-backdoor'] is False: # Typically we end up here # Make a suite of cache directories based on the soname cache_dir.mkdir(parents=True, exist_ok=True) else: # Warning: dropping `code` on the floor in favor to whatever is written # within `src_file` try: with open(src_file, 'r') as f: code = f.read() code = ''.join([code, '/* Backdoor edit at %s*/ \n' % time.ctime()]) # Bypass the devito JIT cache # Note: can't simply use Python's `mkdtemp()` as, with MPI, different # ranks would end up creating different cache dirs cache_dir = cache_dir.joinpath('jit-backdoor') cache_dir.mkdir(parents=True, exist_ok=True) except FileNotFoundError: raise ValueError("Trying to use the JIT backdoor for `%s`, but " "the file isn't present" % src_file) # Should the compilation command be emitted? debug = configuration['log-level'] == 'DEBUG' # Spinlock in case of MPI sleep_delay = 0 if configuration['mpi'] else 1 # `catch_warnings` suppresses codepy complaining that it's taking # too long to acquire the cache lock. This warning can only appear # in a multiprocess session, typically (but not necessarily) when # many processes are frequently attempting jit-compilation (e.g., # when running the test suite in parallel) with warnings.catch_warnings(): warnings.simplefilter('ignore') _, _, _, recompiled = compile_from_string(self, target, code, src_file, cache_dir=cache_dir, debug=debug, sleep_delay=sleep_delay) return recompiled, src_file def __lookup_cmds__(self): self.CC = 'unknown' self.CXX = 'unknown' self.MPICC = 'unknown' self.MPICXX = 'unknown' def __str__(self): return self.__class__.__name__ def __repr__(self): return "JITCompiler[%s]" % self.__class__.__name__ def __getstate__(self): # The superclass would otherwise only return a subset of attributes return self.__dict__ def add_include_dirs(self, dirs): self.include_dirs = filter_ordered(self.include_dirs + list(as_tuple(dirs))) def add_library_dirs(self, dirs): self.library_dirs = filter_ordered(self.library_dirs + list(as_tuple(dirs))) def add_libraries(self, libs): self.libraries = filter_ordered(self.libraries + list(as_tuple(libs))) def add_ldflags(self, flags): self.ldflags = filter_ordered(self.ldflags + list(as_tuple(flags))) class GNUCompiler(Compiler): def __init__(self, *args, **kwargs): super(GNUCompiler, self).__init__(*args, **kwargs) self.cflags += ['-march=native', '-Wno-unused-result', '-Wno-unused-variable', '-Wno-unused-but-set-variable', '-ffast-math'] language = kwargs.pop('language', configuration['language']) try: if self.version >= version.StrictVersion("4.9.0"): # Append the openmp flag regardless of the `language` value, # since GCC4.9 and later versions implement OpenMP 4.0, hence # they support `#pragma omp simd` self.ldflags += ['-fopenmp'] except (TypeError, ValueError): if language == 'openmp': self.ldflags += ['-fopenmp'] def __lookup_cmds__(self): self.CC = 'gcc' self.CXX = 'g++' self.MPICC = 'mpicc' self.MPICXX = 'mpicxx' class ClangCompiler(Compiler): def __init__(self, *args, **kwargs): super(ClangCompiler, self).__init__(*args, **kwargs) self.cflags += ['-Wno-unused-result', '-Wno-unused-variable', '-ffast-math'] language = kwargs.pop('language', configuration['language']) platform = kwargs.pop('platform', configuration['platform']) if platform is NVIDIAX: self.cflags.remove('-std=c99') # Add flags for OpenMP offloading if language in ['C', 'openmp']: # TODO: Need a generic -march setup # self.cflags += ['-Xopenmp-target', '-march=sm_37'] self.ldflags += ['-fopenmp', '-fopenmp-targets=nvptx64-nvidia-cuda'] elif platform is AMDGPUX: self.cflags.remove('-std=c99') # Add flags for OpenMP offloading if language in ['C', 'openmp']: self.ldflags += ['-target', 'x86_64-pc-linux-gnu'] self.ldflags += ['-fopenmp', '-fopenmp-targets=amdgcn-amd-amdhsa', '-Xopenmp-target=amdgcn-amd-amdhsa'] self.ldflags += ['-march=%s' % platform.march] else: if platform in [POWER8, POWER9]: # -march isn't supported on power architectures self.cflags += ['-mcpu=native'] else: self.cflags += ['-march=native'] if language == 'openmp': self.ldflags += ['-fopenmp'] def __lookup_cmds__(self): self.CC = 'clang' self.CXX = 'clang++' self.MPICC = 'mpicc' self.MPICXX = 'mpicxx' class AOMPCompiler(Compiler): """AMD's fork of Clang for OpenMP offloading on both AMD and NVidia cards.""" def __init__(self, *args, **kwargs): super(AOMPCompiler, self).__init__(*args, **kwargs) self.cflags += ['-Wno-unused-result', '-Wno-unused-variable', '-ffast-math'] platform = kwargs.pop('platform', configuration['platform']) if platform in [NVIDIAX, AMDGPUX]: self.cflags.remove('-std=c99') elif platform in [POWER8, POWER9]: # It doesn't make much sense to use AOMP on Power, but it should work self.cflags += ['-mcpu=native'] else: self.cflags += ['-march=native'] def __lookup_cmds__(self): self.CC = 'aompcc' self.CXX = 'aompcc' self.MPICC = 'mpicc' self.MPICXX = 'mpicxx' class PGICompiler(Compiler): def __init__(self, *args, **kwargs): super(PGICompiler, self).__init__(*args, cpp=True, **kwargs) self.cflags.remove('-std=c99') self.cflags.remove('-O3') self.cflags.remove('-Wall') self.cflags += ['-fast', '-acc'] # Default PGI compile for a target is GPU and single threaded host. # self.cflags += ['-ta=tesla,host'] def __lookup_cmds__(self): # NOTE: using `pgc++` instead of `pgcc` because of issue #1219 self.CC = 'pgc++' self.CXX = 'pgc++' self.MPICC = 'mpic++' self.MPICXX = 'mpicxx' class IntelCompiler(Compiler): def __init__(self, *args, **kwargs): super(IntelCompiler, self).__init__(*args, **kwargs) self.cflags += ["-xhost"] language = kwargs.pop('language', configuration['language']) platform = kwargs.pop('platform', configuration['platform']) if platform is SKX: # Systematically use 512-bit vectors on skylake self.cflags += ["-qopt-zmm-usage=high"] try: if self.version >= version.StrictVersion("15.0.0"): # Append the OpenMP flag regardless of configuration['language'], # since icc15 and later versions implement OpenMP 4.0, hence # they support `#pragma omp simd` self.ldflags += ['-qopenmp'] except (TypeError, ValueError): if language == 'openmp': # Note: fopenmp, not qopenmp, is what is needed by icc versions < 15.0 self.ldflags += ['-fopenmp'] # Make sure the MPI compiler uses `icc` underneath -- whatever the MPI distro is if kwargs.get('mpi'): ver = check_output([self.MPICC, "--version"]).decode("utf-8") if not ver.startswith("icc"): warning("The MPI compiler `%s` doesn't use the Intel " "C/C++ compiler underneath" % self.MPICC) def __lookup_cmds__(self): self.CC = 'icc' self.CXX = 'icpc' # On some systems, the Intel distribution of MPI may be available, in # which case the MPI compiler may be shipped either as `mpiicc` or `mpicc`. # On other systems, there may be no Intel distribution of MPI available, # thus the MPI compiler is expected to be the classic `mpicc`. Here, # we try to use `mpiicc` first, while `mpicc` is our fallback, which may # or may not be an Intel distribution try: check_output(["mpiicc", "--version"]).decode("utf-8") self.MPICC = 'mpiicc' self.MPICXX = 'mpiicpc' except FileNotFoundError: self.MPICC = 'mpicc' self.MPICXX = 'mpicxx' class IntelKNLCompiler(IntelCompiler): def __init__(self, *args, **kwargs): super(IntelKNLCompiler, self).__init__(*args, **kwargs) self.cflags += ["-xMIC-AVX512"] language = kwargs.pop('language', configuration['language']) if language != 'openmp': warning("Running on Intel KNL without OpenMP is highly discouraged") class CustomCompiler(Compiler): """ Custom compiler based on standard environment flags. If no environment flags are found, defaults to the GNUCompiler. Notes ----- Currently honours CC, CFLAGS and LDFLAGS, with defaults similar to the default GNU/gcc settings. If DEVITO_ARCH is enabled and the DEVITO_LANGUAGE is set to 'openmp', then the OpenMP linker flags are read from OMP_LDFLAGS or otherwise default to ``-fopenmp``. """ def __new__(cls, *args, **kwargs): if any(i in environ for i in ['CC', 'CXX', 'CFLAGS', 'LDFLAGS']): obj = super().__new__(cls, *args, **kwargs) obj.__init__(*args, **kwargs) return obj else: return GNUCompiler(*args, **kwargs) def __init__(self, *args, **kwargs): super(CustomCompiler, self).__init__(*args, **kwargs) default = '-O3 -g -march=native -fPIC -Wall -std=c99' self.cflags = environ.get('CFLAGS', default).split(' ') self.ldflags = environ.get('LDFLAGS', '-shared').split(' ') language = kwargs.pop('language', configuration['language']) if language == 'openmp': self.ldflags += environ.get('OMP_LDFLAGS', '-fopenmp').split(' ') def __lookup_cmds__(self): self.CC = environ.get('CC', 'gcc') self.CXX = environ.get('CXX', 'g++') self.MPICC = environ.get('MPICC', 'mpicc') self.MPICXX = environ.get('MPICXX', 'mpicxx') compiler_registry = { 'custom': CustomCompiler, 'gnu': GNUCompiler, 'gcc': GNUCompiler, 'clang': ClangCompiler, 'aomp': AOMPCompiler, 'pgcc': PGICompiler, 'pgi': PGICompiler, 'osx': ClangCompiler, 'intel': IntelCompiler, 'icpc': IntelCompiler, 'icc': IntelCompiler, 'intel-knl': IntelKNLCompiler, 'knl': IntelKNLCompiler, } """ Registry dict for deriving Compiler classes according to the environment variable DEVITO_ARCH. Developers should add new compiler classes here. """ compiler_registry.update({'gcc-%s' % i: partial(GNUCompiler, suffix=i) for i in ['4.9', '5', '6', '7', '8', '9']})
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='AccessToken', fields=[ ('key', models.CharField(max_length=1024, serialize=False, primary_key=True)), ('issuer', models.TextField(null=True, blank=True)), ('expireTime', models.DateTimeField(null=True, blank=True)), ], ), migrations.CreateModel( name='Token', fields=[ ('key', models.CharField(max_length=1024, serialize=False, primary_key=True)), ('api_server_url', models.CharField(max_length=256, null=True, blank=True)), ('remote_ip', models.CharField(max_length=128, null=True, blank=True)), ('issuer', models.TextField(null=True, blank=True)), ('issuedTime', models.DateTimeField(auto_now_add=True)), ('expireTime', models.DateTimeField(null=True, blank=True)), ('user', models.ForeignKey(related_name='auth_tokens', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='UserProxy', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('username', models.CharField(max_length=128, null=True, blank=True)), ('proxyIOU', models.CharField(max_length=128)), ('proxyTicket', models.CharField(max_length=128)), ('expiresOn', models.DateTimeField(null=True, blank=True)), ], options={ 'verbose_name_plural': 'user proxies', }, ), ]
var searchData= [ ['click_5fsound_593',['click_sound',['../_resource_identifiers_8h.html#a0992169b8996152a51256ea9fa44cda1af2f0ac6b95c75a652e8b1e12772248fa',1,'ResourceIdentifiers.h']]], ['clock_5ftick_5fsound_594',['clock_tick_sound',['../_resource_identifiers_8h.html#a0992169b8996152a51256ea9fa44cda1aba1d47ae1226344d89893ee4e9008ee6',1,'ResourceIdentifiers.h']]], ['controls_595',['Controls',['../_h_u_d_8h.html#a8b9bbfde536d6e2a415388fa10347062ae9fc281552b33245621622c55c98020d',1,'HUD.h']]], ['credits_596',['Credits',['../_menu_state_8h.html#a8b869ec99bdf20396688e111dc688474aaf0a9426b32607bb20d85e6ce0ac98e1',1,'MenuState.h']]], ['cursor_597',['cursor',['../_resource_identifiers_8h.html#a0e337fd2087207b2b6767aa5047e7511a1791a97a8403730ee0760489a2aeb992',1,'ResourceIdentifiers.h']]] ];
########################################################################## # Copyright (c) 2013, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, CAB F.78, Universitaetstr 6, CH-8092 Zurich. ########################################################################## import re import tests import debug from common import TestCommon, TimeoutError from results import PassFailResult MATCH = 'spantest.*Done.*cycles' @tests.add_test class SpanTest(TestCommon): '''Span a program on the twice each on the first and second core''' name = "spantest" def setup(self, build, machine, testdir): super(SpanTest, self).setup(build, machine, testdir) # XXX: track number of cores booted and seen for is_finished() self._ncores = machine.get_ncores() self._nseen = 0 def get_modules(self, build, machine): modules = super(SpanTest, self).get_modules(build, machine) # span on all cores other than 0 -- matches spantest code modules.add_module("spantest", [ machine.get_ncores() - 1 ]) return modules def is_finished(self, line): return re.match(MATCH, line) def process_data(self, testdir, rawiter): result = False for line in rawiter: if re.match(MATCH, line): result = True return PassFailResult(result) @tests.add_test class SpanTestInterleaved(TestCommon): '''Interleave span and thread create''' name = "spantest_interleaved" def setup(self, build, machine, testdir): super(SpanTestInterleaved, self).setup(build, machine, testdir) # XXX: track number of cores booted and seen for is_finished() self._ncores = machine.get_ncores() self._nseen = 0 def get_modules(self, build, machine): modules = super(SpanTestInterleaved, self).get_modules(build, machine) # span on all cores other than 0 -- matches spantest code modules.add_module("tests/span-interleaved", [ machine.get_ncores() ]) return modules def is_finished(self, line): return re.search('SPAN_TEST_SUCCESS.', line) def process_data(self, testdir, rawiter): result = False for line in rawiter: if re.search('SPAN_TEST_SUCCESS.', line) : result = True return PassFailResult(result) @tests.add_test class SpanTestExit(TestCommon): '''Span a program then exit and see if other dispatchers cleanup''' name = "spantest_exit" is_done = False def setup(self, build, machine, testdir): super(SpanTestExit, self).setup(build, machine, testdir) # XXX: track number of cores booted and seen for is_finished() self._ncores = machine.get_ncores() self._nseen = 0 def get_modules(self, build, machine): modules = super(SpanTestExit, self).get_modules(build, machine) # span on all cores other than 0 -- matches spantest code modules.add_module("tests/span-exit", [ machine.get_ncores() ]) return modules def is_finished(self, line): if re.search('SPAN_TEST_DONE.', line) : self.is_done = True return re.match('kernel [0-9]*: user page fault WHILE DISABLED', line) def process_data(self, testdir, rawiter): result = True for line in rawiter: if re.match('kernel [0-9]*: user page fault WHILE DISABLED', line): result = False return PassFailResult(result) def collect_data(self, machine): fh = machine.get_output() while True: try: line = self._readline(fh) except TimeoutError as e: if self.boot_phase: if self.boot_attempts < MAX_BOOT_ATTEMPTS: yield '[Error: boot timed out, retry]\n' self.reboot(machine) continue else: yield '[Error: boot timed out, retry limit reached]\n' else: yield '[Error: test timed out]\n' debug.verbose("timeout encountered in collect_data"); self.has_timeout = True if self.is_done : break raise e yield line if not self.boot_phase: self.process_line(line) if self.is_finished(line): debug.verbose("is_finished returned true for line %s" % line) break elif self.is_booted(line): self.boot_phase = False self.set_timeout(self.test_timeout_delta) self.process_line(line)
# -*- coding: utf-8 -*- # Copyright 2018 IBM. # # 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. # ============================================================================= from .oracle import Oracle from .truth_table_oracle import TruthTableOracle from .logical_expression_oracle import LogicalExpressionOracle __all__ = [ 'Oracle', 'TruthTableOracle', 'LogicalExpressionOracle', ]
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import caffe import yaml import numpy as np import numpy.random as npr from fast_rcnn.config import cfg from fast_rcnn.bbox_transform import bbox_transform from generate_anchors import generate_anchors from utils.cython_bbox import bbox_overlaps DEBUG = False class ProposalTargetLayer(caffe.Layer): """ Assign object detection proposals to ground-truth targets. Produces proposal classification labels and bounding-box regression targets. """ def setup(self, bottom, top): self._anchors = generate_anchors() self._num_anchors = self._anchors.shape[0] if DEBUG: print 'anchors:' print self._anchors self._count = 0 self._fg_num = 0 self._bg_num = 0 layer_params = yaml.load(self.param_str) self._num_classes = layer_params['num_classes'] # sampled rois (0, x1, y1, x2, y2) top[0].reshape(1, 5) # labels top[1].reshape(1, 1) # bbox_targets top[2].reshape(1, self._num_classes * 4) # bbox_inside_weights top[3].reshape(1, self._num_classes * 4) # bbox_outside_weights top[4].reshape(1, self._num_classes * 4) # azimuth pose top[5].reshape(1) # elevation pose top[6].reshape(1) # theta pose top[7].reshape(1) def forward(self, bottom, top): # Proposal ROIs (0, x1, y1, x2, y2) coming from RPN # (i.e., rpn.proposal_layer.ProposalLayer), or any other source all_rois = bottom[0].data # GT boxes (x1, y1, x2, y2, label) # TODO(rbg): it's annoying that sometimes I have extra info before # and other times after box coordinates -- normalize to one format gt_boxes = bottom[1].data # Get pose gt gt_azimuths = bottom[2].data gt_elevations = bottom[3].data gt_thetas = bottom[4].data # Include ground-truth boxes in the set of candidate rois zeros = np.zeros((gt_boxes.shape[0], 1), dtype=gt_boxes.dtype) all_rois = np.vstack( (all_rois, np.hstack((zeros, gt_boxes[:, :-1]))) ) # Sanity check: single batch only assert np.all(all_rois[:, 0] == 0), \ 'Only single item batches are supported' num_images = 1 rois_per_image = cfg.TRAIN.BATCH_SIZE / num_images fg_rois_per_image = np.round(cfg.TRAIN.FG_FRACTION * rois_per_image) # Sample rois with classification labels and bounding box regression # targets labels, rois, bbox_targets, bbox_inside_weights, \ azimuth_labels, elevation_labels, theta_labels = \ _sample_rois(all_rois, gt_boxes, gt_azimuths, gt_elevations, \ gt_thetas, fg_rois_per_image, rois_per_image, self._num_classes) if DEBUG: print 'num fg: {}'.format((labels > 0).sum()) print 'num bg: {}'.format((labels == 0).sum()) self._count += 1 self._fg_num += (labels > 0).sum() self._bg_num += (labels == 0).sum() print 'num fg avg: {}'.format(self._fg_num / self._count) print 'num bg avg: {}'.format(self._bg_num / self._count) print 'ratio: {:.3f}'.format(float(self._fg_num) / float(self._bg_num)) # sampled rois top[0].reshape(*rois.shape) top[0].data[...] = rois # classification labels top[1].reshape(*labels.shape) top[1].data[...] = labels # bbox_targets top[2].reshape(*bbox_targets.shape) top[2].data[...] = bbox_targets # bbox_inside_weights top[3].reshape(*bbox_inside_weights.shape) top[3].data[...] = bbox_inside_weights # bbox_outside_weights top[4].reshape(*bbox_inside_weights.shape) top[4].data[...] = np.array(bbox_inside_weights > 0).astype(np.float32) # Output Pose top[5].reshape(*azimuth_labels.shape) top[5].data[...] = azimuth_labels top[6].reshape(*elevation_labels.shape) top[6].data[...] = elevation_labels top[7].reshape(*theta_labels.shape) top[7].data[...] = theta_labels def backward(self, top, propagate_down, bottom): """This layer does not propagate gradients.""" pass def reshape(self, bottom, top): """Reshaping happens during the call to forward.""" pass def _get_bbox_regression_labels(bbox_target_data, num_classes): """Bounding-box regression targets (bbox_target_data) are stored in a compact form N x (class, tx, ty, tw, th) This function expands those targets into the 4-of-4*K representation used by the network (i.e. only one class has non-zero targets). Returns: bbox_target (ndarray): N x 4K blob of regression targets bbox_inside_weights (ndarray): N x 4K blob of loss weights """ clss = bbox_target_data[:, 0] bbox_targets = np.zeros((clss.size, 4 * num_classes), dtype=np.float32) bbox_inside_weights = np.zeros(bbox_targets.shape, dtype=np.float32) inds = np.where(clss > 0)[0] for ind in inds: cls = clss[ind] start = int(4 * cls) end = start + 4 bbox_targets[ind, start:end] = bbox_target_data[ind, 1:] bbox_inside_weights[ind, start:end] = cfg.TRAIN.BBOX_INSIDE_WEIGHTS return bbox_targets, bbox_inside_weights def _compute_targets(ex_rois, gt_rois, labels): """Compute bounding-box regression targets for an image.""" assert ex_rois.shape[0] == gt_rois.shape[0] assert ex_rois.shape[1] == 4 assert gt_rois.shape[1] == 4 targets = bbox_transform(ex_rois, gt_rois) if cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED: # Optionally normalize targets by a precomputed mean and stdev targets = ((targets - np.array(cfg.TRAIN.BBOX_NORMALIZE_MEANS)) / np.array(cfg.TRAIN.BBOX_NORMALIZE_STDS)) return np.hstack( (labels[:, np.newaxis], targets)).astype(np.float32, copy=False) def _sample_rois(all_rois, gt_boxes, gt_azimuths, gt_elevations, gt_thetas, fg_rois_per_image, rois_per_image, num_classes): """Generate a random sample of RoIs comprising foreground and background examples. """ # overlaps: (rois x gt_boxes) overlaps = bbox_overlaps( np.ascontiguousarray(all_rois[:, 1:5], dtype=np.float), np.ascontiguousarray(gt_boxes[:, :4], dtype=np.float)) gt_assignment = overlaps.argmax(axis=1) max_overlaps = overlaps.max(axis=1) labels = gt_boxes[gt_assignment, 4] azimuth = gt_azimuths[gt_assignment] elevation = gt_elevations[gt_assignment] theta = gt_thetas[gt_assignment] # Select foreground RoIs as those with >= FG_THRESH overlap fg_inds = np.where(max_overlaps >= cfg.TRAIN.FG_THRESH)[0].astype(np.int32) # Guard against the case when an image has fewer than fg_rois_per_image # foreground RoIs fg_rois_per_this_image = fg_rois_per_image #int(min(fg_rois_per_image, fg_inds.size)) fg_rois_per_this_image = fg_rois_per_this_image.astype(np.int32) # Sample foreground regions without replacement if fg_inds.size > 0: fg_inds = npr.choice(fg_inds, size=fg_rois_per_this_image, replace=True) # Select background RoIs as those within [BG_THRESH_LO, BG_THRESH_HI) bg_inds = np.where((max_overlaps < cfg.TRAIN.BG_THRESH_HI) & (max_overlaps >= cfg.TRAIN.BG_THRESH_LO))[0] # Compute number of background RoIs to take from this image (guarding # against there being fewer than desired) bg_rois_per_this_image = rois_per_image - fg_rois_per_this_image bg_rois_per_this_image = min(bg_rois_per_this_image, bg_inds.size) # Sample background regions without replacement if bg_inds.size > 0: bg_inds = npr.choice(bg_inds, size=bg_rois_per_this_image, replace=False) # The indices that we're selecting (both fg and bg) keep_inds = np.append(fg_inds, bg_inds) # Select sampled values from various arrays: labels = labels[keep_inds] azimuth = azimuth[keep_inds] elevation = elevation[keep_inds] theta = theta[keep_inds] # Clamp labels for the background RoIs to 0 labels[fg_rois_per_this_image:] = 0 azimuth[fg_rois_per_this_image:] = 0 elevation[fg_rois_per_this_image:] = 0 theta[fg_rois_per_this_image:] = 0 rois = all_rois[keep_inds] bbox_target_data = _compute_targets( rois[:, 1:5], gt_boxes[gt_assignment[keep_inds], :4], labels) bbox_targets, bbox_inside_weights = \ _get_bbox_regression_labels(bbox_target_data, num_classes) return labels, rois, bbox_targets, bbox_inside_weights, azimuth, elevation, theta
/* buoyant.js Buoyant force Sparisoma Viridi | dudung@gmail.com 20180602 Create this library from previous force.js library. 20190630 2000 Add dir for non-horizontal fluid surface. 20190531 0630 Fix sliding on water surface plane. 20200618 2143 Integrate to abm-x manually, comment the last part. 2143 Commment require classes part. 2229 Set webpack_libs_md_force_buoyant to false. 20200702 2003 Move from amb-x to butiran. 2128 Add require config.js file. 2354 Use locaSotrage to store butiran state, remove Compile. */ //var butiran = localStorage.getItem("butiran"); // Require classes if(butiran == "compile") { Vect3 = require('../vect3')(); } // Define class of Buoyant class Buoyant { // Create constructor constructor() { // Set default fluid to water this.rho = 1000; // kg m^-3 // Set default gravity this.g = new Vect3(0, 0, -10); // kg m s^-2 } // Set fluid density setFluidDensity(rho) { this.rho = rho; } // Set gravity setGravity(g) { this.g = g; } // Calculate buoyant force due to immersed volume V force() { var f = new Vect3; if(arguments[0] instanceof Grain) { if(arguments.length == 1) { // Fully immersed in water var D = arguments[0].D; var V = (Math.PI / 6) * D * D * D; var g = this.g.len(); var rhof = this.rho; var n = this.g.unit().neg(); f = Vect3.mul(rhof * g * V, n); } else if(arguments.length == 2) { // Only in -gacc direction var D = arguments[0].D; var yf = arguments[1]; var y = arguments[0].r.y; var V = 0; if(y < yf - 0.5 * D) { V = (Math.PI / 6) * D * D * D; } else if(yf - 0.5 * D <= y && y <= yf + 0.5 * D) { var dy = yf - y; var V1 = 0.25 * D * D * (dy + 0.5 * D); var V2 = -(1/3) * (dy * dy * dy + D * D * D / 8); V = Math.PI * (V1 + V2); } else { V = 0; } var g = this.g.len(); var rhof = this.rho; var n = this.g.unit().neg(); f = Vect3.mul(rhof * g * V, n); } else if(arguments.length == 4) { // Make an angle with -gacc direction var x = arguments[0].r.x; var D = arguments[0].D; var GField = this.g; var xA = x + 0.5 * D; var xB = x - 0.5 * D; var yA = arguments[1]; var yB = arguments[2]; var yf = arguments[3]; //var yf = 0.5 * (yA + yB); var rA = new Vect3(xA, yA, 0); var rB = new Vect3(xB, yB, 0); var rAB = Vect3.sub(rA, rB); var nAB = rAB.unit(); var nG = GField.unit(); var nGaccent = Vect3.cross(Vect3.cross(nG, nAB), nAB); var fB; var rhof = this.rho; var y = arguments[0].r.y; if(y < yf - 0.5 * D) { //console.log("case 1"); fB = (Math.PI / 6) * rhof * D * D * D * GField.len(); nGaccent = Vect3.mul(-1, nG); } else if(yf - 0.5 * D <= y && y <= yf + 0.5 * D) { //console.log("case 2"); var dy = yf - y; var term1 = 0.25 * D * D * (dy + 0.5 * D); var term2 = -(1/3) * (dy * dy * dy + D * D * D / 8); fB = Math.PI * rhof * (term1 + term2) * GField.len(); } else { //console.log("case 3"); fB = 0; } //console.log(y, yf - 0.5 * D, fB, nGaccent); f = Vect3.mul(fB, nGaccent); } } return f; } } // Export module -- 20180602.1944 ok if(butiran == "compile") { module.exports = function() { return Buoyant; }; }
/* * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * */ /* * Purpose of this file : * * To hold user-definable portion of STLport settings which may be overridden * on per-project basis. * Please note that if you use STLport iostreams (compiled library) then you have * to use consistent settings when you compile STLport library and your project. * Those settings are defined in _site_config.h and have to be the same for a given * STLport installation. * */ //========================================================== // User-settable macros that control compilation: // Features selection //========================================================== /* _STLP_NO_OWN_IOSTREAMS: * __STL_NO_SGI_IOSTREAMS (in older versions) * This is major configuration switch. * Turn it on to disable use of SGI iostreams and use wrappers * around your compiler's iostreams, like before. * Keep it off if you want to use SGI iostreams * (Note that in this case you have to compile library in ../src * and supply resulting library at link time). * */ // # define _STLP_NO_OWN_IOSTREAMS 1 /* * This macro only works in non-SGI iostreams mode. * * Uncomment to suppress using new-style streams even if they are * available. * Beware - _STLP_USE_OWN_NAMESPACE depends on this macro, too. * Do that only if you are absolutely sure backwards-compatible * <iostream.h> is not actually a wrapper with <iostream> * Hint : In VC++ 6.x, they are not. */ // #define _STLP_NO_NEW_IOSTREAMS 1 /* * Use this switch for embedded systems where no iostreams are available * at all. STLport own iostreams will also get disabled automatically then. */ // # define _STLP_NO_IOSTREAMS 1 /* * Set _STLP_DEBUG to turn the "Debug Mode" on. * That gets you checked iterators/ranges in the manner * of "Safe STL". Very useful for debugging. Thread-safe. * Please do not forget to link proper STLport library flavor * (e.g libstlport_gcc_stldebug.a) when you set this flag in STLport iostreams mode. */ //#define _STLP_DEBUG 1 /* * * _STLP_NO_CUSTOM_IO : define this if you do not instantiate basic_xxx iostream classes with custom types (which is most likely the case). * Custom means types other than char, wchar and char_traits<>, * like basic_ostream<my_char_type, my_traits<my_char_type> > * When this option is on, most non-inline template functions definitions for iostreams are not seen by the client. * Default is off, just not to break compilation for those who do use those types. * which saves a lot of compile time for most compilers, also object and executable size for some. * That also guarantees that you still use optimized standard i/o when you compile your program without optimization. * Option does not affect STLport library build; you may use the same binary library with and without this option, * on per-project basis. * */ //#define _STLP_NO_CUSTOM_IO /* * _STLP_NO_RELOPS_NAMESPACE: if defined, don't put the relational * operator templates (>, <=. >=, !=) in namespace std::rel_ops, even * if the compiler supports namespaces. * Note : if the compiler do not support namespaces, those operators are not be provided by default, * to simulate hiding them into rel_ops. This was proved to resolve many compiler bugs with ambiguity. */ // #define _STLP_NO_RELOPS_NAMESPACE 1 /* * If _STLP_USE_OWN_NAMESPACE is in effect, STLport by default will not try * to rename std:: for the user * to _STL::. If you do want this feature, please define the following switch : */ // # define _STLP_REDEFINE_STD 1 /* * _STLP_WHOLE_NATIVE_STD : only meaningful in _STLP_USE_OWN_NAMESPACE mode. * Normally, STLport only imports necessary components from native std:: namespace - * those not yet provided by STLport (<iostream>, <complex>, etc.) * and their dependencies (<string>, <stdexcept>). * You might want everything from std:: being available in std:: namespace when you * include corresponding STLport header (like STLport <map> provides std::map as well, etc.), * if you are going to use both stlport:: and std:: components in your code. * Otherwise this option is not recommended as it increases the size of your object files * and slows down compilation. */ // # define _STLP_WHOLE_NATIVE_STD /* * Use this option to catch uninitialized members in your classes. * When it is set, construct() and destroy() fill the class storage * with _STLP_SHRED_BYTE (see below). * Note : _STLP_DEBUG and _STLP_DEBUG_ALLOC don't set this option automatically. */ // # define _STLP_DEBUG_UNINITIALIZED 1 /* * Uncomment and provide a definition for the byte with which raw memory * will be filled if _STLP_DEBUG_ALLOC or _STLP_DEBUG_UNINITIALIZED is defined. * Choose a value which is likely to cause a noticeable problem if dereferenced * or otherwise abused. A good value may already be defined for your platform; see * stl_config.h */ // #define _STLP_SHRED_BYTE 0xA3 /* * This option is for gcc users only and only affects systems where native linker * does not let gcc to implement automatic instantiation of static template data members/ * It is being put in this file as there is no way to check if we are using GNU ld automatically, * so it becomes user's responsibility. * */ // #define _STLP_GCC_USES_GNU_LD //========================================================== // Compatibility section //========================================================== /* * Define this macro to disable anachronistic constructs (like the ones used in HP STL and * not included in final standard, etc. */ // define _STLP_NO_ANACHRONISMS 1 /* * Define this macro to disable STLport extensions (for example, to make sure your code will * compile with some other implementation ) */ // define _STLP_NO_EXTENSIONS 1 /* * You should define this macro if compiling with MFC - STLport <stl/_config.h> * then include <afx.h> instead of <windows.h> to get synchronisation primitives * */ // # define _STLP_USE_MFC 1 // boris : this setting is here as we cannot detect precense of new Platform SDK automatically // If you are using new PSDK with VC++ 6.0 or lower, please define this to get correct prototypes for InterlockedXXX functions //# define _STLP_NEW_PLATFORM_SDK 1 /* * Use minimum set of default arguments on template classes that have more * than one - for example map<>, set<>. * This has effect only if _STLP_LIMITED_DEFAULT_TEMPLATES is on. * If _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS is set, you'll be able to compile * set<T> with those compilers, but you'll have to use __set__<T, less<T>> * * Affects : map<>, multimap<>, set<>, multiset<>, hash_*<>, * queue<>, priority_queue<>, stack<>, istream_iterator<> */ // # define _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS 1 //========================================================== // Local Variables: // mode:C++ // End:
import _ from 'lodash'; import React from 'react'; import { Sparklines, SparklinesLine, SparklinesReferenceLine } from 'react-sparklines'; export default (props) => { function average(data){ return _.round(_.sum(data)/data.length); } return( <div> <Sparklines height={100} width={180} data={props.data}> <SparklinesLine color={props.color}/> <SparklinesReferenceLine type="avg" /> </Sparklines> <div>{ average(props.data) } {props.units}</div> </div> ); }
#!/usr/bin/python3 import getopt import subprocess import requests import urllib3 import os import sys urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) CLUSTER_API = "cluster/api/v1.0" snapdata_path = os.environ.get('SNAP_DATA') snap_path = os.environ.get('SNAP') callback_tokens_file = "{}/credentials/callback-tokens.txt".format(snapdata_path) def do_op(remote_op): """ Perform an operation on a remote node :param op_str: the operation json string """ with open(callback_tokens_file, "r+") as fp: for _, line in enumerate(fp): parts = line.split() node_ep = parts[0] host = node_ep.split(":")[0] print("Applying to node {}.".format(host)) try: # Make sure this node exists subprocess.check_call("{}/microk8s-kubectl.wrapper get no {}".format(snap_path, host).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) token = parts[1] remote_op["callback"] = token # TODO: handle ssl verification res = requests.post("https://{}/{}/configure".format(node_ep, CLUSTER_API), json=remote_op, verify=False) if res.status_code != 200: print("Failed to perform a {} on node {}".format(remote_op["action_str"], node_ep)) except subprocess.CalledProcessError: print("Node {} not present".format(host)) def restart(service): """ Restart service on all nodes :param service: the service name """ print("Restarting nodes.") remote_op = { "action_str": "restart {}".format(service), "service": [ { "name": service, "restart": "yes" } ] } do_op(remote_op) def update_argument(service, key, value): """ Configure an argument on all nodes :param service: the service we configure :param key: the argument we configure :param value: the value we set """ print("Adding argument {} to nodes.".format(key)) remote_op = { "action_str": "change of argument {} to {}".format(key, value), "service": [ { "name": service, "arguments_update": [ {key: value} ] } ] } do_op(remote_op) def remove_argument(service, key): """ Drop an argument from all nodes :param service: the service we configure :param key: the argument we configure """ print("Removing argument {} from nodes.".format(key)) remote_op = { "action_str": "removal of argument {}".format(key), "service": [ { "name": service, "arguments_remove": [key] } ] } do_op(remote_op) def set_addon(addon, state): """ Enable or disable an add-on across all nodes :param addon: the add-on name :param state: 'enable' or 'disable' """ print("Set add-on {} to {} on nodes.".format(addon, state)) remote_op = { "action_str": "set of {} to {}".format(addon, state), "addon": [ { "name": addon, state: "true" } ] } do_op(remote_op) def usage(): print("usage: dist_refresh_opt [OPERATION] [SERVICE] (ARGUMENT) (value)") print("OPERATION is one of restart, update_argument, remove_argument, set_addon") if __name__ == "__main__": if not os.path.isfile(callback_tokens_file): print("No callback tokens file.") exit(1) try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) except getopt.GetoptError as err: # print help information and exit: print(err) # will print something like "option -a not recognized" usage() sys.exit(2) for o, a in opts: if o in ("-h", "--help"): usage() sys.exit() else: assert False, "unhandled option" operation = args[0] service = args[1] if operation == "restart": restart(service) if operation == "update_argument": update_argument(service, args[2], args[3]) if operation == "remove_argument": remove_argument(service, args[2]) if operation == "set_addon": set_addon(service, args[2]) exit(0)
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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. # import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.aiplatform.v1beta1.schema.trainingjob.definition", manifest={"AutoMlTextClassification", "AutoMlTextClassificationInputs",}, ) class AutoMlTextClassification(proto.Message): r"""A TrainingJob that trains and uploads an AutoML Text Classification Model. Attributes: inputs (google.cloud.aiplatform.v1beta1.schema.trainingjob.definition_v1beta1.types.AutoMlTextClassificationInputs): The input parameters of this TrainingJob. """ inputs = proto.Field( proto.MESSAGE, number=1, message="AutoMlTextClassificationInputs", ) class AutoMlTextClassificationInputs(proto.Message): r""" Attributes: multi_label (bool): """ multi_label = proto.Field(proto.BOOL, number=1,) __all__ = tuple(sorted(__protobuf__.manifest))
import yaml class Yaml_Helper(): def __init__(self, config_fname): self.config = self.load_config(config_fname) or {} @staticmethod def load_config(config_fname): """ Loads the configuration file config_file given by command line or config.DEFAULT_CONFIG when none is specified. the default values are used for any configuration value that is not specified in config_file. :param args: :return: dictionary of config values """ with open(config_fname) as config_file: conf = yaml.load(config_file) return conf def add_config(self, config_fname, should_override=False): """ Please note that this function will always override the key values. :param config_fname: :return: """ default = self.load_config(config_fname) for key in default: if key not in self.config or should_override and key in self.config: self.config[key] = default[key]
############################################################################### # Copyright (c) 2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory # Written by Francesco Di Natale, dinatale3@llnl.gov. # # LLNL-CODE-734340 # All rights reserved. # This file is part of MaestroWF, Version: 1.0.0. # # For details, see https://github.com/LLNL/maestrowf. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall 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. ############################################################################### """A collection of more general utility functions.""" import logging import os import time LOGGER = logging.getLogger(__name__) def generate_filename(path, append_time=True): """ Utility function for generating a non-conflicting file name. :param path: Path to file. :param append_time: Setting to append a timestamp. """ LOGGER.debug("Parameter path = %s", path) path = os.path.expanduser(path) root, ext = os.path.splitext(path) parent = os.path.dirname(root) fname = os.path.basename(root) LOGGER.debug("Expanded path = %s", path) LOGGER.debug("Root, Extension = (%s, %s)", root, ext) LOGGER.debug("Parent directory = %s", parent) LOGGER.debug("Filename = %s", fname) index = 0 timestamp = '' if append_time: timestamp = '_{0}'.format(time.strftime("%Y%m%d-%H%M%S")) candidate = "{0}{1}{2}".format(fname, timestamp, ext) ls_files = set(os.listdir(parent)) while candidate in ls_files: candidate = "{0}_{1:05d}{2}".format(root, index, ext) index += 1 return os.path.join(parent, candidate) def create_parentdir(path): """ Utility function that recursively creates parent directories. :param path: Path to a directory to be created. """ if not os.path.exists(path): LOGGER.info("Directory does not exist. Creating directories to %s", path) path = os.path.expanduser(path) os.makedirs(path) def apply_function(item, func): """ Utility function for applying a wider range of functions to items. :param item: A Python primitive to apply a function to. :param func: Function that returns takes item as a parameter and returns item modified in some way. """ if not item: return item elif isinstance(item, str): return func(item) elif isinstance(item, list): return [apply_function(x, func) for x in item] elif isinstance(item, dict): return { key: apply_function(value, func) for key, value in item.items()} elif isinstance(item, int): return item else: msg = "Encountered an object of type '{}'. Expected a str, list, int" \ ", or dict.".format(type(item)) LOGGER.error(msg) raise ValueError(msg)
function generate(inputArray){ var beam = inputArray['beam']; var shade = inputArray['shade']; var weight = inputArray['weight']; var count = parseInt(inputArray['count']); var countArray = Array.from(new Array(count), (x,i) => i); var angleInterval = 90/count; var output = ` <svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'> <rect width='100%' height='100%' fill='#${ beam }'/> ${ countArray.map( i => `<rect width='5000%' height='2000%' fill-opacity='${ weight }' fill='#${ shade }' transform='rotate(${ angleInterval*i })'/>` ).join("\n ") } </svg>`; return output; }
import React from 'react'; import { Link } from 'react-router-dom'; import { Sidebar, UncontrolledTooltip } from './../../../components'; import { VersionSelector } from '../VersionSelector'; const SidebarTopB = () => ( <React.Fragment> { /* START Sidebar TOP: B */ } { /* START DESKTOP View */ } <Sidebar.HideSlim> <div> <div className="d-flex"> <Link to="/" className="align-self-center sidebar__brand" id="tooltipBackToHome"> <i className="fa fa-send fa-fw fa-2x"></i> </Link> <UncontrolledTooltip placement="right" target="tooltipBackToHome"> Back to Home </UncontrolledTooltip> <VersionSelector down sidebar dashboard="airframe" render={(currentVersion) => ( <React.Fragment> <div className="h4 fw-600 sidebar-logo mb-1 text-left"> react.bs4 <i className="fa fa-angle-down ml-1 sidebar__link--muted"></i> </div> <div className="job-title small text-left sidebar__link--muted" > Version: {currentVersion.label}, {currentVersion.version} </div> </React.Fragment> )} /> </div> </div> </Sidebar.HideSlim> { /* END DESKTOP View */ } { /* START SLIM Only View */ } <Sidebar.ShowSlim> <div className="text-center"> <Link to="/"> <i className="fa fa-send fa-fw text-primary" id="tooltipBackToHomeSlim"></i> </Link> <UncontrolledTooltip placement="right" target="tooltipBackToHomeSlim"> Back to Home </UncontrolledTooltip> </div> </Sidebar.ShowSlim> { /* END SLIM Only View */ } { /* END Sidebar TOP: B */ } </React.Fragment> ) export { SidebarTopB };
/** * ---------------------------------------------------------------------------------------------------- * Update LDAP Mapping for a User [Run] * * @description - Update ldap mapping for a user using the Github API * * @author Buildable Technologies Inc. * @access open * @license MIT * @docs https://docs.github.com/enterprise-server@3.3/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user * * ---------------------------------------------------------------------------------------------------- */ const axios = require("axios"); /** * The Node’s executable function * * @param {Run} input - Data passed to your Node from the input function */ const run = async (input) => { const { GITHUB_API_TOKEN, GITHUB_API_USERNAME, username, ldap_dn } = input; verifyInput(input); try { const { data } = await axios({ method: "patch", url: `https://api.github.com/admin/ldap/users/${username}/mapping`, auth: { password: GITHUB_API_TOKEN, username: GITHUB_API_USERNAME }, data: { ldap_dn }, }); return data; } catch (error) { return { failed: true, message: error.message, data: error.response.data, }; } }; /** * Verifies the input parameters */ const verifyInput = ({ GITHUB_API_TOKEN, GITHUB_API_USERNAME, username, ldap_dn, }) => { const ERRORS = { INVALID_GITHUB_API_TOKEN: "A valid GITHUB_API_TOKEN field (string) was not provided in the input.", INVALID_GITHUB_API_USERNAME: "A valid GITHUB_API_USERNAME field (string) was not provided in the input.", INVALID_USERNAME: "A valid username field (string) was not provided in the input.", INVALID_LDAP_DN: "A valid ldap_dn field (string) was not provided in the input.", }; if (typeof GITHUB_API_TOKEN !== "string") throw new Error(ERRORS.INVALID_GITHUB_API_TOKEN); if (typeof GITHUB_API_USERNAME !== "string") throw new Error(ERRORS.INVALID_GITHUB_API_USERNAME); if (typeof username !== "string") throw new Error(ERRORS.INVALID_USERNAME); if (typeof ldap_dn !== "string") throw new Error(ERRORS.INVALID_LDAP_DN); };
############################################################################### # WaterTAP Copyright (c) 2021, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National # Laboratory, National Renewable Energy Laboratory, and National Energy # Technology Laboratory (subject to receipt of any required approvals from # the U.S. Dept. of Energy). All rights reserved. # # Please see the files COPYRIGHT.md and LICENSE.md for full copyright and license # information, respectively. These files are also available online at the URL # "https://github.com/watertap-org/watertap/" # ############################################################################### """ This module contains a zero-order representation of an evaporation pond unit model. """ from pyomo.environ import units as pyunits, Var, Constraint, Reference, value, sqrt from pyomo.common.config import ConfigValue, In from idaes.core import declare_process_block_class from watertap.core import build_sido, constant_intensity, ZeroOrderBaseData # Some more information about this module __author__ = "Kurban Sitterley" @declare_process_block_class("EvaporationPondZO") class EvaporationPondZOData(ZeroOrderBaseData): """ Zero-Order model for a evaporation pond unit. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() build_sido(self) constant_intensity(self) self._tech_type = "evaporation_pond" self.air_temperature = Var( self.flowsheet().time, initialize=298, units=pyunits.kelvin, doc="Air temperature", ) self.solar_radiation = Var( self.flowsheet().time, units=pyunits.mJ / pyunits.m**2, doc="Daily solar radiation incident", ) self.dike_height = Var( self.flowsheet().time, units=pyunits.ft, doc="Pond dike height" ) self.evaporation_rate_adj_factor = Var( self.flowsheet().time, units=pyunits.dimensionless, doc="Factor to adjust evaporation rate of pure water", ) self.evap_rate_calc_a_parameter = Var( self.flowsheet().time, units=pyunits.mm / pyunits.d, doc="Evaporation rate calculation parameter A", ) self.evap_rate_calc_b_parameter = Var( self.flowsheet().time, units=pyunits.m**2 / pyunits.mJ, doc="Evaporation rate calculation parameter B", ) self.evap_rate_calc_c_parameter = Var( self.flowsheet().time, units=pyunits.m**2 / pyunits.mJ, doc="Evaporation rate calculation parameter C", ) self.adj_area_calc_a_parameter = Var( self.flowsheet().time, units=pyunits.acres, doc="Adjusted area calculation parameter A", ) self.adj_area_calc_b_parameter = Var( self.flowsheet().time, units=pyunits.dimensionless, doc="Adjusted area calculation parameter B", ) self._fixed_perf_vars.append(self.air_temperature) self._fixed_perf_vars.append(self.solar_radiation) self._fixed_perf_vars.append(self.dike_height) self._fixed_perf_vars.append(self.evaporation_rate_adj_factor) self._fixed_perf_vars.append(self.evap_rate_calc_a_parameter) self._fixed_perf_vars.append(self.evap_rate_calc_b_parameter) self._fixed_perf_vars.append(self.evap_rate_calc_c_parameter) self._fixed_perf_vars.append(self.adj_area_calc_a_parameter) self._fixed_perf_vars.append(self.adj_area_calc_b_parameter) self.area = Var( self.flowsheet().time, initialize=1, units=pyunits.acres, bounds=(0, None), doc="Pond area needed based on evaporation rate", ) self.adj_area = Var( self.flowsheet().time, units=pyunits.acres, doc="Adjusted pond area needed" ) self.evaporation_rate_pure = Var( self.flowsheet().time, units=pyunits.mm / pyunits.d, doc="Calculated evaporation rate of pure water", ) self.evaporation_rate_salt = Var( self.flowsheet().time, units=(pyunits.gallons / pyunits.minute / pyunits.acre), doc="Pure water evaporation rate adjusted for salinity", ) @self.Constraint( self.flowsheet().time, doc="Evaporation rate of pure water constraint" ) def evap_rate_pure_constraint(b, t): air_temperature_C = pyunits.convert_temp_K_to_C(value(b.air_temperature[t])) return ( b.evaporation_rate_pure[t] == b.evap_rate_calc_a_parameter[t] * ( b.evap_rate_calc_b_parameter[t] * air_temperature_C + b.evap_rate_calc_c_parameter[t] ) * b.solar_radiation[t] ) @self.Constraint( self.flowsheet().time, doc="Adjusted evaporation rate for salinity constraint", ) def evap_rate_salt_constraint(b, t): evap_rate_gal_min_acre = pyunits.convert( b.evaporation_rate_pure[t], to_units=(pyunits.gallons / pyunits.minute / pyunits.acre), ) return ( b.evaporation_rate_salt[t] == evap_rate_gal_min_acre * b.evaporation_rate_adj_factor[t] ) @self.Constraint(self.flowsheet().time, doc="Base area constraint") def area_constraint(b, t): q_out = pyunits.convert( self.properties_byproduct[t].flow_vol, to_units=pyunits.gallon / pyunits.minute, ) return q_out == b.evaporation_rate_salt[t] * b.area[t] @self.Constraint(self.flowsheet().time, doc="Adjusted area constraint") def area_adj_constraint(b, t): area = b.area[t] / pyunits.acres dike_ht = b.dike_height[t] / pyunits.ft return b.adj_area[t] == b.adj_area_calc_a_parameter[t] * area * ( 1 + (b.adj_area_calc_b_parameter[t] * dike_ht) / area**0.5 ) self._perf_var_dict["Evaporation rate (mm/d)"] = self.evaporation_rate_pure self._perf_var_dict["Pond area (acres)"] = self.adj_area self._perf_var_dict["Pond dike height (ft)"] = self.dike_height
"use strict"; var mongoose = require("mongoose"), Schema = mongoose.Schema, ObjectId = Schema.ObjectId; var favourite = { name: "Favourite", schema: new Schema({ userId: { type: ObjectId }, twitterId: { type: String }, created: { type: Date, default: Date.now }, term: { type: String } }) }; favourite.schema.index({ userId: 1 }); module.exports = favourite;
import { expect, request, use } from 'chai' import chaiHttp from 'chai-http' import app from '../src/app' import 'dotenv/config'; use(chaiHttp) describe("ARTICLE END-POINT TESTING", () => { it("Should retrieve the articles", async () => { const res = await request(app).get("/api/v1/articles/") expect(res).to.have.status([200]) expect(res.type).to.have.equal("application/json") }) it("Should not retrieve the articles", async () => { const res = await request(app).get("/api/v1/aritcle/") expect(res).to.have.status([404]) }) it("Should retrieve the article by ID", async () => { const res = await request(app).get( "/api/v1/articles/61fae837852d90ca8358d7bf" ); expect(res).to.have.status([200]); }); it("Should not create an article", (done) => { request(app) .post("/api/v1/articles") .send({ title: "test", content: "test", image: "test", }) .end((err, res) => { expect(res.statusCode).to.equal(401); done(); }); }); it("Should not retrieve the articles", async () => { const res = await request(app).get("/api/v1/articles/3434"); expect(res).to.have.status([404]); }); })
module.exports = { presets: [['react-app', { flow: false, typescript: true }], '@linaria'], plugins: [ ['@babel/plugin-proposal-private-methods', { loose: true }], ['@babel/plugin-proposal-class-properties', { loose: true }], [ 'module-resolver', { root: ['./src'], alias: { constants: './src/constants', config: './src/config', utils: './src/utils', lib: './src/lib', store: './src/store', api: './src/api', features: './src/features', pages: './src/pages', components: './src/components', assets: './src/assets', styles: './src/styles', }, }, ], ], };
[{"Owner":"royibernthal","Date":"2017-12-04T15:24:44Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI_t_d like to display GUI on box faces.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tFor that purpose_co_ I_t_m creating an AdvancedDynamicTexture with 6 objects_co_ place horizontally one after the other. Sort of like a dynamic texture atlas_co_ each part representing a different face of the box.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tOnce I have that_co_ I_t_m trying to map each part of the texture to its corresponding part in the box using faceUV.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tHere_t_s how it looks like in a full screen GUI_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#XCPP9Y%23337_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#XCPP9Y#337_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tHere_t_s how it_t_s mapped to the box faces_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2322_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#22_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tAs you can see_co_ it_t_s still not working as I want it to.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI_t_d like to create objects in their real size (e.g. images) inside the texture_co_ instead of filling the texture completely by using percentage to define width_co_ height and positioning - an approach which has its own problems as well as far as I can see.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tIs it possible to change the width and height of AdvancedDynamicTexture to match its content? (e.g. in this example width_dd_ 514 x 6_co_ height_dd_ 514)\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI assume this could possibly solve the issue and then distributing GUI parts to their corresponding faces should be easy since we could treat AdvancedDynamicTexture as if it was an ordinary texture atlas_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Sebavan","Date":"2017-12-04T18:35:12Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tping _lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/4442-deltakosh/?do_eq_hovercard_qt_ data-mentionid_eq__qt_4442_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/4442-deltakosh/_qt_ rel_eq__qt__qt__gt_@Deltakosh_lt_/a_gt_ as you asked for it _dd_-) Happy Come Back !!!\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2017-12-05T01:37:30Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHi guys!   Hey Royi... I just want to remind you of something Deltakosh often reminds me/us-of... and is easy to forget_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_qt_Often_co_ dispose old one and re-create._qt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tBending and twisting something... in an attempt to do after-rendered scale-to-fit/paddings/margins... can give ya tumors.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tPerhaps_co_ there is a _qt_re-create instead of adjusting_qt_ solution for you_co_ too.  Just a reminder of _lt_em_gt_that_lt_/em_gt_ sometimes-viable option.  _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\tHope you_t_re doin_t_ well!\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-05T05:00:25Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tHey_co_ I don_t_t think it_t_s an option here_co_ but thanks for the reminder _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-12-05T17:07:13Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tYou can create the texture as the size you want_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW#24_qt_ ipsnoembed_eq__qt_true_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#24_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-05T18:51:29Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tYup thanks. I went through the source and found scaleTo() - which is even better for me_co_ that way I can measure the GUI content in runtime and then resize the texture accordingly.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tI got a couple of performance questions_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t1) I have more than 1 box_co_ each has its own AdvancedDynamicTexture. Would each set of box + texture trigger a different shader compilation? Since these are basically different diffuseTextures for different meshes.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2) Does GUI update trigger shader recompilation in this case? (e.g. if I_t_m animating things in the GUI)\n_lt_/p_gt_\n\n_lt_p_gt_\n\t3) How performance heavy is what I_t_m trying to do compared to displaying GUI on a Plane? Does it use substantially more resources? Would it be a bad idea to do this on mobile?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-08T09:40:40Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tDeltakosh?\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-12-08T16:58:19Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t1/ Nope. Same shader as you don_t_t have different options (all are only using diffuse)\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2/ ADT does not trigger any shader related stuff. You can use it freely\n_lt_/p_gt_\n\n_lt_p_gt_\n\t3/ Each ADT requires a copy from a canvas to a texture so having multiple ADT is obviously more expensive than one. But having 6 ADT of 100x100 is equivalent to 1 ADT with 100x600\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-09T00:59:22Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tGot it_co_ thanks for the answers.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI got a follow-up question - or rather_co_ digging a little deeper into what I_t_m trying to do -\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tA box needs to have a texture skin_co_ and only one face should have an ADT on top of the skin.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tMy current approach seems way too expensive according to your answer. Multiplying 6 faces times the amount of boxes I have_co_ while 5 faces in each box shouldn_t_t even require ADT.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI_t_d like to re-use the box skin - I suppose a normal texture would be the solution for that?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tWould you go with MultiMaterial to mix the box skin with ADT? If so_co_ is it possible to apply different faceUV to different sub materials somehow? Since the skin will need to be applied from a texture map to 6 faces (or 5 depending on whether the 6th will have to be part of the ADT)_co_ and the ADT only to a single face.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tHow would you best approach it?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-12-11T19:39:51Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tmultimat is really my option #1 here\n_lt_/p_gt_\n\n_lt_p_gt_\n\tYou can create a box with specific UV per face_dd__lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_qt_ ipsnoembed_eq__qt_true_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-11T23:56:24Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tYeah that_t_s the link in my first post. What am I missing here?\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tWhat I theoretically need -\n_lt_/p_gt_\n\n_lt_p_gt_\n\tadt submat - 1 face and other 5 faces are blank\n_lt_/p_gt_\n\n_lt_p_gt_\n\tbox skin submat - 5-6 faces\n_lt_/p_gt_\n\n_lt_p_gt_\n\tpart of a multimat that_t_s applied to a box.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tThe _qt_issue_qt_ is the faceUV is set for the box and can_t_t be set per submat (as far as I know)_co_ making what I need to do impossible? at least in a straightforward way.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tCan you please elaborate on how you think this can be solved?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-12-12T18:17:41Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tCould you produce a repro in the PG to see where you are (a simple one please)\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-12T21:57:02Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI can_t_t say I_t_m really anywhere as I_t_m not sure what needs to be done_co_ but here_t_s the general direction_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2327_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#27_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-12-13T14:26:45Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tNo idea at all if this is of any use to you but I had fun making a box out of planes each of which contains a GUI. The GUIs happened to be ones I had lying around but please note I only played around with putting them together so they formed a box none of them do anything._lt_span_gt_ _lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#V0LBBB_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#V0LBBB_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-13T15:24:15Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHey_co_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI see_co_ you broke a box into planes.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI_t_m not sure if that_t_s the ideal solution in my case_co_ though it_t_d definitely allow me to apply a different material to each plane.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tWaiting to see what DK has to say _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_ It_t_d be best if this could be solved in a more straightforward way on a single box mesh.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tBtw in your case the same could be achieved with a single ADT and a single box mesh_co_ which is what I did in my first PG_co_ if this is any help to you_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2324_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#24_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-12-13T15:31:52Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198021_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1512781162_qt_ data-ipsquote-userid_eq__qt_8420_qt_ data-ipsquote-username_eq__qt_royibernthal_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tOn 12/9/2017 at 12_dd_59 AM_co_ royibernthal said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tonly one face should have an ADT\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tIf only one face then could you parent a plane to a box?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-13T15:48:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2328_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#28_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tThat plane would intersect with the box_t_s face unless its z is different_co_ in which case the plane would not entirely look as part of the box.\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-12-13T15:52:52Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tA small offset and you cannot tell _lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2329_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#29_lt_/a_gt_\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-13T16:30:07Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHmm I suppose you_t_re right.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIn terms of performance which will be better an extra plane per box or multimat? (imagine you have tens of boxes)\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-12-13T16:52:48Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198528_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513182607_qt_ data-ipsquote-userid_eq__qt_8420_qt_ data-ipsquote-username_eq__qt_royibernthal_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t10 minutes ago_co_ royibernthal said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tIn terms of performance which will be better an extra plane per box or multimat? (imagine you have tens of boxes)\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tThat one is a little beyond me. It also seems to me that you may have the faceUV method and multimaterial method a bit intertwined when they are separate things_co_ but I am very often wrong_co_ paticularly about what other people know.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_qt_ rel_eq__qt_external nofollow_qt__gt_FaceUV_lt_/a_gt_ compared to _lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/multi_materials_qt_ rel_eq__qt_external nofollow_qt__gt_Multi-materials_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tMy other concern is that perhaps you can get the GUI as a texture but will it then still be active? Don_t_t know not skilled enough.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tSo being simple minded I would do the plane plus box approach.\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-12-13T16:54:25Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tBoth techniques are comparable ultimately as they produce the same number of draw calls\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-13T17:37:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198533_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513183968_qt_ data-ipsquote-userid_eq__qt_14282_qt_ data-ipsquote-username_eq__qt_JohnK_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t42 minutes ago_co_ JohnK said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\that one is a little beyond me. It also seems to me that you may have the faceUV method and multimaterial method a bit intertwined when they are separate things_co_ but I am very often wrong_co_ paticularly about what other people know.\n\t\t_lt_/p_gt_\n\n\t\t_lt_p_gt_\n\t\t\t_lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors_qt_ rel_eq__qt_external nofollow_qt__gt_FaceUV_lt_/a_gt_ compared to _lt_a href_eq__qt_http_dd_//doc.babylonjs.com/how_to/multi_materials_qt_ rel_eq__qt_external nofollow_qt__gt_Multi-materials_lt_/a_gt_\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tYeah I_t_m aware that they are separate things _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198533_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513183968_qt_ data-ipsquote-userid_eq__qt_14282_qt_ data-ipsquote-username_eq__qt_JohnK_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t42 minutes ago_co_ JohnK said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tMy other concern is that perhaps you can get the GUI as a texture but will it then still be active?\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tI_t_m not sure I understand what you mean.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198535_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513184065_qt_ data-ipsquote-userid_eq__qt_4442_qt_ data-ipsquote-username_eq__qt_Deltakosh_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t41 minutes ago_co_ Deltakosh said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tBoth techniques are comparable ultimately as they produce the same number of draw calls\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tI see. Is it even possible to achieve this with MultiMaterial?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-12-13T18:11:28Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_197490_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1512401084_qt_ data-ipsquote-userid_eq__qt_8420_qt_ data-ipsquote-username_eq__qt_royibernthal_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tOn 12/4/2017 at 3_dd_24 PM_co_ royibernthal said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tI_t_m trying to map each part of the texture to its corresponding part in the box using faceUV.\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tIf this was possible would the clickable buttons on the GUI still be clickable?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-13T18:22:49Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tYup\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#ICZEXW%2330_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#ICZEXW#30_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2017-12-16T12:12:35Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198542_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513186657_qt_ data-ipsquote-userid_eq__qt_8420_qt_ data-ipsquote-username_eq__qt_royibernthal_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tOn 12/13/2017 at 7_dd_37 PM_co_ royibernthal said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_198535_qt_ data-ipsquote-contentid_eq__qt_34380_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1513184065_qt_ data-ipsquote-userid_eq__qt_4442_qt_ data-ipsquote-username_eq__qt_Deltakosh_qt__gt_\n\t\t\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t\t\tOn 12/13/2017 at 6_dd_54 PM_co_ Deltakosh said_dd_\n\t\t\t_lt_/div_gt_\n\n\t\t\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t\t\t_lt_p_gt_\n\t\t\t\t\tBoth techniques are comparable ultimately as they produce the same number of draw calls\n\t\t\t\t_lt_/p_gt_\n\t\t\t_lt_/div_gt_\n\t\t_lt_/blockquote_gt_\n\n\t\t_lt_p_gt_\n\t\t\tI see. Is it even possible to achieve this with MultiMaterial?\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tDK?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]
# Conquer def Parition(list, left, right): pivot = list[left] index = right for j in range(right, left - 1, -1): if list[j] > pivot: list[index], list[j] = list[j], list[index] index -= 1 list[index], list[left] = list[left], list[index] return index # Divide list into halves def Quick(list, left, right): if left < right: pivot = Parition(list, left, right) Quick(list, left, pivot - 1) Quick(list, pivot + 1, right) def Quick_Sort(list): Quick(list, 0, len(list) - 1) # Function to print list def Print_list(list): for i in range(0, len(list)): print(list[i], end = " ") print() list = [2, 4, 3, 1, 6, 8, 4] Quick_Sort(list) Print_list(list) ''' Output 1 2 3 4 4 6 8 '''
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, ElementRef, forwardRef } from '@angular/core'; import { base } from './base'; export class searchfieldMetaData { } searchfieldMetaData.XTYPE = 'searchfield'; searchfieldMetaData.PROPERTIESOBJECT = { "activeCounter": "Number", "activeError": "String", "activeErrorsTpl": "String/String[]/Ext.XTemplate", "afterBodyEl": "String/Array/Ext.XTemplate", "afterLabelTextTpl": "String/Array/Ext.XTemplate", "afterLabelTpl": "String/Array/Ext.XTemplate", "afterSubTpl": "String/Array/Ext.XTemplate", "alignOnScroll": "Boolean", "alignTarget": "String", "allowBlank": "Boolean", "allowOnlyWhitespace": "Boolean", "alwaysOnTop": "Boolean/Number", "anchor": "String", "animateShadow": "Boolean", "ariaAttributes": "Object", "ariaDescribedBy": "String", "ariaErrorText": "String", "ariaHelp": "String", "ariaLabel": "String", "ariaLabelledBy": "String", "autoEl": "String/Object", "autoFitErrors": "Boolean", "autoHideInputMask": "Boolean", "autoRender": "Boolean/String/HTMLElement/Ext.dom.Element", "autoScroll": "Boolean", "autoShow": "Boolean", "baseBodyCls": "String", "baseCls": "String", "beforeBodyEl": "String/Array/Ext.XTemplate", "beforeLabelTextTpl": "String/Array/Ext.XTemplate", "beforeLabelTpl": "String/Array/Ext.XTemplate", "beforeSubTpl": "String/Array/Ext.XTemplate", "bind": "Object/String", "blankText": "String", "border": "Number/String/Boolean", "checkChangeBuffer": "Number", "checkChangeEvents": "String[]", "childEls": "Object/String[]/Object[]", "cls": "String/String[]", "columnWidth": "Number", "componentCls": "String", "componentLayout": "String/Object", "constrain": "Boolean", "constraintInsets": "Object/String", "constrainTo": "Ext.util.Region/Ext.dom.Element", "contentEl": "String", "controller": "String/Object/Ext.app.ViewController", "data": "Object", "defaultAlign": "String", "defaultListenerScope": "Boolean", "dirtyCls": "String", "disabled": "Boolean", "disabledCls": "String", "disableKeyFilter": "Boolean", "dock": "'top'/'bottom'/'left'/'right'", "draggable": "Boolean/Object", "editable": "Boolean", "emptyCls": "String", "emptyText": "String", "enableKeyEvents": "Boolean", "enforceMaxLength": "Boolean", "errorMsgCls": "String", "fieldBodyCls": "String", "fieldCls": "String", "fieldLabel": "String", "fieldStyle": "String", "fieldSubTpl": "Ext.XTemplate", "fixed": "Boolean", "flex": "Number", "floating": "Boolean", "focusCls": "String", "focusOnToFront": "Boolean", "formatText": "String", "formBind": "Boolean", "formItemCls": "String", "frame": "Boolean", "grow": "Boolean", "growMax": "Number", "growMin": "Number", "height": "Number|String", "hidden": "Boolean", "hideEmptyLabel": "Boolean", "hideLabel": "Boolean", "hideMode": "String", "hideTrigger": "Boolean", "html": "String/Object", "id": "String", "inputAttrTpl": "String/Array/Ext.XTemplate", "inputId": "String", "inputMask": "String/Ext.field.InputMask", "inputType": "String", "inputWrapCls": "String", "invalidCls": "String", "invalidText": "String", "isTextInput": "Boolean", "itemId": "String", "keyMap": "Object", "keyMapEnabled": "Boolean", "keyMapTarget": "String", "labelableRenderTpl": "String/String[]/Ext.XTemplate", "labelAlign": "String", "labelAttrTpl": "String/Array/Ext.XTemplate", "labelCls": "String", "labelClsExtra": "String", "labelPad": "Number", "labelSeparator": "String", "labelStyle": "String", "labelWidth": "Number", "liquidLayout": "Boolean", "listeners": "Object", "liveDrag": "Boolean", "loader": "Ext.ComponentLoader/Object", "margin": "Number/String", "maskDefaults": "Object", "maskElement": "String", "maskRe": "RegExp", "maxHeight": "Number", "maxLength": "Number", "maxLengthText": "String", "maxWidth": "Number", "minHeight": "Number", "minLength": "Number", "minLengthText": "String", "minWidth": "Number", "modal": "Boolean", "modelValidation": "Boolean", "msgTarget": "String", "name": "String", "nameable": "Boolean", "overCls": "String", "overflowX": "String", "overflowY": "String", "padding": "Number/String", "plugins": "Array/Ext.enums.Plugin/Object/Ext.plugin.Abstract", "preventMark": "Boolean", "publishes": "String/String[]/Object", "readOnly": "Boolean", "readOnlyCls": "String", "reference": "String", "regex": "RegExp", "regexText": "String", "region": "'north'/'south'/'east'/'west'/'center'", "renderConfig": "Object", "renderData": "Object", "renderSelectors": "Object", "renderTo": "String/HTMLElement/Ext.dom.Element", "renderTpl": "Ext.XTemplate/String/String[]", "repeatTriggerClick": "Boolean", "requiredCls": "String", "resizable": "Boolean/Object", "resizeHandles": "String", "saveDelay": "Number", "scrollable": "Boolean/String/Object", "selectOnFocus": "Boolean", "session": "Boolean/Object/Ext.data.Session", "shadow": "String/Boolean", "shadowOffset": "Number", "shareableName": "Boolean", "shim": "Boolean", "shrinkWrap": "Boolean/Number", "size": "Number", "stateEvents": "String[]", "stateful": "Boolean/Object", "stateId": "String", "stripCharsRe": "RegExp", "style": "String/Object", "submitValue": "Boolean", "tabIndex": "Number", "toFrontOnShow": "Boolean", "touchAction": "Object", "tpl": "Ext.XTemplate/Ext.Template/String/String[]", "tplWriteMode": "String", "triggers": "Object", "triggerWrapCls": "String", "twoWayBindable": "String/String[]/Object", "ui": "String", "uiCls": "String[]", "userCls": "String/String[]", "validateBlank": "Boolean", "validateOnBlur": "Boolean", "validateOnChange": "Boolean", "validateOnFocusLeave": "Boolean", "validation": "Boolean/String", "validationField": "Ext.data.Field", "validator": "Function", "value": "Object", "valuePublishEvent": "String[]/String", "viewModel": "String/Object/Ext.app.ViewModel", "vtype": "String", "vtypeText": "String", "weight": "Number", "width": "Number|String", "xtype": "Ext.enums.Widget", "platformConfig": "Object", "responsiveConfig": "Object", "fitToParent": "Boolean", "config": "Object", }; searchfieldMetaData.PROPERTIES = [ 'activeCounter', 'activeError', 'activeErrorsTpl', 'afterBodyEl', 'afterLabelTextTpl', 'afterLabelTpl', 'afterSubTpl', 'alignOnScroll', 'alignTarget', 'allowBlank', 'allowOnlyWhitespace', 'alwaysOnTop', 'anchor', 'animateShadow', 'ariaAttributes', 'ariaDescribedBy', 'ariaErrorText', 'ariaHelp', 'ariaLabel', 'ariaLabelledBy', 'autoEl', 'autoFitErrors', 'autoHideInputMask', 'autoRender', 'autoScroll', 'autoShow', 'baseBodyCls', 'baseCls', 'beforeBodyEl', 'beforeLabelTextTpl', 'beforeLabelTpl', 'beforeSubTpl', 'bind', 'blankText', 'border', 'checkChangeBuffer', 'checkChangeEvents', 'childEls', 'cls', 'columnWidth', 'componentCls', 'componentLayout', 'constrain', 'constraintInsets', 'constrainTo', 'contentEl', 'controller', 'data', 'defaultAlign', 'defaultListenerScope', 'dirtyCls', 'disabled', 'disabledCls', 'disableKeyFilter', 'dock', 'draggable', 'editable', 'emptyCls', 'emptyText', 'enableKeyEvents', 'enforceMaxLength', 'errorMsgCls', 'fieldBodyCls', 'fieldCls', 'fieldLabel', 'fieldStyle', 'fieldSubTpl', 'fixed', 'flex', 'floating', 'focusCls', 'focusOnToFront', 'formatText', 'formBind', 'formItemCls', 'frame', 'grow', 'growMax', 'growMin', 'height', 'hidden', 'hideEmptyLabel', 'hideLabel', 'hideMode', 'hideTrigger', 'html', 'id', 'inputAttrTpl', 'inputId', 'inputMask', 'inputType', 'inputWrapCls', 'invalidCls', 'invalidText', 'isTextInput', 'itemId', 'keyMap', 'keyMapEnabled', 'keyMapTarget', 'labelableRenderTpl', 'labelAlign', 'labelAttrTpl', 'labelCls', 'labelClsExtra', 'labelPad', 'labelSeparator', 'labelStyle', 'labelWidth', 'liquidLayout', 'listeners', 'liveDrag', 'loader', 'margin', 'maskDefaults', 'maskElement', 'maskRe', 'maxHeight', 'maxLength', 'maxLengthText', 'maxWidth', 'minHeight', 'minLength', 'minLengthText', 'minWidth', 'modal', 'modelValidation', 'msgTarget', 'name', 'nameable', 'overCls', 'overflowX', 'overflowY', 'padding', 'plugins', 'preventMark', 'publishes', 'readOnly', 'readOnlyCls', 'reference', 'regex', 'regexText', 'region', 'renderConfig', 'renderData', 'renderSelectors', 'renderTo', 'renderTpl', 'repeatTriggerClick', 'requiredCls', 'resizable', 'resizeHandles', 'saveDelay', 'scrollable', 'selectOnFocus', 'session', 'shadow', 'shadowOffset', 'shareableName', 'shim', 'shrinkWrap', 'size', 'stateEvents', 'stateful', 'stateId', 'stripCharsRe', 'style', 'submitValue', 'tabIndex', 'toFrontOnShow', 'touchAction', 'tpl', 'tplWriteMode', 'triggers', 'triggerWrapCls', 'twoWayBindable', 'ui', 'uiCls', 'userCls', 'validateBlank', 'validateOnBlur', 'validateOnChange', 'validateOnFocusLeave', 'validation', 'validationField', 'validator', 'value', 'valuePublishEvent', 'viewModel', 'vtype', 'vtypeText', 'weight', 'width', 'xtype', 'platformConfig', 'responsiveConfig', 'fitToParent', 'config' ]; searchfieldMetaData.EVENTS = [ { name: 'activate', parameters: 'searchfield' }, { name: 'added', parameters: 'searchfield,container,pos' }, { name: 'afterlayoutanimation', parameters: 'searchfield' }, { name: 'afterrender', parameters: 'searchfield' }, { name: 'autosize', parameters: 'searchfield,width' }, { name: 'beforeactivate', parameters: 'searchfield' }, { name: 'beforedeactivate', parameters: 'searchfield' }, { name: 'beforedestroy', parameters: 'searchfield' }, { name: 'beforehide', parameters: 'searchfield' }, { name: 'beforerender', parameters: 'searchfield' }, { name: 'beforeshow', parameters: 'searchfield' }, { name: 'beforestaterestore', parameters: 'searchfield,state' }, { name: 'beforestatesave', parameters: 'searchfield,state' }, { name: 'blur', parameters: 'searchfield,event' }, { name: 'boxready', parameters: 'searchfield,width,height' }, { name: 'change', parameters: 'searchfield,newValue,oldValue' }, { name: 'deactivate', parameters: 'searchfield' }, { name: 'destroy', parameters: 'searchfield' }, { name: 'dirtychange', parameters: 'searchfield,isDirty' }, { name: 'disable', parameters: 'searchfield' }, { name: 'enable', parameters: 'searchfield' }, { name: 'errorchange', parameters: 'searchfield,error' }, { name: 'focus', parameters: 'searchfield,event' }, { name: 'focusenter', parameters: 'searchfield,event' }, { name: 'focusleave', parameters: 'searchfield,event' }, { name: 'hide', parameters: 'searchfield' }, { name: 'keydown', parameters: 'searchfield,e' }, { name: 'keypress', parameters: 'searchfield,e' }, { name: 'keyup', parameters: 'searchfield,e' }, { name: 'move', parameters: 'searchfield,x,y' }, { name: 'paste', parameters: 'searchfield,e' }, { name: 'removed', parameters: 'searchfield,ownerCt' }, { name: 'render', parameters: 'searchfield' }, { name: 'resize', parameters: 'searchfield,width,height,oldWidth,oldHeight' }, { name: 'show', parameters: 'searchfield' }, { name: 'specialkey', parameters: 'searchfield,e' }, { name: 'staterestore', parameters: 'searchfield,state' }, { name: 'statesave', parameters: 'searchfield,state' }, { name: 'validitychange', parameters: 'searchfield,isValid' }, { name: 'writeablechange', parameters: 'searchfield,Read' }, { name: 'ready', parameters: '' } ]; searchfieldMetaData.EVENTNAMES = [ 'activate', 'added', 'afterlayoutanimation', 'afterrender', 'autosize', 'beforeactivate', 'beforedeactivate', 'beforedestroy', 'beforehide', 'beforerender', 'beforeshow', 'beforestaterestore', 'beforestatesave', 'blur', 'boxready', 'change', 'deactivate', 'destroy', 'dirtychange', 'disable', 'enable', 'errorchange', 'focus', 'focusenter', 'focusleave', 'hide', 'keydown', 'keypress', 'keyup', 'move', 'paste', 'removed', 'render', 'resize', 'show', 'specialkey', 'staterestore', 'statesave', 'validitychange', 'writeablechange', 'ready' ]; if (false) { /** @type {?} */ searchfieldMetaData.XTYPE; /** @type {?} */ searchfieldMetaData.PROPERTIESOBJECT; /** @type {?} */ searchfieldMetaData.PROPERTIES; /** @type {?} */ searchfieldMetaData.EVENTS; /** @type {?} */ searchfieldMetaData.EVENTNAMES; } export class ExtSearchfieldComponent extends base { /** * @param {?} eRef */ constructor(eRef) { super(eRef, searchfieldMetaData); } /** * @return {?} */ ngOnInit() { this.baseOnInit(searchfieldMetaData); } //public ngOnChanges(changes: SimpleChanges) {this.baseOnChanges(changes)} /** * @return {?} */ ngAfterContentInit() { this.baseAfterContentInit(); this['ready'].emit(this); } } ExtSearchfieldComponent.decorators = [ { type: Component, args: [{ selector: 'searchfield', inputs: searchfieldMetaData.PROPERTIES, outputs: searchfieldMetaData.EVENTNAMES, providers: [{ provide: base, useExisting: forwardRef(() => ExtSearchfieldComponent) }], template: '<ng-template #dynamic></ng-template>' }] } ]; /** @nocollapse */ ExtSearchfieldComponent.ctorParameters = () => [ { type: ElementRef } ]; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0LXNlYXJjaGZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzZW5jaGEvZXh0LWFuZ3VsYXItY2xhc3NpYy8iLCJzb3VyY2VzIjpbImxpYi9leHQtc2VhcmNoZmllb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cyBiYXNlIGltcGxlbWVudHMgT25Jbml0LEFmdGVyQ29udGVudEluaXQsT25DaGFuZ2VzIHtcbiAgY29uc3RydWN0b3IoZVJlZjpFbGVtZW50UmVmKSB7c3VwZXIoZVJlZixzZWFyY2hmaWVsZE1ldGFEYXRhKX1cbiAgcHVibGljIG5nT25Jbml0KCkge3RoaXMuYmFzZU9uSW5pdChzZWFyY2hmaWVsZE1ldGFEYXRhKX1cbiAgLy9wdWJsaWMgbmdPbkNoYW5nZXMoY2hhbmdlczogU2ltcGxlQ2hhbmdlcykge3RoaXMuYmFzZU9uQ2hhbmdlcyhjaGFuZ2VzKX1cbiAgcHVibGljIG5nQWZ0ZXJDb250ZW50SW5pdCgpIHtcbiAgICB0aGlzLmJhc2VBZnRlckNvbnRlbnRJbml0KClcbiAgICB0aGlzWydyZWFkeSddLmVtaXQodGhpcylcbiAgICB9XG59Il19
import collections import logging import numpy as np from ray.rllib.policy.sample_batch import SampleBatch, MultiAgentBatch from ray.rllib.utils.annotations import PublicAPI, DeveloperAPI from ray.rllib.utils.debug import log_once, summarize logger = logging.getLogger(__name__) def to_float_array(v): arr = np.array(v) if arr.dtype == np.float64: return arr.astype(np.float32) # save some memory return arr @PublicAPI class SampleBatchBuilder: """Util to build a SampleBatch incrementally. For efficiency, SampleBatches hold values in column form (as arrays). However, it is useful to add data one row (dict) at a time. """ @PublicAPI def __init__(self): self.buffers = collections.defaultdict(list) self.count = 0 self.unroll_id = 0 # disambiguates unrolls within a single episode @PublicAPI def add_values(self, **values): """Add the given dictionary (row) of values to this batch.""" for k, v in values.items(): self.buffers[k].append(v) self.count += 1 @PublicAPI def add_batch(self, batch): """Add the given batch of values to this batch.""" for k, column in batch.items(): self.buffers[k].extend(column) self.count += batch.count @PublicAPI def build_and_reset(self): """Returns a sample batch including all previously added values.""" batch = SampleBatch( {k: to_float_array(v) for k, v in self.buffers.items()}) batch.data[SampleBatch.UNROLL_ID] = np.repeat(self.unroll_id, batch.count) self.buffers.clear() self.count = 0 self.unroll_id += 1 return batch @DeveloperAPI class MultiAgentSampleBatchBuilder: """Util to build SampleBatches for each policy in a multi-agent env. Input data is per-agent, while output data is per-policy. There is an M:N mapping between agents and policies. We retain one local batch builder per agent. When an agent is done, then its local batch is appended into the corresponding policy batch for the agent's policy. """ def __init__(self, policy_map, clip_rewards, postp_callback): """Initialize a MultiAgentSampleBatchBuilder. Arguments: policy_map (dict): Maps policy ids to policy instances. clip_rewards (bool): Whether to clip rewards before postprocessing. postp_callback: function to call on each postprocessed batch. """ self.policy_map = policy_map self.clip_rewards = clip_rewards self.policy_builders = { k: SampleBatchBuilder() for k in policy_map.keys() } self.agent_builders = {} self.agent_to_policy = {} self.postp_callback = postp_callback self.count = 0 # increment this manually def total(self): """Returns summed number of steps across all agent buffers.""" return sum(p.count for p in self.policy_builders.values()) def has_pending_data(self): """Returns whether there is pending unprocessed data.""" return len(self.agent_builders) > 0 @DeveloperAPI def add_values(self, agent_id, policy_id, **values): """Add the given dictionary (row) of values to this batch. Arguments: agent_id (obj): Unique id for the agent we are adding values for. policy_id (obj): Unique id for policy controlling the agent. values (dict): Row of values to add for this agent. """ if agent_id not in self.agent_builders: self.agent_builders[agent_id] = SampleBatchBuilder() self.agent_to_policy[agent_id] = policy_id builder = self.agent_builders[agent_id] builder.add_values(**values) def postprocess_batch_so_far(self, episode): """Apply policy postprocessors to any unprocessed rows. This pushes the postprocessed per-agent batches onto the per-policy builders, clearing per-agent state. Arguments: episode: current MultiAgentEpisode object or None """ # Materialize the batches so far pre_batches = {} for agent_id, builder in self.agent_builders.items(): pre_batches[agent_id] = ( self.policy_map[self.agent_to_policy[agent_id]], builder.build_and_reset()) # Apply postprocessor post_batches = {} if self.clip_rewards: for _, (_, pre_batch) in pre_batches.items(): pre_batch["rewards"] = np.sign(pre_batch["rewards"]) for agent_id, (_, pre_batch) in pre_batches.items(): other_batches = pre_batches.copy() del other_batches[agent_id] policy = self.policy_map[self.agent_to_policy[agent_id]] if any(pre_batch["dones"][:-1]) or len(set( pre_batch["eps_id"])) > 1: raise ValueError( "Batches sent to postprocessing must only contain steps " "from a single trajectory.", pre_batch) post_batches[agent_id] = policy.postprocess_trajectory( pre_batch, other_batches, episode) if log_once("after_post"): logger.info( "Trajectory fragment after postprocess_trajectory():\n\n{}\n". format(summarize(post_batches))) # Append into policy batches and reset for agent_id, post_batch in sorted(post_batches.items()): self.policy_builders[self.agent_to_policy[agent_id]].add_batch( post_batch) if self.postp_callback: self.postp_callback({ "episode": episode, "agent_id": agent_id, "pre_batch": pre_batches[agent_id], "post_batch": post_batch, "all_pre_batches": pre_batches, }) self.agent_builders.clear() self.agent_to_policy.clear() def check_missing_dones(self): for agent_id, builder in self.agent_builders.items(): if builder.buffers["dones"][-1] is not True: raise ValueError( "The environment terminated for all agents, but we still " "don't have a last observation for " "agent {} (policy {}). ".format( agent_id, self.agent_to_policy[agent_id]) + "Please ensure that you include the last observations " "of all live agents when setting '__all__' done to True. " "Alternatively, set no_done_at_end=True to allow this.") @DeveloperAPI def build_and_reset(self, episode): """Returns the accumulated sample batches for each policy. Any unprocessed rows will be first postprocessed with a policy postprocessor. The internal state of this builder will be reset. Arguments: episode: current MultiAgentEpisode object or None """ self.postprocess_batch_so_far(episode) policy_batches = {} for policy_id, builder in self.policy_builders.items(): if builder.count > 0: policy_batches[policy_id] = builder.build_and_reset() old_count = self.count self.count = 0 return MultiAgentBatch.wrap_as_needed(policy_batches, old_count)
"""Meshtastic smoke tests with a single device via USB""" import re import subprocess import time import platform import os # Do not like using hard coded sleeps, but it probably makes # sense to pause for the radio at apprpriate times import pytest from ..util import findPorts # seconds to pause after running a meshtastic command PAUSE_AFTER_COMMAND = 2 PAUSE_AFTER_REBOOT = 7 @pytest.mark.smoke1 def test_smoke1_reboot(): """Test reboot""" return_value, _ = subprocess.getstatusoutput('meshtastic --reboot') assert return_value == 0 # pause for the radio to reset (10 seconds for the pause, and a few more seconds to be back up) time.sleep(18) @pytest.mark.smoke1 def test_smoke1_info(): """Test --info""" return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'^Owner', out, re.MULTILINE) assert re.search(r'^My info', out, re.MULTILINE) assert re.search(r'^Nodes in mesh', out, re.MULTILINE) assert re.search(r'^Preferences', out, re.MULTILINE) assert re.search(r'^Channels', out, re.MULTILINE) assert re.search(r'^ PRIMARY', out, re.MULTILINE) assert re.search(r'^Primary channel URL', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_sendping(): """Test --sendping""" return_value, out = subprocess.getstatusoutput('meshtastic --sendping') assert re.match(r'Connected to radio', out) assert re.search(r'^Sending ping message', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_get_with_invalid_setting(): """Test '--get a_bad_setting'.""" return_value, out = subprocess.getstatusoutput('meshtastic --get a_bad_setting') assert re.search(r'Choices in sorted order', out) assert return_value == 0 @pytest.mark.smoke1 def test_set_with_invalid_setting(): """Test '--set a_bad_setting'.""" return_value, out = subprocess.getstatusoutput('meshtastic --set a_bad_setting foo') assert re.search(r'Choices in sorted order', out) assert return_value == 0 @pytest.mark.smoke1 def test_ch_set_with_invalid_settingpatch_find_ports(): """Test '--ch-set with a_bad_setting'.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-set invalid_setting foo --ch-index 0') assert re.search(r'Choices in sorted order', out) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_pos_fields(): """Test --pos-fields (with some values POS_ALTITUDE POS_ALT_MSL POS_BATTERY)""" return_value, out = subprocess.getstatusoutput('meshtastic --pos-fields POS_ALTITUDE POS_ALT_MSL POS_BATTERY') assert re.match(r'Connected to radio', out) assert re.search(r'^Setting position fields to 35', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --pos-fields') assert re.match(r'Connected to radio', out) assert re.search(r'POS_ALTITUDE', out, re.MULTILINE) assert re.search(r'POS_ALT_MSL', out, re.MULTILINE) assert re.search(r'POS_BATTERY', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_test_with_arg_but_no_hardware(): """Test --test Note: Since only one device is connected, it will not do much. """ return_value, out = subprocess.getstatusoutput('meshtastic --test') assert re.search(r'^Warning: Must have at least two devices', out, re.MULTILINE) assert return_value == 1 @pytest.mark.smoke1 def test_smoke1_debug(): """Test --debug""" return_value, out = subprocess.getstatusoutput('meshtastic --info --debug') assert re.search(r'^Owner', out, re.MULTILINE) assert re.search(r'^DEBUG file', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_seriallog_to_file(): """Test --seriallog to a file creates a file""" filename = 'tmpoutput.txt' if os.path.exists(f"{filename}"): os.remove(f"{filename}") return_value, _ = subprocess.getstatusoutput(f'meshtastic --info --seriallog {filename}') assert os.path.exists(f"{filename}") assert return_value == 0 os.remove(f"{filename}") @pytest.mark.smoke1 def test_smoke1_qr(): """Test --qr""" filename = 'tmpqr' if os.path.exists(f"{filename}"): os.remove(f"{filename}") return_value, _ = subprocess.getstatusoutput(f'meshtastic --qr > {filename}') assert os.path.exists(f"{filename}") # not really testing that a valid qr code is created, just that the file size # is reasonably big enough for a qr code assert os.stat(f"{filename}").st_size > 20000 assert return_value == 0 os.remove(f"{filename}") @pytest.mark.smoke1 def test_smoke1_nodes(): """Test --nodes""" return_value, out = subprocess.getstatusoutput('meshtastic --nodes') assert re.match(r'Connected to radio', out) if platform.system() != 'Windows': assert re.search(r' User ', out, re.MULTILINE) assert re.search(r' 1 ', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_send_hello(): """Test --sendtext hello""" return_value, out = subprocess.getstatusoutput('meshtastic --sendtext hello') assert re.match(r'Connected to radio', out) assert re.search(r'^Sending text message hello to \^all', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_port(): """Test --port""" # first, get the ports ports = findPorts(True) # hopefully there is just one assert len(ports) == 1 port = ports[0] return_value, out = subprocess.getstatusoutput(f'meshtastic --port {port} --info') assert re.match(r'Connected to radio', out) assert re.search(r'^Owner', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_set_location_info(): """Test --setlat, --setlon and --setalt """ return_value, out = subprocess.getstatusoutput('meshtastic --setlat 32.7767 --setlon -96.7970 --setalt 1337') assert re.match(r'Connected to radio', out) assert re.search(r'^Fixing altitude', out, re.MULTILINE) assert re.search(r'^Fixing latitude', out, re.MULTILINE) assert re.search(r'^Fixing longitude', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out2 = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'1337', out2, re.MULTILINE) assert re.search(r'32.7767', out2, re.MULTILINE) assert re.search(r'-96.797', out2, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_set_owner(): """Test --set-owner name""" # make sure the owner is not Joe return_value, out = subprocess.getstatusoutput('meshtastic --set-owner Bob') assert re.match(r'Connected to radio', out) assert re.search(r'^Setting device owner to Bob', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert not re.search(r'Owner: Joe', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --set-owner Joe') assert re.match(r'Connected to radio', out) assert re.search(r'^Setting device owner to Joe', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'Owner: Joe', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_set_team(): """Test --set-team """ # unset the team return_value, out = subprocess.getstatusoutput('meshtastic --set-team CLEAR') assert re.match(r'Connected to radio', out) assert re.search(r'^Setting team to CLEAR', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) return_value, out = subprocess.getstatusoutput('meshtastic --set-team CYAN') assert re.search(r'Setting team to CYAN', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'CYAN', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_ch_set_modem_config(): """Test --ch-set modem_config""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config MidFast') assert re.search(r'Warning: Need to specify', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert not re.search(r'MidFast', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config MidFast --ch-index 0') assert re.match(r'Connected to radio', out) assert re.search(r'^Set modem_config to MidFast', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'MidFast', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_ch_values(): """Test --ch-vlongslow --ch-longslow, --ch-longfast, --ch-mediumslow, --ch-mediumsfast, --ch-shortslow, and --ch-shortfast arguments """ exp = { '--ch-vlongslow': '{ "psk": "AQ==" }', '--ch-longslow': 'LongSlow', '--ch-longfast': 'LongFast', '--ch-midslow': 'MidSlow', '--ch-midfast': 'MidFast', '--ch-shortslow': 'ShortSlow', '--ch-shortfast': 'ShortFast' } for key, val in exp.items(): print(key, val) return_value, out = subprocess.getstatusoutput(f'meshtastic {key}') assert re.match(r'Connected to radio', out) assert re.search(r'Writing modified channels to device', out, re.MULTILINE) assert return_value == 0 # pause for the radio (might reboot) time.sleep(PAUSE_AFTER_REBOOT) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(val, out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_ch_set_name(): """Test --ch-set name""" return_value, out = subprocess.getstatusoutput('meshtastic --info') assert not re.search(r'MyChannel', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-set name MyChannel') assert re.match(r'Connected to radio', out) assert re.search(r'Warning: Need to specify', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-set name MyChannel --ch-index 0') assert re.match(r'Connected to radio', out) assert re.search(r'^Set name to MyChannel', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'MyChannel', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_ch_set_downlink_and_uplink(): """Test -ch-set downlink_enabled X and --ch-set uplink_enabled X""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-set downlink_enabled false --ch-set uplink_enabled false') assert re.match(r'Connected to radio', out) assert re.search(r'Warning: Need to specify', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-set downlink_enabled false --ch-set uplink_enabled false --ch-index 0') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert not re.search(r'uplinkEnabled', out, re.MULTILINE) assert not re.search(r'downlinkEnabled', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-set downlink_enabled true --ch-set uplink_enabled true --ch-index 0') assert re.match(r'Connected to radio', out) assert re.search(r'^Set downlink_enabled to true', out, re.MULTILINE) assert re.search(r'^Set uplink_enabled to true', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'uplinkEnabled', out, re.MULTILINE) assert re.search(r'downlinkEnabled', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_ch_add_and_ch_del(): """Test --ch-add""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing') assert re.search(r'Writing modified channels to device', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-index 1 --ch-del') assert re.search(r'Deleting channel 1', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) # make sure the secondar channel is not there return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert not re.search(r'SECONDARY', out, re.MULTILINE) assert not re.search(r'testing', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_ch_enable_and_disable(): """Test --ch-enable and --ch-disable""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing') assert re.search(r'Writing modified channels to device', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) # ensure they need to specify a --ch-index return_value, out = subprocess.getstatusoutput('meshtastic --ch-disable') assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-disable --ch-index 1') assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'DISABLED', out, re.MULTILINE) assert re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-enable --ch-index 1') assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 1') assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_ch_del_a_disabled_non_primary_channel(): """Test --ch-del will work on a disabled non-primary channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing') assert re.search(r'Writing modified channels to device', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) # ensure they need to specify a --ch-index return_value, out = subprocess.getstatusoutput('meshtastic --ch-disable') assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 1') assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert not re.search(r'DISABLED', out, re.MULTILINE) assert not re.search(r'SECONDARY', out, re.MULTILINE) assert not re.search(r'testing', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_attempt_to_delete_primary_channel(): """Test that we cannot delete the PRIMARY channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 0') assert re.search(r'Warning: Cannot delete primary channel', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_attempt_to_disable_primary_channel(): """Test that we cannot disable the PRIMARY channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-disable --ch-index 0') assert re.search(r'Warning: Cannot enable', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_attempt_to_enable_primary_channel(): """Test that we cannot enable the PRIMARY channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-enable --ch-index 0') assert re.search(r'Warning: Cannot enable', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_ensure_ch_del_second_of_three_channels(): """Test that when we delete the 2nd of 3 channels, that it deletes the correct channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing1') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing1', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing2') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'testing2', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 1') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'testing2', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 1') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_ensure_ch_del_third_of_three_channels(): """Test that when we delete the 3rd of 3 channels, that it deletes the correct channel.""" return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing1') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'SECONDARY', out, re.MULTILINE) assert re.search(r'testing1', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-add testing2') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'testing2', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 2') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.match(r'Connected to radio', out) assert re.search(r'testing1', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --ch-del --ch-index 1') assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_seturl_default(): """Test --seturl with default value""" # set some channel value so we no longer have a default channel return_value, out = subprocess.getstatusoutput('meshtastic --ch-set name foo --ch-index 0') assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) # ensure we no longer have a default primary channel return_value, out = subprocess.getstatusoutput('meshtastic --info') assert not re.search('CgUYAyIBAQ', out, re.MULTILINE) assert return_value == 0 url = "https://www.meshtastic.org/d/#CgUYAyIBAQ" return_value, out = subprocess.getstatusoutput(f"meshtastic --seturl {url}") assert re.match(r'Connected to radio', out) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search('CgUYAyIBAQ', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_seturl_invalid_url(): """Test --seturl with invalid url""" # Note: This url is no longer a valid url. url = "https://www.meshtastic.org/c/#GAMiENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ=" return_value, out = subprocess.getstatusoutput(f"meshtastic --seturl {url}") assert re.match(r'Connected to radio', out) assert re.search('Warning: There were no settings', out, re.MULTILINE) assert return_value == 1 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) @pytest.mark.smoke1 def test_smoke1_configure(): """Test --configure""" _ , out = subprocess.getstatusoutput(f"meshtastic --configure example_config.yaml") assert re.match(r'Connected to radio', out) assert re.search('^Setting device owner to Bob TBeam', out, re.MULTILINE) assert re.search('^Fixing altitude at 304 meters', out, re.MULTILINE) assert re.search('^Fixing latitude at 35.8', out, re.MULTILINE) assert re.search('^Fixing longitude at -93.8', out, re.MULTILINE) assert re.search('^Setting device position', out, re.MULTILINE) assert re.search('^Set region to 1', out, re.MULTILINE) assert re.search('^Set is_always_powered to true', out, re.MULTILINE) assert re.search('^Set screen_on_secs to 31536000', out, re.MULTILINE) assert re.search('^Set wait_bluetooth_secs to 31536000', out, re.MULTILINE) assert re.search('^Writing modified preferences to device', out, re.MULTILINE) # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) @pytest.mark.smoke1 def test_smoke1_set_ham(): """Test --set-ham Note: Do a factory reset after this setting so it is very short-lived. """ return_value, out = subprocess.getstatusoutput('meshtastic --set-ham KI1234') assert re.search(r'Setting Ham ID', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_REBOOT) return_value, out = subprocess.getstatusoutput('meshtastic --info') assert re.search(r'Owner: KI1234', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_set_wifi_settings(): """Test --set wifi_ssid and --set wifi_password""" return_value, out = subprocess.getstatusoutput('meshtastic --set wifi_ssid "some_ssid" --set wifi_password "temp1234"') assert re.match(r'Connected to radio', out) assert re.search(r'^Set wifi_ssid to some_ssid', out, re.MULTILINE) assert re.search(r'^Set wifi_password to temp1234', out, re.MULTILINE) assert return_value == 0 # pause for the radio time.sleep(PAUSE_AFTER_COMMAND) return_value, out = subprocess.getstatusoutput('meshtastic --get wifi_ssid --get wifi_password') assert re.search(r'^wifi_ssid: some_ssid', out, re.MULTILINE) assert re.search(r'^wifi_password: sekrit', out, re.MULTILINE) assert return_value == 0 @pytest.mark.smoke1 def test_smoke1_factory_reset(): """Test factory reset""" return_value, out = subprocess.getstatusoutput('meshtastic --set factory_reset true') assert re.match(r'Connected to radio', out) assert re.search(r'^Set factory_reset to true', out, re.MULTILINE) assert re.search(r'^Writing modified preferences to device', out, re.MULTILINE) assert return_value == 0 # NOTE: The radio may not be responsive after this, may need to do a manual reboot # by pressing the button
// THIS FILE IS AUTO GENERATED import { GenIcon } from '../lib'; export function GiBranchArrow (props) { return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M95.053 18.096l.002.004v-.004h-.002zm.002.004L88.43 75.234l64.943 69.444c22.73-80.96-33.616-62.34-58.318-126.578zM76.307 89.633l-59.713 6.924c73.505 19.88 58.272 84.583 122.982 60.728l-63.27-67.652zm193.775 25.39c-59.893 27.56-58.306 75.928 3.877 110.715 39.215-50.06-20.79-53.14-3.878-110.715zm-103.77 42.375l-13.14 13.29c30.208 29.86 63.767 58.348 98.982 83.347l54.108 81.645 64.763 51.605c2.657-5.314 5.914-9.756 9.95-13.38.516-.465 1.045-.9 1.578-1.33l-42.22-33.643.692-.233c-4.833-14.35-4.43-28.26.516-42.946l-17.71-5.965c-3.46 10.272-5.133 20.8-4.78 31.353l-53.19-80.256-1.43-1.01c-34.845-24.603-68.176-52.88-98.12-82.48zM244.52 301.4c-16.637-.16-33.458 13.866-46.784 44.596 49.157-22.96 48.114 35.165 92.475-4.058-12.595-26.026-29.05-40.376-45.69-40.538zm200.507 43.03l-15.737 27.808 30.877 87.125-89.932-31.867-27.494 13.393 152.524 54.606-50.24-151.066zm-32.426 36.668c-8.966.967-14.955 2.948-19.14 6.71-4.377 3.93-8.102 11.308-10.782 24.27l46.775 16.574-16.853-47.554z"}}]})(props); };
/* Copyright 2006 Google */ var tn_=true,tn_a=null,tn_b=false;function tn_aa(a){if(a in tn_ba)return tn_ba[a];return tn_ba[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}var tn_ba={},tn_ca={ua:function(a){return a.document.body.scrollTop},va:function(a){return a.document.documentElement.scrollTop},W:function(a){return a.pageYOffset}},tn_da={ua:function(a){return a.document.body.scrollLeft},va:function(a){return a.document.documentElement.scrollLeft},W:function(a){return a.pageXOffset}}; function tn_ea(a,b){try{if(tn_aa("safari")||tn_aa("konqueror"))return b.W(a);else if(!window.opera&&"compatMode"in a.document&&a.document.compatMode=="CSS1Compat")return b.va(a);else if(tn_aa("msie")&&!window.opera)return b.ua(a)}catch(c){}return b.W(a)}function tn_fa(a){return document.getElementById(a)}function tn_ga(a){return document.all[a]}var tn_ha=document.getElementById?tn_fa:tn_ga; function tn_ia(a){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+"::"+a);return}}catch(b){}var c=tn_ha("log");if(c){a="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+a+"</span></p>";c.innerHTML=a+c.innerHTML}else window.status=a};function tn_c(a,b,c){this.x=a;this.y=b;this.coordinateFrame=c||tn_a}tn_c.prototype.toString=function(){return"[P "+this.x+","+this.y+"]"};tn_c.prototype.clone=function(){return new tn_c(this.x,this.y,this.coordinateFrame)};function tn_ja(a,b){this.dx=a;this.dy=b}tn_ja.prototype.toString=function(){return"[D "+this.dx+","+this.dy+"]"};function tn_d(a,b,c,d,e){this.x=a;this.y=b;this.w=c;this.h=d;this.coordinateFrame=e||tn_a} tn_d.prototype.contains=function(a){return this.x<=a.x&&a.x<this.x+this.w&&this.y<=a.y&&a.y<this.y+this.h};tn_d.prototype.toString=function(){return"[R "+this.w+"x"+this.h+"+"+this.x+"+"+this.y+"]"};tn_d.prototype.clone=function(){return new tn_d(this.x,this.y,this.w,this.h,this.coordinateFrame)};function tn_ka(a){function b(h){for(var j=a.offsetParent;j&&j.offsetParent;j=j.offsetParent){if(j.scrollLeft)h.x-=j.scrollLeft;if(j.scrollTop)h.y-=j.scrollTop}}if(!a)return tn_a;var c;c=a.ownerDocument&&a.ownerDocument.parentWindow?a.ownerDocument.parentWindow:a.ownerDocument&&a.ownerDocument.defaultView?a.ownerDocument.defaultView:window;if(a.getBoundingClientRect){var d=a.getBoundingClientRect();return new tn_d(d.left+tn_ea(c,tn_da),d.top+tn_ea(c,tn_ca),d.right-d.left,d.bottom-d.top,c)}if(a.ownerDocument&& a.ownerDocument.getBoxObjectFor){d=a.ownerDocument.getBoxObjectFor(a);c=new tn_d(d.x,d.y,d.width,d.height,c);b(c);return c}for(var e=d=0,f=a;f.offsetParent;f=f.offsetParent){d+=f.offsetLeft;e+=f.offsetTop}c=new tn_d(d,e,a.offsetWidth,a.offsetHeight,c);b(c);return c};var tn_e=function(){for(var a=[" ","\u0120",-1,"!","\u0120",-1,"\u0120","\u0120",0,"\u0121","\u0120",-1,"\u0121","\u0120|\u0121",0,"\u0122","\u0120|\u0121",-1,"\u0120","[\u0120]",0,"\u0121","[\u0120]",-1,"\u0121","[\u0120\u0121]",0,"\u0122","[\u0120\u0121]",-1,"\u0121","[\u0120-\u0121]",0,"\u0122","[\u0120-\u0121]",-1],b=0;b<a.length;b+=3)if(a[b].search(RegExp(a[b+1]))!=a[b+2])return tn_b;return tn_}(),tn_la=tn_e?"A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u0131\u0134-\u013e\u0141-\u0148\u014a-\u017e\u0180-\u01c3\u01cd-\u01f0\u01f4-\u01f5\u01fa-\u0217\u0250-\u02a8\u02bb-\u02c1\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03ce\u03d0-\u03d6\u03da\u03dc\u03de\u03e0\u03e2-\u03f3\u0401-\u040c\u040e-\u044f\u0451-\u045c\u045e-\u0481\u0490-\u04c4\u04c7-\u04c8\u04cb-\u04cc\u04d0-\u04eb\u04ee-\u04f5\u04f8-\u04f9\u0531-\u0556\u0559\u0561-\u0586\u05d0-\u05ea\u05f0-\u05f2\u0621-\u063a\u0641-\u064a\u0671-\u06b7\u06ba-\u06be\u06c0-\u06ce\u06d0-\u06d3\u06d5\u06e5-\u06e6\u0905-\u0939\u093d\u0958-\u0961\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8b\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ae0\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b36-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb5\u0bb7-\u0bb9\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c60-\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cde\u0ce0-\u0ce1\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d60-\u0d61\u0e01-\u0e2e\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eae\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0f40-\u0f47\u0f49-\u0f69\u10a0-\u10c5\u10d0-\u10f6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110b-\u110c\u110e-\u1112\u113c\u113e\u1140\u114c\u114e\u1150\u1154-\u1155\u1159\u115f-\u1161\u1163\u1165\u1167\u1169\u116d-\u116e\u1172-\u1173\u1175\u119e\u11a8\u11ab\u11ae-\u11af\u11b7-\u11b8\u11ba\u11bc-\u11c2\u11eb\u11f0\u11f9\u1e00-\u1e9b\u1ea0-\u1ef9\u1f00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2126\u212a-\u212b\u212e\u2180-\u2182\u3041-\u3094\u30a1-\u30fa\u3105-\u312c\uac00-\ud7a3": "A-Za-z",tn_ma=tn_e?"\u4e00-\u9fa5\u3007\u3021-\u3029":"",tn_na=tn_e?"\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05a1\u05a3-\u05b9\u05bb-\u05bd\u05bf\u05c1-\u05c2\u05c4\u064b-\u0652\u0670\u06d6-\u06dc\u06dd-\u06df\u06e0-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0901-\u0903\u093c\u093e-\u094c\u094d\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09bc\u09be\u09bf\u09c0-\u09c4\u09c7-\u09c8\u09cb-\u09cd\u09d7\u09e2-\u09e3\u0a02\u0a3c\u0a3e\u0a3f\u0a40-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a70-\u0a71\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0b01-\u0b03\u0b3c\u0b3e-\u0b43\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b82-\u0b83\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c82-\u0c83\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0d02-\u0d03\u0d3e-\u0d43\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86-\u0f8b\u0f90-\u0f95\u0f97\u0f99-\u0fad\u0fb1-\u0fb7\u0fb9\u20d0-\u20dc\u20e1\u302a-\u302f\u3099\u309a": "",tn_oa=tn_e?"0-9\u0660-\u0669\u06f0-\u06f9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be7-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29":"0-9",tn_pa=tn_e?"\u00b7\u02d0\u02d1\u0387\u0640\u0e46\u0ec6\u3005\u3031-\u3035\u309d-\u309e\u30fc-\u30fe":"",tn_qa=tn_la+tn_ma,tn_ra=tn_qa+tn_oa+"\\._:"+tn_na+tn_pa+"-",tn_sa="["+tn_qa+"_:]["+tn_ra+"]*",tn_ta="&"+tn_sa+";",tn_ua=tn_ta+"|&#[0-9]+;|&#x[0-9a-fA-F]+;",tn_va='"(([^<&"]|'+tn_ua+")*)\"|'(([^<&']|"+ tn_ua+")*)'",tn_wa="("+tn_sa+")([ \t\r\n]+)?=([ \t\r\n]+)?("+tn_va+")",tn_xa=tn_e?":A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd":":A-Z_a-z",tn_ya=tn_xa+(tn_e?"\\.0-9\u00b7\u0300-\u036f\u203f-\u2040-":"\\.0-9-"),tn_za="["+tn_xa+"]["+tn_ya+"]*",tn_Aa="&"+tn_za+";",tn_Ba=tn_Aa+"|&#[0-9]+;|&#x[0-9a-fA-F]+;",tn_Ca='"(([^<&"]|'+tn_Ba+")*)\"|'(([^<&']|"+tn_Ba+")*)'",tn_Da="("+tn_za+")([ \t\r\n]+)?=([ \t\r\n]+)?("+ tn_Ca+")",tn_Ea=tn_qa+tn_oa+"\\._"+tn_na+tn_pa+"-",tn_Fa="["+tn_qa+"_]["+tn_Ea+"]*";function tn_f(a){a||tn_g("Assertion failed")}function tn_Ga(a,b){var c=a.indexOf(b);if(c==-1)return[a];var d=[];for(d.push(a.substr(0,c));c!=-1;){var e=a.indexOf(b,c+1);e!=-1?d.push(a.substr(c+1,e-c-1)):d.push(a.substr(c+1));c=e}return d} function tn_Ha(a,b){if(b.nodeType==3)return a.createTextNode(b.nodeValue);else if(b.nodeType==4)return a.createCDATASection(b.nodeValue);else if(b.nodeType==1){for(var c=a.createElement(b.nodeName),d=0;d<b.attributes.length;++d){var e=b.attributes[d],f=e.nodeName;e=e.nodeValue;c.setAttribute(f,e)}for(d=b.firstChild;d;d=d.nextSibling){f=arguments.callee(a,d);c.appendChild(f)}return c}else return a.createComment(b.nodeName)}function tn_Ia(){this.keys=[]}tn_Ia.prototype.size=function(){return this.keys.length}; tn_Ia.prototype.add=function(a,b){var c=b||1;if(!this.contains(a)){this[":"+a]=c;this.keys.push(a)}};tn_Ia.prototype.remove=function(a){if(this.contains(a)){delete this[":"+a];tn_Ja(this.keys,a,tn_)}};tn_Ia.prototype.contains=function(a){return typeof this[":"+a]!="undefined"};tn_Ia.prototype.map=function(a){for(var b=0;b<this.keys.length;++b){var c=this.keys[b];a.call(this,c,this[":"+c])}}; tn_Ia.prototype.clear=function(){for(var a=0;a<this.keys.length;++a)delete this[":"+this.keys[a]];this.keys.length=0};function tn_Ka(a,b){for(var c=0;c<a.length;++c)b.call(this,a[c],c)}function tn_La(a,b){for(var c=[],d=0;d<a.length;++d)c.push(b(a[d]));return c}function tn_Ma(a){for(var b=0;b<a.length/2;++b){var c=a[b],d=a.length-b-1;a[b]=a[d];a[d]=c}}function tn_Ja(a,b,c){for(var d=0,e=0;e<a.length;++e)if(a[e]===b||c&&a[e]==b){a.splice(e--,1);d++}return d} function tn_Na(a,b){for(var c=0;c<b.length;++c)a.push(b[c])}function tn_h(a){if(!a)return"";var b="";if(a.nodeType==3||a.nodeType==4||a.nodeType==2)b+=a.nodeValue;else if(a.nodeType==1||a.nodeType==9||a.nodeType==11)for(var c=0;c<a.childNodes.length;++c)b+=arguments.callee(a.childNodes[c]);return b}function tn_Oa(a,b){var c=[];tn_Pa(a,c,b);return c.join("")} function tn_Pa(a,b,c){if(a.nodeType==3)b.push(tn_Qa(a.nodeValue));else if(a.nodeType==4)c?b.push(a.nodeValue):b.push("<![CDATA["+a.nodeValue+"]]\>");else if(a.nodeType==8)b.push("<!--"+a.nodeValue+"--\>");else if(a.nodeType==1){b.push("<"+tn_Ra(a));for(var d=0;d<a.attributes.length;++d){var e=a.attributes[d];e&&e.nodeName&&e.nodeValue&&b.push(" "+tn_Ra(e)+'="'+tn_Qa(e.nodeValue).replace(/\"/g,"&quot;")+'"')}if(a.childNodes.length==0)b.push("/>");else{b.push(">");for(d=0;d<a.childNodes.length;++d)arguments.callee(a.childNodes[d], b,c);b.push("</"+tn_Ra(a)+">")}}else if(a.nodeType==9||a.nodeType==11)for(d=0;d<a.childNodes.length;++d)arguments.callee(a.childNodes[d],b,c)}function tn_Ra(a){return a.prefix&&a.nodeName.indexOf(a.prefix+":")!=0?a.prefix+":"+a.nodeName:a.nodeName}function tn_Qa(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function tn_Sa(a,b,c){return a.setAttribute(b,c)}function tn_Ta(a,b){return a.appendChild(b)}function tn_Ua(a,b){return a.createTextNode(b)} function tn_g(a){if(typeof Error!="undefined")throw Error(a||"Assertion Failed");else throw a;};function tn_Va(a){a=tn_Ga(a,"&");for(var b=a[0],c=1;c<a.length;++c){var d=a[c].indexOf(";");if(d==-1)b+=a[c];else{var e=a[c].substring(0,d);d=a[c].substring(d+1);switch(e){case "lt":e="<";break;case "gt":e=">";break;case "amp":e="&";break;case "quot":e='"';break;case "apos":e="'";break;case "nbsp":e=String.fromCharCode(160);break;default:var f=window.document.createElement("span");f.innerHTML="&"+e+"; ";e=f.childNodes[0].nodeValue.charAt(0)}b+=e+d}}return b} var tn_Wa=RegExp("^("+tn_sa+")"),tn_Xa=RegExp(tn_wa,"g"),tn_Ya=RegExp("^("+tn_za+")"),tn_Za=RegExp(tn_Da,"g"); function tn__a(a){var b=/\/$/,c,d;if(a.match(/^<\?xml/))if(a.search(/[ \t\r\n]+version([ \t\r\n]+)?=([ \t\r\n]+)?("1\.0"|'1\.0')/)==5){c=tn_Wa;d=tn_Xa}else if(a.search(/[ \t\r\n]+version([ \t\r\n]+)?=([ \t\r\n]+)?("1\.1"|'1\.1')/)==5){c=tn_Ya;d=tn_Za}else alert("VersionInfo is missing, or unknown version number.");else{c=tn_Wa;d=tn_Xa}var e=new tn_i,f=e,h=[],j=f;h.push(j);var m="";a=tn_Ga(a,"<");for(var l=1;l<a.length;++l){var g=tn_Ga(a[l],">"),i=g[0];g=tn_Va(g[1]||"");if(m){i=a[l].indexOf(m);if(i!= -1){var n=a[l].substring(0,i);j.nodeValue+="<"+n;h.pop();j=h[h.length-1];g=a[l].substring(i+m.length);m=""}else{j.nodeValue+="<"+a[l];g=tn_a}}else if(i.indexOf("![CDATA[")==0){n=8;i=a[l].indexOf("]]\>");if(i!=-1){n=a[l].substring(n,i);var k=e.createCDATASection(n);j.appendChild(k)}else{n=a[l].substring(n);g=tn_a;k=e.createCDATASection(n);j.appendChild(k);j=k;h.push(k);m="]]\>"}}else if(i.indexOf("!--")==0){n=3;i=a[l].indexOf("--\>");if(i!=-1){n=a[l].substring(n,i);k=e.createComment(n);j.appendChild(k)}else{n= a[l].substring(n);g=tn_a;k=e.createComment(n);j.appendChild(k);j=k;h.push(k);m="--\>"}}else if(i.charAt(0)=="/"){h.pop();j=h[h.length-1]}else if(i.charAt(0)!="?")if(i.charAt(0)!="!"){n=i.match(b);k=c.exec(i)[1];k=e.createElement(k);for(var o;o=d.exec(i);){var p=tn_Va(o[5]||o[7]||"");k.setAttribute(o[1],p)}j.appendChild(k);if(!n){j=k;h.push(k)}}g&&j!=f&&tn_Ta(j,e.createTextNode(g))}return f} function tn_0a(a,b,c){var d;if(b){d=b.call(tn_a,a);if(typeof d=="boolean"&&!d)return tn_b}for(var e=a.firstChild;e;e=e.nextSibling)if(e.nodeType==1){d=arguments.callee.call(this,e,b,c);if(typeof d=="boolean"&&!d)return tn_b}if(c){d=c.call(tn_a,a);if(typeof d=="boolean"&&!d)return tn_b}}function tn_j(a,b,c,d){this.attributes=[];this.childNodes=[];tn_j.init.call(this,a,b,c,d)} tn_j.init=function(a,b,c,d){this.nodeType=a-0;this.nodeName=""+b;this.nodeValue=""+c;this.ownerDocument=d;this.parentNode=this.previousSibling=this.nextSibling=this.lastChild=this.firstChild=tn_a};tn_j.ia=[]; tn_j.recycle=function(a){if(a)if(a.constructor==tn_i)tn_j.recycle(a.documentElement);else if(a.constructor==this){tn_j.ia.push(a);for(var b=0;b<a.attributes.length;++b)tn_j.recycle(a.attributes[b]);for(b=0;b<a.childNodes.length;++b)tn_j.recycle(a.childNodes[b]);a.attributes.length=0;a.childNodes.length=0;tn_j.init.call(a,0,"","",tn_a)}};tn_j.create=function(a,b,c,d){if(tn_j.ia.length>0){var e=tn_j.ia.pop();tn_j.init.call(e,a,b,c,d);return e}else return new tn_j(a,b,c,d)}; tn_j.prototype.appendChild=function(a){if(this.childNodes.length==0)this.firstChild=a;a.previousSibling=this.lastChild;a.nextSibling=tn_a;if(this.lastChild)this.lastChild.nextSibling=a;a.parentNode=this;this.lastChild=a;this.childNodes.push(a)}; tn_j.prototype.replaceChild=function(a,b){if(b!=a)for(var c=0;c<this.childNodes.length;++c)if(this.childNodes[c]==b){this.childNodes[c]=a;c=b.parentNode;b.parentNode=tn_a;a.parentNode=c;c=b.previousSibling;b.previousSibling=tn_a;a.previousSibling=c;if(a.previousSibling)a.previousSibling.nextSibling=a;c=b.nextSibling;b.nextSibling=tn_a;a.nextSibling=c;if(a.nextSibling)a.nextSibling.previousSibling=a;if(this.firstChild==b)this.firstChild=a;if(this.lastChild==b)this.lastChild=a;break}}; tn_j.prototype.insertBefore=function(a,b){if(b!=a)if(b.parentNode==this){a.parentNode&&a.parentNode.removeChild(a);for(var c=[],d=0;d<this.childNodes.length;++d){var e=this.childNodes[d];if(e==b){c.push(a);a.parentNode=this;a.previousSibling=b.previousSibling;b.previousSibling=a;if(a.previousSibling)a.previousSibling.nextSibling=a;a.nextSibling=b;if(this.firstChild==b)this.firstChild=a}c.push(e)}this.childNodes=c}}; tn_j.prototype.removeChild=function(a){for(var b=[],c=0;c<this.childNodes.length;++c){var d=this.childNodes[c];if(d!=a)b.push(d);else{if(d.previousSibling)d.previousSibling.nextSibling=d.nextSibling;if(d.nextSibling)d.nextSibling.previousSibling=d.previousSibling;if(this.firstChild==d)this.firstChild=d.nextSibling;if(this.lastChild==d)this.lastChild=d.previousSibling}}this.childNodes=b};tn_j.prototype.hasAttributes=function(){return this.attributes.length>0}; tn_j.prototype.setAttribute=function(a,b){for(var c=0;c<this.attributes.length;++c)if(this.attributes[c].nodeName==a){this.attributes[c].nodeValue=""+b;return}this.attributes.push(tn_j.create(2,a,b,this))};tn_j.prototype.getAttribute=function(a){for(var b=0;b<this.attributes.length;++b)if(this.attributes[b].nodeName==a)return this.attributes[b].nodeValue;return tn_a}; tn_j.prototype.removeAttribute=function(a){for(var b=[],c=0;c<this.attributes.length;++c)this.attributes[c].nodeName!=a&&b.push(this.attributes[c]);this.attributes=b};tn_j.prototype.getElementsByTagName=function(a){var b=[];tn_0a(this,function(c){c.nodeName==a&&b.push(c)},tn_a);return b};tn_j.prototype.getElementById=function(a){var b=tn_a;tn_0a(this,function(c){if(c.getAttribute("id")==a){b=c;return tn_b}},tn_a);return b}; function tn_i(){tn_j.call(this,9,"#document",tn_a,tn_a);this.documentElement=tn_a}tn_i.prototype=new tn_j(9,"#document");tn_i.prototype.clear=function(){tn_j.recycle(this.documentElement);this.documentElement=tn_a};tn_i.prototype.appendChild=function(a){tn_j.prototype.appendChild.call(this,a);this.documentElement=this.childNodes[0]};tn_i.prototype.createElement=function(a){return tn_j.create(1,a,tn_a,this)}; tn_i.prototype.createDocumentFragment=function(){return tn_j.create(11,"#document-fragment",tn_a,this)};tn_i.prototype.createTextNode=function(a){return tn_j.create(3,"#text",a,this)};tn_i.prototype.createAttribute=function(a){return tn_j.create(2,a,tn_a,this)};tn_i.prototype.createComment=function(a){return tn_j.create(8,"#comment",a,this)};tn_i.prototype.createCDATASection=function(a){return tn_j.create(4,"#cdata-section",a,this)};function tn_1a(a,b){tn_2a(new tn_k(a,b),b)} function tn_2a(a,b){var c=b.getAttribute("select");if(c){b.removeAttribute("select");tn_3a(a,b,c)}else{if(c=b.getAttribute("display"))if(tn_4a(c,a).d())b.removeAttribute("display");else{b.parentNode.removeChild(b);return}if(c=b.getAttribute("values")){b.removeAttribute("values");tn_5a(a,b,c)}if(c=b.getAttribute("transclude")){if(c=tn_6a(c,b.ownerDocument)){b.parentNode.replaceChild(c,b);tn_2a(a,c)}else b.parentNode.removeChild(b);tn_j.recycle(b)}else if(c=b.getAttribute("content")){b.removeAttribute("content"); tn_7a(a,b,c)}else{c=[];for(var d=0;d<b.childNodes.length;++d)b.childNodes[d].nodeType==1&&c.push(b.childNodes[d]);for(d=0;d<c.length;++d)tn_2a(a,c[d])}}} function tn_3a(a,b,c){var d=c.split(/;/),e=tn_4a(d[0],a).c();if(e.length>0){c=[];for(var f=1;f<e.length;++f){var h=tn_Ha(b.ownerDocument,b);c.push(h);b.parentNode.insertBefore(h,b)}c.push(b);b=[];for(f=1;f<d.length;++f){var j=d[f],m=0;if(j.charAt(m)=="#"){h="number";m++}else h="text";if(j.charAt(m)=="-"){j="descending";m++}else j="ascending";m=tn_8a(d[f].substr(m));b.push({expr:m,type:h,order:j})}a=a.clone(e[0],0,e);tn_9a(a,b);for(f=0;f<a.z();++f)a.nodelist[f].nodeType==1&&tn_2a(a.clone(a.nodelist[f], f),c[f])}else b.parentNode.removeChild(b)}function tn_5a(a,b,c){c=c.split(/;/);for(var d=0;d<c.length;++d){var e=c[d].indexOf(":");if(!(e<0)){var f=c[d].substr(0,e);e=tn_4a(c[d].substr(e+1),a);if(f.charAt(0)=="$")a.fa(f.substr(1),e);else f&&tn_Sa(b,f,e.a())}}} function tn_7a(a,b,c){for(;b.firstChild;)b.removeChild(b.firstChild);a=tn_4a(c,a);if(a.type=="node-set")for(c=0;c<a.value.length;++c){var d=a.value[c];if(d.nodeType==1)for(d=d.firstChild;d;d=d.nextSibling){var e=tn_Ha(b.ownerDocument,d);b.appendChild(e)}else if(d.nodeType==2){d=b.ownerDocument.createTextNode(d.nodeValue);b.appendChild(d)}}else{d=tn_Ua(b.ownerDocument,a.a());b.appendChild(d)}}function tn_4a(a,b){var c=tn_8a(a);return c=c.evaluate(b)} function tn_6a(a,b){var c=b.getElementById(a);if(c)return c=tn_Ha(b,c);else return tn_a};function tn_8a(a){tn_$a();var b=tn_ab[a];if(b)return b;if(a.match(/^(\$|@)?\w+$/i)){b=tn_bb(a);return tn_ab[a]=b}if(a.match(/^\w+(\/\w+)*$/i)){b=tn_cb(a);return tn_ab[a]=b}b=a;for(var c=[],d=tn_a,e=tn_a,f=tn_b,h=0,j=0,m=0;!f;){h++;a=a.replace(/^\s*/,"");e=d;for(var l=d=tn_a,g="",i=0;i<tn_db.length;++i){var n=tn_db[i].re.exec(a);j++;if(n&&n.length>0&&n[0].length>g.length){l=tn_db[i];g=n[0];break}}if(l&&(l==tn_eb||l==tn_fb||l==tn_gb||l==tn_hb)&&(!e||e.tag==tn_ib||e.tag==tn_jb||e.tag==tn_l||e.tag==tn_kb|| e.tag==tn_lb))l=tn_mb;if(l){a=a.substr(g.length);d={tag:l,match:g,prec:l.prec?l.prec:0,expr:new tn_nb(g)}}else f=tn_;for(;tn_ob(c,d);)m++}c.length!=1&&tn_g("XPath parse error "+b+":\n"+tn_pb(c));n=c[0].expr;return tn_ab[b]=n}var tn_ab={}; function tn_ob(a,b){var c=tn_a;if(a.length>0){var d=a[a.length-1];if(d=tn_qb[d.tag.key])for(var e=0;e<d.length;++e){var f=d[e],h=tn_rb(a,f[1]);if(h.length){c={tag:f[0],rule:f,match:h};c.prec=tn_sb(c);break}}}if(c&&(!b||c.prec>b.prec||b.tag.left&&c.prec>=b.prec)){for(e=0;e<c.match.matchlength;++e)a.pop();d=tn_La(c.match,function(j){return j.expr});c.expr=c.rule[3].apply(tn_a,d);a.push(c);c=tn_}else{b&&a.push(b);c=tn_b}return c} function tn_rb(a,b){var c=a.length,d=b.length,e=[],f=e.matchlength=0;d=d-1;for(c=c-1;d>=0&&c>=0;--d,c-=f){f=0;var h=[];if(b[d]==tn_tb){d-=1;for(e.push(h);c-f>=0&&a[c-f].tag==b[d];){h.push(a[c-f]);f+=1;e.matchlength+=1}}else if(b[d]==tn_ub){d-=1;for(e.push(h);c-f>=0&&f<2&&a[c-f].tag==b[d];){h.push(a[c-f]);f+=1;e.matchlength+=1}}else if(b[d]==tn_vb){d-=1;e.push(h);if(a[c].tag==b[d])for(;c-f>=0&&a[c-f].tag==b[d];){h.push(a[c-f]);f+=1;e.matchlength+=1}else return[]}else if(a[c].tag==b[d]){e.push(a[c]); f+=1;e.matchlength+=1}else return[];tn_Ma(h);h.expr=tn_La(h,function(j){return j.expr})}tn_Ma(e);return d==-1?e:[]}function tn_sb(a){var b=0;if(a.rule)if(a.rule.length>=3&&a.rule[2]>=0)b=a.rule[2];else for(var c=0;c<a.rule[1].length;++c){var d=a.rule[1][c].prec||2;b=Math.max(b,d)}else if(a.tag)b=a.tag.prec||2;else if(a.length)for(c=0;c<a.length;++c){d=tn_sb(a[c]);b=Math.max(b,d)}return b}function tn_pb(a){for(var b="",c=0;c<a.length;++c){if(b)b+="\n";b+=a[c].tag.label}return b} function tn_k(a,b,c,d,e){this.node=a;this.stylesheet=b||tn_a;this.position=c||0;this.nodelist=d||[a];this.variables={};this.parent=e||tn_a;this.root=e?e.root:this.node.nodeType==9?a:a.ownerDocument}tn_k.prototype.clone=function(a,b,c){return new tn_k(a||this.node,this.stylesheet,typeof b!="undefined"?b:this.position,c||this.nodelist,this)};tn_k.prototype.fa=function(a,b){this.variables[a]=b}; tn_k.prototype.J=function(a){return typeof this.variables[a]!="undefined"?this.variables[a]:this.parent?this.parent.J(a):tn_a};tn_k.prototype.Oa=function(a){this.node=this.nodelist[a];this.position=a};tn_k.prototype.z=function(){return this.nodelist.length};function tn_m(a){this.value=a;this.type="string"}tn_m.prototype.a=function(){return this.value};tn_m.prototype.d=function(){return this.value.length>0};tn_m.prototype.b=function(){return this.value-0};tn_m.prototype.c=function(){tn_g(this)}; function tn_n(a){this.value=a;this.type="boolean"}tn_n.prototype.a=function(){return""+this.value};tn_n.prototype.d=function(){return this.value};tn_n.prototype.b=function(){return this.value?1:0};tn_n.prototype.c=function(){tn_g(this)};function tn_o(a){this.value=a;this.type="number"}tn_o.prototype.a=function(){return""+this.value};tn_o.prototype.d=function(){return!!this.value};tn_o.prototype.b=function(){return this.value-0};tn_o.prototype.c=function(){tn_g(this)}; function tn_p(a){this.value=a;this.type="node-set"}tn_p.prototype.a=function(){return this.value.length==0?"":tn_h(this.value[0])};tn_p.prototype.d=function(){return this.value.length>0};tn_p.prototype.b=function(){return this.a()-0};tn_p.prototype.c=function(){return this.value};function tn_nb(a){this.value=a}tn_nb.prototype.evaluate=function(){return new tn_m(this.value)};function tn_q(){this.absolute=tn_b;this.rootExpr=tn_a;this.steps=[]}tn_q.prototype.j=function(a){this.steps.push(a)}; tn_q.prototype.ca=function(a){this.steps.unshift(a)};tn_q.prototype.evaluate=function(a){var b;b=this.rootExpr?this.rootExpr.evaluate(a).c():this.absolute?[a.root]:[a.node];for(var c=[],d=0;d<b.length;++d){var e=b[d];tn_wb(c,this.steps,0,e,a)}return new tn_p(c)};function tn_wb(a,b,c,d,e){var f=b[c];d=e.clone(d);f=f.evaluate(d).c();for(d=0;d<f.length;++d)c==b.length-1?a.push(f[d]):tn_wb(a,b,c+1,f[d],e)}function tn_r(a,b,c){this.axis=a;this.nodetest=b;this.predicate=c||[]}tn_r.prototype.la=function(a){this.predicate.push(a)}; tn_r.prototype.evaluate=function(a){var b=a.node,c=[];if(this.axis==tn_s.ANCESTOR_OR_SELF){c.push(b);for(b=b.parentNode;b;b=b.parentNode)c.push(b)}else if(this.axis==tn_s.ANCESTOR)for(b=b.parentNode;b;b=b.parentNode)c.push(b);else if(this.axis==tn_s.ATTRIBUTE)tn_Na(c,b.attributes);else if(this.axis==tn_s.CHILD)tn_Na(c,b.childNodes);else if(this.axis==tn_s.DESCENDANT_OR_SELF){c.push(b);tn_xb(c,b)}else if(this.axis==tn_s.DESCENDANT)tn_xb(c,b);else if(this.axis==tn_s.FOLLOWING)for(b=b;b;b=b.parentNode)for(var d= b.nextSibling;d;d=d.nextSibling){c.push(d);tn_xb(c,d)}else if(this.axis==tn_s.FOLLOWING_SIBLING)for(b=b.nextSibling;b;b=b.nextSibling)c.push(b);else if(this.axis==tn_s.NAMESPACE)tn_g("not implemented: axis namespace");else if(this.axis==tn_s.PARENT)b.parentNode&&c.push(b.parentNode);else if(this.axis==tn_s.PRECEDING)for(b=b;b;b=b.parentNode)for(d=b.previousSibling;d;d=d.previousSibling){c.push(d);tn_yb(c,d)}else if(this.axis==tn_s.PRECEDING_SIBLING)for(b=b.previousSibling;b;b=b.previousSibling)c.push(b); else this.axis==tn_s.SELF?c.push(b):tn_g("ERROR -- NO SUCH AXIS: "+this.axis);d=c;c=[];for(var e=0;e<d.length;++e){b=d[e];this.nodetest.evaluate(a.clone(b,e,d)).d()&&c.push(b)}for(e=0;e<this.predicate.length;++e){d=c;c=[];for(var f=0;f<d.length;++f){b=d[f];this.predicate[e].evaluate(a.clone(b,f,d)).d()&&c.push(b)}}return new tn_p(c)};function tn_zb(){this.value=new tn_n(tn_)}tn_zb.prototype.evaluate=function(){return this.value};function tn_Ab(){} tn_Ab.prototype.evaluate=function(a){return new tn_n(a.node.nodeType==1||a.node.nodeType==2)};function tn_Bb(){}tn_Bb.prototype.evaluate=function(a){return new tn_n(a.node.nodeType==3)};function tn_Cb(){}tn_Cb.prototype.evaluate=function(a){return new tn_n(a.node.nodeType==8)};function tn_Db(a){this.target=a}tn_Db.prototype.evaluate=function(a){return new tn_n(a.node.nodeType==7&&(!this.target||a.node.nodeName==this.target))};function tn_Eb(a){this.regex=RegExp("^"+a+":");this.nsprefix=a} tn_Eb.prototype.evaluate=function(a){a=a.node;return new tn_n(this.regex.test(a.nodeName))};function tn_Fb(a){this.name=a}tn_Fb.prototype.evaluate=function(a){a=a.node;return new tn_n(a.nodeName==this.name)};function tn_Gb(a){this.expr=a}tn_Gb.prototype.evaluate=function(a){var b=this.expr.evaluate(a);return b.type=="number"?new tn_n(a.position==b.b()-1):new tn_n(b.d())};function tn_Hb(a){this.name=a;this.args=[]}tn_Hb.prototype.T=function(a){this.args.push(a)}; tn_Hb.prototype.evaluate=function(a){var b=""+this.name.value;return(b=this.xpathfunctions[b])?b.call(this,a):new tn_n(tn_b)}; tn_Hb.prototype.xpathfunctions={last:function(a){tn_f(this.args.length==0);return new tn_o(a.z())},position:function(a){tn_f(this.args.length==0);return new tn_o(a.position+1)},count:function(a){tn_f(this.args.length==1);a=this.args[0].evaluate(a);return new tn_o(a.c().length)},id:function(a){tn_f(this.args.length==1);var b=this.args[0].evaluate(a),c=[],d;if(b.type=="node-set"){d=[];var e=b.c();for(b=0;b<e.length;++b)for(var f=tn_h(e[b]).split(/\s+/),h=0;h<f.length;++h)d.push(f[h])}else d=b.a().split(/\s+/); a=a.node.ownerDocument;for(b=0;b<d.length;++b)(e=a.getElementById(d[b]))&&c.push(e);return new tn_p(c)},"local-name":function(){tn_g("not implmented yet: XPath function local-name()")},"namespace-uri":function(){tn_g("not implmented yet: XPath function namespace-uri()")},name:function(a){tn_f(this.args.length==1||this.args.length==0);a=this.args.length==0?[a.node]:this.args[0].evaluate(a).c();return a.length==0?new tn_m(""):new tn_m(a[0].nodeName)},string:function(a){tn_f(this.args.length==1||this.args.length== 0);return this.args.length==0?new tn_m((new tn_p([a.node])).a()):new tn_m(this.args[0].evaluate(a).a())},concat:function(a){for(var b="",c=0;c<this.args.length;++c)b+=this.args[c].evaluate(a).a();return new tn_m(b)},document:function(a){var b=this.args[0].evaluate(a).a();if(b===""&&a.stylesheet)return new tn_p([a.stylesheet]);tn_g("Can't resolve uri in document(\""+b+'")')},"starts-with":function(a){tn_f(this.args.length==2);var b=this.args[0].evaluate(a).a();a=this.args[1].evaluate(a).a();return new tn_n(b.indexOf(a)== 0)},contains:function(a){tn_f(this.args.length==2);var b=this.args[0].evaluate(a).a();a=this.args[1].evaluate(a).a();return new tn_n(b.indexOf(a)!=-1)},"substring-before":function(a){tn_f(this.args.length==2);var b=this.args[0].evaluate(a).a();a=this.args[1].evaluate(a).a();a=b.indexOf(a);b=a==-1?"":b.substr(0,a);return new tn_m(b)},"substring-after":function(a){tn_f(this.args.length==2);var b=this.args[0].evaluate(a).a();a=this.args[1].evaluate(a).a();var c=b.indexOf(a);b=c==-1?"":b.substr(c+a.length); return new tn_m(b)},substring:function(a){tn_f(this.args.length==2||this.args.length==3);var b=this.args[0].evaluate(a).a(),c=this.args[1].evaluate(a).b();if(this.args.length==2){c=Math.max(0,Math.round(c)-1);b=b.substr(c)}else{a=this.args[2].evaluate(a).b();var d=Math.round(c)-1;c=Math.max(0,d);a=Math.round(a)-Math.max(0,-d);b=b.substr(c,a)}return new tn_m(b)},"string-length":function(a){a=this.args.length>0?this.args[0].evaluate(a).a():(new tn_p([a.node])).a();return new tn_o(a.length)},"normalize-space":function(a){a= this.args.length>0?this.args[0].evaluate(a).a():(new tn_p([a.node])).a();a=a.replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," ");return new tn_m(a)},translate:function(a){tn_f(this.args.length==3);var b=this.args[0].evaluate(a).a(),c=this.args[1].evaluate(a).a();a=this.args[2].evaluate(a).a();for(var d=0;d<c.length;++d)b=b.replace(RegExp(c.charAt(d),"g"),a.charAt(d));return new tn_m(b)},"boolean":function(a){tn_f(this.args.length==1);return new tn_n(this.args[0].evaluate(a).d())},not:function(a){tn_f(this.args.length== 1);a=!this.args[0].evaluate(a).d();return new tn_n(a)},"true":function(){tn_f(this.args.length==0);return new tn_n(tn_)},"false":function(){tn_f(this.args.length==0);return new tn_n(tn_b)},lang:function(a){tn_f(this.args.length==1);var b=this.args[0].evaluate(a).a(),c;for(a=a.node;a&&a!=a.parentNode;){if(c=a.getAttribute("xml:lang"))break;a=a.parentNode}if(c){b=RegExp("^"+b+"$","i");return new tn_n(b.test(c)||b.test(c.replace(/_.*$/,"")))}else return new tn_n(tn_b)},number:function(a){tn_f(this.args.length== 1||this.args.length==0);return this.args.length==1?new tn_o(this.args[0].evaluate(a).b()):new tn_o((new tn_p([a.node])).b())},sum:function(a){tn_f(this.args.length==1);a=this.args[0].evaluate(a).c();for(var b=0,c=0;c<a.length;++c)b+=tn_h(a[c])-0;return new tn_o(b)},floor:function(a){tn_f(this.args.length==1);a=this.args[0].evaluate(a).b();return new tn_o(Math.floor(a))},ceiling:function(a){tn_f(this.args.length==1);a=this.args[0].evaluate(a).b();return new tn_o(Math.ceil(a))},round:function(a){tn_f(this.args.length== 1);a=this.args[0].evaluate(a).b();return new tn_o(Math.round(a))},"ext-join":function(a){tn_f(this.args.length==2);var b=this.args[0].evaluate(a).c();a=this.args[1].evaluate(a).a();for(var c="",d=0;d<b.length;++d){if(c)c+=a;c+=tn_h(b[d])}return new tn_m(c)},"ext-if":function(a){tn_f(this.args.length==3);return this.args[0].evaluate(a).d()?this.args[1].evaluate(a):this.args[2].evaluate(a)},"ext-cardinal":function(a){tn_f(this.args.length>=1);for(var b=this.args[0].evaluate(a).b(),c=[],d=0;d<b;++d)c.push(a.node); return new tn_p(c)}};function tn_Ib(a,b){this.expr1=a;this.expr2=b}tn_Ib.prototype.evaluate=function(a){var b=this.expr1.evaluate(a).c();a=this.expr2.evaluate(a).c();for(var c=b.length,d=0;d<a.length;++d){for(var e=a[d],f=tn_b,h=0;h<c;++h)if(b[h]==e){f=tn_;h=c}f||b.push(e)}return new tn_p(b)};function tn_Jb(a,b){this.filter=a;this.rel=b} tn_Jb.prototype.evaluate=function(a){for(var b=this.filter.evaluate(a).c(),c=[],d=0;d<b.length;++d)for(var e=this.rel.evaluate(a.clone(b[d],d,b)).c(),f=0;f<e.length;++f)c.push(e[f]);return new tn_p(c)};function tn_Kb(a,b){this.expr=a;this.predicate=b}tn_Kb.prototype.evaluate=function(a){for(var b=this.expr.evaluate(a).c(),c=0;c<this.predicate.length;++c){var d=b;b=[];for(var e=0;e<d.length;++e){var f=d[e];this.predicate[c].evaluate(a.clone(f,e,d)).d()&&b.push(f)}}return new tn_p(b)}; function tn_Lb(a){this.expr=a}tn_Lb.prototype.evaluate=function(a){return new tn_o(-this.expr.evaluate(a).b())};function tn_Mb(a,b,c){this.expr1=a;this.expr2=c;this.op=b} tn_Mb.prototype.evaluate=function(a){var b;switch(this.op.value){case "or":b=new tn_n(this.expr1.evaluate(a).d()||this.expr2.evaluate(a).d());break;case "and":b=new tn_n(this.expr1.evaluate(a).d()&&this.expr2.evaluate(a).d());break;case "+":b=new tn_o(this.expr1.evaluate(a).b()+this.expr2.evaluate(a).b());break;case "-":b=new tn_o(this.expr1.evaluate(a).b()-this.expr2.evaluate(a).b());break;case "*":b=new tn_o(this.expr1.evaluate(a).b()*this.expr2.evaluate(a).b());break;case "mod":b=new tn_o(this.expr1.evaluate(a).b()% this.expr2.evaluate(a).b());break;case "div":b=new tn_o(this.expr1.evaluate(a).b()/this.expr2.evaluate(a).b());break;case "=":b=this.compare(a,function(c,d){return c==d});break;case "!=":b=this.compare(a,function(c,d){return c!=d});break;case "<":b=this.compare(a,function(c,d){return c<d});break;case "<=":b=this.compare(a,function(c,d){return c<=d});break;case ">":b=this.compare(a,function(c,d){return c>d});break;case ">=":b=this.compare(a,function(c,d){return c>=d});break;default:tn_g("BinaryExpr.evaluate: "+ this.op.value)}return b}; tn_Mb.prototype.compare=function(a,b){var c=this.expr1.evaluate(a),d=this.expr2.evaluate(a);if(c.type=="node-set"&&d.type=="node-set"){c=c.c();var e=d.c();d=tn_b;for(var f=0;f<c.length;++f)for(var h=0;h<e.length;++h)if(b(tn_h(c[f]),tn_h(e[h]))){d=tn_;h=e.length;f=c.length}}else if(c.type=="node-set"||d.type=="node-set")if(c.type=="number"){c=c.b();e=d.c();d=tn_b;for(f=0;f<e.length;++f){h=tn_h(e[f])-0;if(b(c,h)){d=tn_;break}}}else if(d.type=="number"){e=c.c();c=d.b();d=tn_b;for(f=0;f<e.length;++f){h= tn_h(e[f])-0;if(b(h,c)){d=tn_;break}}}else if(c.type=="string"){c=c.a();e=d.c();d=tn_b;for(f=0;f<e.length;++f){h=tn_h(e[f]);if(b(c,h)){d=tn_;break}}}else if(d.type=="string"){e=c.c();c=d.a();d=tn_b;for(f=0;f<e.length;++f){h=tn_h(e[f]);if(b(h,c)){d=tn_;break}}}else d=b(c.d(),d.d());else d=c.type=="boolean"||d.type=="boolean"?b(c.d(),d.d()):c.type=="number"||d.type=="number"?b(c.b(),d.b()):b(c.a(),d.a());return new tn_n(!!d)};function tn_Nb(a){this.value=a}tn_Nb.prototype.evaluate=function(){return new tn_m(this.value)}; function tn_Ob(a){this.value=a}tn_Ob.prototype.evaluate=function(){return new tn_o(this.value)};function tn_Pb(a){this.name=a}tn_Pb.prototype.evaluate=function(a){return a.J(this.name)};function tn_t(a){return a}function tn_Qb(a,b){b.absolute=tn_;return b}function tn_Rb(a,b){b.absolute=tn_;b.ca(tn_u(a.value));return b}function tn_Sb(){var a=new tn_q;a.j(tn_u("."));a.absolute=tn_;return a}function tn_Tb(a){var b=new tn_q;b.absolute=tn_;b.j(tn_u(a.value));return b} function tn_Ub(a){var b=new tn_q;b.j(a);return b}function tn_Vb(a,b,c){a.j(c);return a}function tn_Wb(a,b){a.j(tn_u(b.value));return a}function tn_Xb(a,b,c){b=new tn_q;b.rootExpr=a;b.j(c);return b}function tn_Yb(a){return tn_u(a.value)}function tn_Zb(a){return tn_u(a.value)}function tn__b(a,b,c){return new tn_r(a.value,c)}function tn_0b(a,b){return new tn_r("attribute",b)}function tn_1b(a){return new tn_r("child",a)}function tn_2b(a,b){a.la(b);return a} function tn_u(a){switch(a){case "//":return new tn_r("descendant-or-self",new tn_zb);case ".":return new tn_r("self",new tn_zb);case "..":return new tn_r("parent",new tn_zb)}}function tn_3b(){return new tn_Ab}function tn_4b(a){return new tn_Eb(a.value)}function tn_5b(a){return new tn_Fb(a.value)}function tn_6b(a){a=a.value.replace(/\s*\($/,"");switch(a){case "node":return new tn_zb;case "text":return new tn_Bb;case "comment":return new tn_Cb;case "processing-instruction":return new tn_Db("")}} function tn_7b(a,b){var c=a.replace(/\s*\($/,"");c!="processing-instruction"&&tn_g(c);return new tn_Db(b.value)}function tn_8b(a,b){return new tn_Gb(b)}function tn_9b(a,b){return b}function tn_$b(a){return new tn_Hb(a)}function tn_ac(a,b,c,d){a=new tn_Hb(a);a.T(c);for(c=0;c<d.length;++c)a.T(d[c]);return a}function tn_bc(a,b){return b}function tn_cc(a,b,c){return new tn_Ib(a,c)}function tn_dc(a,b,c){return new tn_Jb(a,c)}function tn_ec(a,b,c){c.ca(tn_u(b.value));return new tn_Jb(a,c)} function tn_fc(a,b){return b.length>0?new tn_Kb(a,b):a}function tn_gc(a,b){return new tn_Lb(b)}function tn_v(a,b,c){return new tn_Mb(a,b,c)}function tn_hc(a){a=a.value.substring(1,a.value.length-1);return new tn_Nb(a)}function tn_ic(a){return new tn_Ob(a.value)}function tn_jc(a,b){return new tn_Pb(b.value)} function tn_bb(a){if(a.charAt(0)=="$")return new tn_Pb(a.substr(1));else if(a.charAt(0)=="@"){a=new tn_Fb(a.substr(1));a=new tn_r("attribute",a);var b=new tn_q;b.j(a);return b}else if(a.match(/^[0-9]+$/))return new tn_Ob(a);else{a=new tn_Fb(a);a=new tn_r("child",a);b=new tn_q;b.j(a);return b}}function tn_cb(a){a=tn_Ga(a,"/");for(var b=new tn_q,c=0;c<a.length;++c){var d=new tn_Fb(a[c]);d=new tn_r("child",d);b.j(d)}return b} var tn_s={ANCESTOR_OR_SELF:"ancestor-or-self",ANCESTOR:"ancestor",ATTRIBUTE:"attribute",CHILD:"child",DESCENDANT_OR_SELF:"descendant-or-self",DESCENDANT:"descendant",FOLLOWING_SIBLING:"following-sibling",FOLLOWING:"following",NAMESPACE:"namespace",PARENT:"parent",PRECEDING_SIBLING:"preceding-sibling",PRECEDING:"preceding",SELF:"self"},tn_kc=[tn_s.ANCESTOR_OR_SELF,tn_s.ANCESTOR,tn_s.ATTRIBUTE,tn_s.CHILD,tn_s.DESCENDANT_OR_SELF,tn_s.DESCENDANT,tn_s.FOLLOWING_SIBLING,tn_s.FOLLOWING,tn_s.NAMESPACE,tn_s.PARENT, tn_s.PRECEDING_SIBLING,tn_s.PRECEDING,tn_s.SELF].join("|"),tn_lc={label:"|",prec:17,re:/^\|/},tn_jb={label:"//",prec:19,re:/^\/\//},tn_l={label:"/",prec:30,re:/^\//},tn_kb={label:"::",prec:20,re:/^::/},tn_mc={label:":",prec:1E3,re:/^:/},tn_nc={label:"[axis]",re:RegExp("^("+tn_kc+")")},tn_oc={label:"(",prec:34,re:/^\(/},tn_pc={label:")",re:/^\)/},tn_qc={label:"..",prec:34,re:/^\.\./},tn_rc={label:".",prec:34,re:/^\./},tn_ib={label:"@",prec:34,re:/^@/},tn_sc={label:",",re:/^,/},tn_hb={label:"or",prec:10, re:/^or\b/},tn_gb={label:"and",prec:11,re:/^and\b/},tn_tc={label:"=",prec:12,re:/^=/},tn_uc={label:"!=",prec:12,re:/^!=/},tn_vc={label:">=",prec:13,re:/^>=/},tn_wc={label:">",prec:13,re:/^>/},tn_xc={label:"<=",prec:13,re:/^<=/},tn_yc={label:"<",prec:13,re:/^</},tn_zc={label:"+",prec:14,re:/^\+/,left:tn_},tn_Ac={label:"-",prec:14,re:/^\-/,left:tn_},tn_eb={label:"div",prec:15,re:/^div\b/,left:tn_},tn_fb={label:"mod",prec:15,re:/^mod\b/,left:tn_},tn_Bc={label:"[",prec:32,re:/^\[/},tn_Cc={label:"]",re:/^\]/}, tn_lb={label:"$",re:/^\$/},tn_Dc={label:"[ncname]",re:RegExp("^"+tn_Fa)},tn_Ec={label:"*",prec:15,re:/^\*/,left:tn_},tn_Fc={label:"[litq]",prec:20,re:/^'[^\']*'/},tn_Gc={label:"[litqq]",prec:20,re:/^"[^\"]*"/},tn_Hc={label:"[number]",prec:35,re:/^\d+(\.\d*)?/},tn_mb={label:"[qname]",re:RegExp("^("+tn_Fa+":)?"+tn_Fa)},tn_Ic={label:"[nodetest-start]",re:/^(processing-instruction|comment|text|node)\(/},tn_db=[tn_jb,tn_l,tn_qc,tn_rc,tn_kb,tn_mc,tn_nc,tn_Ic,tn_oc,tn_pc,tn_Bc,tn_Cc,tn_ib,tn_sc,tn_hb,tn_gb, tn_uc,tn_tc,tn_vc,tn_wc,tn_xc,tn_yc,tn_zc,tn_Ac,tn_Ec,tn_lc,tn_fb,tn_eb,tn_Fc,tn_Gc,tn_Hc,tn_mb,tn_Dc,tn_lb],tn_Jc={label:"LocationPath"},tn_w={label:"RelativeLocationPath"},tn_Kc={label:"AbsoluteLocationPath"},tn_x={label:"Step"},tn_y={label:"NodeTest"},tn_Lc={label:"Predicate"},tn_Mc={label:"Literal"},tn_z={label:"Expr"},tn_A={label:"PrimaryExpr"},tn_Nc={label:"Variablereference"},tn_Oc={label:"Number"},tn_Pc={label:"FunctionCall"},tn_Qc={label:"ArgumentRemainder"},tn_B={label:"PathExpr"},tn_Rc= {label:"UnionExpr"},tn_Sc={label:"FilterExpr"},tn_Tc={label:"Digits"},tn_Uc=[tn_Jc,tn_w,tn_Kc,tn_x,tn_y,tn_Lc,tn_Mc,tn_z,tn_A,tn_Nc,tn_Oc,tn_Pc,tn_Qc,tn_B,tn_Rc,tn_Sc,tn_Tc],tn_ub={label:"?"},tn_tb={label:"*"},tn_vb={label:"+"},tn_Vc=[[tn_Jc,[tn_w],18,tn_t],[tn_Jc,[tn_Kc],18,tn_t],[tn_Kc,[tn_l,tn_w],18,tn_Qb],[tn_Kc,[tn_jb,tn_w],18,tn_Rb],[tn_Kc,[tn_l],0,tn_Sb],[tn_Kc,[tn_jb],0,tn_Tb],[tn_w,[tn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v],[tn_z,[tn_z, tn_uc,tn_z],-1,tn_v],[tn_z,[tn_z,tn_yc,tn_z],-1,tn_v],[tn_z,[tn_z,tn_xc,tn_z],-1,tn_v],[tn_z,[tn_z,tn_wc,tn_z],-1,tn_v],[tn_z,[tn_z,tn_vc,tn_z],-1,tn_v],[tn_z,[tn_z,tn_zc,tn_z],-1,tn_v,tn_],[tn_z,[tn_z,tn_Ac,tn_z],-1,tn_v,tn_],[tn_z,[tn_z,tn_Ec,tn_z],-1,tn_v,tn_],[tn_z,[tn_z,tn_eb,tn_z],-1,tn_v,tn_],[tn_z,[tn_z,tn_fb,tn_z],-1,tn_v,tn_],[tn_Mc,[tn_Fc],-1,tn_hc],[tn_Mc,[tn_Gc],-1,tn_hc],[tn_Oc,[tn_Hc],-1,tn_ic],[tn_Nc,[tn_lb,tn_mb],200,tn_jc]],tn_qb=[]; function tn_$a(){function a(h,j,m){h[j]||(h[j]=[]);h[j].push(m)}if(!tn_qb.length){tn_Vc.sort(function(h,j){var m=h[1].length,l=j[1].length;return m<l?1:m>l?-1:0});for(var b=1,c=0;c<tn_Uc.length;++c)tn_Uc[c].key=b++;for(c=0;c<tn_db.length;++c)tn_db[c].key=b++;for(c=0;c<tn_Vc.length;++c){b=tn_Vc[c];for(var d=b[1],e=d.length-1;e>=0;--e)if(d[e]==tn_vb){a(tn_qb,d[e-1].key,b);break}else if(d[e]==tn_tb||d[e]==tn_ub){a(tn_qb,d[e-1].key,b);--e}else{a(tn_qb,d[e].key,b);break}}var f=0;tn_Ka(tn_qb,function(h){if(h)f+= h.length})}}function tn_xb(a,b){for(var c=b.firstChild;c;c=c.nextSibling){a.push(c);arguments.callee(a,c)}}function tn_yb(a,b){for(var c=b.lastChild;c;c=c.previousSibling){a.push(c);arguments.callee(a,c)}} function tn_9a(a,b){if(b.length!=0){for(var c=[],d=0;d<a.z();++d){var e=a.nodelist[d],f={node:e,key:[]};e=a.clone(e,0,[e]);for(var h=0;h<b.length;++h){var j=b[h],m=j.expr.evaluate(e),l;if(j.type=="text")l=m.a();else if(j.type=="number")l=m.b();f.key.push({value:l,order:j.order})}f.key.push({value:d,order:"ascending"});c.push(f)}c.sort(tn_Wc);f=[];for(d=0;d<c.length;++d)f.push(c[d].node);a.nodelist=f;a.Oa(0)}} function tn_Wc(a,b){for(var c=0;c<a.key.length;++c){var d=a.key[c].order=="descending"?-1:1;if(a.key[c].value>b.key[c].value)return+1*d;else if(a.key[c].value<b.key[c].value)return-1*d}return 0}function tn_C(a,b){var c=tn_8a(a);return c=c.evaluate(b)};function tn_Xc(a,b){var c=(new tn_i).createDocumentFragment();tn_Yc(new tn_k(a,b),b,c);return c=tn_Oa(c)} function tn_Yc(a,b,c){var d=c.nodeType==9?c:c.ownerDocument,e=b.nodeName.split(/:/);if(e.length==1||e[0]!="xsl")tn_Zc(a,b,c,d);else switch(e[1]){case "apply-imports":alert("not implemented: "+e[1]);break;case "apply-templates":e=(e=tn_D(b,"select"))?tn_C(e,a).c():a.node.childNodes;a=a.clone(e[0],0,e);tn__c(a,b);tn_0c(a,b);var f=tn_D(b,"mode");d=b.ownerDocument.documentElement;e=[];for(b=0;b<d.childNodes.length;++b){var h=d.childNodes[b];h.nodeType==1&&h.nodeName=="xsl:template"&&h.getAttribute("mode")== f&&e.push(h)}for(d=0;d<a.z();++d){h=a.nodelist[d];for(b=0;b<e.length;++b)tn_Yc(a.clone(h,d),e[b],c)}break;case "attribute":e=tn_D(b,"name");e=tn_1c(e,a);h=d.createDocumentFragment();tn_E(a,b,h);b=tn_h(h);c.setAttribute(e,b);break;case "attribute-set":alert("not implemented: "+e[1]);break;case "call-template":e=tn_D(b,"name");d=b.ownerDocument.documentElement;a=a.clone();tn__c(a,b);for(b=0;b<d.childNodes.length;++b){h=d.childNodes[b];if(h.nodeType==1&&h.nodeName=="xsl:template"&&h.getAttribute("name")== e){tn_E(a,h,c);break}}break;case "choose":tn_2c(a,b,c);break;case "comment":h=d.createDocumentFragment();tn_E(a,b,h);b=tn_h(h);b=d.createComment(b);c.appendChild(b);break;case "copy":(h=tn_3c(c,a.node,d))&&tn_E(a,b,h);break;case "copy-of":e=tn_D(b,"select");b=tn_C(e,a);if(b.type=="node-set"){e=b.c();for(b=0;b<e.length;++b)tn_4c(c,e[b],d)}else{h=tn_Ua(d,b.a());c.appendChild(h)}break;case "decimal-format":alert("not implemented: "+e[1]);break;case "element":e=tn_D(b,"name");e=tn_1c(e,a);h=d.createElement(e); c.appendChild(h);tn_E(a,b,h);break;case "fallback":alert("not implemented: "+e[1]);break;case "for-each":tn_5c(a,b,c);break;case "if":d=tn_D(b,"test");d=tn_C(d,a);d!=tn_a&&d.d()&&tn_E(a,b,c);break;case "import":alert("not implemented: "+e[1]);break;case "include":alert("not implemented: "+e[1]);break;case "key":alert("not implemented: "+e[1]);break;case "message":alert("not implemented: "+e[1]);break;case "namespace-alias":alert("not implemented: "+e[1]);break;case "number":alert("not implemented: "+ e[1]);break;case "otherwise":alert("error if here: "+e[1]);break;case "output":break;case "preserve-space":break;case "processing-instruction":alert("not implemented: "+e[1]);break;case "sort":break;case "strip-space":alert("not implemented: "+e[1]);break;case "stylesheet":case "transform":tn_E(a,b,c);break;case "template":(d=tn_D(b,"match"))&&tn_6c(d,a)&&tn_E(a,b,c);break;case "text":b=tn_h(b);h=d.createTextNode(b);c.appendChild(h);break;case "value-of":e=tn_D(b,"select");b=tn_C(e,a).a();h=d.createTextNode(b); c.appendChild(h);break;case "param":tn_7c(a,b,tn_b);break;case "variable":tn_7c(a,b,tn_);break;case "when":alert("error if here: "+e[1]);break;case "with-param":alert("error if here: "+e[1]);break;default:alert("error if here: "+e[1]);break}}function tn__c(a,b){for(var c=0;c<b.childNodes.length;++c){var d=b.childNodes[c];d.nodeType==1&&d.nodeName=="xsl:with-param"&&tn_7c(a,d,tn_)}} function tn_0c(a,b){for(var c=[],d=0;d<b.childNodes.length;++d){var e=b.childNodes[d];if(e.nodeType==1&&e.nodeName=="xsl:sort"){var f=tn_D(e,"select");f=tn_8a(f);var h=tn_D(e,"data-type")||"text";e=tn_D(e,"order")||"ascending";c.push({expr:f,type:h,order:e})}}tn_9a(a,c)}function tn_7c(a,b,c){var d=tn_D(b,"name"),e=tn_D(b,"select");if(b.childNodes.length>0){e=b.ownerDocument.createDocumentFragment();tn_E(a,b,e);b=new tn_p([e])}else b=e?tn_C(e,a):new tn_m("");if(c||!a.J(d))a.fa(d,b)} function tn_2c(a,b,c){for(var d=0;d<b.childNodes.length;++d){var e=b.childNodes[d];if(e.nodeType==1)if(e.nodeName=="xsl:when"){var f=tn_D(e,"test");if(tn_C(f,a).d()){tn_E(a,e,c);break}}else if(e.nodeName=="xsl:otherwise"){tn_E(a,e,c);break}}}function tn_5c(a,b,c){var d=tn_D(b,"select");d=tn_C(d,a).c();a=a.clone(d[0],0,d);tn_0c(a,b);for(d=0;d<a.z();++d){var e=a.nodelist[d];tn_E(a.clone(e,d),b,c)}}function tn_E(a,b,c){a=a.clone();for(var d=0;d<b.childNodes.length;++d)tn_Yc(a,b.childNodes[d],c)} function tn_Zc(a,b,c,d){if(b.nodeType==3){if(tn_8c(b)){d=d.createTextNode(b.nodeValue);c.appendChild(d)}}else if(b.nodeType==1){d=d.createElement(b.nodeName);for(var e=0;e<b.attributes.length;++e){var f=b.attributes[e];if(f){var h=f.nodeName;f=tn_1c(f.nodeValue,a);d.setAttribute(h,f)}}c.appendChild(d);tn_E(a,b,d)}else tn_E(a,b,c)} function tn_8c(a){if(!a.nodeValue.match(/^\s*$/))return tn_;a=a.parentNode;if(a.nodeName=="xsl:text")return tn_;for(;a&&a.nodeType==1;){var b=a.getAttribute("xml:space");if(b)if(b=="default")return tn_b;else if(b=="preserve")return tn_;a=a.parentNode}return tn_b}function tn_1c(a,b){var c=tn_Ga(a,"{");if(c.length==1)return a;for(var d="",e=0;e<c.length;++e){var f=tn_Ga(c[e],"}");if(f.length!=2)d+=c[e];else{var h=tn_C(f[0],b).a();d+=h+f[1]}}return d} function tn_D(a,b){var c=a.getAttribute(b);return c?tn_Va(c):c}function tn_4c(a,b,c){if(b.nodeType==11||b.nodeType==9)for(var d=0;d<b.childNodes.length;++d)arguments.callee(a,b.childNodes[d],c);else{var e=tn_3c(a,b,c);if(e){for(d=0;d<b.attributes.length;++d)arguments.callee(e,b.attributes[d],c);for(d=0;d<b.childNodes.length;++d)arguments.callee(e,b.childNodes[d],c)}}} function tn_3c(a,b,c){if(b.nodeType==1){b=c.createElement(b.nodeName);a.appendChild(b);return b}if(b.nodeType==3){b=c.createTextNode(b.nodeValue);a.appendChild(b)}else if(b.nodeType==4){b=c.createCDATASection(b.nodeValue);a.appendChild(b)}else if(b.nodeType==8){b=c.createComment(b.nodeValue);a.appendChild(b)}else b.nodeType==2&&a.setAttribute(b.nodeName,b.nodeValue);return tn_a} function tn_6c(a,b){var c=tn_8a(a),d;if(c.steps&&!c.absolute&&c.steps.length==1&&c.steps[0].axis=="child"&&c.steps[0].predicate.length==0)d=c.steps[0].nodetest.evaluate(b).d();else{d=tn_b;for(var e=b.node;!d&&e;){for(var f=c.evaluate(b.clone(e,0,[e])).c(),h=0;h<f.length;++h)if(f[h]==b.node){d=tn_;break}e=e.parentNode}}return d};function tn_9c(a,b){window[a]=b}tn_9c("nxslProcess",tn_1a);tn_9c("xmlParse",tn__a);tn_9c("xsltProcess",tn_Xc);tn_9c("xmlText",tn_Oa);tn_9c("xmlImportNode",tn_Ha);var tn_$c="http://www.google.com/images/infowindow/";function tn_ad(){return tn_$c+"transparent.png"}var tn_bd=Number.MAX_VALUE;var tn_cd="windo";function tn_F(a,b,c,d,e,f){var h=((b?b.ownerDocument:tn_a)||document).createElement(a);c&&tn_G(h,c);d&&tn_dd(h,d);h.style.display="none";if(b&&!e){tn_H(b,h);if(b[tn_cd])h[tn_cd]=b[tn_cd]}f||window.setTimeout(function(){h.style.display=""},0);return h}function tn_ed(a,b){var c=((b?b.ownerDocument:tn_a)||document).createTextNode(a);b&&tn_H(b,c);return c}function tn_I(a){return tn_J(a)+"px"}function tn_G(a,b){var c=a.style;c.position="absolute";c.left=tn_I(b.x);c.top=tn_I(b.y)} function tn_dd(a,b){var c=a.style;c.width=tn_I(b.width);c.height=tn_I(b.height)}function tn_K(a,b){a.style.width=tn_I(b)}function tn_L(a,b){a.style.height=tn_I(b)}function tn_M(a){a.style.display="none"}function tn_N(a){a.style.display=""}function tn_fd(a){a.style.visibility="hidden"}function tn_gd(a){a.style.visibility=""}function tn_hd(a){tn_id(a,"hidden")}function tn_id(a,b){a.style.overflow=b}var tn_O=Math.min,tn_P=Math.max,tn_J=Math.round; function tn_Q(a,b){try{a.style.cursor=b}catch(c){b=="pointer"&&tn_Q(a,"hand")}}function tn_jd(a){tn_kd(a,"gmnoscreen");tn_ld(a,"gmnoprint")}function tn_md(a,b,c){return window.setTimeout(function(){b.apply(a)},c)}function tn_nd(a){a=a.target||a.srcElement;if(a.nodeType==3)a=a.parentNode;return a}function tn_H(a,b){a.appendChild(b)}function tn_R(a){if(a.parentNode){a.parentNode.removeChild(a);tn_od(a)}}function tn_pd(a){for(var b;b=a.firstChild;){tn_od(b);a.removeChild(b)}} function tn_qd(a,b){if(a.innerHTML!=b){tn_pd(a);a.innerHTML=b}}function tn_rd(a){if(tn_S.k())a.style.MozUserSelect="none";else{a.unselectable="on";a.onselectstart=tn_sd}}function tn_td(a,b){for(var c=a.length,d=0;d<c;++d)b(a[d],d)}function tn_ud(a,b,c){for(var d in a)if(c||!a.hasOwnProperty||a.hasOwnProperty(d))b(d,a[d])}function tn_vd(a,b,c,d){c=c||0;d=d||b.length;for(c=c;c<d;++c)a.push(b[c])}function tn_sd(){return tn_b} function tn_wd(a,b){if(tn_S.type==1)a.style.filter="alpha(opacity="+tn_J(b*100)+")";else a.style.opacity=b}function tn_xd(a,b,c){a=tn_F("div",a,b,c);a.style.backgroundColor="black";tn_wd(a,0.35);return a}function tn_T(a,b){var c=(a?a.ownerDocument:tn_a)||document;if(a.currentStyle){c=tn_yd(b);return a.currentStyle[c]}else if(c.defaultView&&c.defaultView.getComputedStyle)return(c=c.defaultView.getComputedStyle(a,""))?c.getPropertyValue(b):"";else{c=tn_yd(b);return a.style[c]}}var tn_zd="__mapsBaseCssDummy__"; function tn_Ad(a,b,c){b=c?c:tn_T(a,b);if(typeof b=="number")return b;else if(isNaN(parseInt(b,10)))return b;else if(b.length>2&&b.substring(b.length-2)=="px")return parseInt(b,10);else{if(c=a.ownerDocument.getElementById(tn_zd))a.parentNode.appendChild(c);else{c=tn_F("div",a,new tn_c(0,0),new tn_U(0,0));c.id=tn_zd;tn_fd(c)}c.style.width="0px";c.style.width=b;return c.offsetWidth}}var tn_Bd="border-left-width",tn_Cd="border-top-width"; function tn_Dd(a){return new tn_U(tn_Ed(a,tn_Bd),tn_Ed(a,tn_Cd))}function tn_Ed(a,b){var c=tn_T(a,b);if(isNaN(parseInt(c,10)))return 0;return tn_Ad(a,b,c)}function tn_yd(a){return a.replace(/-(\w)/g,function(b,c){return(""+c).toUpperCase()})}function tn_Fd(a){a.length=0}function tn_Gd(a){var b=tn_b;if(a&&typeof a=="object")b=typeof Window=="function"?a instanceof Window:typeof a.navigator=="object"&&typeof a.history=="object"&&typeof a.document=="object";return b} function tn_Hd(a){return a=tn_Gd(a)?a:a&&a[tn_cd]?a[tn_cd]:window}function tn_Id(a,b){var c=tn_Hd(b);return a[tn_cd]=c};function tn_Jd(a,b,c){tn_Kd([a],function(d){b(d[0])},c)} function tn_Kd(a,b,c){c=c||screen.width;var d=tn_F("div",window.document.body,new tn_c(-screen.width,-screen.height),new tn_U(c,screen.height)),e=[];for(c=0;c<a.length;c++){var f=tn_F("div",d,tn_c.ORIGIN);tn_H(f,a[c]);e.push(f)}window.setTimeout(function(){for(var h=[],j=new tn_U(0,0),m=0;m<e.length;m++){var l=e[m],g=new tn_U(l.offsetWidth,l.offsetHeight);h.push(g);l.removeChild(a[m]);tn_R(l);j.width=tn_P(j.width,g.width);j.height=tn_P(j.height,g.height)}tn_R(d);e=tn_a;b(h,j)},0)};function tn_Ld(a,b,c,d,e,f,h){if(e&&tn_S.type==1){b=tn_F("div",b,c,d);b.style.overflow="hidden";if(d&&f)b.sizingMethod="scale";d=tn_F("img",b);tn_fd(d);tn_Md(d,tn_Nd,tn_Od)}else{b=tn_F("img",b,c,d);h&&tn_Md(b,tn_Nd,tn_Pd)}if(h)b.hideAndTrackLoading=tn_;tn_rd(b);if(tn_S.type==1)b.galleryImg="no";b.style.border=tn_I(0);b.style.padding=tn_I(0);b.style.margin=tn_I(0);b.oncontextmenu=tn_Qd;tn_Rd(b,a);return b} function tn_Od(){var a=this.parentNode;a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod="+(a.sizingMethod?a.sizingMethod:"crop")+',src="'+this.src+'")';if(a.hideAndTrackLoading)a.loaded=tn_}function tn_Rd(a,b){if(a.tagName=="DIV"){a.firstChild.src=b;a.src=b;if(a.hideAndTrackLoading){a.style.filter="";a.loaded=tn_b}}else if(a.hideAndTrackLoading&&b!=tn_ad()){if(b!=tn_ad()){a.loaded=tn_b;a.pendingSrc=b}else a.pendingSrc=tn_a;a.src=tn_ad()}else a.src=b} function tn_Pd(){var a=this;if(a.src==tn_ad()&&a.pendingSrc){a.src=a.pendingSrc;a.pendingSrc=tn_a}else a.loaded=tn_};var tn_Sd="click",tn_Td="contextmenu",tn_Ud="dblclick",tn_Nd="load",tn_Vd="mousedown",tn_Wd="mousewheel",tn_Xd="DOMMouseScroll",tn_Yd="unload",tn_Zd="closeclick",tn__d="maximizeclick",tn_0d="restoreclick",tn_1d="maximizeend",tn_2d="restoreend",tn_3d="clearlisteners",tn_4d="logclick";var tn_5d=tn_b;function tn_V(){this.n=[]}function tn_6d(){}tn_V.instance=function(a){a||(a=window);if(!a.gEventListenerPool)a.gEventListenerPool=new tn_V;return a.gEventListenerPool};tn_V.remove=function(a){tn_V.instance(tn_Hd(a)).Ia(a)};tn_V.prototype.Ia=function(a){var b=this.n.pop(),c=a.qa();if(c<this.n.length){this.n[c]=b;b.D(c)}a.D(-1)};tn_V.push=function(a){tn_V.instance(tn_Hd(a)).Ha(a)};tn_V.prototype.Ha=function(a){this.n.push(a);a.D(this.n.length-1)}; tn_V.prototype.clear=function(){for(var a=0;a<this.n.length;++a)this.n[a].D(-1);this.n=[]};function tn_7d(a,b,c){a=new tn_W(a,b,c,0);tn_V.push(a);return a}function tn_8d(a){a.remove();tn_V.remove(a)}function tn_9d(a){tn_X(a,tn_3d);tn_td(tn_$d(a),function(b){b.remove();tn_V.remove(b)})}function tn_$d(a,b){var c=[],d=a.__e_;if(d)if(b)d[b]&&tn_vd(c,d[b]);else tn_ud(d,function(e,f){tn_vd(c,f)});return c} function tn_ae(a,b,c){var d=tn_a,e=a.__e_;if(e){d=e[b];if(!d){d=[];if(c)e[b]=d}}else{d=[];if(c){a.__e_={};a.__e_[b]=d}}return d}function tn_X(a,b){var c=[];tn_vd(c,arguments,2);tn_td(tn_$d(a,b),function(d){if(tn_5d)d.apply(a,c);else try{d.apply(a,c)}catch(e){}})} function tn_Md(a,b,c){if(tn_S.type==2&&b==tn_Ud){a["on"+b]=c;c=new tn_W(a,b,c,3)}else if(a.addEventListener){a.addEventListener(b,c,tn_b);c=new tn_W(a,b,c,1)}else if(a.attachEvent){c=tn_be(a,c);a.attachEvent("on"+b,c);c=new tn_W(a,b,c,2)}else{a["on"+b]=c;c=new tn_W(a,b,c,3)}var d=tn_Hd(a);if(a!=d||b!=tn_Yd)tn_V.push(c);return c}function tn_Y(a,b,c,d){c=tn_ce(c,d);return tn_Md(a,b,c)}function tn_de(a,b,c){tn_Y(a,tn_Sd,b,c);tn_S.type==1&&tn_Y(a,tn_Ud,b,c)} function tn_ce(a,b){return function(c){if(!c)c=window.event;if(c&&!c.target)c.target=c.srcElement;b.call(a,c,this)}}function tn_be(a,b){return function(){return b.apply(a,arguments)}}function tn_W(a,b,c,d){tn_f(a);tn_f(typeof c=="function");var e=this;e.r=a;e.I=b;e.L=c;e.Ya=d;e.wa=-1;tn_Id(e,a);tn_ae(a,b,tn_).push(e)} tn_W.prototype.remove=function(){var a=this;switch(a.Ya){case 1:a.r.removeEventListener(a.I,a.L,tn_b);break;case 2:a.r.detachEvent("on"+a.I,a.L);break;case 3:a.r["on"+a.I]=tn_a;break}tn_Ja(tn_ae(a.r,a.I),a);a.r=tn_a;a.L=tn_a;a.remove=tn_6d;a.apply=tn_6d};tn_W.prototype.qa=function(){return this.wa};tn_W.prototype.D=function(a){this.wa=a};tn_W.prototype.apply=function(a,b){return this.L.apply(a,b)};function tn_od(a){tn_0a(a,tn_9d)} function tn_ee(a){a.type==tn_Sd&&tn_X(document,tn_4d,a);if(tn_S.type==1){window.event.cancelBubble=tn_;window.event.returnValue=tn_b}else{a.preventDefault();a.stopPropagation()}}function tn_fe(a){a.type==tn_Sd&&tn_X(document,tn_4d,a);if(tn_S.type==1)window.event.cancelBubble=tn_;else a.stopPropagation()}function tn_Qd(a){if(tn_S.type==1)window.event.returnValue=tn_b;else a.preventDefault()};var tn_S,tn_ge=["opera","msie","safari","firefox","mozilla"],tn_he=["x11;","macintosh","windows"]; function tn_ie(a){this.os=this.type=-1;this.revision=this.version=0;a=a.toLowerCase();for(var b=0;b<tn_ge.length;b++){var c=tn_ge[b];if(a.indexOf(c)!=-1){this.type=b;b=RegExp(c+"[ /]?([0-9]+(.[0-9]+)?)");if(b.exec(a)!=tn_a)this.version=parseFloat(RegExp.$1);break}}for(b=0;b<tn_he.length;b++){c=tn_he[b];if(a.indexOf(c)!=-1){this.os=b;break}}if(this.type==4||this.type==3)if(/\brv:\s*(\d+\.\d+)/.exec(a))this.revision=parseFloat(RegExp.$1)} tn_ie.prototype.k=function(){return this.type==3||this.type==4};tn_S=new tn_ie(navigator.userAgent);tn_c.ORIGIN=new tn_c(0,0);tn_c.prototype.toString=function(){return"("+this.x+", "+this.y+")"};function tn_U(a,b){this.width=a;this.height=b}tn_U.ZERO=new tn_U(0,0);tn_U.prototype.toString=function(){return"("+this.width+", "+this.height+")"};function tn_je(a){this.minX=this.minY=tn_bd;this.maxX=this.maxY=-tn_bd;var b=arguments;if(a&&a.length)for(b=0;b<a.length;b++)this.extend(a[b]);else if(b.length>=4){this.minX=b[0];this.minY=b[1];this.maxX=b[2];this.maxY=b[3]}} tn_je.prototype.min=function(){return new tn_c(this.minX,this.minY)};tn_je.prototype.max=function(){return new tn_c(this.maxX,this.maxY)};tn_je.prototype.toString=function(){return"("+this.min()+", "+this.max()+")"};tn_je.prototype.extend=function(a){var b=this;b.minX=tn_O(b.minX,a.x);b.maxX=tn_P(b.maxX,a.x);b.minY=tn_O(b.minY,a.y);b.maxY=tn_P(b.maxY,a.y)}; tn_je.intersection=function(a,b){return new tn_je([new tn_c(tn_P(a.minX,b.minX),tn_P(a.minY,b.minY)),new tn_c(tn_O(a.maxX,b.maxX),tn_O(a.maxY,b.maxY))])};function tn_ld(a,b){var c=a.className?""+a.className:"";if(c){c=c.split(/\s+/);for(var d=tn_b,e=0;e<c.length;++e)if(c[e]==b){d=tn_;break}d||c.push(b);a.className=c.join(" ")}else a.className=b}function tn_kd(a,b){var c=a.className?""+a.className:"";if(!(!c||c.indexOf(b)==-1)){c=c.split(/\s+/);for(var d=0;d<c.length;++d)c[d]==b&&c.splice(d--,1);a.className=c.join(" ")}};tn_ia=function(){};function tn_ke(){}tn_ke.monitor=function(){};tn_ke.monitorAll=function(){};tn_ke.dump=function(){};function tn_Z(){var a=tn_F("div",document.body),b=a.style;b.position="absolute";b.left=tn_I(7);b.bottom=tn_I(4);b.zIndex=1E4;var c=tn_xd(a,new tn_c(2,2)),d=tn_F("div",a);b=d.style;b.position="relative";b.zIndex=1;b.fontFamily="Verdana,Arial,sans-serif";b.fontSize="small";b.border="1px solid black";var e=[["Clear",this.clear],["Close",this.close]],f=tn_F("div",d);b=f.style;b.position="relative";b.zIndex=2;b.backgroundColor="#979797";b.color="white";b.fontSize="85%";b.padding=tn_I(2);tn_Q(f,"default"); tn_rd(f);tn_ed("Log",f);for(b=0;b<e.length;b++){var h=e[b];tn_ed(" - ",f);var j=tn_F("span",f);j.style.textDecoration="underline";tn_ed(h[0],j);tn_de(j,this,h[1]);tn_Q(j,"pointer")}d=tn_F("div",d);b=d.style;b.backgroundColor="white";b.width="80em";b.height="10em";b.overflow=tn_S.k()?"-moz-scrollbars-vertical":"auto";tn_Md(d,tn_Vd,tn_fe);this.N=d;this.U=a;this.i=c}tn_Z.instance=function(){var a=tn_Z.r;if(!a){a=new tn_Z;tn_Z.r=a}return a}; tn_Z.prototype.write=function(a,b){var c=this.oa();if(b){c=tn_F("span",c);c.style.color=b}tn_ed(a,c);this.Ja()};tn_Z.prototype.clear=function(){this.N.innerHTML=""};tn_Z.prototype.close=function(){tn_R(this.U)};tn_Z.prototype.oa=function(){var a=tn_F("div",this.N),b=a.style;b.fontSize="85%";b.borderBottom="1px solid silver";b.paddingBottom=tn_I(2);b=tn_F("div",a);b.style.color="gray";b.style.fontSize="75%";tn_ed(this.Sa(),b);return a}; tn_Z.prototype.Ja=function(){this.N.scrollTop=this.N.scrollHeight;this.Qa()};tn_Z.prototype.Sa=function(){var a=new Date;return this.B(a.getHours(),2)+":"+this.B(a.getMinutes(),2)+":"+this.B(a.getSeconds(),2)+":"+this.B(a.getMilliseconds(),3)};tn_Z.prototype.B=function(a,b){for(var c=a.toString();c.length<b;)c="0"+c;return c};tn_Z.prototype.Qa=function(){tn_dd(this.i,new tn_U(this.U.offsetWidth,this.U.offsetHeight))};var tn_le="overflow",tn_me="position",tn_ne="visible",tn_oe="static",tn_pe="BODY"; function tn_qe(a,b){for(var c=new tn_c(0,0);a&&a!=b;){a.nodeName==tn_pe&&tn_re(c,a);var d=tn_Dd(a);c.x+=d.width;c.y+=d.height;if(a.nodeName!=tn_pe||!tn_S.k()){c.x+=a.offsetLeft;c.y+=a.offsetTop}if(tn_S.k()&&tn_S.revision>=1.8&&a.offsetParent&&a.offsetParent.nodeName!=tn_pe&&tn_T(a.offsetParent,tn_le)!=tn_ne){d=tn_Dd(a.offsetParent);c.x+=d.width;c.y+=d.height}if(a.offsetParent){c.x-=a.offsetParent.scrollLeft;c.y-=a.offsetParent.scrollTop}if(tn_S.type!=1&&tn_se(a)){if(tn_S.k()){c.x-=self.pageXOffset; c.y-=self.pageYOffset;d=tn_Dd(a.offsetParent.parentNode);c.x+=d.width;c.y+=d.height}break}if(tn_S.type==2&&a.offsetParent){d=tn_Dd(a.offsetParent);c.x-=d.width;c.y-=d.height}a=a.offsetParent}if(tn_S.type==1&&!b&&document.documentElement){c.x+=document.documentElement.clientLeft;c.y+=document.documentElement.clientTop}if(b&&a==tn_a){d=tn_qe(b);return new tn_c(c.x-d.x,c.y-d.y)}else return c} function tn_se(a){if(a.offsetParent&&a.offsetParent.nodeName==tn_pe&&tn_T(a.offsetParent,tn_me)==tn_oe)if(tn_S.type==0&&tn_T(a,tn_me)!=tn_oe)return tn_;else if(tn_S.type!=0&&tn_T(a,tn_me)=="absolute")return tn_;return tn_b} function tn_re(a,b){var c=tn_b;if(tn_S.k()){c=tn_T(b,tn_le)!=tn_ne&&tn_T(b.parentNode,tn_le)!=tn_ne;var d=tn_T(b,tn_me)!=tn_oe;if(d||c){a.x+=tn_Ad(b,"margin-left");a.y+=tn_Ad(b,"margin-top");var e=tn_Dd(b.parentNode);a.x+=e.width;a.y+=e.height}if(d){a.x+=tn_Ad(b,"left");a.y+=tn_Ad(b,"top")}}if((tn_S.k()||tn_S.type==1)&&document.compatMode!="BackCompat"||c)if(self.pageYOffset){a.x-=self.pageXOffset;a.y-=self.pageYOffset}else{a.x-=document.documentElement.scrollLeft;a.y-=document.documentElement.scrollTop}} function tn_te(a,b){if(typeof a.offsetX!="undefined"){var c=tn_nd(a),d=tn_qe(c,b),e=new tn_c(a.offsetX,a.offsetY);if(tn_S.type==2){c=tn_Dd(c);e.x-=c.width;e.y-=c.height}return new tn_c(d.x+e.x,d.y+e.y)}else if(typeof a.clientX!="undefined"){d=tn_S.type==2?new tn_c(a.pageX-self.pageXOffset,a.pageY-self.pageYOffset):new tn_c(a.clientX,a.clientY);e=tn_qe(b);return new tn_c(d.x-e.x,d.y-e.y)}else return tn_c.ORIGIN};function tn_ue(a){this.ticks=a;this.tick=0}tn_ue.prototype.reset=function(){this.tick=0};tn_ue.prototype.next=function(){this.tick++;var a=Math.PI*(this.tick/this.ticks-0.5);return(Math.sin(a)+1)/2};tn_ue.prototype.more=function(){return this.tick<this.ticks};tn_ue.prototype.extend=function(){if(this.tick>this.ticks/3)this.tick=tn_J(this.ticks/3)};var tn_ve=tn_b;function tn_we(a,b,c){this.name=a;if(typeof b=="string"){a=tn_F("div",tn_a);tn_qd(a,b);b=a}this.contentElem=b;b.style.zIndex=9500;this.onclick=c}function tn__(){this.da=new tn_d(0,0,0,0);this.ba=tn_U.ZERO;this.f=[];this.l=[];this.Q=[];this.ha=[];this.s=this.v=0;this.q=this.H(tn_U.ZERO);this.g={};this.m=this.S=this.Aa=tn_b;this.ga=new tn_c(8,8);this.aa="ltr"} tn__.prototype.create=function(a,b){var c=this.g,d=tn_xe(c,a,[["iw_n",628,6,0,0,"iw_n1"],["iw_n",628,6,0,0,"iw_n2"],["iw_w",6,598,0,0],["iw_e",6,598,0,0],["iw_s0",628,6,0,0,"iw_s1"],["iw_s0",628,6,0,0,"iw_s2"],["iw_c",628,598,0,0]]),e=new tn_U(6,6);tn_0(c,d,"iw_nw",e);tn_0(c,d,"iw_ne",e);tn_0(c,d,"iw_xtap",new tn_U(32,21));tn_0(c,d,"iw_xtap_l",new tn_U(32,21));tn_0(c,d,"iw_xtap_u",new tn_U(32,21));tn_0(c,d,"iw_xtap_ul",new tn_U(32,21));tn_0(c,d,"iw_xtap_rd",new tn_U(21,32));tn_0(c,d,"iw_xtap_ld", new tn_U(21,32));tn_0(c,d,"iw_sw0",e,"iw_sw");tn_0(c,d,"iw_se0",e,"iw_se");tn_jd(d);this.e=d;e=new tn_U(8,8);var f=tn_xe(c,b,[["iws_n",628,8,0,0,"iws_n1"],["iws_n",628,8,0,0,"iws_n2"],["iws_w",8,598,0,0],["iws_e",8,598,0,0],["iws_s",628,8,0,0,"iws_s1"],["iws_s",628,8,0,0,"iws_s2"],["iws_c",628,598,0,0]]);tn_0(c,f,"iws_nw",e);tn_0(c,f,"iws_ne",e);tn_0(c,f,"iws_sw",e);tn_0(c,f,"iws_se",e);tn_0(c,f,"iws_tap",new tn_U(37,16));tn_0(c,f,"iws_tap_l",new tn_U(32,16));tn_0(c,f,"iws_tap_u",new tn_U(37,26)); tn_0(c,f,"iws_tap_ul",new tn_U(32,26));tn_0(c,f,"iws_tap_rd",new tn_U(16,37));tn_0(c,f,"iws_tap_ld",new tn_U(26,37));tn_0(c,f,"iws_tab_dl",new tn_U(8,28));tn_0(c,f,"iws_tab_dr",new tn_U(14,28));tn_0(c,f,"iws_tab_l",new tn_U(8,28));tn_0(c,f,"iws_tab_r",new tn_U(14,28));tn_M(c.iws_tab_dl);tn_M(c.iws_tab_dr);tn_M(c.iws_tab_l);tn_M(c.iws_tab_r);tn_jd(f);this.i=f;e=new tn_U(14,13);f=tn_0(c,d,"close",e,"close",tn_);f.style.zIndex=1E4;tn_Q(f,"pointer");tn_de(f,this,this.Fa);f=tn_0(c,d,"maximize",e,"maximize", tn_);f.style.zIndex=1E4;tn_fd(f);tn_Q(f,"pointer");tn_de(f,this,this.maximize);c=tn_0(c,d,"restore",e,"restore",tn_);c.style.zIndex=10001;tn_fd(c);tn_Q(c,"pointer");tn_de(c,this,this.restore);tn_Y(d,tn_Vd,this,this.X);tn_Y(d,tn_Ud,this,this.pa);tn_Y(d,tn_Sd,this,this.X);tn_Y(d,tn_Td,this,tn_fe);tn_Y(d,tn_Wd,this,tn_fe);tn_Y(d,tn_Xd,this,tn_fe);this.Pa();this.hide()};tn__.prototype.remove=function(){tn_R(this.i);tn_R(this.e)}; tn__.prototype.ka=function(a){if(a){tn_N(this.g.maximize);tn_N(this.g.restore)}else{tn_M(this.g.maximize);tn_M(this.g.restore)}};tn__.prototype.G=function(a){this.g.close.style.visibility=a?"visible":"hidden"};tn__.prototype.La=function(a){this.aa=a===tn_||a==="rtl"?"rtl":"ltr"};tn__.prototype.za=function(a){this.Aa=a};tn__.prototype.Ba=function(a){this.Ca=a};tn__.prototype.ja=function(a){this.S=a}; tn__.prototype.F=function(a){if(!a.getClientRects)return this.p(tn_ka(a));var b=this.A(),c=this.g,d=b.width,e=b.height,f=window.innerWidth||document.body.scrollWidth;b=document.documentElement.scrollLeft||window.scrollX||document.body.scrollLeft;var h=document.documentElement.scrollTop||window.scrollY||document.body.scrollTop;tn_M(c.iw_xtap);tn_M(c.iw_xtap_l);tn_M(c.iw_xtap_u);tn_M(c.iw_xtap_ul);tn_M(c.iw_xtap_ld);tn_M(c.iw_xtap_rd);tn_M(c.iws_tap);tn_M(c.iws_tap_l);tn_M(c.iws_tap_u);tn_M(c.iws_tap_ul); tn_M(c.iws_tap_ld);tn_M(c.iws_tap_rd);var j,m,l,g;c=a.getClientRects();var i=Array(c.length),n=tn_ka(a);a=c[0].top-n.y;for(var k=0;k<c.length;++k){i[k]={left:c[k].left,right:c[k].right,top:c[k].top,bottom:c[k].bottom};if(k>0&&i[k].bottom==i[k-1].bottom)if(i[k].left==i[k-1].right){i[k].left=i[k-1].left;i[k].top=tn_O(i[k].top,i[k-1].top)}else if(i[k].right==i[k-1].left){i[k].right=i[k-1].right;i[k].top=tn_O(i[k].top,i[k-1].top)}if(!j||i[k].left<=j.left)j=i[k];if(!m||i[k].right>=m.right)m=i[k];if(!l|| i[k].top<=l.top)l=i[k];if(!g||i[k].bottom>=g.bottom)g=i[k]}if(this.m&&21+d+6+12+m.right<f)return this.p(new tn_d(j.left+b,m.top-a,m.right-j.left,m.bottom-m.top));else if(this.m&&18+d+21<j.left)return this.p(new tn_d(j.left+b,j.top-a,m.right-j.left,j.bottom-j.top));else{if(this.S&&21+e+6+12+(this.f.length>1?20:0)>n.y-(this.Ca?h:0)){d=this.m;this.m=tn_b;l=this.p(new tn_d(g.left+b,l.top-a,g.right-g.left,g.bottom-l.top))}else{d=this.m;this.m=tn_b;l=this.p(new tn_d(l.left+b,l.top-a,l.right-l.left,g.bottom- l.top))}this.m=d;return l}}; tn__.prototype.p=function(a,b){var c=this.A(),d=this.g,e=c.width,f=c.height,h=document.body.scrollWidth,j=document.documentElement.scrollLeft||window.scrollX||document.body.scrollLeft,m=document.documentElement.scrollTop||window.scrollY||document.body.scrollTop;tn_M(d.iw_xtap);tn_M(d.iw_xtap_l);tn_M(d.iw_xtap_u);tn_M(d.iw_xtap_ul);tn_M(d.iw_xtap_ld);tn_M(d.iw_xtap_rd);tn_M(d.iws_tap);tn_M(d.iws_tap_l);tn_M(d.iws_tap_u);tn_M(d.iws_tap_ul);tn_M(d.iws_tap_ld);tn_M(d.iws_tap_rd);var l=0;c=0;var g,i,n, k,o,p=0,q=this.m;if(q&&21+e+6+12+a.x+a.w<j+h){i=tn_;f=d.iw_xtap_ld;m=d.iws_tap_ld}else if(q&&18+e+21+j<a.x){n=tn_;f=d.iw_xtap_rd;m=d.iws_tap_rd;c=5}else{if(this.S&&21+f+6+12+(this.f.length>1?20:0)+(this.Ca?m:0)>a.y){f=d.iw_xtap_u;m=d.iws_tap_u;l=0;g=tn_}else{f=d.iw_xtap;m=d.iws_tap;l=0}if(tn_J(a.x+a.w/2)+32+6+12>j+h){if(f==d.iw_xtap_u){f=d.iw_xtap_ul;m=d.iws_tap_ul}else{f=d.iw_xtap_l;m=d.iws_tap_l}c=5;l=32}k=tn_J((e-32)/2);if(this.Aa)if(k+6+12+l+j>a.x+tn_J(a.w/2)){k=a.x+tn_J(a.w/2)-6-12-l-j;if(k< 0){p=tn_O(-k,tn_J(a.w/2));k=0}k=k}else if(a.x+tn_J(a.w/2)-l+e-k+6+12>j+h){if(g){f=d.iw_xtap_ul;m=d.iws_tap_ul}else{f=d.iw_xtap_l;m=d.iws_tap_l}c=5;l=32;k=a.x+tn_J(a.w/2)-l+e+6+12-h-j;if(k>e-32){p=tn_P(e-32-k,-tn_J(a.w/2));k=e-32}k=k}o=e-32-k}tn_N(f);tn_N(m);this.Xa=i?0:n?6+e+21:6+k+l;e=this.ba=b||tn_U.ZERO;p=this.Xa-p;d=i||n?6:g?0:this.ra().height+(this.f.length>1?20:0);p-=e.width;d-=e.height;this.cb=e=new tn_c(a.x+(i?a.w:n?0:a.w/2)-p,a.y+(i||n?a.h/2:g?a.h:0)-d);tn_G(this.e,e);tn_G(this.i,e);this.da= a;this.Ea=undefined;return this.Ga(i,n,g,k,o,f,m,c)}; tn__.prototype.Ga=function(a,b,c,d,e,f,h,j){var m=!(a||b||c);this.R=f;this.P=h;var l=this.A(),g=this.g,i=l.width,n=l.height,k=this.f.length>1?this.v:0;if(c){tn_K(g.iw_n1,tn_P(d,0));tn_K(g.iw_n2,tn_P(e,0));tn_K(g.iw_s1,i-k);tn_K(g.iw_s2,0);tn_K(g.iws_n1,tn_P(d,0));tn_K(g.iws_n2,tn_P(e,0));tn_K(g.iws_s1,i-k);tn_K(g.iws_s2,0)}else if(m){tn_K(g.iw_n1,i-k);tn_K(g.iw_n2,0);tn_K(g.iw_s1,tn_P(d,0));tn_K(g.iw_s2,tn_P(e,0));tn_K(g.iws_n1,i-k);tn_K(g.iws_n2,0);tn_K(g.iws_s1,tn_P(d,0));tn_K(g.iws_s2,tn_P(e,0))}else{tn_K(g.iw_n1, i);tn_K(g.iw_n2,0);tn_K(g.iw_s1,i-k);tn_K(g.iw_s2,0);tn_K(g.iws_n1,i);tn_K(g.iws_n2,0);tn_K(g.iws_s1,i-k);tn_K(g.iws_s2,0)}tn_dd(g.iw_c,l);if(a){tn_L(g.iw_w,tn_P(n-32,0));tn_L(g.iw_e,tn_P(n,32));tn_L(g.iws_w,tn_P(n-32,0));tn_L(g.iws_e,tn_P(n,32))}else if(b){tn_L(g.iw_e,tn_P(n-32,0));tn_L(g.iw_w,tn_P(n,32));tn_L(g.iws_e,tn_P(n-32,0));tn_L(g.iws_w,tn_P(n,32))}else{tn_L(g.iw_w,n);tn_L(g.iw_e,n);tn_L(g.iws_w,n);tn_L(g.iws_e,n)}e=a?15:0;l=e+5-2;var o=e+6,p=o+5,q=o+i,r=q+5,s=a?0:b?q:o+d,B=s+j,A=s+32,C= A+5;i=c?15:!a&&!b&&this.f.length>1?20:0;var y=i+5-2,t=i+6,z=t+5,u=t+(a||b?tn_P(n,32):n),w=u+5;n=c||a||b?u:0;j=n+5-(c||a||b?0:2);d=c||a||b?u+6-1:0;var D=new tn_c(o,u),E=new tn_c(p,w),F=new tn_c(o,i),G=new tn_c(p,y);tn_G(g.iw_nw,new tn_c(e,i));tn_G(g.iws_nw,new tn_c(l,y));if(m){tn_G(g.iw_n1,new tn_c(o+k,i));tn_G(g.iws_n1,new tn_c(p+k,y));tn_G(g.iw_s1,D);tn_G(g.iws_s1,E);tn_G(g.iw_s2,new tn_c(A,u));tn_G(g.iws_s2,new tn_c(C,w));tn_M(g.iws_tab_dl);tn_M(g.iws_tab_dr);tn_N(g.iws_tab_l);tn_N(g.iws_tab_r); tn_G(g.iws_tab_l,new tn_c(l,j));tn_G(g.iws_tab_r,new tn_c(p+k-14,j))}else{tn_G(g.iw_n1,F);tn_G(g.iws_n1,G);tn_G(g.iw_s2,D);tn_G(g.iws_s2,E);tn_G(g.iw_s1,new tn_c(o+k,u));tn_G(g.iws_s1,new tn_c(p+k,w));tn_N(g.iws_tab_dl);tn_N(g.iws_tab_dr);tn_M(g.iws_tab_l);tn_M(g.iws_tab_r);tn_G(g.iws_tab_dl,new tn_c(l,j));tn_G(g.iws_tab_dr,new tn_c(p+k-14,j))}if(c){tn_G(g.iw_n2,new tn_c(A,i));tn_G(g.iws_n2,new tn_c(C,y))}else{tn_G(g.iw_n2,F);tn_G(g.iws_n2,G)}tn_G(g.iw_ne,new tn_c(q,i));tn_G(g.iws_ne,new tn_c(r,y)); tn_G(g.iw_w,new tn_c(e,t+(a?32:0)));tn_G(g.iws_w,new tn_c(l,z+(a?32:0)));tn_G(g.iw_c,new tn_c(o,t));tn_G(g.iws_c,new tn_c(p,z));tn_K(g.iw_c,q-o);tn_L(g.iw_c,u-t);tn_K(g.iws_c,r-p);tn_L(g.iws_c,w-z);tn_G(g.iw_e,new tn_c(q,t+(b?32:0)));tn_G(g.iws_e,new tn_c(r,z+(b?32:0)));tn_G(g.iw_sw,new tn_c(e,u));tn_G(g.iws_sw,new tn_c(l,w));tn_G(g.iw_se,new tn_c(q,u));tn_G(g.iws_se,new tn_c(r,w));if(a){tn_G(f,new tn_c(0,t));tn_G(h,new tn_c(0,t))}else if(b){tn_G(f,new tn_c(q,t));tn_G(h,new tn_c(r,t))}else if(c){tn_G(f, new tn_c(s,0));tn_G(h,new tn_c(B,0))}else{tn_G(f,new tn_c(s,u));tn_G(h,new tn_c(B,w))}a=this.aa=="rtl"?0+o:q-14+0;b=t-0;tn_G(g.close,new tn_c(a,b));if(g.close.style.visibility!="hidden")if(this.aa=="rtl")a+=16;else a-=16;a=new tn_c(a,b);tn_G(g.maximize,a);tn_G(g.restore,a);this.ga=new tn_c(e+8,i+8);for(a=0;a<this.l.length;a++){b=this.l[a];tn_G(b,this.ga)}if(this.f.length<2){tn_M(g.iws_tab_l);tn_M(g.iws_tab_r);tn_M(g.iws_tab_dl);tn_M(g.iws_tab_dr);tn_N(g.iw_sw);tn_N(g.iws_sw);tn_N(g.iw_nw);tn_N(g.iws_nw)}else{if(m){tn_M(g.iw_nw); tn_M(g.iws_nw);tn_N(g.iw_sw);tn_N(g.iws_sw)}else{tn_M(g.iw_sw);tn_M(g.iws_sw);tn_N(g.iw_nw);tn_N(g.iws_nw)}for(a=0;a<this.f.length;++a){g=this.f[a];i=g.images;f=g.textWidth;b=g.labelNode;p=b.style;var v;if(a>0)v=this.ha[a-1];tn_M(i.iw_tabback_dl);tn_M(i.iw_tabback_dm);tn_M(i.iw_tabback_dr);tn_M(i.iw_tabback_l);tn_M(i.iw_tabback_m);tn_M(i.iw_tabback_r);tn_M(i.iw_tab_dl);tn_M(i.iw_tab_dm);tn_M(i.iw_tab_dr);tn_M(i.iw_tab_l);tn_M(i.iw_tab_m);tn_M(i.iw_tab_r);tn_M(i.iws_tab_m);tn_M(i.iws_tab_dm);if(v){tn_M(v.iws_tab_do); tn_M(v.iws_tab_o)}else{tn_M(i.iw_tab_1l);tn_M(i.iw_tab_1dl);tn_M(i.iw_tabback_1l);tn_M(i.iw_tabback_1dl);tn_M(i.iws_tab_1l);tn_M(i.iws_tab_1dl)}var x;c=this.e.style.zIndex;if(m){if(this.s==a){h=a==0?i.iw_tab_1l:i.iw_tab_l;k=i.iw_tab_m;o=i.iw_tab_r;++c}else{h=a==0?i.iw_tabback_1l:i.iw_tabback_l;k=i.iw_tabback_m;o=i.iw_tabback_r}i=i.iws_tab_m;if(v)x=v.iws_tab_o;p.paddingTop=tn_I(4);p.paddingBottom=tn_I(0)}else{if(this.s==a){h=a==0?i.iw_tab_1dl:i.iw_tab_dl;k=i.iw_tab_dm;o=i.iw_tab_dr;++c}else{h=a==0? i.iw_tabback_1dl:i.iw_tabback_dl;k=i.iw_tabback_dm;o=i.iw_tabback_dr}i=i.iws_tab_dm;if(v)x=v.iws_tab_do;p.paddingTop=tn_I(4);p.paddingBottom=""}tn_N(h);tn_N(k);tn_N(o);tn_N(i);p=g.offset+(a==0?6:11);tn_G(h,new tn_c(e+g.offset,n));tn_G(k,new tn_c(e+p,n));tn_K(k,f);tn_G(i,new tn_c(l+2+p,j));tn_K(i,f);tn_G(o,new tn_c(e+p+f,n));if(x){tn_N(x);tn_G(x,new tn_c(l+p-14+2,j));x.parentNode||tn_H(this.i,x)}h.style.zIndex=c;k.style.zIndex=c;o.style.zIndex=c;f=f+2+3;tn_K(b,f);tn_G(b,new tn_c(e+p-2,d));tn_N(b); b.style.zIndex=c+1;!b.parentNode&&g.textWidth>0&&tn_H(this.e,b)}}};tn__.prototype.C=function(){if(this.Ea)this.F(this.Ea,this.ba);else this.da&&this.p(this.da,this.ba)};tn__.prototype.A=function(){return new tn_U(tn_P(this.q.width,this.v),this.q.height)};tn__.prototype.reset=function(a,b,c,d,e){this.u(c,b,e);this.p(a,d);this.show();tn_fd(this.g.restore)};tn__.prototype.hide=function(){this.R&&tn_M(this.R);this.P&&tn_M(this.P);tn_M(this.e);tn_M(this.i)}; tn__.prototype.show=function(){if(this.ya()){tn_N(this.e);tn_N(this.i);this.R&&tn_N(this.R);this.P&&tn_N(this.P)}};tn__.prototype.Pa=function(){this.bb=tn_};tn__.prototype.ya=function(){return this.e.style.display=="none"};tn__.prototype.Ka=function(a){if(a!=this.s){this.ea(a);var b=this.l;tn_td(b,tn_M);tn_N(b[a]);var c=this;window.setTimeout(function(){c.C()},0)}};tn__.prototype.Fa=function(){tn_X(this,tn_Zd)}; tn__.prototype.maximize=function(a){if(!this.M){tn_X(this,tn__d);tn_gd(this.g.restore);this.Ra=this.q;this.ab=this.f;this.$a=this.s;this.o=this.o||new tn_U(628,598);var b=new tn_U(4+this.o.width,4+this.o.height);if(tn_S.k())b.width+=1;this.$(b,a)}};tn__.prototype.Na=function(a){this.o=this.H(a)};tn__.prototype.restore=function(a){if(this.M){tn_X(this,tn_0d);tn_fd(this.g.restore);this.u(this.o,this.ab,this.$a);this.Va=this.Ra;this.$(this.Ra,a)}}; tn__.prototype.$=function(a,b){this.Z=new tn_ue(b===tn_?1:10);this.K=this.q;this.ta=a;this.V()};tn__.prototype.V=function(){var a=this.Z.next();this.Z.more()&&tn_md(this,this.V,10);var b=this.K.width+(this.ta.width-this.K.width)*a;a=this.K.height+(this.ta.height-this.K.height)*a;this.O(new tn_U(b,a));this.C();this.Ta();this.Z.more()||this.sa()};tn__.prototype.sa=function(){if(this.M){this.M=tn_b;tn_X(this,tn_2d)}else{this.M=tn_;tn_X(this,tn_1d);this.o&&this.Da&&this.u(this.o,this.Da,this.Wa)}}; tn__.prototype.O=function(a){return a=this.q=this.H(a)};tn__.prototype.pa=function(a){if(tn_S.type==1)tn_ee(a);else{var b=tn_te(a,this.e);b.y<=this.Y()&&tn_ee(a)}};tn__.prototype.X=function(a){if(tn_S.type==1)tn_fe(a);else{var b=tn_te(a,this.e);if(b.y<=this.Y())a.cancelDrag=tn_}};tn__.prototype.Y=function(){return this.A().height+12};tn__.prototype.ra=function(){var a=this.A();return new tn_U(a.width+12,a.height+21+6)}; tn__.prototype.u=function(a,b,c){this.na();this.Va=a;a=new tn_U(4+a.width,4+a.height);if(tn_S.k())a.width+=1;var d=this.O(a),e=[];this.f=e;var f=c||0;a=new tn_U(d.width+-4,d.height+-4);var h=this.ga,j=this.l=[];for(c=0;c<b.length;c++){var m=tn_F("div",this.e,h,a);tn_hd(m);c!=f&&tn_M(m);m.style.zIndex=10;tn_H(m,b[c].contentElem);j.push(m)}if(b.length>1){a=[];h=new tn_U(11,26);j=new tn_U(14,26);this.xa();for(c=0;c<b.length;++c){var l={images:b[c].images||{},textWidth:b[c].textWidth||0,offset:b[c].offset|| 0,name:b[c].name,contentElem:b[c].contentElem,onclick:b[c].onclick},g=l.images;tn_xe(g,this.e,[["iw_tabback_dm",1,26,0,0],["iw_tabback_m",1,26,0,0],["iw_tab_dm",1,26,0,0],["iw_tab_m",1,26,0,0]]);tn_0(g,this.e,"iw_tabback_dl",h);tn_0(g,this.e,"iw_tabback_dr",j);tn_0(g,this.e,"iw_tabback_l",h);tn_0(g,this.e,"iw_tabback_r",j);tn_0(g,this.e,"iw_tab_dl",h);tn_0(g,this.e,"iw_tab_dr",j);tn_0(g,this.e,"iw_tab_l",h);tn_0(g,this.e,"iw_tab_r",j);tn_xe(g,this.i,[["iws_tab_dm",1,28,0,0],["iws_tab_m",1,28,0,0]]); m=function(k,o){tn_M(o);k.Q.push(o)};if(c==0){var i=new tn_U(6,26);tn_0(g,this.e,"iw_tab_1dl",i);tn_0(g,this.e,"iw_tab_1l",i);tn_0(g,this.e,"iw_tabback_1dl",i);tn_0(g,this.e,"iw_tabback_1l",i);i=new tn_U(8,28);tn_0(g,this.i,"iws_tab_1dl",i);tn_0(g,this.i,"iws_tab_1l",i);m(this,g.iw_tab_1dl);m(this,g.iw_tab_1l);m(this,g.iw_tabback_1dl);m(this,g.iw_tabback_1l);m(this,g.iws_tab_1dl);m(this,g.iws_tab_1l)}m(this,g.iw_tabback_dl);m(this,g.iw_tabback_dm);m(this,g.iw_tabback_dr);m(this,g.iw_tabback_l);m(this, g.iw_tabback_m);m(this,g.iw_tabback_r);m(this,g.iw_tab_dl);m(this,g.iw_tab_dm);m(this,g.iw_tab_dr);m(this,g.iw_tab_l);m(this,g.iw_tab_m);m(this,g.iw_tab_r);m(this,g.iws_tab_dm);m(this,g.iws_tab_m);g=document.createElement("div");l.labelNode=g;tn_L(g,20);i=g.style;tn_hd(g);i.fontWeight="bold";i.fontFamily="Arial,sans-serif";i.fontSize=tn_I(12);i.textAlign="center";i.display="inline";tn_ye(g);tn_ed(l.name,g);(function(k,o,p,q){tn_de(q,k,function(){k.Ka(o);p&&p()})})(this,c,b[c].onclick,g);this.Q.push(g); a.push(g);this.f.push(l);if(c>0){l={};g=new tn_U(14,28);tn_0(l,this.i,"iws_tab_do",g);tn_0(l,this.i,"iws_tab_o",g);m(this,l.iws_tab_do);m(this,l.iws_tab_o);this.ha.push(l)}}var n=this;tn_Kd(a,function(k){var o;if(k.length==e.length){for(var p=0;p<k.length;++p){var q=o=e[p];if(k[p].width!=0)q.textWidth=tn_P(0,k[p].width-2-3);tn_N(q.labelNode);tn_H(n.e,q.labelNode);if(p>0){var r=e[p-1];q.offset=r.offset+r.textWidth+(p==1?6:11)+14-11}}n.v=o.offset+o.textWidth+ +14+11-6;if(n.v+30>d.width){n.O(new tn_U(n.v+ 30,d.height));k=new tn_U(n.v+30+-4,d.height+-4);for(p=0;p<n.l.length;++p)tn_dd(n.l[p],k)}}n.ea(f);n.C()})}else{l={images:b[0].images||{},textWidth:b[0].textWidth||0,offset:b[0].offset||0,name:b[0].name,contentElem:b[0].contentElem,onclick:b[0].onclick};this.f.push(l);this.C()}};tn__.prototype.Ta=function(){for(var a=new tn_U(this.q.width+-4,this.q.height+-4),b=0;b<this.l.length;b++){var c=this.l[b];tn_dd(c,a)}};tn__.prototype.Ma=function(a,b,c){this.o=a;this.Da=b;this.Wa=c;tn_gd(this.g.maximize)}; tn__.prototype.na=function(){var a=this.l;tn_td(a,tn_R);tn_Fd(a);a=this.Q;tn_td(a,tn_R);tn_Fd(a);this.s=0};tn__.prototype.H=function(a){return new tn_U(tn_P(a.width,32),tn_P(a.height,0))};tn__.prototype.xa=function(){this.Q=[];this.ha=[];this.v=0};tn__.prototype.ea=function(a){tn_ye(this.f[this.s].labelNode);this.s=a;tn_ze(this.f[a].labelNode)};function tn_ze(a){var b=a.style;b.color="";b.textDecoration="";tn_Q(a,"")} function tn_ye(a){var b=a.style;b.color="#0000cc";b.textDecoration="underline";tn_Q(a,"pointer")}function tn_xe(a,b,c){b=tn_F("div",b,tn_a,tn_a,tn_b,tn_);for(var d=0;d<c.length;d++){var e=c[d],f=new tn_U(e[1],e[2]),h=new tn_c(e[3],e[4]),j=tn_$c+e[0]+".png";f=tn_Ld(j,b,h,f,tn_,tn_);a[e[5]||e[0]]=f}return b} function tn_0(a,b,c,d,e,f){if(tn_S.type==1&&tn_S.version<7){b=tn_Ld(tn_$c+c+(f?".gif":".png"),b,new tn_c(0,0),d,tn_,tn_);return a[e||c]=b}if(!tn_ve){tn_ve=tn_;d=document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=tn_$c+"iw_sprite.css";document.getElementsByTagName("head")[0].appendChild(d)}d=document.createElement("div");d.className="SPRITE_"+c;d.style.overflow="hidden";b.appendChild(d);return a[e||c]=d};if(window.jstiming){window.jstiming.ma={};window.jstiming.Za=1;var tn_Ae=function(a,b,c){var d=a.t[b],e=a.t.start;if(d&&(e||c)){d=a.t[b][0];e=c!=undefined?c:e[0];return d-e}};window.jstiming.report=function(a,b,c){var d="";if(window.jstiming.pt){d+="&srt="+window.jstiming.pt;delete window.jstiming.pt}try{if(window.external&&window.external.tran)d+="&tran="+window.external.tran;else if(window.gtbExternal&&window.gtbExternal.tran)d+="&tran="+window.gtbExternal.tran();else if(window.chrome&&window.chrome.csi)d+= "&tran="+window.chrome.csi().tran}catch(e){}var f="chrome.loadTimes";if(window.chrome&&window[f]&&window[f]().wasFetchedViaSpdy)d+="&p=s";if(a.Ua)d+="&"+a.Ua;f=a.t;var h=f.start,j=[],m=[];for(var l in f)if(l!="start")if(l.indexOf("_")!=0){var g=f[l][1];if(g)f[g]&&m.push(l+"."+tn_Ae(a,l,f[g][0]));else h&&j.push(l+"."+tn_Ae(a,l))}delete f.start;if(b)for(var i in b)d+="&"+i+"="+b[i];a=[c?c:"http://csi.gstatic.com/csi","?v=3","&s="+(window.jstiming.sn||"translate")+"&action=",a.name,m.length?"&it="+m.join(","): "","",d,"&rt=",j.join(",")].join("");b=new Image;var n=window.jstiming.Za++;window.jstiming.ma[n]=b;b.onload=b.onerror=function(){delete window.jstiming.ma[n]};b.src=a;b=tn_a;return a}};var _infowindowVersion=1,_redirectUrl,tn_1,tn_2=tn_a,tn_3,tn_Be,tn_Ce,tn_De=tn_b,tn_Ee=tn_b,tn_4=tn_b,tn_5=tn_b,tn_6={};tn_6.right="left";tn_6.left="right";tn_6.ltr="rtl";tn_6.rtl="ltr";var tn_Fe="/community",tn_Ge=tn_Fe+"/edit",tn_7,tn_He,tn_Ie,tn_Je,tn_8,tn_Ke;function tn_Le(a){return a.substring(0,1).toUpperCase()+a.substring(1)} var _intlStrings={_originalText:"Original Text:",_interfaceDirection:"ltr",_interfaceAlign:"left",_langpair:"",_currentBy:"",_unknown:"unknown",_suggestTranslation:"Suggest a translation",_submit:"Submit",_feedbackUrl:"http://translate.google.com/translate_suggestion",_suggestThanks:"Thank you for helping us improve the quality of our translations.",_reverse:tn_b}; function tn_Me(a){if(a.nodeType==3)return a.nodeValue;else if(a.nodeType==1){for(var b=new String,c=0;c<a.childNodes.length;++c)b+=tn_Me(a.childNodes[c]);return b}}function tn_Ne(a,b){if(a)if(b.nodeType==3)a.appendChild(document.createTextNode(b.nodeValue));else if(b.nodeType==1){var c;if(b.nodeName==="a"||b.nodeName==="A"){c=document.createElement("a");var d=b.getAttribute("href");d&&c.setAttribute("href",d);a.appendChild(c)}else c=a;for(d=0;d<b.childNodes.length;++d)tn_Ne(c,b.childNodes[d])}} function tn_Oe(){for(var a=document.getElementsByTagName("span"),b=0;b<a.length;++b){var c=a[b];if(c.className=="google-tr-info"){var d=tn_Pe(c.firstChild.nodeValue,",",3);if(d&&d[1]!=="0")c.parentNode.className="google-tr-highlight"}}} function _setupIW(){if(!tn_De){tn_1=new tn__;tn_3=document.createElement("div");tn_3.id="google-infowindow";tn_Be=document.createElement("span");tn_3.onmouseover=tn_Qe;tn_3.onmouseout=tn_Re;document.body.appendChild(tn_Be);document.body.appendChild(tn_3);var a=document.createElement("div");document.body.appendChild(a);tn_M(a);a.innerHTML='<iframe id="google-feedback-frame" name="google-feedback-frame"></iframe>';tn_1.create(tn_3,tn_Be);tn_3.firstChild.style.zIndex=2147483647;tn_Be.firstChild.style.zIndex= 2147483647;tn_1.G(tn_);tn_1.za(tn_);tn_1.Ba(tn_);tn_1.ja(tn_);tn_1.ka(tn_b);tn_1.La(_intlStrings._interfaceDirection);tn_7d(tn_1,tn_Zd,function(){tn_Re(tn_);tn_5&&tn_Se(tn_b)});_infowindowVersion==2&&tn_Oe();tn_De=tn_}}var tn_9=tn_a;function tn_Qe(){tn_Ee=tn_;tn_Te(tn_2)} function tn_Te(a){if(a){if(tn_9!==tn_a){window.clearTimeout(tn_9);tn_9=tn_a}if(!tn_4)if(tn_2==a){if(!tn_5){tn_Ce=tn_2.style.backgroundColor;tn_2.style.backgroundColor="#E6ECF9"}}else{if(tn_5){tn_1.restore(tn_);tn_5=tn_b}for(var b,c=a.cloneNode(tn_),d=a.childNodes.length-1;d>=0;--d)if(a.childNodes[d].className=="google-src-text"){b=a.childNodes[d].cloneNode(tn_);c.removeChild(c.childNodes[d]);b.className="google-src-active-text"}else a.childNodes[d].className=="google-tr-info"&&c.removeChild(c.childNodes[d]); if(b){tn_1.G(tn_);tn_Ce=a.style.backgroundColor;a.style.backgroundColor="#E6ECF9";var e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("img"),j=document.createElement("div");j.appendChild(h);h.width=48;h.height=17;h.border=0;h.style.padding="0px";h.style.border="0px solid black";j.style.margin="0px";j.style.marginBottom="-17px";j.style.padding="0px";j.style.textAlign=tn_6[_intlStrings._interfaceAlign];h.src="http://www.google.com/images/logo_smallest.png";h.style["margin"+ tn_Le(_intlStrings._interfaceAlign)]="6px";h.style["margin"+tn_Le(tn_6[_intlStrings._interfaceAlign])]=tn_I(18);e.appendChild(j);e.appendChild(f);f.appendChild(document.createTextNode(_intlStrings._originalText));f.style.color="#333";f.style.direction=_intlStrings._interfaceDirection;f.style.textAlign=_intlStrings._interfaceAlign;f.style.fontWeight="bold";f.style.fontSize="12px";f.style.minHeight="19px";f.style.fontFamily="arial,sans-serif";f.style["margin"+tn_Le(tn_6[_intlStrings._interfaceAlign])]= tn_I(72);f=document.createElement("div");f.className="google-src-active-text";f.style.lineHeight="19px";f.style.direction=_intlStrings._interfaceDirection;f.style.textAlign=_intlStrings._interfaceAlign;tn_Ne(f,b);e.appendChild(f);e.style.zIndex=2147483647;if(_intlStrings._langpair.length==0){tn_2=a;tn_Jd(e,function(s){tn_1.hide();tn_1.u(s,[new tn_we(_intlStrings._originalText,e)]);tn_1.F(tn_2);tn_1.show()},(document.width||document.body.scrollWidth)/2)}else{h=e.cloneNode(tn_);var m=document.createElement("div"); m.appendChild(h);var l=document.createElement("div");h=document.createElement("span");f=document.createElement("div");f.style.direction=_intlStrings._interfaceDirection;f.style.textAlign=_intlStrings._interfaceAlign;f.style.marginTop=tn_I(5);l.appendChild(f);j=document.createElement("img");j.src="http://www.google.com/images/zippy_plus_sm.gif";j.width=12;j.height=12;j.border=0;j.style.border="none";j.style.verticalAlign="middle";f.appendChild(j);f.appendChild(document.createTextNode(" "));f.appendChild(h); h.appendChild(document.createTextNode(_intlStrings._suggestTranslation));h.style.direction=_intlStrings._interfaceDirection;h.style.textAlign=_intlStrings._interfaceAlign;h.style.color="#0000CC";h.style.textDecoration="underline";h.style.fontFamily="arial,sans-serif";h.style.fontSize="12px";f.onclick=tn_Ue;tn_Q(h,"pointer");e.appendChild(l);var g=document.createElement("div");h=document.createElement("div");j=document.createElement("span");h.style.direction=_intlStrings._interfaceDirection;h.style.textAlign= _intlStrings._interfaceAlign;h.style.marginTop=tn_I(5);h.style.marginBottom=tn_I(6);g.appendChild(h);var i=document.createElement("img");i.src="http://www.google.com/images/zippy_minus_sm.gif";i.width=12;i.height=12;i.border=0;i.style.border="none";i.style.verticalAlign="middle";h.appendChild(i);h.appendChild(document.createTextNode(" "));h.appendChild(j);j.appendChild(document.createTextNode(_intlStrings._suggestTranslation));j.style.direction=_intlStrings._interfaceDirection;j.style.textAlign=_intlStrings._interfaceAlign; j.style.color="#0000CC";j.style.textDecoration="underline";j.style.fontFamily="arial,sans-serif";j.style.fontSize="12px";h.onclick=function(){tn_Se(tn_)};tn_Q(j,"pointer");tn_2=a;if(_infowindowVersion==1){var n=document.createElement("div");f=document.createElement("form");f.style.marginBottom="0px";f.style.paddingBottom="0px";f.target="google-feedback-frame";f.method="post";f.action=_intlStrings._feedbackUrl;n.appendChild(f);a=document.createElement("input");a.type="hidden";a.name="gtrans";f.appendChild(a); if(_intlStrings._reverse){h=tn_Me(c);c=tn_Me(b)}else{c=tn_Me(c);h=tn_Me(b)}a.value=c;b=document.createElement("input");b.type="hidden";b.value=h;b.name="text";f.appendChild(b);b=document.createElement("input");b.name="langpair";b.type="hidden";b.value=_intlStrings._langpair;f.appendChild(b);b=document.createElement("input");b.name="u";b.type="hidden";b.value=tn_$("u");f.appendChild(b);b=document.createElement("input");b.name="oe";b.type="hidden";if(document.charset){b.value=document.charset;f.appendChild(b)}else if(document.characterSet){b.value= document.characterSet;f.appendChild(b)}else if(a=tn_$("oe")){f.appendChild(b);b.value=a}var k=document.createElement("textarea");k.rows=3;k.name="utrans";k.value=c;f.appendChild(k);b=document.createElement("div");b.style.direction=_intlStrings._interfaceDirection;b.style.textAlign=tn_6[_intlStrings._interfaceAlign];b.style.marginTop=tn_I(6);b.style.marginBottom="0px";f.appendChild(b);c=document.createElement("input");c.type="submit";c.value=_intlStrings._submit;b.appendChild(c);var o=document.createElement("div"); o.appendChild(document.createElement("hr"));o.appendChild(document.createTextNode(_intlStrings._suggestThanks));o.style.direction=_intlStrings._interfaceDirection;o.style.textAlign=_intlStrings._interfaceAlign;o.style.fontFamily="arial,sans-serif";o.style.fontSize="12px";o.style.overflow="auto";o.style.marginTop="10px";tn_M(o);g.appendChild(n);m.appendChild(g);m.appendChild(o);f.onsubmit=function(){window.setTimeout(function(){tn_M(g);tn_N(o)},1);tn_4=tn_b;return tn_};tn_Kd([m,e],function(s){k.style.width= tn_I(s[0].width);tn_1.hide();tn_1.u(s[1],[new tn_we(_intlStrings._originalText,e)]);tn_1.Ma(s[0],[new tn_we(_intlStrings._originalText,m)]);tn_1.F(tn_2);tn_1.G(tn_);tn_1.show()},(document.width||document.body.scrollWidth)/2)}else if(_infowindowVersion==2){(j=tn_$("rurl"))||(j="translate.google.com");h=_intlStrings._langpair.split("|",2);i="hl="+tn_$("hl")+"&sl="+h[0]+"&tl="+h[1];try{tn_7=document.createElement('<iframe name="google-edit-frame">')}catch(p){tn_7=document.createElement("iframe")}tn_7.id= "google-edit-frame";tn_7.name="google-edit-frame";tn_7.style.margin=0;tn_7.style.padding=0;tn_7.frameBorder=0;tn_7.width=650;tn_7.height=350;e.appendChild(tn_7);h=e.cloneNode(tn_);for(d=0;d<a.childNodes.length;++d)if(a.childNodes[d].className=="google-tr-info"){n=a.childNodes[d].firstChild.nodeValue;break}if(n)if((a=tn_Pe(n,",",3))&&a[1]!=="0"){tn_7.src="http://translate.google.com"+tn_Fe+"/authorinfo?"+i+"&uid="+a[0]+"&date="+a[1];tn_7.height=15}else tn_7.style.display="none";else tn_7.style.display= "none";if(!tn_He){try{tn_He=document.createElement('<iframe name="google-send-frame">')}catch(q){tn_He=document.createElement("iframe")}tn_He.name="google-send-frame";window.document.body.appendChild(tn_He);tn_He.style.display="none";a="http://"+j+tn_Fe+"/send?domain="+window.location.host;if(d=tn_$("hl"))a+="&hl="+d;tn_He.src=a}var r=document.createElement("form");r.style.display="none";r.target="google-edit-frame";r.method="post";a="http://"+j+tn_Ge+"?"+i;j=new Date;a+="&ctz="+j.getTimezoneOffset(); e.appendChild(r);i=document.createElement("input");i.name="sentence";i.type="hidden";i.value=_intlStrings._reverse?c.innerHTML:b.innerHTML;if(j=document.documentMode){i.value=encodeURIComponent(i.value);a+="&escape=1"}r.appendChild(i);r.action=a;if(!n&&!tn_$("mt")){n=document.createElement("input");n.type="hidden";n.name="showtrans";n.value=_intlStrings._reverse?b.innerHTML:c.innerHTML;if(j)n.value=encodeURIComponent(n.value);r.appendChild(n)}b=document.createElement("input");b.name="u";b.type="hidden"; b.value=tn_$("u");r.appendChild(b);b=document.createElement("input");b.name="domain";b.type="hidden";b.value=window.location.host;r.appendChild(b);f.onclick=function(){if(_redirectUrl)if(_redirectUrl.indexOf("/community/login?")>0)window.open(_redirectUrl);else window.top.location=_redirectUrl;else{r.submit();l.parentNode.replaceChild(g,l);tn_Ue()}};tn_Ie=l;tn_Je=g;tn_Kd([h,e],function(s){tn_1.hide();tn_1.u(s[1],[new tn_we(_intlStrings._originalText,e)]);tn_1.Na(s[0]);tn_1.F(tn_2);tn_1.G(tn_);tn_1.show()}, 650)}}}}}}function tn_$(a){var b=window.location.search.substring(1);b=b.split("&");for(var c=0;c<b.length;c++){var d=b[c].split("=");if(d[0].toLowerCase()==a&&d.length>0)return window.unescape(d[1])}return""}function tn_Ve(a){if(tn_De){tn_Ee=tn_;if(!tn_4){if(tn_9!==tn_a){window.clearTimeout(tn_9);tn_9=tn_a}if(tn_2==a){tn_Ce=tn_2.style.backgroundColor;tn_2.style.backgroundColor="#E6ECF9"}else tn_9=window.setTimeout(function(){tn_Te(a)},500)}}} function tn_Re(a){if(tn_De){if(a!==tn_)tn_Ee=tn_b;if(!tn_4){if(tn_2&&tn_2.style)tn_2.style.backgroundColor=tn_Ce;if(tn_9){window.clearTimeout(tn_9);tn_9=tn_a}if(a!==tn_)tn_9=window.setTimeout(tn_We,250);else tn_We()}}}function tn_We(){if(!tn_4){tn_1.hide();if(tn_5){tn_1.restore(tn_);tn_5=tn_b}tn_2=tn_a}}function tn_Ue(){tn_5=tn_4=tn_;var a=tn_7d(tn_1,tn_1d,function(){if(_infowindowVersion==2){tn_7.height=350;tn_7.style.display="block"}tn_8d(a)});tn_1.maximize()} function tn_Se(a){_infowindowVersion==2&&tn_Je.parentNode.replaceChild(tn_Ie,tn_Je);var b=tn_7d(tn_1,tn_2d,function(){tn_8d(b);tn_5=tn_b;if(a)window.setTimeout(function(){tn_4=tn_b;tn_Ee||tn_Re(tn_)},500);else{tn_4=tn_b;tn_Ee||tn_Re(tn_)}});tn_1.restore()}function _csi(a,b){var c={};c.sl=a;c.tl=b;var d=window.jstiming.load;d.tick("prt");d.tick("ol");d.name="w";window.jstiming.report(d,c);try{window.external&&window.external.resT()}catch(e){}} function tn_Pe(a,b,c){if(!a)return tn_a;for(var d=[],e=0,f=0;f<c-1;++f){var h=a.indexOf(b,e);if(h==-1)return tn_a;d[f]=a.substring(e,h);e=h+b.length}d[c-1]=a.substring(e);return d} function tn_Xe(a){if(a=="reload")window.location.reload();else if(a=="restore"){if(tn_8&&tn_Ke){for(tn_8.style.backgroundColor=tn_Ke.style.backgroundColor;tn_8.hasChildNodes();)tn_8.removeChild(tn_8.firstChild);for(;tn_Ke.hasChildNodes();)tn_8.appendChild(tn_Ke.firstChild);tn_8=tn_a}}else if(tn_2){tn_2.style.backgroundColor=tn_Ce;if((a=tn_Pe(a,"|",3))&&!tn_$("mt")){tn_8=tn_2;tn_Ke=tn_2.cloneNode(tn_);for(var b=tn_2.childNodes.length-1;b>=0;--b){var c=tn_2.childNodes[b];c.className!="google-src-text"&& tn_2.removeChild(c)}b=document.createElement("span");b.className="google-tr-info";b.appendChild(document.createTextNode(a[0]+","+(new Date).getTime()+","+a[1]));tn_2.appendChild(b);c=document.createElement("div");c.innerHTML=a[2];for(b=0;b<c.childNodes.length;++b)tn_2.appendChild(c.childNodes[b].cloneNode(tn_))}tn_4=tn_b;tn_We();tn_Oe()}}function tn_Ye(a){var b=window.onload;window.onload=b?function(){a();b()}:a}var _tipon=tn_Ve,_tipoff=tn_Re,_updatec=tn_Xe,_addload=tn_Ye,tn_Ze=window.jstiming.load; tn_Ze.tick("jl");
import Ember from 'ember'; export default Ember.Component.extend({ heading: Ember.computed('review.author', 'review.rating', function() { return this.get('review.author') + '-' + this.get('review.rating'); }), actions: { delete(review) { if(confirm('Are you sure you want to delete this review?')) { this.sendAction('destroyReview', review); } } } });
const mysql = require
#ifndef BLOCK_H #define BLOCK_H #include "blockindex.h" #include "blockreject.h" #include "globals.h" #include "outpoint.h" #include "transaction.h" #include "txindex.h" #include "uint256.h" #include <unordered_map> #include <vector> class CBlockIndex; class CTxDB; class CWallet; /** Nodes collect new transactions into a block, hash them into a hash tree, * and scan through nonce values to make the block's hash satisfy proof-of-work * requirements. When they solve the proof-of-work, they broadcast the block * to everyone and the block is added to the block chain. The first transaction * in the block is a special one that creates a new coin owned by the creator * of the block. * * Blocks are appended to blk0001.dat files on disk (not anymore, now they're in lmdb). * Their location on disk is indexed by CBlockIndex objects in memory. */ class CBlock { public: // header static const int CURRENT_VERSION = 6; int nVersion; uint256 hashPrevBlock; uint256 hashMerkleRoot; unsigned int nTime; unsigned int nBits; unsigned int nNonce; // network and disk std::vector<CTransaction> vtx; // ppcoin: block signature - signed by one of the coin base txout[N]'s owner std::vector<unsigned char> vchBlockSig; enum class BlockColdStakingCheckError { SolverOnStakeTransactionFailed, }; enum class ColdStakeKeyExtractionError { KeySizeInvalid, }; boost::optional<CBlockReject> reject; // Denial-of-service detection: mutable int nDoS; bool DoS(int nDoSIn, bool fIn) const { nDoS += nDoSIn; return fIn; } CBlock() { SetNull(); } // clang-format off IMPLEMENT_SERIALIZE( READWRITE(this->nVersion); nVersion = this->nVersion; READWRITE(hashPrevBlock); READWRITE(hashMerkleRoot); READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); // ConnectBlock depends on vtx following header to generate CDiskTxPos if (!(nType & (SER_GETHASH | SER_BLOCKHEADERONLY))) { READWRITE(vtx); READWRITE(vchBlockSig); } else if (fRead) { const_cast<CBlock*>(this)->vtx.clear(); const_cast<CBlock*>(this)->vchBlockSig.clear(); }) // clang-format on void SetNull(); CBlock GetBlockHeader() const; bool IsNull() const; uint256 GetHash() const; uint256 GetPoWHash() const; int64_t GetBlockTime() const; void UpdateTime(const CBlockIndex* pindexPrev); // entropy bit for stake modifier if chosen by modifier unsigned int GetStakeEntropyBit(const uint256& hash) const; // ppcoin: two types of block: proof-of-work or proof-of-stake bool IsProofOfStake() const; bool IsProofOfWork() const { return !IsProofOfStake(); } std::pair<COutPoint, unsigned int> GetProofOfStake() const; // ppcoin: get max transaction timestamp int64_t GetMaxTransactionTime() const; [[nodiscard]] uint256 GetMerkleRoot(bool* fMutated = nullptr) const; [[nodiscard]] std::vector<uint256> GetMerkleBranch(int nIndex) const; static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex); bool WriteToDisk(const boost::optional<CBlockIndex>& prevBlockIndex, const uint256& hashProof, const uint256& blockHash); bool WriteBlockPubKeys(CTxDB& txdb); bool ReadFromDisk(const uint256& hash, const ITxDB& txdb, bool fReadTransactions = true); void print() const; static bool CheckBIP30Attack(ITxDB& txdb, const uint256& hashTx); struct ChainReplaceTxs { // transactions that are being spent in the above ones std::unordered_map<uint256, CTxIndex> modifiedOutputsTxs; // the common ancestor block between the new fork of the new block and the main chain CBlockIndex commonAncestorBlockIndex; // tx vs number of outputs, we don't care about the out count but we have it as a side effect std::unordered_map<uint256, uint32_t> forkTxsOutCount; }; struct CommonAncestorSuccessorBlocks { // while finding the common ancestor, this is the part of this block's chain (excluding this // block) std::vector<uint256> inFork; // order matters here because we want to simulate respending these in order CBlockIndex commonAncestor; }; enum class VIUError { UnknownErrorWhileCollectingTxs, TxInputIndexOutOfRange_Case1, TxInputIndexOutOfRange_Case2, DoublespendAttempt, BlockCannotBeReadFromDB, TxNonExistent_ReadTxIndexFailed_Case1, TxNonExistent_ReadTxIndexFailed_Case2, ReadBlockIndexFailed, BlockIndexOfPrevBlockNotFound, CommonAncestorSearchFailed }; static const char* VIUErrorToString(VIUError err); Result<CommonAncestorSuccessorBlocks, VIUError> GetBlocksUpToCommonAncestorInMainChain(const ITxDB& txdb) const; Result<ChainReplaceTxs, VIUError> ReplaceMainChainWithForkUpToCommonAncestor(const ITxDB& txdb) const; bool DisconnectBlock(CTxDB& txdb, const CBlockIndex& pindex); bool ConnectBlock(ITxDB& txdb, const boost::optional<CBlockIndex>& pindex, bool fJustCheck = false); Result<void, CBlock::VIUError> VerifyInputsUnspent(const CTxDB& txdb) const; bool VerifyBlock(CTxDB& txdb); bool ReadFromDisk(const CBlockIndex* pindex, const ITxDB& txdb, bool fReadTransactions = true); bool SetBestChain(CTxDB& txdb, const boost::optional<CBlockIndex>& pindexNew, const bool createDbTransaction = true); boost::optional<CBlockIndex> AddToBlockIndex(const uint256& blockHash, const boost::optional<CBlockIndex>& prevBlockIndex, const uint256& hashProof, CTxDB& txdb, const bool createDbTransaction = true); bool CheckBlock(const ITxDB& txdb, const uint256& blockHash, bool fCheckPOW = true, bool fCheckMerkleRoot = true, bool fCheckSig = true); bool AcceptBlock(const CBlockIndex& prevBlockIndex, const uint256& blockHash); bool SignBlock(const CTxDB& txdb, const CWallet& keystore, int64_t nFees, const boost::optional<std::set<std::pair<uint256, unsigned>>>& customInputs = boost::none, CAmount extraPayoutForTest = 0); bool SignBlockWithSpecificKey(const ITxDB& txdb, const COutPoint& outputToStake, const CKey& keyOfOutput, int64_t nFees); bool CheckBlockSignature(const ITxDB& txdb, const uint256& blockHash) const; Result<bool, BlockColdStakingCheckError> HasColdStaking(const ITxDB& txdb) const; static boost::optional<CBlockIndex> FindBlockByHeight(int nHeight); static void InvalidChainFound(const CBlockIndex& pindexNew, ITxDB& txdb); bool Reorganize(CTxDB& txdb, const boost::optional<CBlockIndex>& pindexNew, const bool createDbTransaction = true); private: bool SetBestChainInner(CTxDB& txdb, const boost::optional<CBlockIndex>& pindexNew, const bool createDbTransaction = true); }; #endif // BLOCK_H
from decimal import Decimal from typing import List from typing import Optional from pydantic import BaseModel from pydantic import FilePath from pydantic import Field from pydantic_yaml import VersionedYamlModel from ._common import ALL_MODULES from ._typing import Modules class Statement(BaseModel): file: FilePath modules: Modules = ALL_MODULES class FinalStatement(Statement): scoring_ratio: Decimal = Field(default=Decimal('0.5'), ge=0, le=1) class StatementsConfig(VersionedYamlModel): statements: List[Statement] final_statement: Optional[FinalStatement] = None class Config: min_version = '1.0.0' max_version = '2.0.0'
const awyhttp = require('awyhttp'); const weicall = require('./weixinToken.js'); weicall.getToken().then((ret)=>{ if(!ret.status){ throw ret.data; } var getcount_api = `https://api.weixin.qq.com/cgi-bin/material/get_materialcount?access_token=${ret.data}`; awyhttp.get(getcount_api).then(data=>{ console.log(data); module.exports = data.image_count; },err=>{ throw err; }).catch(err=>{console.log(err)}); })
""" Test twin sac against various environments. """ from gym.envs.mujoco import ( HalfCheetahEnv, AntEnv, Walker2dEnv, InvertedDoublePendulumEnv, HopperEnv, HumanoidEnv, SwimmerEnv, ) from gym.envs.classic_control import PendulumEnv from railrl.data_management.env_replay_buffer import EnvReplayBuffer from railrl.envs.wrappers import NormalizedBoxEnv from railrl.launchers.launcher_util import run_experiment import railrl.torch.pytorch_util as ptu from railrl.samplers.data_collector import MdpPathCollector from railrl.samplers.data_collector.step_collector import MdpStepCollector from railrl.torch.networks import FlattenMlp from railrl.torch.sac.policies import TanhGaussianPolicy, MakeDeterministic from railrl.torch.sac.awr_sac import AWRSACTrainer import railrl.misc.hyperparameter as hyp from railrl.torch.torch_rl_algorithm import ( TorchBatchRLAlgorithm, TorchOnlineRLAlgorithm, ) from railrl.launchers.arglauncher import run_variants ENV_PARAMS = { 'half-cheetah': { # 6 DoF 'env_class': HalfCheetahEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 1000, }, 'hopper': { # 6 DoF 'env_class': HopperEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 1000, }, 'humanoid': { # 6 DoF 'env_class': HumanoidEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 3000, }, 'inv-double-pendulum': { # 2 DoF 'env_class': InvertedDoublePendulumEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 100, }, 'pendulum': { # 2 DoF 'env_class': PendulumEnv, 'num_expl_steps_per_train_loop': 200, 'max_path_length': 200, 'num_epochs': 200, 'min_num_steps_before_training': 2000, 'target_update_period': 200, }, 'ant': { # 6 DoF 'env_class': AntEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 3000, }, 'walker': { # 6 DoF 'env_class': Walker2dEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 3000, }, 'swimmer': { # 6 DoF 'env_class': SwimmerEnv, 'num_expl_steps_per_train_loop': 1000, 'max_path_length': 1000, 'num_epochs': 2000, }, } def experiment(variant): env_params = ENV_PARAMS[variant['env']] variant.update(env_params) expl_env = NormalizedBoxEnv(variant['env_class']()) eval_env = NormalizedBoxEnv(variant['env_class']()) obs_dim = expl_env.observation_space.low.size action_dim = eval_env.action_space.low.size M = variant['layer_size'] qf1 = FlattenMlp( input_size=obs_dim + action_dim, output_size=1, hidden_sizes=[M, M], ) qf2 = FlattenMlp( input_size=obs_dim + action_dim, output_size=1, hidden_sizes=[M, M], ) target_qf1 = FlattenMlp( input_size=obs_dim + action_dim, output_size=1, hidden_sizes=[M, M], ) target_qf2 = FlattenMlp( input_size=obs_dim + action_dim, output_size=1, hidden_sizes=[M, M], ) policy = TanhGaussianPolicy( obs_dim=obs_dim, action_dim=action_dim, hidden_sizes=[M, M], ) eval_policy = MakeDeterministic(policy) eval_path_collector = MdpPathCollector( eval_env, eval_policy, ) replay_buffer = EnvReplayBuffer( variant['replay_buffer_size'], expl_env, ) trainer = AWRSACTrainer( env=eval_env, policy=policy, qf1=qf1, qf2=qf2, target_qf1=target_qf1, target_qf2=target_qf2, **variant['trainer_kwargs'] ) if variant['collection_mode'] == 'online': expl_path_collector = MdpStepCollector( expl_env, policy, ) algorithm = TorchOnlineRLAlgorithm( trainer=trainer, exploration_env=expl_env, evaluation_env=eval_env, exploration_data_collector=expl_path_collector, evaluation_data_collector=eval_path_collector, replay_buffer=replay_buffer, max_path_length=variant['max_path_length'], batch_size=variant['batch_size'], num_epochs=variant['num_epochs'], num_eval_steps_per_epoch=variant['num_eval_steps_per_epoch'], num_expl_steps_per_train_loop=variant['num_expl_steps_per_train_loop'], num_trains_per_train_loop=variant['num_trains_per_train_loop'], min_num_steps_before_training=variant['min_num_steps_before_training'], ) else: expl_path_collector = MdpPathCollector( expl_env, policy, ) algorithm = TorchBatchRLAlgorithm( trainer=trainer, exploration_env=expl_env, evaluation_env=eval_env, exploration_data_collector=expl_path_collector, evaluation_data_collector=eval_path_collector, replay_buffer=replay_buffer, max_path_length=variant['max_path_length'], batch_size=variant['batch_size'], num_epochs=variant['num_epochs'], num_eval_steps_per_epoch=variant['num_eval_steps_per_epoch'], num_expl_steps_per_train_loop=variant['num_expl_steps_per_train_loop'], num_trains_per_train_loop=variant['num_trains_per_train_loop'], min_num_steps_before_training=variant['min_num_steps_before_training'], ) algorithm.to(ptu.device) algorithm.train() if __name__ == "__main__": variant = dict( num_epochs=3000, num_eval_steps_per_epoch=5000, num_trains_per_train_loop=1000, num_expl_steps_per_train_loop=1000, min_num_steps_before_training=1000, max_path_length=1000, batch_size=256, replay_buffer_size=int(1E6), layer_size=256, algorithm="SAC", version="normal", collection_mode='batch', trainer_kwargs=dict( discount=0.99, soft_target_tau=5e-3, target_update_period=1, policy_lr=3E-4, qf_lr=3E-4, reward_scale=1, beta=1, use_automatic_entropy_tuning=True, ), num_exps_per_instance=1, region='us-west-1', ) search_space = { 'env': [ 'half-cheetah', 'inv-double-pendulum', 'pendulum', 'ant', 'walker', 'hopper', 'humanoid', 'swimmer', ], 'seedid': range(1), 'trainer_kwargs.beta': [10, 100, ], } sweeper = hyp.DeterministicHyperparameterSweeper( search_space, default_parameters=variant, ) variants = [] for variant in sweeper.iterate_hyperparameters(): variants.append(variant) run_variants(experiment, variants, run_id=0)
const { expect } = require('chai'); const { bsv, buildContractClass, signTx, toHex, getPreimage, num2bin, PubKey, SigHashPreimage, Sig } = require('scryptlib'); const { inputIndex, inputSatoshis, compileContract, DataLen, dummyTxId } = require('../../helper'); const outputAmount = 22222 describe('Test sCrypt contract Non-Fungible Token In Javascript', () => { let token, lockingScriptCodePart const privateKey1 = new bsv.PrivateKey.fromRandom('testnet') const publicKey1 = bsv.PublicKey.fromPrivateKey(privateKey1) const privateKey2 = new bsv.PrivateKey.fromRandom('testnet') const publicKey2 = bsv.PublicKey.fromPrivateKey(privateKey2) const currTokenId = 42 const issuer = publicKey1 const sender = publicKey1 const actionIssue = '00' const actionTransfer = '01' before(() => { const Token = buildContractClass(compileContract('nonFungibleToken.scrypt')) token = new Token() // code part lockingScriptCodePart = token.codePart.toASM() }); it('should succeed when one new token is issued', () => { token.setDataPart(num2bin(currTokenId, DataLen) + toHex(issuer) + actionIssue) const testIssue = (privKey, receiver, newIssuer = issuer, nextTokenId = currTokenId + 1, issuedTokenId = currTokenId) => { const tx = new bsv.Transaction() tx.addInput(new bsv.Transaction.Input({ prevTxId: dummyTxId, outputIndex: 0, script: '' }), bsv.Script.fromASM(token.lockingScript.toASM()), inputSatoshis) const newLockingScript0 = [lockingScriptCodePart, num2bin(nextTokenId, DataLen) + toHex(newIssuer) + actionIssue].join(' ') tx.addOutput(new bsv.Transaction.Output({ script: bsv.Script.fromASM(newLockingScript0), satoshis: outputAmount })) const newLockingScript1 = [lockingScriptCodePart, num2bin(issuedTokenId, DataLen) + toHex(receiver) + actionTransfer].join(' ') tx.addOutput(new bsv.Transaction.Output({ script: bsv.Script.fromASM(newLockingScript1), satoshis: outputAmount })) token.txContext = { tx, inputIndex, inputSatoshis } const preimage = getPreimage(tx, token.lockingScript, inputSatoshis, inputIndex) const sig = signTx(tx, privKey, token.lockingScript, inputSatoshis) return token.issue( new Sig(toHex(sig)), new PubKey(toHex(receiver)), outputAmount, outputAmount, new SigHashPreimage(toHex(preimage)) ) } result = testIssue(privateKey1, publicKey2, publicKey1, currTokenId + 1, currTokenId).verify() expect(result.success, result.error).to.be.true // issuer must not change result = testIssue(privateKey1, publicKey2, publicKey2, currTokenId + 1, currTokenId).verify() expect(result.success, result.error).to.be.false // unauthorized key result = testIssue(privateKey2, publicKey2, publicKey1, currTokenId + 1, currTokenId).verify() expect(result.success, result.error).to.be.false // mismatched next token ID result = testIssue(privateKey1, publicKey2, publicKey1, currTokenId + 2, currTokenId).verify() expect(result.success, result.error).to.be.false // mismatched issued token ID result = testIssue(privateKey1, publicKey2, publicKey1, currTokenId + 1, currTokenId - 1).verify() expect(result.success, result.error).to.be.false }); it('should succeed when a token is transferred', () => { token.setDataPart(num2bin(currTokenId, DataLen) + toHex(sender) + actionTransfer) const testTransfer = (privKey, receiver, receivedTokenId = currTokenId) => { const tx = new bsv.Transaction() tx.addInput(new bsv.Transaction.Input({ prevTxId: dummyTxId, outputIndex: 0, script: '' }), bsv.Script.fromASM(token.lockingScript.toASM()), inputSatoshis) const newLockingScript0 = [lockingScriptCodePart, num2bin(receivedTokenId, DataLen) + toHex(receiver) + actionTransfer].join(' ') tx.addOutput(new bsv.Transaction.Output({ script: bsv.Script.fromASM(newLockingScript0), satoshis: outputAmount })) token.txContext = { tx, inputIndex, inputSatoshis } const preimage = getPreimage(tx, token.lockingScript, inputSatoshis, inputIndex) const sig = signTx(tx, privKey, token.lockingScript, inputSatoshis) return token.transfer( new Sig(toHex(sig)), new PubKey(toHex(receiver)), outputAmount, new SigHashPreimage(toHex(preimage)) ) } result = testTransfer(privateKey1, publicKey2, currTokenId).verify() expect(result.success, result.error).to.be.true // unauthorized key result = testTransfer(privateKey2, publicKey2, currTokenId).verify() expect(result.success, result.error).to.be.false // token ID must not change result = testTransfer(privateKey1, publicKey2, currTokenId + 2).verify() expect(result.success, result.error).to.be.false }); it('should fail when receiver pretending to be the issuer', () => { token.setDataPart(num2bin(currTokenId, DataLen) + toHex(sender) + actionTransfer) const testIssue = (privKey, receiver, newIssuer = issuer, nextTokenId = currTokenId + 1, issuedTokenId = currTokenId) => { const tx = new bsv.Transaction() tx.addInput(new bsv.Transaction.Input({ prevTxId: dummyTxId, outputIndex: 0, script: '' }), bsv.Script.fromASM(token.lockingScript.toASM()), inputSatoshis) const newLockingScript0 = [lockingScriptCodePart, num2bin(nextTokenId, DataLen) + toHex(newIssuer) + actionIssue].join(' ') tx.addOutput(new bsv.Transaction.Output({ script: bsv.Script.fromASM(newLockingScript0), satoshis: outputAmount })) // set token receiver to be issuer const newLockingScript1 = [lockingScriptCodePart, num2bin(issuedTokenId, DataLen) + toHex(receiver) + actionTransfer].join(' ') tx.addOutput(new bsv.Transaction.Output({ script: bsv.Script.fromASM(newLockingScript1), satoshis: outputAmount })) token.txContext = { tx, inputIndex, inputSatoshis } const preimage = getPreimage(tx, token.lockingScript, inputSatoshis, inputIndex) const sig = signTx(tx, privKey, token.lockingScript, inputSatoshis) return token.issue( new Sig(toHex(sig)), new PubKey(toHex(receiver)), outputAmount, outputAmount, new SigHashPreimage(toHex(preimage)) ) } result = testIssue(privateKey1, publicKey2, publicKey1, currTokenId + 1, currTokenId).verify() expect(result.success, result.error).to.be.false }) });