code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
{{-- localized datetime using carbon --}} @php $value = data_get($entry, $column['name']); @endphp <span data-order="{{ $value }}"> @if (!empty($value)) {{ \Carbon\Carbon::parse($value) ->locale(App::getLocale()) ->isoFormat($column['format'] ?? config('backpack.base.default_datetime_format')) }} @endif </span>
lejubila/piGardenWeb
vendor/backpack/crud/src/resources/views/columns/datetime.blade.php
PHP
gpl-3.0
333
package com.supermap.desktop.Interface; public interface IBaseItem { /** * 获取或设置控件对象是否可用。 */ boolean isEnabled(); void setEnabled(boolean enabled); /** * 获取或设置控件是否可见。 */ boolean isVisible(); void setVisible(boolean visible); /** * 获取或设置控件是否选中。 */ boolean isChecked(); void setChecked(boolean checked); /** * 获取或设置控件的索引值,控件的索引值用来对处于同一层次内的 Ribbon 控件进行位置的排列。 */ int getIndex(); void setIndex(int index); /** * 获取控件的唯一标识名称。 */ String getID(); /** * 获取或设置触发控件事件时所要运行的内容。 */ ICtrlAction getCtrlAction(); void setCtrlAction(ICtrlAction ctrlAction); String getText(); }
SuperMap-iDesktop/SuperMap-iDesktop-Cross
Core/src/main/java/com/supermap/desktop/Interface/IBaseItem.java
Java
gpl-3.0
835
using IntWarsSharp.Core.Logic.PacketHandlers; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using IntWarsSharp; using System.IO; namespace SnifferApp.net.Packets { public class Packets { private readonly byte[] bytes; internal BinaryReader reader; internal List<Tuple<string, string, object>> data = new List<Tuple<string, string, object>>(); public Packets(byte[] bytes) { reader = new BinaryReader(new MemoryStream(bytes)); this.bytes = bytes; } internal byte readByte(string name) { byte b = 0; try { b = reader.ReadByte(); } catch { } data.Add(new Tuple<string, string, object>("b", name, b)); return b; } internal short readShort(string name) { short s = 0; try { s = reader.ReadInt16(); } catch { } data.Add(new Tuple<string, string, object>("s", name, s)); return s; } internal int readInt(string name) { int i = 0; try { reader.ReadInt32(); } catch { } data.Add(new Tuple<string, string, object>("d", name, i)); return i; } internal uint readUInt(string name) { uint ui = 0; try { ui = reader.ReadUInt32(); } catch { } data.Add(new Tuple<string, string, object>("d+", name, ui)); return ui; } internal long readLong(string name) { long l = 0; try { l = reader.ReadInt64(); } catch { } data.Add(new Tuple<string, string, object>("l", name, l)); return l; } internal float readFloat(string name) { var f = float.NaN; try { f = reader.ReadSingle(); } catch { } data.Add(new Tuple<string, string, object>("f", name, f)); return f; } internal byte[] readFill(int len, string name) { byte[] arr = new byte[len]; try { arr = reader.ReadBytes(len); } catch { } data.Add(new Tuple<string, string, object>("fill", name, arr)); return arr; } internal string readString(int len, string name) { var buff = new List<byte>(len); try { for (var i = 0; i < len; i++) buff.Add(reader.ReadByte()); } catch { } var s = Encoding.Default.GetString(buff.ToArray()); data.Add(new Tuple<string, string, object>("str", name, s)); return s; } internal string readZeroTerminatedString(string name) { var buff = new List<byte>(); try { byte b = 0; do { b = reader.ReadByte(); buff.Add(b); } while (b != 0); } catch { } var s = Encoding.Default.GetString(buff.ToArray()); data.Add(new Tuple<string, string, object>("str", name, s)); return s; } internal void close() { if (reader.BaseStream.Position < reader.BaseStream.Length) readFill((int)(reader.BaseStream.Length - reader.BaseStream.Position), "unk(Not defined)"); reader.Close(); } internal int getBufferLength() { return (int)reader.BaseStream.Length; } //lol internal bool isEnterVisionPacket() { if (bytes[0] != (byte)PacketCmdS2C.PKT_S2C_ObjectSpawn) return false; bool isEnterVision = true; for (var i = 5; i < 18; i++) if (bytes[i] != 0) isEnterVision = false; isEnterVision = isEnterVision && BitConverter.ToSingle(bytes.Skip(18).Take(4).ToArray(), 0) == 1.0f; for (var i = 22; i < 35; i++) if (bytes[i] != 0) isEnterVision = false; return isEnterVision; } internal bool isHeroSpawn() { if (bytes[0] != (byte)PacketCmdS2C.PKT_S2C_HeroSpawn) return false; bool isHeroSpawn = true; for (int i = 5; i < 20; i++) if (bytes[i] != 0) isHeroSpawn = false; isHeroSpawn = isHeroSpawn && bytes[20] == 0x80; isHeroSpawn = isHeroSpawn && bytes[21] == 0x3F; for (int i = 22; i < 35; i++) if (bytes[i] != 0) isHeroSpawn = false; return isHeroSpawn; } internal bool isTeleport() { if (bytes[0] != (byte)PacketCmdS2C.PKT_S2C_MoveAns) return false; return bytes[9] == 0x01 && bytes[10] == 0x00; } } public class PKT_C2S_ClientReady : Packets { public PKT_C2S_ClientReady(byte[] data) : base(data) { readByte("cmd"); readInt("playerId"); readInt("teamId"); close(); } } public class PKT_S2C_SynchVersion : Packets { public PKT_S2C_SynchVersion(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("unk(9)"); readInt("mapId"); for (var i = 0; i < 12; i++) { readLong("userId"); readShort("unk(0x1E)"); readInt("summonerSpell1"); readInt("summonerSpell2"); readByte("isBot"); readInt("teamId"); readFill(64, "formerName"); readFill(64, "none"); readString(24, "rank"); readInt("icon"); readShort("ribbon"); } readString(256, "version"); readString(128, "gameMode"); readString(3, "serverLocale"); readFill(2333, "unk"); readInt("gameFeatures"); // gameFeatures (turret range indicators, etc.) readFill(256, "unk"); readInt("unk"); readFill(19, "unk(1)"); close(); } } public class PKT_S2C_Ping_Load_Info : Packets { public PacketCmdS2C cmd; public int netId; public int unk1; public long userId; public float loaded; public float ping; public short unk2; public short unk3; public byte unk4; public PKT_S2C_Ping_Load_Info(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readInt("unk"); readLong("userId"); readFloat("loaded"); readFloat("ping"); readShort("unk"); readShort("unk"); readByte("unk"); close(); } } public class PKT_C2S_Ping_Load_Info : PKT_S2C_Ping_Load_Info { public PKT_C2S_Ping_Load_Info(byte[] data) : base(data) { } } public class PKT_S2C_LoadScreenInfo : Packets { public PKT_S2C_LoadScreenInfo(byte[] bytes) : base(bytes) { readByte("cmd"); //Zero this complete buffer readInt("blueMax"); readInt("blueMax"); for (var i = 0; i < 6; i++) readLong("userId"); readFill(144, "unk"); for (int i = 0; i < 6; i++) readLong("userId"); readFill(144, "unk"); readInt("currentBlue"); readInt("currentPurple"); close(); } } public class PKT_S2C_KeyCheck : Packets { public PKT_S2C_KeyCheck(byte[] data) : base(data) { readByte("cmd"); readByte("unk(0x2A?)"); readByte("unk"); readByte("unk(0xFF?)"); readInt("playerNo"); readLong("userId"); readInt("unk(0)"); readLong("unk(0)"); readInt("unk(0)"); close(); } } public class PKT_C2S_KeyCheck : PKT_S2C_KeyCheck { public PKT_C2S_KeyCheck(byte[] data) : base(data) { } } public class PKT_C2S_LockCamera : Packets { public PKT_C2S_LockCamera(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readByte("isLock"); readInt("padding"); close(); } } /*typedef struct _ViewReq { byte cmd; int unk1; float x; float zoom; float y; float y2; //Unk int width; //Unk int height; //Unk int unk2; //Unk byte requestNo; } ViewReq;*/ public class PKT_C2S_ViewReq : Packets { public PKT_C2S_ViewReq(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readFloat("x"); readFloat("zoom"); readFloat("y"); readFloat("y2"); readInt("width"); readInt("height"); readInt("unk"); readByte("requestNo"); close(); } } public class PKT_S2C_ObjectSpawn : Packets //Minion Spawn { public PKT_S2C_ObjectSpawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); if (getBufferLength() == 8) //MinionSpawn2 { readUInt("netId"); readFill(3, "unk"); close(); return; } if (isHeroSpawn()) //HeroSpawn2 { readFill(15, "unk"); readByte("unk(0x80)"); readByte("unk(0x3F)"); readFill(13, "unk"); readByte("unk(3)"); readInt("unk(1)"); readFloat("x"); readFloat("y"); readFloat("z?"); readFloat("rotation?"); close(); return; } if (isEnterVisionPacket()) { readFill(13, "unk"); readFloat("unk(1)"); readFill(13, "unk"); readByte("unk(0x02)"); readInt("tickCount"); var coordsCount = readByte("coordCount"); readInt("netId"); readByte("movementMask(0)"); for (int i = 0; i < coordsCount / 2; i++) { readShort("x"); readShort("y"); } close(); return; } readInt("unk"); // unk readByte("spawnType(3)"); // SpawnType - 3 = minion readInt("netId"); readInt("netId"); readInt("spawnPos"); readByte("unk(255)"); readByte("unk(1)"); readByte("type"); readByte("minionType(0=melee)"); readByte("unk"); readInt("minionSpawnType"); readInt("unk"); readInt("unk"); readShort("unk"); readFloat("unk(1)"); readInt("unk"); readInt("unk"); readInt("unk"); readShort("unk(512)"); readInt("tickCount"); var count = readByte("coordCount"); readInt("netId"); readByte("movementMask(0)"); for (int i = 0; i < count / 2; i++) { readShort("x"); readShort("y"); } close(); } } class PKT_S2C_SpellAnimation : Packets { public PKT_S2C_SpellAnimation(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("unk(5)"); readInt("unk"); readInt("unk"); readFloat("unk(1)"); readZeroTerminatedString("animationName"); close(); } } class PKT_S2C_SetAnimation : Packets { public PKT_S2C_SetAnimation(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); var count = readByte("animationPairsCount"); for (int i = 0; i < count; i++) { var strLen = readInt("animationPair1Length"); readString(strLen, "animationPair1"); strLen = readInt("animationPair2Length"); readString(strLen, "animationPair2"); } close(); } } public class PKT_S2C_FaceDirection : Packets { public PKT_S2C_FaceDirection(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("relativeX"); readFloat("relativeZ"); readFloat("relativeY"); readByte("unk"); readFloat("unk(0.0833)"); close(); } }; public class PKT_S2C_Dash : Packets { public PKT_S2C_Dash(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("tickCount"); readShort("numUpdates?(1)"); readByte("unk(5)"); readInt("netId"); readByte("unk(0)"); readFloat("dashSpeed"); readInt("unk"); readFloat("x"); readFloat("y"); readInt("unk(0)"); readByte("unk(0)"); readInt("unk"); readUInt("unk"); readInt("unk"); readByte("vectorBitmask"); // Vector bitmask on whether they're int16 or byte readShort("fromX"); readShort("fromY"); readShort("toX"); readShort("toY"); close(); } } public class PKT_S2C_LeaveVision : Packets { public PKT_S2C_LeaveVision(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); close(); } } public class PKT_S2C_DeleteObject : Packets { public PKT_S2C_DeleteObject(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); close(); } } public class AddGold : Packets { public AddGold(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("killerNetId"); readInt("killedNetId"); readFloat("gold"); close(); } } public class PKT_C2S_MoveReq : Packets { public PKT_C2S_MoveReq(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readByte("moveType"); readFloat("x"); readFloat("y"); readInt("targetNetId"); readByte("coordsCount"); readInt("netId"); readFill((int)(reader.BaseStream.Length - reader.BaseStream.Position), "moveData"); close(); } } public class PKT_S2C_MoveAns : Packets { public PKT_S2C_MoveAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("tickCount"); readShort("updatesCount"); //count int coordsCount = readByte("coordsCount"); if (isTeleport()) { readByte("teleportId?"); readInt("netId"); if ((reader.BaseStream.Length - reader.BaseStream.Position) > 4) { readByte("unk(1)"); } readShort("x"); readShort("y"); close(); return; } readInt("actorNetId"); for (var i = 0; i < (coordsCount + 5) / 8; i++) readByte("coordsMask"); for (int i = 0; i < coordsCount / 2; i++) { readShort("coord" + i + "x"); readShort("coord" + i + "y"); } close(); } } public class PKT_S2C_ViewAns : Packets { public PKT_S2C_ViewAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("requestNo"); close(); } } public class PKT_S2C_QueryStatusAns : Packets { public PKT_S2C_QueryStatusAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("status(1=ok)"); close(); } } public class PKT_C2S_QueryStatusReq : Packets { public PKT_C2S_QueryStatusReq(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); close(); } } public class PKT_C2S_SynchVersion : Packets { public PacketCmdS2C cmd; public int netId; public int unk1; private byte[] _version = new byte[256]; // version string might be shorter? public PKT_C2S_SynchVersion(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readInt("unk"); readString(256, "versionString"); close(); } } public class PKT_S2C_World_SendGameNumber : Packets { public PKT_S2C_World_SendGameNumber(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readLong("gameId"); readString(128, "clientName"); close(); } } //app crash inc public class PKT_C2S_StatsConfirm : Packets { public PKT_C2S_StatsConfirm(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("tickCount"); readByte("updateNo"); readByte("masterMask"); readInt("netId"); var mask = readInt("mask"); var size = readByte("size"); for (int i = 0; i < size; i++) { if (mask == 0) readShort("value"); else readByte("value"); } close(); } } public class PKT_C2S_ChatBoxMessage : Packets { public PKT_C2S_ChatBoxMessage(byte[] data) : base(data) { var reader = new BinaryReader(new MemoryStream(data)); readByte("cmd"); readInt("playerNetId"); readInt("botNetId"); readByte("idBotMsg"); readInt("msgType"); readInt("unk"); var len = readInt("msgLen"); readFill(32, "unk"); readString(len, "msg"); close(); } } public class PKT_S2C_UpdateModel : Packets { public PKT_S2C_UpdateModel(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("netId"); readByte("bOk"); readInt("unk(-1)"); readString(32, "modelName"); close(); } } public class PKT_S2C_EndSpawn : Packets { public PKT_S2C_EndSpawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); close(); } } public class PKT_S2C_StartGame : PKT_S2C_EndSpawn { public PKT_S2C_StartGame(byte[] bytes) : base(bytes) { } } public class PKT_S2C_StartSpawn : Packets { public PKT_S2C_StartSpawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readShort("unk"); close(); } } /* public class FogUpdate2 { PacketHeader header; float x; float y; int radius; short unk1; public FogUpdate2() { header = new PacketHeader(); header.cmd = PacketCmdS2C.PKT_S2C_FogUpdate2; header.netId = 0x40000019; } }*/ public class Click : Packets { public Click(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readInt("zero"); readInt("targetNetId"); close(); } } public class PKT_S2C_HeroSpawn : Packets { public PKT_S2C_HeroSpawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("playerNetId"); readInt("playerId"); readByte("netNodeID?(40)"); readByte("botSkillLevel"); readByte("teamId"); readByte("isBot"); readByte("spawnPosIndex"); readInt("skinNo"); readString(128, "playerName"); readString(40, "championType"); readFloat("deathDurationRemaining"); readFloat("timeSinceDeath"); readInt("unk"); readByte("bitField"); close(); } } public class PKT_S2C_TurretSpawn : Packets { public PKT_S2C_TurretSpawn(byte[] b) : base(b) { readByte("cmd"); readInt("netId"); readInt("netId"); readString(64, "name"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); close(); } } public class PKT_S2C_GameTimer : Packets { public PKT_S2C_GameTimer(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("time"); close(); } } public class PKT_S2C_GameTimerUpdate : Packets { public PKT_S2C_GameTimerUpdate(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("time"); } } public class PKT_C2S_HeartBeat : Packets { public PKT_C2S_HeartBeat(byte[] data) : base(data) { readByte("cmd"); readInt("netId"); readFloat("receiveTime"); readFloat("ackTime"); close(); } } /* public class SpellSet { public PacketHeader header; public int spellID; public int level; public SpellSet(int netID, int _spellID, int _level) { header = new PacketHeader(); header.cmd = (PacketCmdS2C)0x5A; header.netId = netID; spellID = _spellID; level = _level; } }*/ public class PKT_C2S_SkillUp : Packets { public PacketCmdC2S cmd; public int netId; public byte skill; public PKT_C2S_SkillUp(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("skillId"); close(); } } public class PKT_S2C_SkillUp : Packets { public PKT_S2C_SkillUp(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("skill"); readByte("level"); readByte("pointsLeft"); close(); } } public class PKT_C2S_BuyItemReq : Packets { public PKT_C2S_BuyItemReq(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("id"); close(); } } public class PKT_S2C_BuyItemAns : Packets { public PKT_S2C_BuyItemAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("itemId"); readByte("itemSlot"); readByte("itemStack"); readByte("unk"); readByte("unk"); close(); } } public class PKT_C2S_SellItem : Packets { public PKT_C2S_SellItem(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("slot"); close(); } } public class PKT_S2C_RemoveItem : Packets { public PKT_S2C_RemoveItem(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("slot"); readByte("remaining"); } } public class PKT_C2S_Emotion : Packets { public PKT_C2S_Emotion(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("id"); close(); } } public class PKT_S2C_Emotion : PKT_C2S_Emotion { public PKT_S2C_Emotion(byte[] bytes) : base(bytes) { } } public class PKT_C2S_SwapItems : Packets { public PKT_C2S_SwapItems(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("slotFrom"); readByte("slotTo"); close(); } } public class PKT_S2C_SwapItems : PKT_C2S_SwapItems { public PKT_S2C_SwapItems(byte[] bytes) : base(bytes) { } } class PKT_S2C_Announce : Packets { public PKT_S2C_Announce(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("msgId"); readLong("unk"); if (reader.BaseStream.Position < reader.BaseStream.Length) readInt("mapId"); close(); } } public class PKT_S2C_AddBuff : Packets { public PKT_S2C_AddBuff(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("targetNetId"); readShort("unk"); readShort("unk"); readShort("stacks"); readShort("unk"); readInt("buffHash"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readShort("unk"); readInt("sourceNetId"); close(); } } public class PKT_S2C_RemoveBuff : Packets { public PKT_S2C_RemoveBuff(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readShort("unk"); readInt("buffHash"); readInt("unk"); close(); } } public class PKT_S2C_DamageDone : Packets { public PKT_S2C_DamageDone(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readShort("type"); readShort("unk"); readFloat("dmgDone"); readInt("targetNetId"); readInt("sourceNetId"); close(); } } public class EPKT_S2C_NPC_Die : Packets { public EPKT_S2C_NPC_Die(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("killedNetId"); readByte("ecmd"); readByte("unk"); readInt("unk"); readShort("unk"); readInt("killerNetId"); readShort("unk"); readShort("unk"); readShort("unk"); close(); } } public class PKT_S2C_LoadName : Packets { public PKT_S2C_LoadName(byte[] bytes) : base(bytes) { readByte("cmd"); readLong("userId"); readInt("unk(0)"); readInt("strLen"); readZeroTerminatedString("name"); close(); } } public class PKT_S2C_LoadHero : Packets { public PKT_S2C_LoadHero(byte[] bytes) : base(bytes) { readByte("cmd"); readLong("userId"); readInt("skinNo"); readInt("strLen"); readZeroTerminatedString("name"); close(); } } public class PKT_C2S_AttentionPing : Packets { public PKT_C2S_AttentionPing(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("unk"); readFloat("x"); readFloat("y"); readInt("targetNetId"); readByte("pingType"); close(); } } public class PKT_S2C_AttentionPing : Packets { public PKT_S2C_AttentionPing(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("x"); readFloat("y"); readInt("targetNetId"); readInt("championNetId"); readByte("pingType"); readByte("unk"); close(); } } public class PKT_S2C_BeginAutoAttack : Packets { public PKT_S2C_BeginAutoAttack(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("attackerNetId"); readInt("attackedNetId"); readByte("unk"); readInt("futureProjNetId"); readByte("isCritical(0x49=true"); readByte("unk"); readByte("unk"); readShort("attackedX"); readByte("unk"); readByte("unk"); readShort("attackedY"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readFloat("attackerX"); readFloat("attackerY"); close(); } } public class PKT_S2C_NextAutoAttack : Packets { public PKT_S2C_NextAutoAttack(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("attackedNetID"); readByte("isInitial(0x80=1)"); readInt("futureProjNetId"); readByte("isCritical(0x49=1)"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); close(); } } public class PKT_S2C_StopAutoAttack : Packets { public PKT_S2C_StopAutoAttack(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("unk"); readByte("unk"); close(); } } public class EPKT_S2C_OnAttack : Packets { public EPKT_S2C_OnAttack(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("ecmd"); readByte("unk"); readByte("attackType"); readFloat("x"); readFloat("z"); readFloat("y"); readInt("attackerNetId"); close(); } } public class PKT_S2C_SetTarget : Packets { public PKT_S2C_SetTarget(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("attackerNetId"); readInt("atackedNetId"); close(); } } public class PKT_S2C_SetTarget2 : PKT_S2C_SetTarget { public PKT_S2C_SetTarget2(byte[] bytes) : base(bytes) { } } public class PKT_S2C_ChampionDie : Packets { public PKT_S2C_ChampionDie(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("killedNetId"); readInt("goldFromKill"); readByte("unk"); readInt("killerNetId"); readByte("unk"); readByte("unk"); readFloat("respawnTimer"); close(); } } public class EPKT_S2C_ChampionDeathTimer : Packets { public EPKT_S2C_ChampionDeathTimer(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("ecmd"); readByte("unk"); readFloat("respawnTimer"); close(); } } public class PKT_S2C_ChampionRespawn : Packets { public PKT_S2C_ChampionRespawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("x"); readFloat("y"); readFloat("z"); close(); } } public class PKT_S2C_ShowProjectile : Packets { public PKT_S2C_ShowProjectile(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("ownerNetId"); readInt("projectileNetId"); close(); } } public class PKT_S2C_SetHealth : Packets { public PKT_S2C_SetHealth(byte[] bytes) : base(bytes) { readByte("cmd"); readUInt("netId/itemHash"); readShort("unk"); if (reader.BaseStream.Position < reader.BaseStream.Length) { readFloat("maxHP"); readFloat("currentHp"); } close(); } } public class PKT_C2S_CastSpell : Packets { public PKT_C2S_CastSpell(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("spellSlotType"); readByte("spellSlot"); readFloat("x"); readFloat("y"); readFloat("x2"); readFloat("y2"); readInt("targetNetId"); close(); } } public class PKT_S2C_CastSpellAns : Packets { public PKT_S2C_CastSpellAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("tickCount"); readByte("unk"); readByte("unk"); readByte("unk"); readInt("spellHash"); readInt("spellNetId"); readByte("unk"); readFloat("unk"); readInt("ownerNetId"); readInt("ownerNetId"); readInt("ownerChampionHash"); readInt("futureProjectileNetId"); readFloat("x"); readFloat("z"); readFloat("y"); readFloat("x"); readFloat("z"); readFloat("y"); readByte("unk"); readFloat("castTime"); readFloat("unk"); readFloat("unk"); readFloat("cooldown"); readFloat("unk"); readByte("unk"); readByte("spellSlot"); readFloat("manacost"); readFloat("ownerX"); readFloat("ownerZ"); readFloat("ownerY"); readLong("unk"); close(); } } public class PKT_S2C_PlayerInfo : Packets { public PKT_S2C_PlayerInfo(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); #region wtf readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readInt("summonerSpell1"); readInt("summonerSpell2"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readByte("unk"); #endregion close(); } } public class PKT_S2C_SpawnProjectile : Packets { public PKT_S2C_SpawnProjectile(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("x"); readFloat("z"); readFloat("y"); readFloat("x"); readFloat("z"); readFloat("y"); readLong("unk"); readFloat("unk"); readFloat("targetX"); readFloat("targetZ"); readFloat("targetY"); readFloat("targetX"); readFloat("targetZ"); readFloat("targetY"); readFloat("targetX"); readFloat("targetZ"); readFloat("targetY"); readFloat("x"); readFloat("z"); readFloat("y"); readInt("unk"); readFloat("projectileMoveSpeed"); readLong("unk"); readInt("unk"); readByte("unk"); readByte("unk"); readByte("unk"); readInt("projectileId"); readInt("unk"); readByte("unk"); readFloat("unk"); readInt("ownerNetId"); readInt("ownerNetId"); readInt("championHash"); readInt("projectileNetId"); readFloat("targetX"); readFloat("targetZ"); readFloat("targetY"); readFloat("targetX"); readFloat("targetZ"); readFloat("targetY"); readUInt("unk"); readInt("unk"); readUInt("unk"); readInt("unk"); readInt("unk"); readShort("unk"); readByte("unk"); readInt("unk"); readFloat("x"); readFloat("z"); readFloat("y"); readLong("unk"); close(); } } public class PKT_S2C_SpawnParticle : Packets { public PKT_S2C_SpawnParticle(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("ownerNetId"); readShort("numberOfParticles"); readInt("championHash"); readInt("particleHash"); readInt("unk"); readInt("unk"); readShort("unk"); readShort("numberOfTargets?"); readInt("ownerNetId"); readInt("particleNetId"); readInt("ownerNetId"); readInt("netId"); readInt("unk"); for (var i = 0; i < 3; ++i) { readShort("width"); readFloat("unk"); readShort("height"); } readInt("unk"); readInt("unk"); readInt("unk"); readInt("unk"); readFloat("unk"); close(); } public class PKT_S2C_DestroyProjectile : Packets { public PKT_S2C_DestroyProjectile(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); } } /* public class PKT_S2C_CharStats : Packets { public PKT_S2C_CharStats(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("tickCount"); readByte("numUpdates"); readByte("masterMask"); readInt("netId"); foreach (var m in masks) { int mask = 0; byte size = 0; var updatedStats = stats[m]; updatedStats.Sort(); foreach (var it in updatedStats) { size += u.getStats().getSize(m, it); mask |= it; } //if (updatedStats.Contains((int)FieldMask.FM1_SummonerSpells_Enabled)) // System.Diagnostics.Debugger.Break(); buffer.Write((int)mask); buffer.Write((byte)size); for (int i = 0; i < 32; i++) { int tmpMask = (1 << i); if ((tmpMask & mask) > 0) { if (u.getStats().getSize(m, tmpMask) == 4) { float f = u.getStats().getStat(m, tmpMask); var c = BitConverter.GetBytes(f); if (c[0] >= 0xFE) { c[0] = (byte)0xFD; } buffer.Write(BitConverter.ToSingle(c, 0)); } else if (u.getStats().getSize(m, tmpMask) == 2) { short stat = (short)Math.Floor(u.getStats().getStat(m, tmpMask) + 0.5); buffer.Write(stat); } else { byte stat = (byte)Math.Floor(u.getStats().getStat(m, tmpMask) + 0.5); buffer.Write(stat); } } } } } } */ public class PKT_S2C_LevelPropSpawn : Packets { public PKT_S2C_LevelPropSpawn(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("levelPropNetId"); readInt("unk"); readByte("unk"); readFloat("x"); readFloat("z"); readFloat("y"); readFloat("rotationZ"); readFloat("directionX"); readFloat("directionZ"); readFloat("directionY"); readFloat("unk"); readFloat("unk"); readFloat("unk"); readFloat("unk"); readFloat("unk"); readInt("unk"); readInt("propType");// nPropType [size 1 . 4] (4.18) -- if is a prop, become unselectable and use direction params readString(64, "levelPropName"); readString(64, "levelPropType"); close(); } } public class PKT_C2S_ViewReq : Packets { public PKT_C2S_ViewReq(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readFloat("x"); readFloat("zoom"); readFloat("y"); readFloat("y2"); readInt("width"); readInt("height"); readInt("unk"); readByte("requestNo"); close(); } } public class PKT_S2C_LevelUp : Packets { public PKT_S2C_LevelUp(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("level"); readShort("skillPoints"); close(); } } public class PKT_S2C_ViewAns : Packets { public PKT_S2C_ViewAns(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("requestNo"); close(); } } public class PKT_S2C_DebugMessage : Packets { public PKT_S2C_DebugMessage(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readInt("unk"); readString(512, "message"); close(); } } public class SetCooldown : Packets { public SetCooldown(byte[] bytes) : base(bytes) { readByte("cmd"); readInt("netId"); readByte("slotId"); readShort("unk"); readFloat("totalCd"); readFloat("currentCd"); close(); } } } }
horato/IntWarsSharp
Sniffer/Logic/net/Packets.cs
C#
gpl-3.0
60,336
package es.vcarmen.chatapp; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
Carets12/2DAM
DSINTERFAZ/Actividades/ChatApp/app/src/test/java/es/vcarmen/chatapp/ExampleUnitTest.java
Java
gpl-3.0
396
package com.trade12.Archangel.NEI; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.trade12.Archangel.lib.Log; /** * Created by Kieran on 25/08/2014. */ public class NEIConfiguration implements IConfigureNEI { @Override public void loadConfig() { API.registerRecipeHandler(new NEICraftingRuneRecipeHandler()); API.registerRecipeHandler(new InfoHandler()); API.registerUsageHandler(new InfoHandler()); Log.info("*********************Loaded NEI Support for Archangel***********************"); } @Override public String getName() { return "Archange; NEI"; } @Override public String getVersion() { return "1.0-Banana"; } }
trade12/ToBeNamed
src/main/java/com/trade12/Archangel/NEI/NEIConfiguration.java
Java
gpl-3.0
758
package com.navid.trafalgar.mod.windtunnel.model; import com.jme3.asset.AssetManager; /** * * @author alberto */ public final class HarnessModel extends AHarnessModel { public HarnessModel(AssetManager assetManager) { super(assetManager); } @Override protected void initGeometry(AssetManager assetManager) { } public boolean isEnabled() { return true; } public void setEnabled(boolean value) { //todo } }
albertonavarro/cabotrafalgar
modWindTunnel/src/main/java/com/navid/trafalgar/mod/windtunnel/model/HarnessModel.java
Java
gpl-3.0
475
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.269 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ECCentral.Portal.UI.IM.Resources { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class ResCategoryPropertyBatEdit { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public ResCategoryPropertyBatEdit() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ECCentral.Portal.UI.IM.Resources.ResCategoryPropertyBatEdit", typeof(ResCategoryPropertyBatEdit).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to 组名. /// </summary> public static string Grid_GroupDescription { get { return ResourceManager.GetString("Grid_GroupDescription", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 高级搜索. /// </summary> public static string Grid_IsInAdvSearch { get { return ResourceManager.GetString("Grid_IsInAdvSearch", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 商品管理查询. /// </summary> public static string Grid_IsItemSearch { get { return ResourceManager.GetString("Grid_IsItemSearch", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 必选. /// </summary> public static string Grid_IsMustInput { get { return ResourceManager.GetString("Grid_IsMustInput", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 最近一次更新时间. /// </summary> public static string Grid_LastEditTime { get { return ResourceManager.GetString("Grid_LastEditTime", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 最近一次更新用户. /// </summary> public static string Grid_LastEditUserSysNo { get { return ResourceManager.GetString("Grid_LastEditUserSysNo", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 操作. /// </summary> public static string Grid_Operation { get { return ResourceManager.GetString("Grid_Operation", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 编辑. /// </summary> public static string Grid_OperationEdit { get { return ResourceManager.GetString("Grid_OperationEdit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 规格参数优先级. /// </summary> public static string Grid_Priority { get { return ResourceManager.GetString("Grid_Priority", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 属性名称. /// </summary> public static string Grid_PropertyName { get { return ResourceManager.GetString("Grid_PropertyName", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 属性类型. /// </summary> public static string Grid_PropertyType { get { return ResourceManager.GetString("Grid_PropertyType", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 搜索显示优先级. /// </summary> public static string Grid_SearchPriority { get { return ResourceManager.GetString("Grid_SearchPriority", resourceCulture); } } /// <summary> /// Looks up a localized string similar to 前台展示样式. /// </summary> public static string Grid_WebDisplayStyle { get { return ResourceManager.GetString("Grid_WebDisplayStyle", resourceCulture); } } } }
ZeroOne71/ql
02_ECCentral/02_Portal/UI/ECCentral.Portal.UI.IM/Resources/ResCategoryPropertyBatEdit.Designer.cs
C#
gpl-3.0
6,812
package org.paradise.netflix.spring; import com.github.vanroy.cloud.dashboard.config.EnableCloudDashboard; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @SpringBootApplication @EnableDiscoveryClient @EnableCloudDashboard public class CloudDashboardApplication { public static void main(String[] args) { SpringApplication.run(CloudDashboardApplication.class, args); } }
TerrenceMiao/netflix
spring-cloud-dashboard/src/main/java/org/paradise/netflix/spring/CloudDashboardApplication.java
Java
gpl-3.0
525
#ifndef MEMMAP_HH_INCLUDED #define MEMMAP_HH_INCLUDED #include "kernel/mm/memmaparea.hh" #include "kernel/panic.hh" #include <iostream> class MemMap { protected: MemMapArea begin; MemMapArea end; bool validBase(VirtAddr a) { return a.inUserSpace(); } bool validEnd(VirtAddr a) { return a.inUserSpaceEx(); } MemMapArea *bss; public: MemMap() : begin(), end() { end.base = VirtAddr((void*)0xFFFFFFFFUL); end.end = VirtAddr((void*)0xFFFFFFFFUL); end.lower = &begin; begin.upper = &end; } VirtAddr findSlot(size_t size); int addArea(MemMapArea *a); int addAreaAt(MemMapArea *a); int removeArea(MemMapArea *a); void dumpMemMap() const; void *setBrk(void *newBrk) { if (! bss) { kernelPanic("Tried to adjust heap when no available!"); } // shrink beyond beginning? // linux returns the beginning of area, so do we! if (VirtAddr(newBrk) < bss->base) { return bss->end.toPointer(); } uintptr_t tmp = (uintptr_t)newBrk; // round up tmp += 0xFFF; tmp &= ~0xFFF; bss->setEnd(VirtAddr((void*)tmp)); return newBrk; } void setBss(MemMapArea *area) { bss = area; } MemMapArea *findAreaByAddr(VirtAddr a) const { if (! a.inUserSpace()) return 0; MemMapArea *cur = begin.upper; while (cur->base <= a) { if (cur->contains(a)) return cur; cur = cur->upper; } return 0; } }; #endif
ztane/zsos
kernel/mm/memmap.hh
C++
gpl-3.0
1,523
from channels.auth import channel_session_user_from_http from .models import Stream, Notification import redis import ast from .task import sendNotifications, send_notifications from channels import Group import json redis_con = redis.Redis('demo.scorebeyond.com', 8007) subs = redis_con.pubsub() subs.subscribe('test') @channel_session_user_from_http def ws_connect(message): '''Capture redis stream and save it into database''' Group('stream').add(message.reply_channel) for message in subs.listen(): if message['type'] == "message": data1 = ast.literal_eval(message['data']) print data1['name'] if Notification.objects.filter(event_name=data1['name']): notif = Notification.objects.get(event_name=data1['name']) if notif.no_delay: send_notifications(data1) else: sendNotifications(data1, capture=notif.delay) if not Stream.objects.filter(name=data1['name']): type_list = [] if not data1['info']: Stream.objects.create(name=data1['name'], info="") else: for k, v in data1['info'].iteritems(): type_list.append(k+":"+type(v).__name__) Stream.objects.create(name=data1['name'], info=','.join(type_list)) Group('stream').send({ 'text': json.dumps({ 'event_name': data1['name'], 'blueprint': ','.join(type_list), }) }) else: print message
bkaganyildiz/StreamBasedNotification
StreamBasedNotifs/capture/consumer.py
Python
gpl-3.0
1,668
// Copyright (c) 2016 Lorenzo Rossoni #pragma once #include <dxgi.h> #include <dxgi1_2.h> #include <d2d1_1.h> #include <d2d1_2.h> #include <d3d11.h> #include <d3d11_2.h> #include <dwrite.h> #include <wrl\module.h> #include <wrl\client.h> #include <DirectXMath.h> #include <Wincodec.h> #include <mfobjects.h> #include <mfapi.h> #include <windows.ui.xaml.media.dxinterop.h> #pragma comment(lib, "d2d1.lib") #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "dxguid.lib") #pragma comment(lib, "mf.lib") #pragma comment(lib, "mfplat.lib") #pragma comment(lib, "mfuuid.lib") #pragma comment(lib, "mfreadwrite.lib") using namespace Platform; using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Data; using namespace Microsoft::WRL; using namespace Windows::UI::Core; using Windows::Foundation::Metadata::WebHostHiddenAttribute; using Windows::UI::Xaml::Data::BindableAttribute; using Windows::UI::Xaml::Media::Imaging::VirtualSurfaceImageSource; namespace Unigram { namespace Native { ref class AnimatedImageSourceRenderer; class VirtualImageSourceRendererCallback WrlSealed : public RuntimeClass<RuntimeClassFlags<ClassicCom>, IVirtualSurfaceUpdatesCallbackNative, IMFAsyncCallback> { public: VirtualImageSourceRendererCallback(_In_ AnimatedImageSourceRenderer^ renderer); ~VirtualImageSourceRendererCallback(); HRESULT StartTimer(LONGLONG duration); HRESULT StopTimer(); STDMETHODIMP UpdatesNeeded(); STDMETHODIMP Invoke(_In_ IMFAsyncResult* pAsyncResult); STDMETHODIMP GetParameters(_Out_ DWORD* pdwFlags, _Out_ DWORD* pdwQueue); inline const bool IsTimerRunning() const { return m_timerKey != NULL; } private: MFWORKITEM_KEY m_timerKey; AnimatedImageSourceRenderer^ m_renderer; DispatchedHandler^ m_timerDispatchedHandler; }; } }
crafti5/Unigram
Unigram/Unigram.Native/AnimatedImageSource/VirtualImageSourceRendererCallback.h
C
gpl-3.0
1,857
<?php // Version: 0.421 class Churro extends Custom_Churro{ private $continue = FALSE; // Usually need to continue back to wordpress when admin private $jsonAuto = TRUE; // Whether to add html and success to json response automatically private $themedir = FALSE; // theme directory private $method = FALSE; // the method we will be using private $template_file = ''; // the actual file to use, no extension // should be $this->themedir.'/'.$this->view.'.php' protected $blog_id = FALSE; // useful for MU protected $queried = FALSE; // has wp_query run protected $view = null; // the template / .php file to render protected $json = array(); // object will be returned back auto on ajax protected $vars = array(); // object to hold varaibles for the template protected $wp = FALSE; // reference to wp object protected $wpdb = FALSE; // reference to wp database object public $wp_query = FALSE; // reference to wp query object // static variables protected static $cPath = '/'; // url public function __construct(){ global $blog_id, $wp, $wpdb, $wp_query; $this->blog_id = $blog_id; $this->wp = &$wp; $this->wpdb = &$wpdb; $this->wp_query = &$wp_query; $this->json = (object) array(); $this->vars = (object) array(); if( is_admin() ){ $this->ContinueWP( TRUE ); } $this->Theme(); // let everybody know add_filter( 'the_generator', 'Churro::ShamelessPromotion' ); } public function ContinueWP( $bool = null ){ if( is_bool($bool) ){ $this->continue = $bool; } return $this->continue; } public function Do404(){ $this->wp_query->is_404 = TRUE; $this->wp_query->is_page = FALSE; $this->wp_query->is_singular = FALSE; // TODO: make the theme path tell the default theme value $this->Theme( '' ); echo $this->Render( '404' ); die(); } public function Globals(){ foreach( $this->vars as $k=>$v ){ if( !isset($this->wp_query->query_vars[$k]) ){ $this->wp_query->query_vars[$k] = $v; } } // i havent decided if this return value is good, it probably doenst matter return (object) $this->wp_query->query_vars; } public function Json(){ return $this->json; } /* * sets and gets whether to automatically add success and html fields to json response * @param boolean $bool optional * @return boolean */ public function JsonAuto( $bool = NULL ){ if( is_bool($bool) ){ $this->jsonAuto = $bool; } return $this->jsonAuto; } // get or set the controller public function Method( $method = null ){ if( $method && method_exists($this, $method) ){ $this->method = $method; } else if( $method && !method_exists($this, $method) ){ return FALSE; } return $this->method; } public function Queried( $bool = null ){ if( is_bool($bool) ){ $this->queried = $bool; } return (bool) $this->queried; } public function Query( $query = null ){ if( !is_null($query) ){ $this->wp_query->parse_query( $query ); } // this is what $this->Globals is doing. consolidate? foreach( $this->wp_query->query_vars as $k=>$v ){ $this->wp->set_query_var( $k ,$v ); } if( !is_array($this->wp->query_vars) ){ $this->wp->query_vars = (array) $this->wp->query_vars; } $this->wp->query_posts(); $this->wp->register_globals(); $this->queried = TRUE; $this->wp_query->is_home = self::$cPath == '/'; } public function Redirect( $url = null ){ if( ISAJAX ){ return TRUE; } wp_redirect( $url ); die(); } /* * * @param string $html * @param array | object $vars * @return string */ public function Render( $html = null, $vars = array() ){ if( is_null($this->view) && is_null($html) && !is_admin() ){ if( $this->wp_query->is_home ){ $this->template_file = get_home_template(); } else if( $this->wp_query->is_page ){ $this->template_file = get_page_template(); } else if( $this->wp_query->is_single ){ $this->template_file = get_single_template(); } else { return FALSE; } } else if( $html ){ $this->template_file = $this->themedir.'/'.$html.'.php'; } else if( $this->View() ){ $this->template_file = $this->themedir.'/'. $this->view .'.php'; } if( !$this->template_file || !file_exists($this->template_file) ){ return FALSE; } // make object variables available to the template if( !count($vars) ){ $vars = $this->vars; } $vars = (array) $vars; // do the magic extract( $vars, EXTR_SKIP ); ob_start(); include $this->template_file; $view = ob_get_contents(); ob_end_clean(); return $view; } /* * set the theme directory manually or auto * @param string optional, name of theme directory. no leading or trailing slashes * @return BOOL */ public function Theme( $template = null ){ if( !$template ){ $template = get_template(); } $this->themedir = plugin_dir_path( plugin_dir_path(__FILE__) ).'/views'; //get_theme_root().'/'.$template; return TRUE; } /* * set or get the template file * */ public function View( $view = null ){ if( $view ){ return $this->view = $view; } else { return $this->view; } } /* static functions */ /* * sets up base directories and config files on plugin activation * @return NULL */ public static function Activation(){ // set up controller directory /* if( !is_dir(WP_PLUGIN_DIR.'/churro-controllers/') ) mkdir( WP_PLUGIN_DIR.'/churro-controllers/' ); // set up config file if( !file_exists(WP_PLUGIN_DIR.'/churro-controllers/_config.php') && file_exists(WP_PLUGIN_DIR.'/churro/_config.php') ) rename( WP_PLUGIN_DIR.'/churro/_config.php', WP_PLUGIN_DIR.'/churro-controllers/_config.php' ); */ } /* * parses the path and pass to self::Path() * attached to `parse_request` action for main site * attached to `admin_menu` action for wp-admin/ * requires pretty permalinks * calls `Churro_Bootstrap` action * @return bool */ public static function Bootstrap(){ // sessions are nice if( !session_id() && !headers_sent() ) session_start(); do_action( 'Churro_Bootstrap' ); // this is specific to jQuery. why would you use anything else? if( !defined('ISAJAX') ) define( 'ISAJAX' , isset($_SERVER['HTTP_X_REQUESTED_WITH']) ); if( is_admin() ){ // dont pop the .php off the admin script anymore! $cPath = explode( ' ', $_SERVER['SCRIPT_NAME'] ); // dashboard.php will be require_once()'d in admin/index.php too, but we may need it sooner. boo. //require_once ABSPATH.'wp-admin/includes/dashboard.php'; } else { // remove query string $cPath = explode( '?', $_SERVER['REQUEST_URI'] ); } self::$cPath = $cPath[0]; $success = self::Path( self::$cPath ); // if we are here churro did not process the page, or we have forced wp to continue. // does it matter what is returned? i don't think so. return $success; } /* * parse the reuested path and find correct file / controller / action * param string $cPath optional * param string $prefix optional */ public static function Path( $cPath = '', $prefix = '' ){ self::_stripPathSlashes( $cPath ); // handle custom routes $friendly = array( ':any', ':num', ':slug' ); $regex = array( '.+', '[0-9]+', '[A-Za-z0-9\-.]+' ); foreach( self::Routes() as $k=>$v ){ $k = str_replace( $friendly, $regex, $k ); if( preg_match('#^'.$k.'$#', $cPath) ){ $cPath = preg_replace( '#^'.$k.'$#', $v, $cPath ); break; } } // matched rule / custom rule // break url down into elements $explode = explode( '/', $cPath ); $explode = array_values( array_filter($explode, 'trim') ); if( !isset($explode[0]) ){ $explode[0] = 'index'; } // load the correct file / method $path = plugin_dir_path( plugin_dir_path(__FILE__) ).'/controllers/'; $controller = ''; $method = ''; $args = array(); // loop through the path segments to find the correct class/controller and method. // the rest of the path segments will be passed to the method as arguments. foreach( $explode as $key => $seg ){ $test = $path.self::_camelCase($seg); if( is_dir($test) ){ $controller = self::_camelCase( $controller.'-'.$seg ); $method = isset( $explode[$key+1] ) ? $explode[$key+1] : 'index'; $path = $test.'/'; unset( $explode[$key]); } else if( is_file($test.'.php') ){ $controller = self::_camelCase( $controller.'-'.$seg ); $method = isset( $explode[$key+1] ) ? $explode[$key+1] : 'index'; $path = $test.'.php'; unset( $explode[$key]); } else { } } if( reset($explode) == $method ){ array_shift( $explode ); } $_method = self::_camelCase( $method ).'Action'; if( is_dir($path) ){ $path .= 'index.php'; } // make sure the path to the controller exists if( file_exists($path) ) include $path; else return FALSE; // set up the class. Controller is an extended Churro $controller = $controller.'_Churro'; if( !class_exists($controller) ){ return FALSE; } $Churro = new $controller; if( !($Churro instanceof Churro) ){ return FALSE; } // Check that the corresponding method exists $_method = $Churro->Method( $_method ); // check that the method exists, or a default index action exists, or return // TODO: make sure this works correctly with controllers in subdirectories if( !$_method && method_exists($controller, 'indexAction') ){ array_unshift( $explode, $method ); $_method = 'indexAction'; } else if( !$_method ){ return FALSE; } else if( $_method == end($explode).'Action' ){ array_pop( $explode ); } // check if the controller is public / wants to accept variables $c = new ReflectionMethod( $controller, $_method ); $args = count( $explode ); if( $args < $c->getNumberOfRequiredParameters() || $args > $c->getNumberOfParameters() || !$c->isPublic() ){ return FALSE; } do_action( 'template_redirect' ); // everything is good, lets do it ob_start(); // do the global actions, only if a specific controller is not found. if( method_exists($Churro, 'init') ){ call_user_func( array($Churro, 'init') ); } // run the controller $success = call_user_func_array( array($Churro, $_method), $explode ); $success = is_bool( $success ) && !$success ? FALSE : TRUE; // run wp_query if it has not if( !$Churro->Queried() ){ $Churro->Query( '' ); } $Churro->Globals(); // set the global query back to our version. i thought assigning by reference took care of this? global $wp_query; $wp_query = $Churro->wp_query; // TODO: see if theres a better way to do this $html = $Churro->Render(); // the content I want $html2 = ob_get_contents(); // extra output from debugs, etc ob_end_clean(); $html = trim( $html2 ).$html; if( ISAJAX ){ // ajax http request status_header( 200 ); $json = $Churro->Json(); if( is_object($json) && $Churro->JsonAuto() ){ if( !isset($json->success) ){ $json->success = $success; } if( !isset($json->html) ){ $json->html = self::_trimJSON($html); } } //die( 'strlen: '.strlen(serialize($json)) ); ini_set( 'memory_limit', '256M' ); echo json_encode( $json ); die(); } else { // normal http request if( !$Churro->ContinueWP() && !stripos($html, '</html>') ){ $file = TEMPLATEPATH.'/churro-default.php'; if( file_exists($file) ){ include $file; // it's already dead, i believe. lets be safe. die(); } else { ob_start(); get_header(); echo $html; get_footer(); $html = ob_get_contents(); ob_end_clean(); } } if( defined('USE_TIDY_WITH_CHURRO') && USE_TIDY_WITH_CHURRO && extension_loaded('tidy') ){ $html = self::_tidy( $html ); } echo $html; if( !$Churro->ContinueWP() ){ die(); } } } /* * gets a list of rewriting routes for Custom Churro class if Routes method exists * @return array */ public static function Routes(){ /* if( method_exists(get_parent_class(), 'Routes') ) return Custom_Churro::Routes(); else return array(); */ return Custom_Churro::Routes(); } /* * add a meta tag below wordpress generator * attached to `the_generator` filter * @return string */ public static function ShamelessPromotion( $x ){ $x .= "\n<meta name=\"generator\" content=\"Churro\" />\n"; return $x; } /* * camelCase strings by using dash - as delimeter * replace periods with dash after camel case * @param string * @return string */ public static function _camelCase( $str = '' ){ $cc = preg_replace_callback( '/-(\w)/', 'Churro::_camelCaseCallback', $str ); return str_replace( '.', '_', $cc); } /* * callback for _camelCase() */ public static function _camelCaseCallback( $matches ){ return ucfirst( $matches[1] ); } /* * clean up the html output if tidy is installed. * experiemental for now, don't use on prod * @param string * @return string */ private static function _tidy( $html = '' ){ $config = array( 'indent' => true, 'indent-spaces' => 4, 'wrap' => 0 ); $tidy = new tidy; $tidy->parseString($html, $config); $tidy->cleanRepair(); $html = (string) $tidy->value; return $html; } /* * remove leading, trailing, and empty slashes in url * @param string $cPath reference */ private static function _stripPathSlashes( &$cPath ){ $aPath = explode('/', $cPath); $aPath = array_filter($aPath); $cPath = implode('/',$aPath); } /* * remove line breaks and tabs from json string * @param string * @return string */ private static function _trimJSON( $string = '' ){ $chars = array( "\n", "\t" ); $string = str_replace( $chars, ' ', $string ); return $string; } } // end of file // /churro/_class_Churro.php
bklein01/cheesepress-framework
framework/_class_Churro.php
PHP
gpl-3.0
14,025
var searchData= [ ['udp',['Udp',['../class_cool_time.html#a4e23216a8121ca79d0fb019f30884b92',1,'CoolTime']]], ['unsubscribe',['unsubscribe',['../class_cool_pub_sub_client.html#a850554280e314d6b5c33c73fd9e809fc',1,'CoolPubSubClient']]], ['update',['update',['../class_cool_board.html#a8612756d3f73198cdde857a66f0fe690',1,'CoolBoard::update()'],['../class_cool_time.html#aae601f795452cfa48d9fb337aed483a8',1,'CoolTime::update()']]], ['updateconfigfiles',['updateConfigFiles',['../class_cool_file_system.html#adfa8e2e80641ae6f0cceabd348a9b841',1,'CoolFileSystem']]], ['user',['user',['../class_cool_m_q_t_t.html#a8cd47e45d457f908d4b4390b35aaee83',1,'CoolMQTT']]], ['useractive',['userActive',['../class_cool_board.html#a6395459131d6889a3005f79c7a35e964',1,'CoolBoard']]], ['userdata',['userData',['../class_cool_board.html#ae7358fb6e623cfc81b775f5f1734909b',1,'CoolBoard']]], ['uv',['uv',['../struct_cool_board_sensors_1_1light_active.html#a0e6cfc311425a31f32c32fc3b834ffb8',1,'CoolBoardSensors::lightActive']]] ];
TamataOcean/TamataSpiru
ARDUINO/LaCOOLBoard/extras/doxygenDocs/html/search/all_14.js
JavaScript
gpl-3.0
1,028
@echo off color 0a cls echo This script is meant for Win7 and higher. Lower ones will not have Features/Firewall report functional. mkdir %userprofile%\Desktop\reports set basedpath=%userprofile%\Desktop\reports del /q %basedpath%\*.* echo Collecting Information... echo This Information run through %username% on %computername% at %time% %date% > %basedpath%\sysinforeport.txt echo -------------------------------------------------------------------------- >> %basedpath%\sysinforeport.txt systeminfo >> %basedpath%\sysinforeport.txt echo System Info Report Compiled echo This Information run through %username% on %computername% at %time% %date% >> %basedpath%\tasksreport.txt tasklist /svc >> %basedpath%\tasksreport.txt echo. >> %basedpath%\tasksreport.txt echo ------VERBOSE REPORT BELOW------ >> %basedpath%\tasksreport.txt tasklist /v >> %basedpath%\tasksreport.txt echo Tasks/Processes Report Compiled schtasks >> %basedpath%\scheduledtasksreport.txt echo Scheduled Tasks Report Compiled net users > %basedpath%\usersreport.txt ( for /F %%h in (%basedpath%\usersreport.txt) do ( net user %%h >NUL if %errorlevel%==0 net user %%h >> %basedpath%\usersreport.txt ) ) echo. >> %basedpath%\usersreport.txt echo Below is the administrators group: >> %basedpath%\usersreport.txt net localgroup Administrators >> %basedpath%\usersreport.txt echo. >> %basedpath%\usersreport.txt echo Below is the account lockout policy net accounts >> %basedpath%\usersreport.txt echo Users Report Compiled net share >> %basedpath%\sharesreport.txt echo Shares Report Compiled dism /online /get-features >> %basedpath%\featuresreport.txt echo Features Report Compiled netsh advfirewall firewall show rule name=all > %basedpath%\firewallreport.txt echo --Port Information Below-- >> %basedpath%\firewallreport.txt netstat -ano >> %basedpath%\firewallreport.txt dir /r /s C:\*.* | findstr /v "AM" | findstr /v "PM" | findstr /v "File(s)" | findstr /v "Dir(s)" | findstr /v "Directory of" | findstr /v "Zone.Identifier" > basedads.txt echo ADS Report Generated echo Done Compiling, go to the reports folder on your desktop pause
hexidecimals/cyberpatriot
Create_Reports.bat
Batchfile
gpl-3.0
2,120
"""effcalculator URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.contrib import admin from django.conf.urls import url, include from django.contrib.auth import views as auth_views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^api/', include('api.urls')), url(r'^', include('frontend.urls')) ]
alvcarmona/efficiencycalculatorweb
effcalculator/effcalculator/urls.py
Python
gpl-3.0
915
// namespaces var dwv = dwv || {}; dwv.image = dwv.image || {}; /** * {@link dwv.image.View} factory. * * @class */ dwv.image.ViewFactory = function () {}; /** * {@link dwv.image.View} factory. Defaults to local one. * * @see dwv.image.ViewFactory */ dwv.ViewFactory = dwv.image.ViewFactory; /** * Get an View object from the read DICOM file. * * @param {object} dicomElements The DICOM tags. * @param {dwv.image.Image} image The associated image. * @returns {dwv.image.View} The new View. */ dwv.image.ViewFactory.prototype.create = function (dicomElements, image) { // view var view = new dwv.image.View(image); // default color map if (image.getPhotometricInterpretation() === 'MONOCHROME1') { view.setDefaultColourMap(dwv.image.lut.invPlain); } else if (image.getPhotometricInterpretation() === 'PALETTE COLOR') { var paletteLut = image.getMeta().paletteLut; if (typeof (paletteLut) !== 'undefined') { view.setDefaultColourMap(paletteLut); } } // window level presets var windowPresets = {}; // image presets if (typeof image.getMeta().windowPresets !== 'undefined') { windowPresets = image.getMeta().windowPresets; } // min/max // Not filled yet since it is stil too costly to calculate min/max // for each slice... It will be filled at first use // (see view.setWindowLevelPreset). // Order is important, if no wl from DICOM, this will be the default. windowPresets.minmax = {name: 'minmax'}; // optional modality presets if (typeof dwv.tool !== 'undefined' && typeof dwv.tool.defaultpresets !== 'undefined') { var modality = image.getMeta().Modality; for (var key in dwv.tool.defaultpresets[modality]) { var preset = dwv.tool.defaultpresets[modality][key]; windowPresets[key] = { wl: new dwv.image.WindowLevel(preset.center, preset.width), name: key }; } } // store view.setWindowPresets(windowPresets); // set the initial position view.setInitialPosition(); return view; };
ivmartel/dwv
src/image/viewFactory.js
JavaScript
gpl-3.0
2,030
/* * This file is part of NaviSpaceDemo. * Copyright 2015 Vasanth Mohan. All Rights Reserved. * * NaviSpaceDemo is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * NaviSpaceDemo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NaviSpaceDemo. If not, see <http://www.gnu.org/licenses/>. */ using UnityEngine; using System.Collections; /// <summary> /// This class manages the user touch input to control pulling the slingshot back and tossing the current jelly /// </summary> public class TossJellyManager : MonoBehaviour { public static TossJellyManager Instance; //global instance of the class public GameObject slingshotTarget; //the center of the slingshot that the jelly will pass through when fired; it is set in the inspector private GameObject slingshotCenter; //the gameobject that the jelly will be parent to; this object will move around private GameObject tossableJelly; //the current jelly to toss private Vector2 prevPos; //previous touch input private const float SwapTime = 1f; //time it takes to get a new jelly private const float SwapSpeed = 5f; //speed the jelly travels to reach the slingshot private bool tossIsReady = false; //whether it is ok to fire the slingshot /// <summary> /// Initalization of global instance /// </summary> void Awake () { if (Instance == null) Instance = this; } /// <summary> /// Initalize events and get the first jelly to toss /// </summary> void Start () { slingshotCenter = new GameObject (); slingshotCenter.transform.position = slingshotTarget.transform.position; slingshotCenter.transform.parent = slingshotTarget.transform.parent; TouchManager.OnTouchDown += HandleOnTouchDown; TouchManager.OnTouchUp += HandleOnTouchUp; TouchManager.OnTouchMove += MoveTarget; TouchManager.OnTouchStayed += MoveTarget; GetJelly (); } /// <summary> /// Method responsible for getting jelly from the ring manager and transfering it into the slingshot /// </summary> private void GetJelly(){ JellyRecruit jelly = JellyRingManager.Instance.GetClosestJelly (); tossableJelly = jelly.GetTossableJelly (); jelly.CreateNewJelly (); tossableJelly.transform.parent = null; iTween.ScaleTo(tossableJelly, iTween.Hash("scale", new Vector3(1f, 1f, 1f), "easeType", "linear", "time", SwapTime)); iTween.RotateTo(tossableJelly, iTween.Hash("rotation", new Vector3(0f, 180f, 0f), "easeType", "linear", "time", SwapTime)); StartCoroutine (MoveToTarget ()); //iTween.MoveTo(tossableJelly, iTween.Hash("position", transform, "easeType", "linear", "time", SwapTime, "oncomplete", "OnAnimationEnd", "oncompletetarget", gameObject)); tossIsReady = false; } /// <summary> /// Coroutine that moves the jelly towards the slingshot target until it reaches it /// </summary> IEnumerator MoveToTarget(){ Vector3 dir = slingshotTarget.transform.position - tossableJelly.transform.position; while (dir.magnitude > 0.1f) { tossableJelly.transform.position += dir.normalized*Time.deltaTime*SwapSpeed; yield return new WaitForFixedUpdate(); dir = slingshotTarget.transform.position - tossableJelly.transform.position; } tossableJelly.transform.parent = transform; tossableJelly.GetComponent<Rigidbody> ().isKinematic = false; tossIsReady = true; } /// <summary> /// When the player taps for the first time, we save that location as the reference location in prevPos /// </summary> private void HandleOnTouchDown (int fingerID, Vector2 pos) { prevPos = pos; } /// <summary> /// When the player moves their finger, we move the slingshot to match pulling it back. /// </summary> private void MoveTarget(int fingerID, Vector2 pos){ if (tossIsReady) { Vector2 dir = (pos - prevPos); Vector3 dir3D = new Vector3 (dir.x, 0f, dir.y); //controlls XZ plane slingshotTarget.transform.localPosition += .01f * dir3D; prevPos = pos; } } /// <summary> /// When the player releases we fire the jelly from its current position to the target /// </summary> private void HandleOnTouchUp (int fingerID, Vector2 pos) { Vector3 dir = (slingshotCenter.transform.position - slingshotTarget.transform.position); if (tossableJelly != null && tossIsReady && dir.magnitude > 0f) { tossableJelly.GetComponent<Rigidbody> ().AddForce (dir *5f, ForceMode.Impulse); tossableJelly.GetComponent<JellyController> ().OnTossed(); tossableJelly.transform.parent = null; slingshotTarget.transform.localPosition = slingshotCenter.transform.localPosition; GetJelly(); } } }
luben93/NaviSpaceDemo
Assets/Scripts/SpaceJellies/TossJellyManager.cs
C#
gpl-3.0
4,987
<table width="100%" border="0"> <tr> <td id="view" valign="top" width="50%"> </td> <td id="addUP" valign="top" style=""> <table> <tr> <td>Part. No</td> <td>:</td> <td><input type="text" id="part_no"/></td> </tr> <tr> <td>Part Name</td> <td>:</td> <td><input type="text" id="part_name"/></td> </tr> <tr> <td colspan="3"> <input type="button" value="Save" id="save" style="float: right;"/> </td> </tr> </table> </td> </tr> </table>
oshanz/ImgMap
application/views/parts/main/tpl.html
HTML
gpl-3.0
774
/* * jcc - A compiler framework. * Copyright (C) 2016-2017 Jacob Zhitomirsky * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "jtac/jtac.hpp" #include <stdexcept> namespace jcc { namespace jtac { //! \brief Returns true if the opcode described an instruction of the form: X = Y. bool is_opcode_assign (jtac_opcode op) { switch (op) { case JTAC_OP_ASSIGN: case JTAC_OP_ASSIGN_ADD: case JTAC_OP_ASSIGN_SUB: case JTAC_OP_ASSIGN_MUL: case JTAC_OP_ASSIGN_DIV: case JTAC_OP_ASSIGN_MOD: case JTAC_OP_ASSIGN_CALL: case JTAC_SOP_ASSIGN_PHI: return true; case JTAC_OP_UNDEF: case JTAC_OP_RET: case JTAC_OP_CMP: case JTAC_OP_JMP: case JTAC_OP_JE: case JTAC_OP_JNE: case JTAC_OP_JL: case JTAC_OP_JLE: case JTAC_OP_JG: case JTAC_OP_JGE: case JTAC_OP_CALL: case JTAC_OP_RETN: case JTAC_SOP_LOAD: case JTAC_SOP_STORE: case JTAC_SOP_UNLOAD: return false; } throw std::runtime_error ("is_opcode_assign: unhandled opcode"); } //! \brief Returns the class of the specified opcode. jtac_opcode_class get_opcode_class (jtac_opcode op) { switch (op) { case JTAC_OP_UNDEF: case JTAC_OP_RETN: return JTAC_OPC_NONE; // intentionally done so that these instructions don't get handled the // usual way. case JTAC_SOP_LOAD: case JTAC_SOP_STORE: case JTAC_SOP_UNLOAD: return JTAC_OPC_NONE; case JTAC_OP_ASSIGN: return JTAC_OPC_ASSIGN2; case JTAC_OP_ASSIGN_ADD: case JTAC_OP_ASSIGN_SUB: case JTAC_OP_ASSIGN_MUL: case JTAC_OP_ASSIGN_DIV: case JTAC_OP_ASSIGN_MOD: return JTAC_OPC_ASSIGN3; case JTAC_OP_RET: case JTAC_OP_JMP: case JTAC_OP_JE: case JTAC_OP_JNE: case JTAC_OP_JL: case JTAC_OP_JLE: case JTAC_OP_JG: case JTAC_OP_JGE: return JTAC_OPC_USE1; case JTAC_OP_CMP: return JTAC_OPC_USE2; case JTAC_OP_ASSIGN_CALL: return JTAC_OPC_ASSIGN_CALL; case JTAC_SOP_ASSIGN_PHI: return JTAC_OPC_ASSIGN_FIXED_CALL; case JTAC_OP_CALL: return JTAC_OPC_CALL; } throw std::runtime_error ("get_opcode_class: unhandled opcode"); } //! \brief Returns the number of operands used by the specified opcode. int get_operand_count (jtac_opcode op) { switch (get_opcode_class (op)) { case JTAC_OPC_ASSIGN_CALL: return 2; case JTAC_OPC_ASSIGN_FIXED_CALL: return 1; case JTAC_OPC_NONE: return 0; case JTAC_OPC_USE1: return 1; case JTAC_OPC_USE2: return 2; case JTAC_OPC_ASSIGN2: return 2; case JTAC_OPC_ASSIGN3: return 3; case JTAC_OPC_CALL: return 1; } throw std::runtime_error ("has_extra_operands: unhandled opcode class"); } //! \brief Checks whether the specified opcode requires extra operands. bool has_extra_operands (jtac_opcode op) { switch (get_opcode_class (op)) { case JTAC_OPC_ASSIGN_CALL: case JTAC_OPC_ASSIGN_FIXED_CALL: case JTAC_OPC_CALL: return true; case JTAC_OPC_NONE: case JTAC_OPC_USE1: case JTAC_OPC_USE2: case JTAC_OPC_ASSIGN2: case JTAC_OPC_ASSIGN3: return false; } throw std::runtime_error ("has_extra_operands: unhandled opcode class"); } //------------------------------------------------------------------------------ jtac_tagged_operand& jtac_tagged_operand::operator= (const jtac_tagged_operand& other) { this->type = other.type; switch (this->type) { case JTAC_OPR_CONST: new (&this->val.konst) jtac_const (other.val.konst); break; case JTAC_OPR_VAR: new (&this->val.var) jtac_var (other.val.var); break; case JTAC_OPR_LABEL: new (&this->val.lbl) jtac_label (other.val.lbl); break; case JTAC_OPR_OFFSET: new (&this->val.off) jtac_offset (other.val.off); break; case JTAC_OPR_NAME: new (&this->val.name) jtac_name (other.val.name); break; case JTAC_OPR_BLOCK_REF: new (&this->val.blk) jtac_block_ref (other.val.blk); break; } return *this; } jtac_tagged_operand& jtac_tagged_operand::operator= (jtac_tagged_operand&& other) { this->type = other.type; switch (this->type) { case JTAC_OPR_CONST: new (&this->val.konst) jtac_const (std::move (other.val.konst)); break; case JTAC_OPR_VAR: new (&this->val.var) jtac_var (std::move (other.val.var)); break; case JTAC_OPR_LABEL: new (&this->val.lbl) jtac_label (std::move (other.val.lbl)); break; case JTAC_OPR_OFFSET: new (&this->val.off) jtac_offset (std::move (other.val.off)); break; case JTAC_OPR_NAME: new (&this->val.name) jtac_name (std::move (other.val.name)); break; case JTAC_OPR_BLOCK_REF: new (&this->val.blk) jtac_block_ref (std::move (other.val.blk)); break; } return *this; } jtac_tagged_operand& jtac_tagged_operand::operator= (const jtac_operand& opr) { this->type = opr.get_type (); switch (opr.get_type ()) { case JTAC_OPR_CONST: new (&this->val.konst) jtac_const (static_cast<const jtac_const&> (opr)); break; case JTAC_OPR_VAR: new (&this->val.var) jtac_var (static_cast<const jtac_var&> (opr)); break; case JTAC_OPR_LABEL: new (&this->val.lbl) jtac_label (static_cast<const jtac_label&> (opr)); break; case JTAC_OPR_OFFSET: new (&this->val.off) jtac_offset (static_cast<const jtac_offset&> (opr)); break; case JTAC_OPR_NAME: new (&this->val.name) jtac_name (static_cast<const jtac_name&> (opr)); break; case JTAC_OPR_BLOCK_REF: new (&this->val.blk) jtac_block_ref (static_cast<const jtac_block_ref&> (opr)); break; } return *this; } jtac_operand& tagged_operand_to_operand (jtac_tagged_operand& opr) { switch (opr.type) { case JTAC_OPR_VAR: return opr.val.var; case JTAC_OPR_CONST: return opr.val.konst; case JTAC_OPR_LABEL: return opr.val.lbl; case JTAC_OPR_OFFSET: return opr.val.off; case JTAC_OPR_NAME: return opr.val.name; case JTAC_OPR_BLOCK_REF: return opr.val.blk; } throw std::runtime_error ("tagged_operand_to_operand: unhandled operand type"); } jtac_instruction::jtac_instruction () { this->extra.cap = 0; } jtac_instruction::jtac_instruction (const jtac_instruction& other) { *this = other; } jtac_instruction::jtac_instruction (jtac_instruction&& other) { *this = std::move (other); } jtac_instruction& jtac_instruction::operator= (const jtac_instruction& other) { this->op = other.op; this->oprs[0] = other.oprs[0]; this->oprs[1] = other.oprs[1]; this->oprs[2] = other.oprs[2]; this->extra.count = other.extra.count; this->extra.cap = other.extra.cap; if (this->extra.cap) { this->extra.oprs = new jtac_tagged_operand[this->extra.cap]; for (int i = 0; i < this->extra.count; ++i) this->extra.oprs[i] = other.extra.oprs[i]; } return *this; } jtac_instruction& jtac_instruction::operator= (jtac_instruction&& other) { this->op = other.op; this->oprs[0] = std::move (other.oprs[0]); this->oprs[1] = std::move (other.oprs[1]); this->oprs[2] = std::move (other.oprs[2]); this->extra.count = other.extra.count; this->extra.cap = other.extra.cap; this->extra.oprs = other.extra.oprs; other.extra.count = 0; other.extra.cap = 0; other.extra.oprs = nullptr; return *this; } //! \brief Inserts the specified operand into the instruction's "extra" list. jtac_instruction& jtac_instruction::push_extra (const jtac_operand& opr) { if (this->extra.count == this->extra.cap) { int ncap = (int)this->extra.cap * 2; if (ncap > 255) ncap = 255; this->extra.cap = (unsigned char)ncap; jtac_tagged_operand *tmp = new jtac_tagged_operand[ncap]; for (int i = 0; i < this->extra.count; ++i) tmp[i] = std::move (this->extra.oprs[i]); delete[] this->extra.oprs; this->extra.oprs = tmp; } this->extra.oprs[this->extra.count ++] = opr; return *this; } } }
BizarreCake/jcc
src/jtac/jtac.cpp
C++
gpl-3.0
9,082
/* 2011-05-31 */ /* Dr. Rainer Sieger */ #include "Application.h" // ********************************************************************************************** // ********************************************************************************************** // ********************************************************************************************** // 2008-04-07 int MainWindow::convertTSG( const QString &s_FilenameIn, const QString &s_FilenameOut, const int i_CodecInput, const int i_CodecOutput, const int i_EOL, const int i_NumOfFiles ) { int i = 1; int n = 0; int stopProgress = 0; QString s = ""; QString s_DateTime = ""; QString s_Position = ""; QString s_EOL = setEOLChar( i_EOL ); QStringList sl_Input; // ********************************************************************************************** // read file if ( ( n = readFile( s_FilenameIn, sl_Input, i_CodecInput ) ) < 1 ) return( -10 ); // ********************************************************************************************** // open output file QFile fout( s_FilenameOut ); if ( fout.open( QIODevice::WriteOnly | QIODevice::Text) == false ) return( -20 ); QTextStream tout( &fout ); switch ( i_CodecOutput ) { case _SYSTEM_: break; case _LATIN1_: tout.setCodec( QTextCodec::codecForName( "ISO 8859-1" ) ); break; case _APPLEROMAN_: tout.setCodec( QTextCodec::codecForName( "Apple Roman" ) ); break; default: tout.setCodec( QTextCodec::codecForName( "UTF-8" ) ); break; } // ********************************************************************************************** initProgress( i_NumOfFiles, s_FilenameIn, tr( "Converting TSG data..." ), sl_Input.count() ); // ********************************************************************************************** tout << "Event label" << "\t" << "Date/Time" << "\t" << "Latitude" << "\t" << "Longitude" << "\t"; tout << "Depth, water [m]" << "\t" << "Temperature, water [C]@ITS-90" << "\t" << "Salinity []" << s_EOL; tout << "PS-track"; while ( ( i<sl_Input.count() ) && ( stopProgress != _APPBREAK_ ) ) { s_DateTime = sl_Input.at( i ).section( "\t", 0, 0 ); s_DateTime.replace( " ", "T" ); s_Position = sl_Input.at( i ).section( "\t", 1, 2 ); s_Position.replace( " ", "" ); s = sl_Input.at( i ).section( "\t", 3, 4 ); s.replace( " ", "" ); s.replace( "-999.000000", "" ); if ( s != "\t" ) tout << "\t" + s_DateTime << "\t" << s_Position << "\t5\t" << s << s_EOL; s = sl_Input.at( i ).section( "\t", 5, 6 ); s.replace( " ", "" ); s.replace( "-999.000000", "" ); if ( s != "\t" ) tout << "\t" + s_DateTime << "\t" << s_Position << "\t11\t" << s << s_EOL; stopProgress = incProgress( i_NumOfFiles, ++i ); } fout.close(); resetProgress( i_NumOfFiles ); if ( stopProgress == _APPBREAK_ ) return( _APPBREAK_ ); return( _NOERROR_ ); } // ********************************************************************************************** // ********************************************************************************************** // ********************************************************************************************** // 2011-05-31 void MainWindow::doConvertTSG() { int i = 0; int err = 0; int stopProgress = 0; QString s_FilenameIn = ""; QString s_FilenameOut = ""; // ********************************************************************************************** if ( existsFirstFile( gi_ActionNumber, gs_FilenameFormat, gi_Extension, gsl_FilenameList ) == true ) { initFileProgress( gsl_FilenameList.count(), gsl_FilenameList.at( 0 ), tr( "Convert TSG data..." ) ); while ( ( i < gsl_FilenameList.count() ) && ( err == _NOERROR_ ) && ( stopProgress != _APPBREAK_ ) ) { if ( buildFilename( gi_ActionNumber, gs_FilenameFormat, gi_Extension, gsl_FilenameList.at( i ), s_FilenameIn, s_FilenameOut ) == true ) { err = convertTSG( s_FilenameIn, s_FilenameOut, gi_CodecInput, gi_CodecOutput, gi_EOL, gsl_FilenameList.count() ); stopProgress = incFileProgress( gsl_FilenameList.count(), ++i ); } else { err = _FILENOTEXISTS_; } } resetFileProgress( gsl_FilenameList.count() ); } else { err = _CHOOSEABORTED_; } // ********************************************************************************************** endTool( err, stopProgress, gi_ActionNumber, gs_FilenameFormat, gi_Extension, gsl_FilenameList, tr( "Done" ), tr( "Converting TSG data was canceled" ) ); onError( err ); }
rsieger/PanConverter
trunk/Sources/convertTSG.cpp
C++
gpl-3.0
5,075
using System.IO; using System.Linq; using System.Reflection; namespace cmdr.TsiLib { internal static class EmbeddedResource { static Assembly ASSEMBLY = Assembly.GetExecutingAssembly(); static string PREFIX = ASSEMBLY.GetName().Name + ".Resources."; static string[] EMBEDDED_RESOURCENAMES = null; internal static bool Contains(string resourceName) { if (EMBEDDED_RESOURCENAMES == null) EMBEDDED_RESOURCENAMES = ASSEMBLY.GetManifestResourceNames(); return EMBEDDED_RESOURCENAMES.Contains(PREFIX + resourceName); } internal static Stream Get(string resourceName) { if (EMBEDDED_RESOURCENAMES == null) EMBEDDED_RESOURCENAMES = ASSEMBLY.GetManifestResourceNames(); return ASSEMBLY.GetManifestResourceStream(PREFIX + resourceName); } } }
TakTraum/cmdr
cmdr/cmdr.TsiLib/Resources/EmbeddedResource.cs
C#
gpl-3.0
932
<!DOCTYPE html> <html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " lang="es"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Publicaciones sobre security, experience | Santos Gallegos</title> <link href="../../../assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> <meta name="theme-color" content="#222222"> <meta name="generator" content="Nikola (getnikola.com)"> <link rel="alternate" type="application/rss+xml" title="RSS (es)" hreflang="es" href="../../rss.xml"> <link rel="alternate" type="application/rss+xml" title="RSS (en)" hreflang="en" href="../../../rss.xml"> <link rel="canonical" href="https://stsewd.dev/es/categories/cat_security-experience/"> <!--[if lt IE 9]><script src="../../../assets/js/html5.js"></script><![endif]--><!-- Custom css --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="../../../assets/css/custom.css" type="text/css" media="all"> <!-- Cloudflare Web Analytics --><script defer src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "f0bcc690290a454ab2e555da28759807"}'></script><!-- End Cloudflare Web Analytics --><link rel="alternate" type="application/rss+xml" title="RSS for category security, experience (es)" hreflang="es" href="../cat_security-experience.xml"> </head> <body> <a href="#content" class="sr-only sr-only-focusable">Ir al contenido principal</a> <!-- Menubar --> <nav class="navbar navbar-expand-md static-top mb-4 navbar-dark bg-dark "><div class="container"> <!-- This keeps the margins nice --> <a class="navbar-brand" href="../../"> <span id="blog-title">Santos Gallegos</span> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-navbar" aria-controls="bs-navbar" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="bs-navbar"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> <a href="../../archive.html" class="nav-link">Posts</a> </li> <li class="nav-item"> <a href="../../projects/" class="nav-link">Proyectos</a> </li> <li class="nav-item"> <a href="../../about/" class="nav-link">Acerca de</a> </li> </ul> <ul class="navbar-nav navbar-right"> <li> </li> <li class="nav-item"><a href="../../../" rel="alternate" hreflang="en" class="nav-link">English</a></li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav><!-- End of Menubar --><div class="container" id="content" role="main"> <div class="body-content"> <!--Body content--> <article class="tagpage"><header><h1>Publicaciones sobre security, experience</h1> <div class="metadata"> <p class="feedlink"> <a href="../cat_security-experience.xml" hreflang="es" type="application/rss+xml">Canal RSS (security, experience, es)</a> </p> </div> </header><ul class="postlist"> <li> <time class="listdate" datetime="2021-06-18T00:00:00-05:00" title="2021-06-18">2021-06-18</time><a href="../../posts/a-tale-about-security-in-web-applications/" class="listtitle">A tale about security in web applications, or how I helped to save a bank from bankruptcy</a><a></a> </li> </ul></article><!--End of body content--><footer id="footer"><div class="container"> <div class="row text-center"> <div class="col"> <small> Contents © 2021 <a href="mailto:stsewd@protonmail.com">Santos Gallegos</a> - Powered by <a href="https://getnikola.com" rel="nofollow">Nikola</a> - Hosted on <a href="https://pages.github.com/" rel="nofollow">GitHub Pages</a> </small> </div> </div> <div class="row text-center"> <div class="col"> <small> <a href="http://github.com/stsewd"> <i class="fa fa-github fa-2x"></i> </a> <a href="http://twitter.com/stsewd"> <i class="fa fa-twitter fa-2x"></i> </a> </small> </div> </div> </div> </footer> </div> </div> <script src="../../../assets/js/all-nocdn.js"></script><script> baguetteBox.run('div#content', { ignoreClass: 'islink', captions: function(element){var i=element.getElementsByTagName('img')[0];return i===undefined?'':i.alt;}}); </script> </body> </html>
stsewd/stsewd.github.io
es/categories/cat_security-experience/index.html
HTML
gpl-3.0
4,858
package lu.kremi151.minamod.enums; public enum EnumIceGolhemState { DISABLED((byte)0), PASSIVE((byte)1), ZOMBIE((byte)2); private byte id; private static final EnumIceGolhemState[] LOOKUP; static{ LOOKUP = new EnumIceGolhemState[values().length]; for(EnumIceGolhemState s : values()){ LOOKUP[(int)s.getStateId()] = s; } } EnumIceGolhemState(byte id){ this.id = id; } public byte getStateId(){ return id; } public static EnumIceGolhemState getFromId(byte id){ if(id < LOOKUP.length)return LOOKUP[(int)id]; return ZOMBIE; } }
kremi151/MinaMod
src/main/java/lu/kremi151/minamod/enums/EnumIceGolhemState.java
Java
gpl-3.0
565
<?php namespace Orm\Entity; use Doctrine\ORM\Mapping as ORM; use Seitenbau\UniqueIdGenerator; /** * Orm\Entity\Lock */ class Lock { /** * @var string $websiteid */ private $websiteid; /** * @var string $itemid */ private $itemid = ''; /** * @var string $userid */ private $userid = ''; /** * @var string $runid */ private $runid = ''; /** * @var string $type */ private $type = ''; /** * @var starttime */ private $starttime; /** * @var lastactivity */ private $lastactivity; /** * @param Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */ public static function loadMetadata(ORM\ClassMetadataInfo $metadata) { $metadata->setTableName('locks'); $metadata->setIdGeneratorType(ORM\ClassMetadataInfo::GENERATOR_TYPE_NONE); $metadata->setCustomRepositoryClass('Orm\Repository\LockRepository'); $metadata->mapField(array( 'fieldName' => 'userid', 'type' => 'string', 'length' => 100, )); $metadata->mapField(array( 'fieldName' => 'runid', 'type' => 'string', 'length' => 100 )); $metadata->mapField(array( 'id' => true, 'fieldName' => 'itemid', 'type' => 'string', 'length' => 100, )); $metadata->mapField(array( 'id' => true, 'fieldName' => 'websiteid', 'type' => 'string', 'length' => 100, )); $metadata->mapField(array( 'id' => true, 'fieldName' => 'type', 'type' => 'string', 'length' => 100, )); $metadata->mapField(array( 'fieldName' => 'starttime', 'type' => 'string', 'length' => 20 )); $metadata->mapField(array( 'fieldName' => 'lastactivity', 'type' => 'string', 'length' => 20 )); } /** * Set websiteid * * @param string $websiteid */ public function setWebsiteid($websiteid) { $this->websiteid = $websiteid; } /** * Get websiteid * * @return string */ public function getWebsiteid() { return $this->websiteid; } /** * Set userid * * @param string $userid */ public function setUserid($userid) { $this->userid = $userid; } /** * Get userid * * @return string */ public function getUserid() { return $this->userid; } /** * Set runid * * @param string $runid */ public function setRunid($runid) { $this->runid = $runid; } /** * Get runid * * @return string */ public function getRunid() { return $this->runid; } /** * Set itemid * * @param string $itemid */ public function setItemid($itemid) { $this->itemid = $itemid; } /** * Get itemid * * @return string */ public function getItemid() { return $this->itemid; } /** * Set type * * @param string $type */ public function setType($type) { $this->type = $type; } /** * Get type * * @return string */ public function getType() { return $this->type; } /** * Get starttime * * @return int */ public function getStarttime() { return $this->starttime; } /** * Set starttime * * @param string $starttime */ public function setStarttime($starttime) { $this->starttime = $starttime; } /** * Get lastactivity * * @return int */ public function getLastactivity() { return $this->lastactivity; } /** * Set lastactivity * * @param string $lastactivity */ public function setLastactivity($lastactivity) { $this->lastactivity = $lastactivity; } /** * Liefert alle Columns und deren Values * * @return array */ public function toArray() { return array( 'userId' => $this->getUserid(), 'runId' => $this->getRunid(), 'itemId' => $this->getItemid(), 'websiteid' => $this->getWebsiteid(), 'type' => $this->getType(), 'starttime' => $this->getStarttime(), 'lastactivity' => $this->getLastactivity() ); } /** * Liefert ein CMS Datenobjekt zurueck mit den Werten des ORM Objektes * * @return \Cms\Data\Lock */ public function toCmsData() { $dataObject = new \Cms\Data\Lock(); $dataObject->setUserid($this->getUserid()) ->setRunid($this->getRunid()) ->setItemid($this->getItemid()) ->setWebsiteid($this->getWebsiteid()) ->setType($this->getType()) ->setStarttime($this->getStarttime()) ->setLastactivity($this->getLastactivity()); return $dataObject; } }
rukzuk/rukzuk
app/server/library/Orm/Entity/Lock.php
PHP
gpl-3.0
4,641
package com.baselet.element.facet; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; import com.baselet.control.enums.FormatLabels; import com.baselet.diagram.draw.helper.StyleException; import com.baselet.gui.AutocompletionText; public abstract class KeyValueFacet extends Facet { public static class KeyValue { private final String key; private final boolean allValuesListed; private final List<ValueInfo> valueInfos; public KeyValue(String key, boolean allValuesListed, String value, String info) { super(); this.key = key.toLowerCase(Locale.ENGLISH); this.allValuesListed = allValuesListed; valueInfos = Arrays.asList(new ValueInfo(value, info)); } public KeyValue(String key, List<ValueInfo> valueInfos) { super(); this.key = key; allValuesListed = true; this.valueInfos = valueInfos; } public KeyValue(String key, ValueInfo... valueInfos) { this(key, Arrays.asList(valueInfos)); } public String getKey() { return key; } public List<ValueInfo> getValueInfos() { return valueInfos; } public String getValueString() { StringBuilder sb = new StringBuilder(); if (allValuesListed) { sb.append("Valid are: "); for (ValueInfo vi : valueInfos) { sb.append(vi.value.toString().toLowerCase(Locale.ENGLISH)).append(','); } sb.deleteCharAt(sb.length() - 1); } else { for (ValueInfo vi : valueInfos) { sb.append(vi.info); } } return sb.toString(); } } public static class ValueInfo { private final Object value; private final String info; private final String base64Img; public ValueInfo(Object value, String info) { this(value, info, null); } public ValueInfo(Object value, String info, String base64Img) { super(); this.value = value; this.info = info; this.base64Img = base64Img; } public Object getValue() { return value; } private String getInfo() { return info; } private String getBase64Img() { return base64Img; } } public static final String SEP = "="; public abstract KeyValue getKeyValue(); public abstract void handleValue(String value, PropertiesParserState state); @Override public boolean checkStart(String line, PropertiesParserState state) { return line.startsWith(getKeyWithSep()); } @Override public void handleLine(String line, PropertiesParserState state) { String value = extractValue(line); try { handleValue(value, state); } catch (Exception e) { log.debug("KeyValue Error", e); String errorMessage = getKeyValue().getValueString(); if (e instanceof StyleException) { // self defined exceptions overwrite the default message errorMessage = e.getMessage(); } throw new RuntimeException(FormatLabels.BOLD.getValue() + "Invalid value:" + FormatLabels.BOLD.getValue() + "\n" + getKeyWithSep() + value + "\n" + errorMessage); } } protected String extractValue(String line) { return line.substring(getKeyWithSep().length()); } @Override public List<AutocompletionText> getAutocompletionStrings() { List<AutocompletionText> returnList = new ArrayList<AutocompletionText>(); for (ValueInfo valueInfo : getKeyValue().getValueInfos()) { returnList.add(new AutocompletionText(getKeyWithSep() + valueInfo.getValue().toString().toLowerCase(Locale.ENGLISH), valueInfo.getInfo(), valueInfo.getBase64Img())); } return returnList; } public String getKeyWithSep() { return getKeyValue().getKey() + KeyValueFacet.SEP; } }
umlet/umlet
umlet-elements/src/main/java/com/baselet/element/facet/KeyValueFacet.java
Java
gpl-3.0
3,528
package org.craftercms.studio.impl.repository.mongodb.api.model; import java.util.HashSet; import java.util.Set; /** * Tree node of type T. * @param <T> Any class that implements Comparable */ public class TreeNode<T extends Comparable<T>> { private T value; private TreeNode<T> parent; private Set<TreeNode<T>> children; public TreeNode() { } public TreeNode(final T value, final TreeNode<T> parent, final Set<TreeNode<T>> children) { this.value = value; this.parent = parent; this.children = children; } public void addChild(final T child) { addChild(new TreeNode<>(child, this, null)); } public void addChild(final TreeNode<T> treeNode) { if (this.children == null) { children = new HashSet<TreeNode<T>>(); } this.children.add(treeNode); } public T getValue() { return value; } public void setValue(final T value) { this.value = value; } public TreeNode<T> getParent() { return parent; } public void setParent(final TreeNode<T> parent) { this.parent = parent; } public Set<TreeNode<T>> getChildren() { return children; } public void setChildren(final Set<TreeNode<T>> children) { this.children = children; } }
craftercms/repo
src/main/java/org/craftercms/studio/impl/repository/mongodb/api/model/TreeNode.java
Java
gpl-3.0
1,338
#Method list * onClose, onError, onMessage,onOpen (to attach event listener) * getBinaryType, getBufferedAmount, getExtensions, getProtocol, getReadyState, getUrl (to get websocket properties) * isOpen (returns true if websocket is opened, else return false) * close (close the websocket) * send(message) (send message to server) ``` //example (function() { var sws = new SmartWebSocket('ws://127.0.0.1:8000'); sws.onMessage(function(e, sws) { console.log('on message 1 called, data: ' + e.data); }).onMessage(function(e, sws) { console.log('on message 2 called, data: ' + e.data); }).send('hello,world').send('hello,world 2'); })(); ```
rabbit-aaron/SmartWebSocket
README.md
Markdown
gpl-3.0
672
<?php /************************************************************************ Codelet Tuning Infrastructure Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ************************************************************************/ // Authors: Franck Talbart, Mathieu Bordet, Nicolas Petit require_once($_SERVER['DOCUMENT_ROOT'].'../cfg/config.inc.php'); require_once($DIRECTORY['INCLUDE'].'globals.inc.php'); require_once($DIRECTORY['INCLUDE'].'cts_utils.inc.php'); require_once($DIRECTORY['PLUGINS'].'ImportCsvPlugin.php'); require_once($DIRECTORY['PLUGINS'].'FilePlugin.php'); require_once($DIRECTORY['PLUGINS'].'DatabasePlugin.php'); require_once($DIRECTORY['VIEW'].'SavedQueries.php'); $import_csv_plugin = new ImportCsvPlugin(); $file_plugin = new FilePlugin(); $database_plugin = new DatabasePlugin(); $current = ''; if(isset($_GET['main'])) { $current = $_GET['main']; } ?> <div id="left_menu"> <ul class="navigation"> <li class="toggleSubMenu"><span>Add</span> <ul class="subMenu"> <li><a <?php if($current == 'cts_input_form' && $_GET['produced_by'] == $import_csv_plugin->uid && $_GET['command'] == 'init'){ echo 'class="highlit"';}?> title="Import a CSV file" href="?page=files&main=cts_input_form&mode=add&amp;produced_by=<?php echo $import_csv_plugin->uid;?>&amp;command=init" onclick="load_main_frame(this); return false;">Import a CSV file</a> </li> <li><a <?php if($current == 'cts_input_form' && $_GET['produced_by'] == $file_plugin->uid && $_GET['command'] == 'init'){ echo 'class="highlit"';}?> title="Import a file" href="?page=files&main=cts_input_form&mode=add&amp;produced_by=<?php echo $file_plugin->uid;?>&amp;command=init" onclick="load_main_frame(this); return false;">Import a file</a> </li> <li><a <?php if($current == 'cts_input_form' && $_GET['produced_by'] == $database_plugin->uid && $_GET['command'] == 'from_csv'){ echo 'class="highlit"';}?> title="Create a schema from CSV" href="?page=files&main=cts_input_form&mode=add&amp;produced_by=<?php echo $database_plugin->uid;?>&amp;command=from_csv" onclick="load_main_frame(this); return false;">Create a schema from CSV</a> </li> </ul> </li> <li class="toggleSubMenu"><span>List</span> <ul class="subMenu"> <li><a <?php if($current == 'query' && (@$_GET['produced_by'] == $file_plugin->uid || @$_GET['produced_by'] == 'file')){ echo 'class="highlit"';}?> title="List of files" href="?page=files&main=query&amp;search_query=*&produced_by=file" onclick="load_main_frame(this); return false;">List of files</a></li> </ul> </li> </ul> <?php $login_uid = $_SESSION['login_uid']; $saved_queries = new SavedQueries($login_uid); $saved_queries->html(); ?> </div> <div id="main_frame"> <?php if(!isset($_GET['main'])) { $_GET['main'] = default_include('files'); } if (security_include($_GET['main'])) { require_once($DIRECTORY['PAGES']. $_GET['main'] . '.php'); } else { echo 'This page is not allowed!'; } ?> </div>
franck-talbart/codelet_tuning_infrastructure
cts/pages/files.php
PHP
gpl-3.0
3,793
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("French Numbers")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Davenport Community School District")> <Assembly: AssemblyProduct("French Numbers")> <Assembly: AssemblyCopyright("Copyright © Davenport Community School District 2017")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("179ee745-264f-4c09-a60e-c875ddaefbb1")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
bradymac16/VBChapter1-2
French Numbers/French Numbers/My Project/AssemblyInfo.vb
Visual Basic
gpl-3.0
1,216
<?php # # forum-list bridge # Copyright (C) 2010 Joel Uckelman # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # require_once(__DIR__ . '/EmailMessage.php'); class MailmanMessage extends EmailMessage { public function __construct($input) { parent::__construct($input); } public function getSource() { # remove 'mailto:' $lp = substr_replace($this->getHeader('list-post'), '', 1, 7); $src = mailparse_rfc822_parse_addresses($lp); return $src[0]['address']; } } ?>
Windfisch/phpbb3-listbridge
src/MailmanMessage.php
PHP
gpl-3.0
1,085
<?php class Elementor_Test_Widgets extends WP_UnitTestCase { public function test_getInstance() { $this->assertInstanceOf( '\Elementor\Widgets_Manager', Elementor\Plugin::$instance->widgets_manager ); } public function test_getWidgets() { $this->assertNotEmpty( Elementor\Plugin::$instance->widgets_manager->get_widget_types() ); } public function test_elementMethods() { foreach ( Elementor\Plugin::$instance->widgets_manager->get_widget_types() as $widget_type ) { $name = $widget_type->get_name(); if ( 'common' === $name ) { continue; } $this->assertNotEmpty( $widget_type->get_title() ); $this->assertNotEmpty( $widget_type->get_type() ); $this->assertNotEmpty( $name ); } } public function test_registerNUnregisterWidget() { $widget_class = '\Elementor\Widget_Text_editor'; $widget_id = 'text-editor'; $this->assertTrue( Elementor\Plugin::$instance->widgets_manager->register_widget_type( new $widget_class() ) ); $widget = Elementor\Plugin::$instance->widgets_manager->get_widget_types( $widget_id ); $this->assertInstanceOf( $widget_class, $widget ); $this->assertTrue( Elementor\Plugin::$instance->widgets_manager->unregister_widget_type( $widget_id ) ); $this->assertFalse( Elementor\Plugin::$instance->widgets_manager->unregister_widget_type( $widget_id ) ); $this->assertNull( Elementor\Plugin::$instance->widgets_manager->get_widget_types( $widget_id ) ); } public function test_controlsSelectorsData() { foreach ( Elementor\Plugin::$instance->widgets_manager->get_widget_types() as $widget ) { foreach ( $widget->get_controls() as $control ) { if ( empty( $control['selectors'] ) ) { continue; } foreach ( $control['selectors'] as $selector => $css_property ) { foreach ( explode( ',', $selector ) as $item ) { preg_match( '/\{\{(WRAPPER)|(ID)\}\}/', $item, $matches ); $this->assertTrue( !! $matches ); } } } } } public function test_controlsDefaultData() { foreach ( Elementor\Plugin::$instance->widgets_manager->get_widget_types() as $widget ) { foreach ( $widget->get_controls() as $control ) { if ( \Elementor\Controls_Manager::SELECT !== $control['type'] ) continue; $error_msg = sprintf( 'Widget: %s, Control: %s', $widget->get_name(), $control['name'] ); if ( empty( $control['default'] ) ) $this->assertTrue( isset( $control['options'][''] ), $error_msg ); else $this->assertArrayHasKey( $control['default'], $control['options'], $error_msg ); } } } }
cobicarmel/elementor
tests/test-widgets.php
PHP
gpl-3.0
2,552
android-segoway ===============
khreenberg/android-segoway
README.md
Markdown
gpl-3.0
32
#!/usr/bin/python # $Id:$ from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.win32 import _kernel32, _user32, types, constants from pyglet.libs.win32.constants import * from pyglet.libs.win32.types import * class Win32Display(Display): def get_screens(self): screens = [] def enum_proc(hMonitor, hdcMonitor, lprcMonitor, dwData): r = lprcMonitor.contents width = r.right - r.left height = r.bottom - r.top screens.append( Win32Screen(self, hMonitor, r.left, r.top, width, height)) return True enum_proc_type = WINFUNCTYPE(BOOL, HMONITOR, HDC, POINTER(RECT), LPARAM) enum_proc_ptr = enum_proc_type(enum_proc) _user32.EnumDisplayMonitors(NULL, NULL, enum_proc_ptr, 0) return screens class Win32Screen(Screen): _initial_mode = None def __init__(self, display, handle, x, y, width, height): super(Win32Screen, self).__init__(display, x, y, width, height) self._handle = handle def get_matching_configs(self, template): canvas = Win32Canvas(self.display, 0, _user32.GetDC(0)) configs = template.match(canvas) # XXX deprecate config's being screen-specific for config in configs: config.screen = self return configs def get_device_name(self): info = MONITORINFOEX() info.cbSize = sizeof(MONITORINFOEX) _user32.GetMonitorInfoW(self._handle, byref(info)) return info.szDevice def get_modes(self): device_name = self.get_device_name() i = 0 modes = [] while True: mode = DEVMODE() mode.dmSize = sizeof(DEVMODE) r = _user32.EnumDisplaySettingsW(device_name, i, byref(mode)) if not r: break modes.append(Win32ScreenMode(self, mode)) i += 1 return modes def get_mode(self): mode = DEVMODE() mode.dmSize = sizeof(DEVMODE) _user32.EnumDisplaySettingsW(self.get_device_name(), ENUM_CURRENT_SETTINGS, byref(mode)) return Win32ScreenMode(self, mode) def set_mode(self, mode): assert mode.screen is self if not self._initial_mode: self._initial_mode = self.get_mode() r = _user32.ChangeDisplaySettingsExW(self.get_device_name(), byref(mode._mode), None, CDS_FULLSCREEN, None) if r == DISP_CHANGE_SUCCESSFUL: self.width = mode.width self.height = mode.height def restore_mode(self): if self._initial_mode: self.set_mode(self._initial_mode) class Win32ScreenMode(ScreenMode): def __init__(self, screen, mode): super(Win32ScreenMode, self).__init__(screen) self._mode = mode self.width = mode.dmPelsWidth self.height = mode.dmPelsHeight self.depth = mode.dmBitsPerPel self.rate = mode.dmDisplayFrequency class Win32Canvas(Canvas): def __init__(self, display, hwnd, hdc): super(Win32Canvas, self).__init__(display) self.hwnd = hwnd self.hdc = hdc
joaormatos/anaconda
Anaconda/pyglet/canvas/win32.py
Python
gpl-3.0
3,404
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js"><span id='Ext-fx-runner-CssTransition'>/** </span> * @author Jacky Nguyen &lt;jacky@sencha.com&gt; * @private */ Ext.define(&#39;Ext.fx.runner.CssTransition&#39;, { extend: &#39;Ext.fx.runner.Css&#39;, requires: [&#39;Ext.AnimationQueue&#39;], <span id='Ext-fx-runner-CssTransition-property-listenersAttached'> listenersAttached: false, </span> <span id='Ext-fx-runner-CssTransition-method-constructor'> constructor: function() { </span> this.runningAnimationsData = {}; return this.callParent(arguments); }, <span id='Ext-fx-runner-CssTransition-method-attachListeners'> attachListeners: function() { </span> this.listenersAttached = true; this.getEventDispatcher().addListener(&#39;element&#39;, &#39;*&#39;, &#39;transitionend&#39;, &#39;onTransitionEnd&#39;, this); }, <span id='Ext-fx-runner-CssTransition-method-onTransitionEnd'> onTransitionEnd: function(e) { </span> var target = e.target, id = target.id; if (id &amp;&amp; this.runningAnimationsData.hasOwnProperty(id)) { this.refreshRunningAnimationsData(Ext.get(target), [e.browserEvent.propertyName]); } }, <span id='Ext-fx-runner-CssTransition-method-onAnimationEnd'> onAnimationEnd: function(element, data, animation, isInterrupted, isReplaced) { </span> var id = element.getId(), runningData = this.runningAnimationsData[id], endRules = {}, endData = {}, runningNameMap, toPropertyNames, i, ln, name; animation.un(&#39;stop&#39;, &#39;onAnimationStop&#39;, this); if (runningData) { runningNameMap = runningData.nameMap; } endRules[id] = endData; if (data.onBeforeEnd) { data.onBeforeEnd.call(data.scope || this, element, isInterrupted); } animation.fireEvent(&#39;animationbeforeend&#39;, animation, element, isInterrupted); this.fireEvent(&#39;animationbeforeend&#39;, this, animation, element, isInterrupted); if (isReplaced || (!isInterrupted &amp;&amp; !data.preserveEndState)) { toPropertyNames = data.toPropertyNames; for (i = 0,ln = toPropertyNames.length; i &lt; ln; i++) { name = toPropertyNames[i]; if (runningNameMap &amp;&amp; !runningNameMap.hasOwnProperty(name)) { endData[name] = null; } } } if (data.after) { Ext.merge(endData, data.after); } this.applyStyles(endRules); if (data.onEnd) { data.onEnd.call(data.scope || this, element, isInterrupted); } animation.fireEvent(&#39;animationend&#39;, animation, element, isInterrupted); this.fireEvent(&#39;animationend&#39;, this, animation, element, isInterrupted); Ext.AnimationQueue.stop(Ext.emptyFn, animation); }, <span id='Ext-fx-runner-CssTransition-method-onAllAnimationsEnd'> onAllAnimationsEnd: function(element) { </span> var id = element.getId(), endRules = {}; delete this.runningAnimationsData[id]; endRules[id] = { &#39;transition-property&#39;: null, &#39;transition-duration&#39;: null, &#39;transition-timing-function&#39;: null, &#39;transition-delay&#39;: null }; this.applyStyles(endRules); this.fireEvent(&#39;animationallend&#39;, this, element); }, <span id='Ext-fx-runner-CssTransition-method-hasRunningAnimations'> hasRunningAnimations: function(element) { </span> var id = element.getId(), runningAnimationsData = this.runningAnimationsData; return runningAnimationsData.hasOwnProperty(id) &amp;&amp; runningAnimationsData[id].sessions.length &gt; 0; }, <span id='Ext-fx-runner-CssTransition-method-refreshRunningAnimationsData'> refreshRunningAnimationsData: function(element, propertyNames, interrupt, replace) { </span> var id = element.getId(), runningAnimationsData = this.runningAnimationsData, runningData = runningAnimationsData[id]; if (!runningData) { return; } var nameMap = runningData.nameMap, nameList = runningData.nameList, sessions = runningData.sessions, ln, j, subLn, name, i, session, map, list, hasCompletedSession = false; interrupt = Boolean(interrupt); replace = Boolean(replace); if (!sessions) { return this; } ln = sessions.length; if (ln === 0) { return this; } if (replace) { runningData.nameMap = {}; nameList.length = 0; for (i = 0; i &lt; ln; i++) { session = sessions[i]; this.onAnimationEnd(element, session.data, session.animation, interrupt, replace); } sessions.length = 0; } else { for (i = 0; i &lt; ln; i++) { session = sessions[i]; map = session.map; list = session.list; for (j = 0,subLn = propertyNames.length; j &lt; subLn; j++) { name = propertyNames[j]; if (map[name]) { delete map[name]; Ext.Array.remove(list, name); session.length--; if (--nameMap[name] == 0) { delete nameMap[name]; Ext.Array.remove(nameList, name); } } } if (session.length == 0) { sessions.splice(i, 1); i--; ln--; hasCompletedSession = true; this.onAnimationEnd(element, session.data, session.animation, interrupt); } } } if (!replace &amp;&amp; !interrupt &amp;&amp; sessions.length == 0 &amp;&amp; hasCompletedSession) { this.onAllAnimationsEnd(element); } }, <span id='Ext-fx-runner-CssTransition-method-getRunningData'> getRunningData: function(id) { </span> var runningAnimationsData = this.runningAnimationsData; if (!runningAnimationsData.hasOwnProperty(id)) { runningAnimationsData[id] = { nameMap: {}, nameList: [], sessions: [] }; } return runningAnimationsData[id]; }, <span id='Ext-fx-runner-CssTransition-method-getTestElement'> getTestElement: function() { </span> var testElement = this.testElement, iframe, iframeDocument, iframeStyle; if (!testElement) { iframe = document.createElement(&#39;iframe&#39;); iframeStyle = iframe.style; iframeStyle.setProperty(&#39;visibility&#39;, &#39;hidden&#39;, &#39;important&#39;); iframeStyle.setProperty(&#39;width&#39;, &#39;0px&#39;, &#39;important&#39;); iframeStyle.setProperty(&#39;height&#39;, &#39;0px&#39;, &#39;important&#39;); iframeStyle.setProperty(&#39;position&#39;, &#39;absolute&#39;, &#39;important&#39;); iframeStyle.setProperty(&#39;border&#39;, &#39;0px&#39;, &#39;important&#39;); iframeStyle.setProperty(&#39;zIndex&#39;, &#39;-1000&#39;, &#39;important&#39;); document.body.appendChild(iframe); iframeDocument = iframe.contentDocument; iframeDocument.open(); iframeDocument.writeln(&#39;&lt;/body&gt;&#39;); iframeDocument.close(); this.testElement = testElement = iframeDocument.createElement(&#39;div&#39;); testElement.style.setProperty(&#39;position&#39;, &#39;absolute&#39;, &#39;important&#39;); iframeDocument.body.appendChild(testElement); this.testElementComputedStyle = window.getComputedStyle(testElement); } return testElement; }, <span id='Ext-fx-runner-CssTransition-method-getCssStyleValue'> getCssStyleValue: function(name, value) { </span> var testElement = this.getTestElement(), computedStyle = this.testElementComputedStyle, style = testElement.style; style.setProperty(name, value); if (Ext.browser.is.Firefox) { // We force a repaint of the element in Firefox to make sure the computedStyle to be updated testElement.offsetHeight; } value = computedStyle.getPropertyValue(name); style.removeProperty(name); return value; }, <span id='Ext-fx-runner-CssTransition-method-run'> run: function(animations) { </span> var me = this, isLengthPropertyMap = this.lengthProperties, fromData = {}, toData = {}, data = {}, element, elementId, from, to, before, fromPropertyNames, toPropertyNames, doApplyTo, message, runningData, elementData, i, j, ln, animation, propertiesLength, sessionNameMap, computedStyle, formattedName, name, toFormattedValue, computedValue, fromFormattedValue, isLengthProperty, runningNameMap, runningNameList, runningSessions, runningSession; if (!this.listenersAttached) { this.attachListeners(); } animations = Ext.Array.from(animations); for (i = 0,ln = animations.length; i &lt; ln; i++) { animation = animations[i]; animation = Ext.factory(animation, Ext.fx.Animation); element = animation.getElement(); // Empty function to prevent idleTasks from running while we animate. Ext.AnimationQueue.start(Ext.emptyFn, animation); computedStyle = window.getComputedStyle(element.dom); elementId = element.getId(); data = Ext.merge({}, animation.getData()); if (animation.onBeforeStart) { animation.onBeforeStart.call(animation.scope || this, element); } animation.fireEvent(&#39;animationstart&#39;, animation); this.fireEvent(&#39;animationstart&#39;, this, animation); data[elementId] = data; before = data.before; from = data.from; to = data.to; data.fromPropertyNames = fromPropertyNames = []; data.toPropertyNames = toPropertyNames = []; for (name in to) { if (to.hasOwnProperty(name)) { to[name] = toFormattedValue = this.formatValue(to[name], name); formattedName = this.formatName(name); isLengthProperty = isLengthPropertyMap.hasOwnProperty(name); if (!isLengthProperty) { toFormattedValue = this.getCssStyleValue(formattedName, toFormattedValue); } if (from.hasOwnProperty(name)) { from[name] = fromFormattedValue = this.formatValue(from[name], name); if (!isLengthProperty) { fromFormattedValue = this.getCssStyleValue(formattedName, fromFormattedValue); } if (toFormattedValue !== fromFormattedValue) { fromPropertyNames.push(formattedName); toPropertyNames.push(formattedName); } } else { computedValue = computedStyle.getPropertyValue(formattedName); if (toFormattedValue !== computedValue) { toPropertyNames.push(formattedName); } } } } propertiesLength = toPropertyNames.length; if (propertiesLength === 0) { this.onAnimationEnd(element, data, animation); continue; } runningData = this.getRunningData(elementId); runningSessions = runningData.sessions; if (runningSessions.length &gt; 0) { this.refreshRunningAnimationsData( element, Ext.Array.merge(fromPropertyNames, toPropertyNames), true, data.replacePrevious ); } runningNameMap = runningData.nameMap; runningNameList = runningData.nameList; sessionNameMap = {}; for (j = 0; j &lt; propertiesLength; j++) { name = toPropertyNames[j]; sessionNameMap[name] = true; if (!runningNameMap.hasOwnProperty(name)) { runningNameMap[name] = 1; runningNameList.push(name); } else { runningNameMap[name]++; } } runningSession = { element: element, map: sessionNameMap, list: toPropertyNames.slice(), length: propertiesLength, data: data, animation: animation }; runningSessions.push(runningSession); animation.on(&#39;stop&#39;, &#39;onAnimationStop&#39;, this); elementData = Ext.apply({}, before); Ext.apply(elementData, from); if (runningNameList.length &gt; 0) { fromPropertyNames = Ext.Array.difference(runningNameList, fromPropertyNames); toPropertyNames = Ext.Array.merge(fromPropertyNames, toPropertyNames); elementData[&#39;transition-property&#39;] = fromPropertyNames; } fromData[elementId] = elementData; toData[elementId] = Ext.apply({}, to); toData[elementId][&#39;transition-property&#39;] = toPropertyNames; toData[elementId][&#39;transition-duration&#39;] = data.duration; toData[elementId][&#39;transition-timing-function&#39;] = data.easing; toData[elementId][&#39;transition-delay&#39;] = data.delay; animation.startTime = Date.now(); } message = this.$className; this.applyStyles(fromData); doApplyTo = function(e) { if (e.data === message &amp;&amp; e.source === window) { window.removeEventListener(&#39;message&#39;, doApplyTo, false); me.applyStyles(toData); } }; if(Ext.browser.is.IE) { window.requestAnimationFrame(function() { window.addEventListener(&#39;message&#39;, doApplyTo, false); window.postMessage(message, &#39;*&#39;); }); }else{ window.addEventListener(&#39;message&#39;, doApplyTo, false); window.postMessage(message, &#39;*&#39;); } }, <span id='Ext-fx-runner-CssTransition-method-onAnimationStop'> onAnimationStop: function(animation) { </span> var runningAnimationsData = this.runningAnimationsData, id, runningData, sessions, i, ln, session; for (id in runningAnimationsData) { if (runningAnimationsData.hasOwnProperty(id)) { runningData = runningAnimationsData[id]; sessions = runningData.sessions; for (i = 0,ln = sessions.length; i &lt; ln; i++) { session = sessions[i]; if (session.animation === animation) { this.refreshRunningAnimationsData(session.element, session.list.slice(), false); } } } } } }); </pre> </body> </html>
MetroBlooms/evaluate-it
docs/source/CssTransition.html
HTML
gpl-3.0
16,620
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license import re from dadict import DADict from error import log_loading ############ ## Consts ## ############ ETHER_ANY = "\x00"*6 ETHER_BROADCAST = "\xff"*6 ETH_P_ALL = 3 ETH_P_IP = 0x800 ETH_P_ARP = 0x806 ETH_P_IPV6 = 0x86dd # From net/if_arp.h ARPHDR_ETHER = 1 ARPHDR_METRICOM = 23 ARPHDR_PPP = 512 ARPHDR_LOOPBACK = 772 ARPHDR_TUN = 65534 # From net/ipv6.h on Linux (+ Additions) IPV6_ADDR_UNICAST = 0x01 IPV6_ADDR_MULTICAST = 0x02 IPV6_ADDR_CAST_MASK = 0x0F IPV6_ADDR_LOOPBACK = 0x10 IPV6_ADDR_GLOBAL = 0x00 IPV6_ADDR_LINKLOCAL = 0x20 IPV6_ADDR_SITELOCAL = 0x40 # deprecated since Sept. 2004 by RFC 3879 IPV6_ADDR_SCOPE_MASK = 0xF0 #IPV6_ADDR_COMPATv4 = 0x80 # deprecated; i.e. ::/96 #IPV6_ADDR_MAPPED = 0x1000 # i.e.; ::ffff:0.0.0.0/96 IPV6_ADDR_6TO4 = 0x0100 # Added to have more specific info (should be 0x0101 ?) IPV6_ADDR_UNSPECIFIED = 0x10000 MTU = 1600 # file parsing to get some values : def load_protocols(filename): spaces = re.compile("[ \t]+|\n") dct = DADict(_name=filename) try: for l in open(filename): try: shrp = l.find("#") if shrp >= 0: l = l[:shrp] l = l.strip() if not l: continue lt = tuple(re.split(spaces, l)) if len(lt) < 2 or not lt[0]: continue dct[lt[0]] = int(lt[1]) except Exception,e: log_loading.info("Couldn't parse file [%s]: line [%r] (%s)" % (filename,l,e)) except IOError: log_loading.info("Can't open /etc/protocols file") return dct IP_PROTOS=load_protocols("/etc/protocols") def load_ethertypes(filename): spaces = re.compile("[ \t]+|\n") dct = DADict(_name=filename) try: f=open(filename) for l in f: try: shrp = l.find("#") if shrp >= 0: l = l[:shrp] l = l.strip() if not l: continue lt = tuple(re.split(spaces, l)) if len(lt) < 2 or not lt[0]: continue dct[lt[0]] = int(lt[1], 16) except Exception,e: log_loading.info("Couldn't parse file [%s]: line [%r] (%s)" % (filename,l,e)) f.close() except IOError,msg: pass return dct ETHER_TYPES=load_ethertypes("/etc/ethertypes") def load_services(filename): spaces = re.compile("[ \t]+|\n") tdct=DADict(_name="%s-tcp"%filename) udct=DADict(_name="%s-udp"%filename) try: f=open(filename) for l in f: try: shrp = l.find("#") if shrp >= 0: l = l[:shrp] l = l.strip() if not l: continue lt = tuple(re.split(spaces, l)) if len(lt) < 2 or not lt[0]: continue if lt[1].endswith("/tcp"): tdct[lt[0]] = int(lt[1].split('/')[0]) elif lt[1].endswith("/udp"): udct[lt[0]] = int(lt[1].split('/')[0]) except Exception,e: log_loading.warning("Couldn't file [%s]: line [%r] (%s)" % (filename,l,e)) f.close() except IOError: log_loading.info("Can't open /etc/services file") return tdct,udct TCP_SERVICES,UDP_SERVICES=load_services("/etc/services") class ManufDA(DADict): def fixname(self, val): return val def _get_manuf_couple(self, mac): oui = ":".join(mac.split(":")[:3]).upper() return self.__dict__.get(oui,(mac,mac)) def _get_manuf(self, mac): return self._get_manuf_couple(mac)[1] def _get_short_manuf(self, mac): return self._get_manuf_couple(mac)[0] def _resolve_MAC(self, mac): oui = ":".join(mac.split(":")[:3]).upper() if oui in self: return ":".join([self[oui][0]]+ mac.split(":")[3:]) return mac def load_manuf(filename): try: manufdb=ManufDA(_name=filename) for l in open(filename): try: l = l.strip() if not l or l.startswith("#"): continue oui,shrt=l.split()[:2] i = l.find("#") if i < 0: lng=shrt else: lng = l[i+2:] manufdb[oui] = shrt,lng except Exception,e: log_loading.warning("Couldn't parse one line from [%s] [%r] (%s)" % (filename, l, e)) except IOError: #log_loading.warning("Couldn't open [%s] file" % filename) pass return manufdb ##################### ## knowledge bases ## ##################### class KnowledgeBase: def __init__(self, filename): self.filename = filename self.base = None def lazy_init(self): self.base = "" def reload(self, filename = None): if filename is not None: self.filename = filename oldbase = self.base self.base = None self.lazy_init() if self.base is None: self.base = oldbase def get_base(self): if self.base is None: self.lazy_init() return self.base
isislovecruft/switzerland
switzerland/lib/shrunk_scapy/data.py
Python
gpl-3.0
5,617
#!/usr/bin/python3 # -*- coding: utf-8 -*- r"""Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.""" from math import exp from scipy.constants import R from lib.EoS.Cubic.RK import RK class RKTwu(RK): r"""Equation of state of Redlich-Kwong with a modified alpha temperature dependence by Twu, (1995) [1]_. .. math:: \begin{array}[t]{l} P = \frac{RT}{V-b}-\frac{a}{V\left(V+b\right)}\\ a = 0.427480263354\frac{R^2T_c^2}{P_c}\alpha\\ b = 0.086640349965\frac{RT_c}{P_c}\\ \alpha = alpha^{(0)} + \omega\left(\alpha^{(1)}-\alpha^{(0)}\right)\\ \alpha^{(0)} = T_r^{-0.201158} \exp{0.141599\left(1-T_r^{2.29528} \right)}\\ \alpha^{(1)} = T_r^{-0.660145} \exp{0.500315\left(1-T_r^{2.63165} \right)}\\ \end{array} """ __title__ = "Twu-Redlich-Kwong (1995)" __status__ = "RKTwu" __doi__ = { "autor": "Twu, C.H., Coon, J.E., Cunningham, J.R.", "title": "A New Generalized Alpha Function for a Cubic Equation of " "State Part 2. Redlich-Kwong equation", "ref": "Fluid Phase Equilibria 105 (1995) 61-69", "doi": "10.1016/0378-3812(94)02602-w"}, def _lib(self, cmp, T): """Modified parameteres correlations""" a = 0.42748023354*R**2*cmp.Tc**2/cmp.Pc alfa = self._alpha(cmp, T) b = 0.086640349965*R*cmp.Tc/cmp.Pc return a*alfa, b def _alpha(self, cmp, T): """Modified α expression""" Tr = T/cmp.Tc if Tr <= 1: alpha0 = Tr**(-0.201158)*exp(0.141599*(1-Tr**2.29528)) # Eq 17 alpha1 = Tr**(-0.660145)*exp(0.500315*(1-Tr**2.63165)) # Eq 18 else: alpha0 = Tr**(-1.10)*exp(0.441411*(1-Tr**(-1.30))) # Eq 19 alpha1 = Tr**(-2.31278)*exp(0.03258*(1-Tr**(-10.3128))) # Eq 20 # Eq 15 alpha = alpha0 + cmp.f_acent*(alpha1-alpha0) return alpha if __name__ == "__main__": from lib.mezcla import Mezcla mix = Mezcla(5, ids=[4], caudalMolar=1, fraccionMolar=[1]) eq = RKTwu(300, 9.9742e5, mix) print('%0.0f %0.1f' % (eq.Vg.ccmol, eq.Vl.ccmol)) eq = RKTwu(300, 42.477e5, mix) print('%0.1f' % (eq.Vl.ccmol))
jjgomera/pychemqt
lib/EoS/Cubic/RKTwu.py
Python
gpl-3.0
2,929
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus * * MAUS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MAUS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MAUS. If not, see <http://www.gnu.org/licenses/>. * */ #include "gtest/gtest.h" #include "json/json.h" #include "Geant4/G4Step.hh" #include "Geant4/G4StepPoint.hh" #include "Geant4/G4ParticleTable.hh" #include "CLHEP/Vector/Rotation.h" #include "CLHEP/Vector/ThreeVector.h" #include "src/common_cpp/Utils/Globals.hh" #include "src/common_cpp/Globals/GlobalsManager.hh" #include "src/common_cpp/Simulation/VirtualPlanes.hh" #include "src/legacy/Config/MiceModule.hh" #include "src/legacy/BeamTools/BTConstantField.hh" #include "src/legacy/BeamTools/BTFieldConstructor.hh" #include "Utils/Exception.hh" #include "src/legacy/Interface/VirtualHit.hh" namespace MAUS { /////////////////////// VIRTUALPLANE ///////////////////////////////////////// class VirtualPlaneTest : public ::testing::Test { protected: VirtualPlaneTest() : pos(1., -2., 6.) { rot.set(CLHEP::Hep3Vector(-1., -1., -1.), 235./360.*2.*CLHEP::pi); vp_z = VirtualPlane::BuildVirtualPlane(rot, pos, 100., true, 5., BTTracker::z, VirtualPlane::ignore, true); vp_u = VirtualPlane::BuildVirtualPlane(rot, pos, 100., true, 5., BTTracker::u, VirtualPlane::ignore, true); vp_t = VirtualPlane::BuildVirtualPlane(rot, pos, 100., true, 5., BTTracker::t, VirtualPlane::ignore, true); vp_tau = VirtualPlane::BuildVirtualPlane(rot, pos, 100., false, 5., BTTracker::tau_field, VirtualPlane::new_station, false); } virtual ~VirtualPlaneTest() { } virtual void SetUp() {} virtual void TearDown() {} MiceModule mod; CLHEP::HepRotation rot; CLHEP::Hep3Vector pos; VirtualPlane vp_z, vp_u, vp_t, vp_tau; }; TEST_F(VirtualPlaneTest, ConstructorTest) { // tests most Get functions also EXPECT_EQ(vp_tau.GetMultipassAlgorithm(), VirtualPlane::new_station); EXPECT_EQ(vp_tau.GetPlaneIndependentVariableType(), BTTracker::tau_field); EXPECT_NEAR(vp_tau.GetPlaneIndependentVariable(), 5., 1e-9); EXPECT_NEAR(vp_tau.GetRadialExtent(), 100., 1e-9); EXPECT_EQ(vp_tau.GetGlobalCoordinates(), false); EXPECT_EQ(vp_tau.GetAllowBackwards(), false); for (size_t i = 0; i <3; ++i) EXPECT_NEAR(vp_tau.GetPosition()[i], pos[i], 1e-9); EXPECT_NEAR(vp_tau.GetRotation().phiX(), rot.phiX(), 1e-9); EXPECT_NEAR(vp_tau.GetRotation().phiY(), rot.phiY(), 1e-9); EXPECT_NEAR(vp_tau.GetRotation().phiZ(), rot.phiZ(), 1e-9); EXPECT_THROW(VirtualPlane::BuildVirtualPlane(rot, pos, 1., true, 5., BTTracker::tau_potential, VirtualPlane::ignore, true), MAUS::Exceptions::Exception); } TEST_F(VirtualPlaneTest, GetIndependentVariableZTest) { G4StepPoint point1; CLHEP::Hep3Vector xyz(1, 2, 3); point1.SetPosition(xyz); point1.SetGlobalTime(4.); point1.SetProperTime(5.); EXPECT_NEAR(vp_z.GetIndependentVariable(&point1), 3., 1e-3); EXPECT_NEAR(vp_t.GetIndependentVariable(&point1), 4., 1e-3); EXPECT_NEAR(vp_tau.GetIndependentVariable(&point1), 5., 1e-3); CLHEP::Hep3Vector particle_vec = xyz-pos; // vector from plane to point // BUG just a bit worried that this is rot.inverse() CLHEP::Hep3Vector plane_normal = rot.inverse()*CLHEP::Hep3Vector(0, 0, 1); EXPECT_NEAR(vp_u.GetIndependentVariable(&point1), plane_normal.dot(particle_vec), 1e-3); } TEST_F(VirtualPlaneTest, SteppingOverTest) { G4Step step; step.SetPreStepPoint(new G4StepPoint()); // deleted by step step.SetPostStepPoint(new G4StepPoint()); step.GetPreStepPoint()->SetGlobalTime(4.); step.GetPostStepPoint()->SetGlobalTime(6.); EXPECT_TRUE(vp_t.SteppingOver(&step)); step.GetPreStepPoint()->SetGlobalTime(6.); step.GetPostStepPoint()->SetGlobalTime(4.); EXPECT_TRUE(vp_t.SteppingOver(&step)); vp_t = VirtualPlane::BuildVirtualPlane(rot, pos, 1., true, 5., BTTracker::t, VirtualPlane::ignore, false); EXPECT_FALSE(vp_t.SteppingOver(&step)); step.GetPreStepPoint()->SetGlobalTime(3.); step.GetPostStepPoint()->SetGlobalTime(4.); EXPECT_FALSE(vp_t.SteppingOver(&step)); step.GetPreStepPoint()->SetGlobalTime(6.); step.GetPostStepPoint()->SetGlobalTime(7.); EXPECT_FALSE(vp_t.SteppingOver(&step)); step.GetPreStepPoint()->SetGlobalTime(5.); step.GetPostStepPoint()->SetGlobalTime(6.); EXPECT_TRUE(vp_t.SteppingOver(&step)); step.GetPreStepPoint()->SetGlobalTime(4.); // don't record these ones twice step.GetPostStepPoint()->SetGlobalTime(5.); EXPECT_FALSE(vp_t.SteppingOver(&step)); } G4Track* SetG4TrackAndStep(G4Step* step) { G4ParticleDefinition* pd = G4ParticleTable::GetParticleTable()->FindParticle(-13); G4DynamicParticle* dyn = new G4DynamicParticle(pd, G4ThreeVector(1., 2., 3.)); G4Track* track = new G4Track(dyn, 7., G4ThreeVector(4., 5., 6.)); track->SetStep(step); step->SetTrack(track); step->SetPreStepPoint(new G4StepPoint()); step->SetPostStepPoint(new G4StepPoint()); track->SetTrackID(10); step->GetPreStepPoint()->SetGlobalTime(1.); step->GetPreStepPoint()->SetPosition(CLHEP::Hep3Vector(2., 3., 4.)); step->GetPreStepPoint()->SetMass(dyn->GetMass()); step->GetPreStepPoint()->SetKineticEnergy(100.); step->GetPreStepPoint()->SetMomentumDirection (CLHEP::Hep3Vector(0., 0.1, 1.)/::sqrt(1.01)); step->GetPostStepPoint()->SetGlobalTime(2.); step->GetPostStepPoint()->SetPosition(CLHEP::Hep3Vector(3., 4., 8.)); step->GetPostStepPoint()->SetMass(dyn->GetMass()); step->GetPostStepPoint()->SetKineticEnergy(110.); step->GetPostStepPoint()->SetMomentumDirection (CLHEP::Hep3Vector(0., 0.1, 1.)/::sqrt(1.01)); return track; } TEST_F(VirtualPlaneTest, BuildNewHitTest) { // sorry this is a long one... VirtualPlane vp_z_local = VirtualPlane::BuildVirtualPlane(rot, pos, 100., false, 5., BTTracker::z, VirtualPlane::ignore, true); std::string mod_name = std::string(getenv("MAUS_ROOT_DIR"))+ std::string("/tests/cpp_unit/Simulation/")+ std::string("TestGeometries/MagFieldTest.dat"); MiceModule* mod_orig = MiceModule::deepCopy(*Globals::GetMonteCarloMiceModules()); MiceModule* test_mod = new MiceModule(mod_name); GlobalsManager::SetMonteCarloMiceModules(test_mod); VirtualPlaneManager vpm; vpm.ConstructVirtualPlanes( MAUS::Globals::GetInstance()->GetMonteCarloMiceModules()); G4Step* step = new G4Step(); SetG4TrackAndStep(step); VirtualHit hit = vp_z.BuildNewHit(step, 99); double mass = step->GetPreStepPoint()->GetMass(); EXPECT_NEAR(hit.GetPosition().x(), 2.25, 1e-2); EXPECT_NEAR(hit.GetPosition().y(), 3.25, 1e-2); EXPECT_NEAR(hit.GetPosition().z(), 5., 1e-6); MAUS::ThreeVector p = hit.GetMomentum(); double p_tot = ::sqrt((102.5+mass)*(102.5+mass)-mass*mass); // transport through B-field should conserve ptrans and pz EXPECT_NEAR(::sqrt(p.x()*p.x()+p.y()*p.y()), p_tot*0.1/::sqrt(1.01), 1e-2); EXPECT_NEAR(p.z(), p_tot*1./::sqrt(1.01), 1e-1); EXPECT_EQ(hit.GetStationId(), 99); EXPECT_EQ(hit.GetTrackId(), 10); EXPECT_NEAR(hit.GetTime(), 1.25, 1e-3); // not quite as v_z b4/after is // different - but near enough EXPECT_EQ(hit.GetParticleId(), -13); EXPECT_EQ(hit.GetMass(), mass); double point[4] = {hit.GetPosition().x(), hit.GetPosition().y(), hit.GetPosition().z(), hit.GetTime()}; double field[6] = {0., 0., 0., 0., 0., 0.}; Globals::GetMCFieldConstructor()->GetFieldValue(point, field); EXPECT_NEAR(hit.GetBField().x(), field[0], 1e-9); EXPECT_NEAR(hit.GetBField().y(), field[1], 1e-9); EXPECT_NEAR(hit.GetBField().z(), field[2], 1e-9); EXPECT_NEAR(hit.GetEField().x(), field[3], 1e-9); EXPECT_NEAR(hit.GetEField().y(), field[4], 1e-9); EXPECT_NEAR(hit.GetEField().z(), field[5], 1e-9); step->GetPreStepPoint()->SetPosition(CLHEP::Hep3Vector(2e6, 3.e6, 4.)); EXPECT_THROW(vp_z.BuildNewHit(step, 99), MAUS::Exceptions::Exception); // outside radial cut step->GetPreStepPoint()->SetPosition(CLHEP::Hep3Vector(2, 3., 4.)); VirtualHit hit_l = vp_z_local.BuildNewHit(step, 99); CLHEP::Hep3Vector h_pos = VirtualPlane::MAUSToCLHEP(hit.GetPosition()); CLHEP::Hep3Vector h_mom = VirtualPlane::MAUSToCLHEP(hit.GetMomentum()); CLHEP::Hep3Vector h_b = VirtualPlane::MAUSToCLHEP(hit.GetBField()); h_pos = rot*(h_pos - pos); h_mom = rot*h_mom; h_b = rot*h_b; EXPECT_NEAR(hit_l.GetPosition().x(), h_pos.x(), 1e-6); EXPECT_NEAR(hit_l.GetPosition().y(), h_pos.y(), 1e-6); EXPECT_NEAR(hit_l.GetPosition().z(), h_pos.z(), 1e-6); EXPECT_NEAR(hit_l.GetMomentum().x(), h_mom.x(), 1e-6); EXPECT_NEAR(hit_l.GetMomentum().y(), h_mom.y(), 1e-6); EXPECT_NEAR(hit_l.GetMomentum().z(), h_mom.z(), 1e-6); EXPECT_NEAR(hit_l.GetBField().x(), h_b.x(), 1e-6); EXPECT_NEAR(hit_l.GetBField().y(), h_b.y(), 1e-6); EXPECT_NEAR(hit_l.GetBField().z(), h_b.z(), 1e-6); // EField; Spin? GlobalsManager::SetMonteCarloMiceModules(mod_orig); } TEST_F(VirtualPlaneTest, ComparePositionTest) { VirtualPlane vp_z_1 = VirtualPlane::BuildVirtualPlane(rot, pos, 100., false, 5., BTTracker::z, VirtualPlane::ignore, true); VirtualPlane vp_z_2 = VirtualPlane::BuildVirtualPlane(rot, pos, 100., false, 5.1, BTTracker::z, VirtualPlane::ignore, true); EXPECT_TRUE(VirtualPlane::ComparePosition(&vp_z_1, &vp_z_2)); } TEST_F(VirtualPlaneTest, InRadialCutTest) { VirtualPlane vp_z_no_cut = VirtualPlane::BuildVirtualPlane(rot, pos, 0., false, 5., BTTracker::z, VirtualPlane::ignore, true); // position in local coords CLHEP::Hep3Vector pos_in(99./::sqrt(2), 99./::sqrt(2), 0.); CLHEP::Hep3Vector pos_out(100.1/::sqrt(2), 100.1/::sqrt(2), 0.); pos_in = rot.inverse()*pos_in+pos; pos_out = rot.inverse()*pos_out+pos; EXPECT_TRUE(vp_z.InRadialCut(pos_in)); EXPECT_TRUE(!vp_z.InRadialCut(pos_out)); EXPECT_TRUE(vp_z_no_cut.InRadialCut(pos_out)); } /////////////////////// VIRTUALPLANE END ////////////////////////////////// // // // // // // /////////////////////// VIRTUALPLANE MANAGER ////////////////////////////////// class VirtualPlaneManagerTest : public ::testing::Test { protected: VirtualPlaneManagerTest() : mod(), vpm() { mod.addPropertyString("SensitiveDetector", "Virtual"); mod.addPropertyHep3Vector("Position", "0 0 1 m"); mod.addPropertyHep3Vector("Rotation", "0. 45. 0. degree"); } virtual ~VirtualPlaneManagerTest() {} virtual void SetUp() {} virtual void TearDown() {} MiceModule mod; VirtualPlaneManager vpm; }; TEST_F(VirtualPlaneManagerTest, GetSetHitsTest) { std::vector<MAUS::VirtualHit>* test_hits = NULL; EXPECT_NE(vpm.GetVirtualHits(), test_hits); // initialised test_hits in ctor vpm.SetVirtualHits(NULL); EXPECT_EQ(vpm.GetVirtualHits(), test_hits); test_hits = new std::vector<MAUS::VirtualHit>(); vpm.SetVirtualHits(test_hits); EXPECT_EQ(vpm.GetVirtualHits(), test_hits); vpm.SetVirtualHits(NULL); test_hits = NULL; EXPECT_EQ(vpm.GetVirtualHits(), test_hits); } TEST_F(VirtualPlaneManagerTest, ConstructVirtualPlanes) { // also GetPlanes() MiceModule mod1, mod2, mod3; mod1.addPropertyString("SensitiveDetector", "Envelope"); vpm.ConstructVirtualPlanes(&mod1); EXPECT_EQ(vpm.GetStationNumberFromModule(&mod1), 1); mod2.addPropertyString("SensitiveDetector", "Virtual"); vpm.ConstructVirtualPlanes(&mod2); EXPECT_EQ(vpm.GetStationNumberFromModule(&mod2), 2); mod3.addPropertyString("SensitiveDetector", ""); vpm.ConstructVirtualPlanes(&mod3); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod3), MAUS::Exceptions::Exception); EXPECT_EQ(vpm.GetPlanes().size(), (size_t) 2); } void __test_indep(std::string indep_string, BTTracker::var indep_enum, double indep_var, MiceModule& mod, VirtualPlaneManager& vpm) { mod.setProperty<std::string>("IndependentVariable", indep_string); vpm.ConstructVirtualPlanes(&mod); EXPECT_EQ(vpm.GetPlanes().back()->GetPlaneIndependentVariableType(), indep_enum) << "Failed with indie " << indep_string; EXPECT_NEAR (vpm.GetPlanes().back()->GetPlaneIndependentVariable(), indep_var, 1e-9) << "Failed with indie " << indep_string; } TEST_F(VirtualPlaneManagerTest, ConstructFromModule_IndepVariableTest) { // throw unless PlaneTime is set size_t vpm_size = vpm.GetPlanes().size(); EXPECT_THROW(__test_indep("t", BTTracker::t, -4., mod, vpm), MAUS::Exceptions::Exception); EXPECT_THROW(__test_indep("tau", BTTracker::t, -4., mod, vpm), MAUS::Exceptions::Exception); EXPECT_THROW(__test_indep("time", BTTracker::t, 4., mod, vpm), MAUS::Exceptions::Exception); EXPECT_EQ(vpm_size, vpm.GetPlanes().size()); // check no planes alloc'd // have to construct in order of indep variable magnitude mod.setProperty<double>("PlaneTime", -3.); __test_indep("t", BTTracker::t, -3., mod, vpm); mod.setProperty<double>("PlaneTime", -2.); __test_indep("time", BTTracker::t, -2., mod, vpm); mod.setProperty<double>("PlaneTime", -1.); __test_indep("tau", BTTracker::tau_field, -1., mod, vpm); __test_indep("u", BTTracker::u, 0., mod, vpm); __test_indep("z", BTTracker::z, 1000., mod, vpm); } void __test_multipass(std::string mp_string, VirtualPlane::multipass_handler mp_enum, MiceModule mod, VirtualPlaneManager& vpm) { mod.setProperty<std::string>("MultiplePasses", mp_string); vpm.ConstructVirtualPlanes(&mod); EXPECT_EQ(vpm.GetPlanes().back()->GetMultipassAlgorithm(), mp_enum); } TEST_F(VirtualPlaneManagerTest, ConstructFromModule_MultiplePassesTest) { __test_multipass("SameStation", VirtualPlane::same_station, mod, vpm); __test_multipass("NewStation", VirtualPlane::new_station, mod, vpm); __test_multipass("Ignore", VirtualPlane::ignore, mod, vpm); EXPECT_THROW(__test_multipass("X", VirtualPlane::ignore, mod, vpm), MAUS::Exceptions::Exception); } TEST_F(VirtualPlaneManagerTest, ConstructFromModule_OtherStuffTest) { mod.setProperty<double>("RadialExtent", 1); mod.setProperty<bool>("GlobalCoordinates", false); mod.setProperty<bool>("AllowBackwards", false); vpm.ConstructVirtualPlanes(&mod); VirtualPlane* vp = vpm.GetPlanes().back(); EXPECT_NEAR(vp->GetRadialExtent(), 1., 1e-9); EXPECT_TRUE(!vp->GetGlobalCoordinates()); EXPECT_TRUE(!vp->GetAllowBackwards()); } // Also tests GetNumberOfHits TEST_F(VirtualPlaneManagerTest, VirtualPlanesSteppingActionTest) { MiceModule mod_0; mod_0.addPropertyString("SensitiveDetector", "Virtual"); mod_0.addPropertyHep3Vector("Position", "0 0 0.0 mm"); MiceModule mod_6; mod_6.addPropertyString("SensitiveDetector", "Virtual"); mod_6.addPropertyHep3Vector("Position", "0 0 6.0 mm"); MiceModule mod_10; mod_10.addPropertyString("SensitiveDetector", "Virtual"); mod_10.addPropertyHep3Vector("Position", "0 0 10.0 mm"); vpm.ConstructVirtualPlanes(&mod_0); for (size_t i = 0; i < 3; ++i) vpm.ConstructVirtualPlanes(&mod_6); vpm.ConstructVirtualPlanes(&mod_10); // two copies G4Step* step = new G4Step(); SetG4TrackAndStep(step); // prestep is at z=4 poststep at z=8 vpm.VirtualPlanesSteppingAction(step); EXPECT_THROW(vpm.GetNumberOfHits(0), MAUS::Exceptions::Exception); EXPECT_EQ(vpm.GetNumberOfHits(1), 0); for (size_t i = 2; i <= 4; ++i) EXPECT_EQ(vpm.GetNumberOfHits(i), 1) << "Failed on station " << i; EXPECT_EQ(vpm.GetNumberOfHits(5), 0); EXPECT_THROW(vpm.GetNumberOfHits(6), MAUS::Exceptions::Exception); std::vector<MAUS::VirtualHit>* hits = vpm.GetVirtualHits(); ASSERT_EQ(hits->size(), 3); for (size_t i = 0; i < hits->size(); ++i) EXPECT_EQ(hits->at(i).GetStationId(), i+2); delete step; } TEST_F(VirtualPlaneManagerTest, VirtualPlanesSteppingActionBackwardsTest) { G4Step* step = new G4Step(); SetG4TrackAndStep(step); // prestep is at z=4 poststep at z=8 MiceModule mod_6; mod_6.addPropertyString("SensitiveDetector", "Virtual"); mod_6.addPropertyHep3Vector("Position", "0 0 6.0 mm"); mod_6.addPropertyBool("AllowBackwards", false); MiceModule mod_7; mod_7.addPropertyString("SensitiveDetector", "Virtual"); mod_7.addPropertyHep3Vector("Position", "0 0 7.0 mm"); mod_7.addPropertyBool("AllowBackwards", true); vpm.ConstructVirtualPlanes(&mod_6); vpm.ConstructVirtualPlanes(&mod_7); vpm.VirtualPlanesSteppingAction(step); EXPECT_EQ(vpm.GetNumberOfHits(1), 1); EXPECT_EQ(vpm.GetNumberOfHits(2), 1); vpm.SetVirtualHits(new std::vector<MAUS::VirtualHit>()); vpm.StartOfEvent(); step->GetPreStepPoint()->SetPosition(G4ThreeVector(0., 0., 8.)); step->GetPostStepPoint()->SetPosition(G4ThreeVector(0., 0., 4.)); step->GetPreStepPoint()->SetMomentumDirection(G4ThreeVector(0., 0., -1.)); step->GetPostStepPoint()->SetMomentumDirection(G4ThreeVector(0., 0., -1.)); vpm.VirtualPlanesSteppingAction(step); EXPECT_EQ(vpm.GetNumberOfHits(1), 0); EXPECT_EQ(vpm.GetNumberOfHits(2), 1); delete step; } // Also tests StartOfEvent TEST_F(VirtualPlaneManagerTest, VirtualPlanesSteppingActionMultipassTest) { // Remember we are sorting by z value MiceModule mod_ignore; mod_ignore.addPropertyString("SensitiveDetector", "Virtual"); mod_ignore.addPropertyHep3Vector("Position", "0 0 5.8 mm"); mod_ignore.addPropertyString("MultiplePasses", "Ignore"); vpm.ConstructVirtualPlanes(&mod_ignore); MiceModule mod_same; mod_same.addPropertyString("SensitiveDetector", "Virtual"); mod_same.addPropertyHep3Vector("Position", "0 0 5.9 mm"); mod_same.addPropertyString("MultiplePasses", "SameStation"); vpm.ConstructVirtualPlanes(&mod_same); MiceModule mod_new; mod_new.addPropertyString("SensitiveDetector", "Virtual"); mod_new.addPropertyHep3Vector("Position", "0 0 6.0 mm"); mod_new.addPropertyString("MultiplePasses", "NewStation"); vpm.ConstructVirtualPlanes(&mod_new); G4Step* step = new G4Step(); SetG4TrackAndStep(step); vpm.VirtualPlanesSteppingAction(step); std::vector<VirtualHit>* hit1 = vpm.GetVirtualHits(); ASSERT_EQ(hit1->size(), 3); for (int i = 0; i < 3; ++i) EXPECT_EQ(hit1->at(i).GetStationId(), i+1); vpm.VirtualPlanesSteppingAction(step); std::vector<VirtualHit>* hit2 = vpm.GetVirtualHits(); ASSERT_EQ(hit2->size(), 5); EXPECT_EQ(hit2->at(3).GetStationId(), 2); EXPECT_EQ(hit2->at(4).GetStationId(), 6); vpm.VirtualPlanesSteppingAction(step); std::vector<VirtualHit>* hit3 = vpm.GetVirtualHits(); ASSERT_EQ(hit3->size(), 7); EXPECT_EQ(hit3->at(5).GetStationId(), 2); EXPECT_EQ(hit3->at(6).GetStationId(), 9); EXPECT_EQ(vpm.GetNumberOfHits(1), 1); EXPECT_EQ(vpm.GetNumberOfHits(2), 3); EXPECT_EQ(vpm.GetNumberOfHits(3), 3); // this is the primary station number vpm.StartOfEvent(); vpm.VirtualPlanesSteppingAction(step); std::vector<VirtualHit>* hit4 = vpm.GetVirtualHits(); ASSERT_EQ(hit4->size(), 3); for (int i = 0; i < 3; ++i) { EXPECT_EQ(hit4->at(i).GetStationId(), i+1); EXPECT_EQ(vpm.GetNumberOfHits(i+1), 1); } delete step; } TEST_F(VirtualPlaneManagerTest, GetModuleFromStationNumberTest) { MiceModule mod_alt; mod_alt.addPropertyString("SensitiveDetector", "Virtual"); mod_alt.addPropertyHep3Vector("Position", "0 0 2 m"); vpm.ConstructVirtualPlanes(&mod); EXPECT_THROW(vpm.GetModuleFromStationNumber(0), MAUS::Exceptions::Exception); EXPECT_EQ(vpm.GetModuleFromStationNumber(1), &mod); EXPECT_EQ(vpm.GetModuleFromStationNumber(2), &mod); vpm.ConstructVirtualPlanes(&mod_alt); EXPECT_THROW(vpm.GetModuleFromStationNumber(0), MAUS::Exceptions::Exception); EXPECT_EQ(vpm.GetModuleFromStationNumber(1), &mod); EXPECT_EQ(vpm.GetModuleFromStationNumber(2), &mod_alt); EXPECT_EQ(vpm.GetModuleFromStationNumber(3), &mod); EXPECT_EQ(vpm.GetModuleFromStationNumber(4), &mod_alt); } TEST_F(VirtualPlaneManagerTest, GetStationNumberFromModuleTest) { MiceModule mod_alt; mod_alt.addPropertyString("SensitiveDetector", "Virtual"); mod_alt.addPropertyHep3Vector("Position", "0 0 2 m"); vpm.ConstructVirtualPlanes(&mod); EXPECT_EQ(vpm.GetStationNumberFromModule(&mod), 1); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_alt), MAUS::Exceptions::Exception); vpm.ConstructVirtualPlanes(&mod_alt); EXPECT_EQ(vpm.GetStationNumberFromModule(&mod), 1); EXPECT_EQ(vpm.GetStationNumberFromModule(&mod_alt), 2); } TEST_F(VirtualPlaneManagerTest, RemovePlaneTest) { MiceModule mod_a[5]; for (size_t i = 0; i < 5; ++i) { std::stringstream pos; pos << "0 0 " << i << " m"; mod_a[i].addPropertyString("SensitiveDetector", "Virtual"); mod_a[i].addPropertyHep3Vector("Position", pos.str()); vpm.ConstructVirtualPlanes(&mod_a[i]); } std::set<int> set_1; set_1.insert(2); vpm.RemovePlanes(set_1); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[0])); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[1]), MAUS::Exceptions::Exception); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[2])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[2])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[4])); std::set<int> set_2; set_2.insert(1); set_2.insert(4); vpm.RemovePlanes(set_2); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[0]), MAUS::Exceptions::Exception); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[1]), MAUS::Exceptions::Exception); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[2])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[3])); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[4]), MAUS::Exceptions::Exception); } TEST_F(VirtualPlaneManagerTest, RemovePlanesTest) { MiceModule mod_a[5]; for (size_t i = 0; i < 5; ++i) { std::stringstream pos; pos << "0 0 " << i << " m"; mod_a[i].addPropertyString("SensitiveDetector", "Virtual"); mod_a[i].addPropertyHep3Vector("Position", pos.str()); vpm.ConstructVirtualPlanes(&mod_a[i]); } std::vector<VirtualPlane*> planes = vpm.GetPlanes(); vpm.RemovePlane(planes[1]); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[0])); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[1]), MAUS::Exceptions::Exception); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[2])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[3])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[4])); vpm.RemovePlane(planes[0]); vpm.RemovePlane(planes[4]); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[0]), MAUS::Exceptions::Exception); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[1]), MAUS::Exceptions::Exception); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[2])); EXPECT_NO_THROW(vpm.GetStationNumberFromModule(&mod_a[3])); EXPECT_THROW(vpm.GetStationNumberFromModule(&mod_a[4]), MAUS::Exceptions::Exception); } /////////////////////// VIRTUALPLANE MANAGER END ////////////////////////////// } // namespace
mice-software/maus
tests/cpp_unit/Simulation/VirtualPlaneTest.cc
C++
gpl-3.0
23,709
var NAVTREEINDEX43 = { "group___peripheral___registers___bits___definition.html#ga26ef6801f38525d6fdda034a130e5ee9":[5,0,0,2,0,1,17,2182], "group___peripheral___registers___bits___definition.html#ga26ef7d6cd5ec547a349462e4f31963b6":[5,0,0,2,0,1,17,2430], "group___peripheral___registers___bits___definition.html#ga26ef7d6cd5ec547a349462e4f31963b6":[2,16,0,6,0,2346], "group___peripheral___registers___bits___definition.html#ga26f3ae80c9bbede6929c20004804476d":[2,16,0,6,0,2569], "group___peripheral___registers___bits___definition.html#ga26f3ae80c9bbede6929c20004804476d":[5,0,0,2,0,1,17,2653], "group___peripheral___registers___bits___definition.html#ga26f92a3f831685d6df7ab69e68181849":[5,0,0,2,0,1,17,3991], "group___peripheral___registers___bits___definition.html#ga26f92a3f831685d6df7ab69e68181849":[2,16,0,6,0,3821], "group___peripheral___registers___bits___definition.html#ga273caacb035cb2ec64c721fa6c747c35":[2,16,0,6,0,1647], "group___peripheral___registers___bits___definition.html#ga273caacb035cb2ec64c721fa6c747c35":[5,0,0,2,0,1,17,1674], "group___peripheral___registers___bits___definition.html#ga27405d413b6d355ccdb076d52fef6875":[5,0,0,2,0,1,17,4136], "group___peripheral___registers___bits___definition.html#ga27405d413b6d355ccdb076d52fef6875":[2,16,0,6,0,3956], "group___peripheral___registers___bits___definition.html#ga274c5b835ec95c97c4f1c6ebbf72a096":[5,0,0,2,0,1,17,2721], "group___peripheral___registers___bits___definition.html#ga274c5b835ec95c97c4f1c6ebbf72a096":[2,16,0,6,0,2637], "group___peripheral___registers___bits___definition.html#ga274c65bc7120061ed73fb4aca02bc1a8":[5,0,0,2,0,1,17,1832], "group___peripheral___registers___bits___definition.html#ga274c65bc7120061ed73fb4aca02bc1a8":[2,16,0,6,0,1769], "group___peripheral___registers___bits___definition.html#ga274d8cb48f0e89831efabea66d64af2a":[5,0,0,2,0,1,17,3422], "group___peripheral___registers___bits___definition.html#ga274d8cb48f0e89831efabea66d64af2a":[2,16,0,6,0,3302], "group___peripheral___registers___bits___definition.html#ga275ab42b13b8a78755581808efea0fdb":[5,0,0,2,0,1,17,1882], "group___peripheral___registers___bits___definition.html#ga275ab42b13b8a78755581808efea0fdb":[2,16,0,6,0,1819], "group___peripheral___registers___bits___definition.html#ga276fd2250d2b085b73ef51cb4c099d24":[5,0,0,2,0,1,17,4011], "group___peripheral___registers___bits___definition.html#ga276fd2250d2b085b73ef51cb4c099d24":[2,16,0,6,0,3841], "group___peripheral___registers___bits___definition.html#ga2774f04e286942d36a5b6135c8028049":[2,16,0,6,0,1512], "group___peripheral___registers___bits___definition.html#ga2774f04e286942d36a5b6135c8028049":[5,0,0,2,0,1,17,1537], "group___peripheral___registers___bits___definition.html#ga277a096614829feba2d0a4fbb7d3dffc":[5,0,0,2,0,1,17,3929], "group___peripheral___registers___bits___definition.html#ga277a096614829feba2d0a4fbb7d3dffc":[2,16,0,6,0,3759], "group___peripheral___registers___bits___definition.html#ga27a0bd49dc24e59b776ad5a00aabb97b":[2,16,0,6,0,1529], "group___peripheral___registers___bits___definition.html#ga27a0bd49dc24e59b776ad5a00aabb97b":[5,0,0,2,0,1,17,1554], "group___peripheral___registers___bits___definition.html#ga27a139540b2db607b4fd61bcba167b1d":[2,16,0,6,0,357], "group___peripheral___registers___bits___definition.html#ga27a139540b2db607b4fd61bcba167b1d":[5,0,0,2,0,1,17,373], "group___peripheral___registers___bits___definition.html#ga27d44bc9617cc430de9413b385dfe0c3":[2,16,0,6,0,2102], "group___peripheral___registers___bits___definition.html#ga27d44bc9617cc430de9413b385dfe0c3":[5,0,0,2,0,1,17,2175], "group___peripheral___registers___bits___definition.html#ga27e45eea9ce17b7251f10ea763180690":[5,0,0,2,0,1,17,3736], "group___peripheral___registers___bits___definition.html#ga27e45eea9ce17b7251f10ea763180690":[2,16,0,6,0,3609], "group___peripheral___registers___bits___definition.html#ga27e762953f42cf0a323a4372cd780c22":[5,0,0,2,0,1,17,3592], "group___peripheral___registers___bits___definition.html#ga27e762953f42cf0a323a4372cd780c22":[2,16,0,6,0,3468], "group___peripheral___registers___bits___definition.html#ga27ec34e08f87e8836f32bbfed52e860a":[2,16,0,6,0,1540], "group___peripheral___registers___bits___definition.html#ga27ec34e08f87e8836f32bbfed52e860a":[5,0,0,2,0,1,17,1565], "group___peripheral___registers___bits___definition.html#ga27f59166864f7cd0a5e8e6b4450e72d3":[2,16,0,6,0,141], "group___peripheral___registers___bits___definition.html#ga27f59166864f7cd0a5e8e6b4450e72d3":[5,0,0,2,0,1,17,155], "group___peripheral___registers___bits___definition.html#ga27f9a6cbfd364bbb050b526ebc01d2d7":[5,0,0,2,0,1,17,3784], "group___peripheral___registers___bits___definition.html#ga27f9a6cbfd364bbb050b526ebc01d2d7":[2,16,0,6,0,3657], "group___peripheral___registers___bits___definition.html#ga280da821f0da1bec1f4c0e132ddf8eab":[5,0,0,2,0,1,17,3478], "group___peripheral___registers___bits___definition.html#ga280da821f0da1bec1f4c0e132ddf8eab":[2,16,0,6,0,3357], "group___peripheral___registers___bits___definition.html#ga2823bb25e138cc52d11b154456947ab7":[2,16,0,6,0,1151], "group___peripheral___registers___bits___definition.html#ga2823bb25e138cc52d11b154456947ab7":[5,0,0,2,0,1,17,1176], "group___peripheral___registers___bits___definition.html#ga2829af32a785e947b469b2bb0702ac8d":[5,0,0,2,0,1,17,4214], "group___peripheral___registers___bits___definition.html#ga2829af32a785e947b469b2bb0702ac8d":[2,16,0,6,0,4034], "group___peripheral___registers___bits___definition.html#ga283a1bfa52851ea4ee45f45817985752":[2,16,0,6,0,1580], "group___peripheral___registers___bits___definition.html#ga283a1bfa52851ea4ee45f45817985752":[5,0,0,2,0,1,17,1605], "group___peripheral___registers___bits___definition.html#ga28517c1f5aeded21b3f0326247b0bbe1":[5,0,0,2,0,1,17,2765], "group___peripheral___registers___bits___definition.html#ga28517c1f5aeded21b3f0326247b0bbe1":[2,16,0,6,0,2681], "group___peripheral___registers___bits___definition.html#ga28664595df654d9d8052fb6f9cc48495":[5,0,0,2,0,1,17,2019], "group___peripheral___registers___bits___definition.html#ga28664595df654d9d8052fb6f9cc48495":[2,16,0,6,0,1956], "group___peripheral___registers___bits___definition.html#ga2871cee90ebecb760bab16e9c039b682":[2,16,0,6,0,1519], "group___peripheral___registers___bits___definition.html#ga2871cee90ebecb760bab16e9c039b682":[5,0,0,2,0,1,17,1544], "group___peripheral___registers___bits___definition.html#ga288b20416b42a79e591aa80d9a690fca":[2,16,0,6,0,3053], "group___peripheral___registers___bits___definition.html#ga288b20416b42a79e591aa80d9a690fca":[5,0,0,2,0,1,17,3162], "group___peripheral___registers___bits___definition.html#ga2894b732a9683d32620fb90b06ba9f62":[5,0,0,2,0,1,17,811], "group___peripheral___registers___bits___definition.html#ga2894b732a9683d32620fb90b06ba9f62":[2,16,0,6,0,786], "group___peripheral___registers___bits___definition.html#ga289d89b4d92d7f685a8e44aeb9ddcded":[2,16,0,6,0,86], "group___peripheral___registers___bits___definition.html#ga289d89b4d92d7f685a8e44aeb9ddcded":[5,0,0,2,0,1,17,100], "group___peripheral___registers___bits___definition.html#ga28a0b7a215abd309bd235b94e7105d0e":[5,0,0,2,0,1,17,4570], "group___peripheral___registers___bits___definition.html#ga28a0b7a215abd309bd235b94e7105d0e":[2,16,0,6,0,4390], "group___peripheral___registers___bits___definition.html#ga28ac1f8f47528eab9454472a30998285":[5,0,0,2,0,1,17,1956], "group___peripheral___registers___bits___definition.html#ga28ac1f8f47528eab9454472a30998285":[2,16,0,6,0,1893], "group___peripheral___registers___bits___definition.html#ga28b823d564e9d90150bcc6744b4ed622":[5,0,0,2,0,1,17,3821], "group___peripheral___registers___bits___definition.html#ga28b823d564e9d90150bcc6744b4ed622":[2,16,0,6,0,3687], "group___peripheral___registers___bits___definition.html#ga28cd1469212463d8a772b0b67543d320":[2,16,0,6,0,470], "group___peripheral___registers___bits___definition.html#ga28cd1469212463d8a772b0b67543d320":[5,0,0,2,0,1,17,491], "group___peripheral___registers___bits___definition.html#ga28d8d13d7e78c9963fbd4efbfc176c55":[2,16,0,6,0,513], "group___peripheral___registers___bits___definition.html#ga28d8d13d7e78c9963fbd4efbfc176c55":[5,0,0,2,0,1,17,534], "group___peripheral___registers___bits___definition.html#ga28d9081b7bdfa6201f4325f9378816f0":[2,16,0,6,0,298], "group___peripheral___registers___bits___definition.html#ga28d9081b7bdfa6201f4325f9378816f0":[5,0,0,2,0,1,17,314], "group___peripheral___registers___bits___definition.html#ga28dd9f93d8687cdc08745df9fcc38e89":[5,0,0,2,0,1,17,2229], "group___peripheral___registers___bits___definition.html#ga28dd9f93d8687cdc08745df9fcc38e89":[2,16,0,6,0,2145], "group___peripheral___registers___bits___definition.html#ga28dfec5b19802ed681ff9b61f31a3b6f":[2,16,0,6,0,4375], "group___peripheral___registers___bits___definition.html#ga28dfec5b19802ed681ff9b61f31a3b6f":[5,0,0,2,0,1,17,4555], "group___peripheral___registers___bits___definition.html#ga2918ac8b94d21ece6e60d8e57466b3ac":[5,0,0,2,0,1,17,3655], "group___peripheral___registers___bits___definition.html#ga2918ac8b94d21ece6e60d8e57466b3ac":[2,16,0,6,0,3530], "group___peripheral___registers___bits___definition.html#ga291a24527a4fd15fbb4bde1b86a9d1a1":[5,0,0,2,0,1,17,1896], "group___peripheral___registers___bits___definition.html#ga291a24527a4fd15fbb4bde1b86a9d1a1":[2,16,0,6,0,1833], "group___peripheral___registers___bits___definition.html#ga2925d05347e46e9c6a970214fa76bbec":[2,16,0,6,0,107], "group___peripheral___registers___bits___definition.html#ga2925d05347e46e9c6a970214fa76bbec":[5,0,0,2,0,1,17,121], "group___peripheral___registers___bits___definition.html#ga292a8826723614aa2504a376f4a2e5d5":[5,0,0,2,0,1,17,2803], "group___peripheral___registers___bits___definition.html#ga292a8826723614aa2504a376f4a2e5d5":[2,16,0,6,0,2719], "group___peripheral___registers___bits___definition.html#ga292c1d0172620e0454ccc36f91f0c6ea":[5,0,0,2,0,1,17,2896], "group___peripheral___registers___bits___definition.html#ga292c1d0172620e0454ccc36f91f0c6ea":[2,16,0,6,0,2811], "group___peripheral___registers___bits___definition.html#ga292e02c41e73a31a9670c91271700031":[5,0,0,2,0,1,17,4310], "group___peripheral___registers___bits___definition.html#ga292e02c41e73a31a9670c91271700031":[2,16,0,6,0,4130], "group___peripheral___registers___bits___definition.html#ga2932a0004cf17558c1445f79baac54a1":[2,16,0,6,0,27], "group___peripheral___registers___bits___definition.html#ga2932a0004cf17558c1445f79baac54a1":[5,0,0,2,0,1,17,41], "group___peripheral___registers___bits___definition.html#ga293fbe15ed5fd1fc95915bd6437859e7":[2,16,0,6,0,3005], "group___peripheral___registers___bits___definition.html#ga293fbe15ed5fd1fc95915bd6437859e7":[5,0,0,2,0,1,17,3114], "group___peripheral___registers___bits___definition.html#ga29484bb25ef911e36e082cdc4f5a0fa4":[5,0,0,2,0,1,17,4225], "group___peripheral___registers___bits___definition.html#ga29484bb25ef911e36e082cdc4f5a0fa4":[2,16,0,6,0,4045], "group___peripheral___registers___bits___definition.html#ga294e216b50edd1c2f891143e1f971048":[5,0,0,2,0,1,17,3986], "group___peripheral___registers___bits___definition.html#ga294e216b50edd1c2f891143e1f971048":[2,16,0,6,0,3816], "group___peripheral___registers___bits___definition.html#ga295a704767cb94ee624cbc4dd4c4cd9a":[5,0,0,2,0,1,17,3405], "group___peripheral___registers___bits___definition.html#ga295a704767cb94ee624cbc4dd4c4cd9a":[2,16,0,6,0,3285], "group___peripheral___registers___bits___definition.html#ga295c26638700a849ee3c6504caf6ceab":[2,16,0,6,0,1358], "group___peripheral___registers___bits___definition.html#ga295c26638700a849ee3c6504caf6ceab":[5,0,0,2,0,1,17,1383], "group___peripheral___registers___bits___definition.html#ga2960fee8bc56574e1b51975da7d2f041":[5,0,0,2,0,1,17,810], "group___peripheral___registers___bits___definition.html#ga2960fee8bc56574e1b51975da7d2f041":[2,16,0,6,0,785], "group___peripheral___registers___bits___definition.html#ga2990db729fb017dfd659dc6cf8823761":[5,0,0,2,0,1,17,3749], "group___peripheral___registers___bits___definition.html#ga2990db729fb017dfd659dc6cf8823761":[2,16,0,6,0,3622], "group___peripheral___registers___bits___definition.html#ga299207b757f31c9c02471ab5f4f59dbe":[5,0,0,2,0,1,17,3949], "group___peripheral___registers___bits___definition.html#ga299207b757f31c9c02471ab5f4f59dbe":[2,16,0,6,0,3779], "group___peripheral___registers___bits___definition.html#ga29acf144e69977a5cf0ca9374f79cb27":[5,0,0,2,0,1,17,4513], "group___peripheral___registers___bits___definition.html#ga29acf144e69977a5cf0ca9374f79cb27":[2,16,0,6,0,4333], "group___peripheral___registers___bits___definition.html#ga29b032782f6ee599b3e6c67a915f2a77":[2,16,0,6,0,3065], "group___peripheral___registers___bits___definition.html#ga29b032782f6ee599b3e6c67a915f2a77":[5,0,0,2,0,1,17,3178], "group___peripheral___registers___bits___definition.html#ga29b52deba459b2a9a6d2379c9b0b0c26":[5,0,0,2,0,1,17,3182], "group___peripheral___registers___bits___definition.html#ga29b52deba459b2a9a6d2379c9b0b0c26":[2,16,0,6,0,3069], "group___peripheral___registers___bits___definition.html#ga29b921567bd5a422c51f9a0f426ac3f6":[5,0,0,2,0,1,17,2227], "group___peripheral___registers___bits___definition.html#ga29b921567bd5a422c51f9a0f426ac3f6":[2,16,0,6,0,2143], "group___peripheral___registers___bits___definition.html#ga29b9389601899ce2731c612ad05d9a96":[2,16,0,6,0,2511], "group___peripheral___registers___bits___definition.html#ga29b9389601899ce2731c612ad05d9a96":[5,0,0,2,0,1,17,2595], "group___peripheral___registers___bits___definition.html#ga29c07a816f3065ae0c9287b6e3e0e967":[5,0,0,2,0,1,17,2728], "group___peripheral___registers___bits___definition.html#ga29c07a816f3065ae0c9287b6e3e0e967":[2,16,0,6,0,2644], "group___peripheral___registers___bits___definition.html#ga29d052fc2597171767d8cf5d72388ad5":[2,16,0,6,0,1041], "group___peripheral___registers___bits___definition.html#ga29d052fc2597171767d8cf5d72388ad5":[5,0,0,2,0,1,17,1066], "group___peripheral___registers___bits___definition.html#ga2a038553e3a30df4b6e331cad504069b":[5,0,0,2,0,1,17,2264], "group___peripheral___registers___bits___definition.html#ga2a038553e3a30df4b6e331cad504069b":[2,16,0,6,0,2180], "group___peripheral___registers___bits___definition.html#ga2a2bfd8de14f8c726439ba8f494b38a1":[2,16,0,6,0,2567], "group___peripheral___registers___bits___definition.html#ga2a2bfd8de14f8c726439ba8f494b38a1":[5,0,0,2,0,1,17,2651], "group___peripheral___registers___bits___definition.html#ga2a3b7e4be7cebb35ad66cb85b82901bb":[2,16,0,6,0,1615], "group___peripheral___registers___bits___definition.html#ga2a3b7e4be7cebb35ad66cb85b82901bb":[5,0,0,2,0,1,17,1640], "group___peripheral___registers___bits___definition.html#ga2a3d15b3abab8199c16e26a3dffdc8b8":[2,16,0,6,0,1550], "group___peripheral___registers___bits___definition.html#ga2a3d15b3abab8199c16e26a3dffdc8b8":[5,0,0,2,0,1,17,1575], "group___peripheral___registers___bits___definition.html#ga2a42e366c56ce09eb944c8f20c520004":[5,0,0,2,0,1,17,3197], "group___peripheral___registers___bits___definition.html#ga2a42e366c56ce09eb944c8f20c520004":[2,16,0,6,0,3084], "group___peripheral___registers___bits___definition.html#ga2a5aa740ee8b8ddcc9e28cad9cc2e287":[5,0,0,2,0,1,17,3260], "group___peripheral___registers___bits___definition.html#ga2a5aa740ee8b8ddcc9e28cad9cc2e287":[2,16,0,6,0,3147], "group___peripheral___registers___bits___definition.html#ga2a5f335c3d7a4f82d1e91dc1511e3322":[5,0,0,2,0,1,17,4095], "group___peripheral___registers___bits___definition.html#ga2a5f335c3d7a4f82d1e91dc1511e3322":[2,16,0,6,0,3925], "group___peripheral___registers___bits___definition.html#ga2a6cc515f13ffe1a3620d06fa08addc7":[5,0,0,2,0,1,17,2066], "group___peripheral___registers___bits___definition.html#ga2a6cc515f13ffe1a3620d06fa08addc7":[2,16,0,6,0,1995], "group___peripheral___registers___bits___definition.html#ga2a77c1bb653218eb77c8bc7b730a559b":[2,16,0,6,0,4288], "group___peripheral___registers___bits___definition.html#ga2a77c1bb653218eb77c8bc7b730a559b":[5,0,0,2,0,1,17,4468], "group___peripheral___registers___bits___definition.html#ga2a7cb5ecc8420bde213d4e25d698bad0":[5,0,0,2,0,1,17,3194], "group___peripheral___registers___bits___definition.html#ga2a7cb5ecc8420bde213d4e25d698bad0":[2,16,0,6,0,3081], "group___peripheral___registers___bits___definition.html#ga2a7d9d78950ebdf3ca4a6eaa7dd6b909":[5,0,0,2,0,1,17,4327], "group___peripheral___registers___bits___definition.html#ga2a7d9d78950ebdf3ca4a6eaa7dd6b909":[2,16,0,6,0,4147], "group___peripheral___registers___bits___definition.html#ga2a7e4efc546c1c9d16c750a4542e1c55":[5,0,0,2,0,1,17,2322], "group___peripheral___registers___bits___definition.html#ga2a7e4efc546c1c9d16c750a4542e1c55":[2,16,0,6,0,2238], "group___peripheral___registers___bits___definition.html#ga2a9958cbf815ac97c3500a46aaf573f5":[5,0,0,2,0,1,17,2701], "group___peripheral___registers___bits___definition.html#ga2a9958cbf815ac97c3500a46aaf573f5":[2,16,0,6,0,2617], "group___peripheral___registers___bits___definition.html#ga2a9f35467043d5c0098c37455b6c8e0c":[2,16,0,6,0,499], "group___peripheral___registers___bits___definition.html#ga2a9f35467043d5c0098c37455b6c8e0c":[5,0,0,2,0,1,17,520], "group___peripheral___registers___bits___definition.html#ga2acccf9ab5708116cd888f2d65da54cc":[2,16,0,6,0,1131], "group___peripheral___registers___bits___definition.html#ga2acccf9ab5708116cd888f2d65da54cc":[5,0,0,2,0,1,17,1156], "group___peripheral___registers___bits___definition.html#ga2ade8feb15ddcef159ccf3ff55fb0c24":[5,0,0,2,0,1,17,2573], "group___peripheral___registers___bits___definition.html#ga2ade8feb15ddcef159ccf3ff55fb0c24":[2,16,0,6,0,2489], "group___peripheral___registers___bits___definition.html#ga2b21a5926cbbc55f725e2716ea9b7285":[5,0,0,2,0,1,17,4372], "group___peripheral___registers___bits___definition.html#ga2b21a5926cbbc55f725e2716ea9b7285":[2,16,0,6,0,4192], "group___peripheral___registers___bits___definition.html#ga2b24d14f0e5d1c76c878b08aad44d02b":[5,0,0,2,0,1,17,4157], "group___peripheral___registers___bits___definition.html#ga2b24d14f0e5d1c76c878b08aad44d02b":[2,16,0,6,0,3977], "group___peripheral___registers___bits___definition.html#ga2b2aa80397b4961a33b41303aa348ea1":[2,16,0,6,0,1014], "group___peripheral___registers___bits___definition.html#ga2b2aa80397b4961a33b41303aa348ea1":[5,0,0,2,0,1,17,1039], "group___peripheral___registers___bits___definition.html#ga2b7d7f29b09a49c31404fc0d44645c84":[5,0,0,2,0,1,17,3477], "group___peripheral___registers___bits___definition.html#ga2b7d7f29b09a49c31404fc0d44645c84":[2,16,0,6,0,3356], "group___peripheral___registers___bits___definition.html#ga2b85b3ab656dfa2809b15e6e530c17a2":[2,16,0,6,0,3332], "group___peripheral___registers___bits___definition.html#ga2b85b3ab656dfa2809b15e6e530c17a2":[5,0,0,2,0,1,17,3453], "group___peripheral___registers___bits___definition.html#ga2b8ad53931f4cb3bebb3f557d8686066":[2,16,0,6,0,644], "group___peripheral___registers___bits___definition.html#ga2b8ad53931f4cb3bebb3f557d8686066":[5,0,0,2,0,1,17,669], "group___peripheral___registers___bits___definition.html#ga2b942752d686c23323880ff576e7dffb":[5,0,0,2,0,1,17,3961], "group___peripheral___registers___bits___definition.html#ga2b942752d686c23323880ff576e7dffb":[2,16,0,6,0,3791], "group___peripheral___registers___bits___definition.html#ga2b959e903cdac33f5da71aa5c7477a0d":[2,16,0,6,0,1337], "group___peripheral___registers___bits___definition.html#ga2b959e903cdac33f5da71aa5c7477a0d":[5,0,0,2,0,1,17,1362], "group___peripheral___registers___bits___definition.html#ga2b96de7db8b71ac7e414f247b871a53c":[5,0,0,2,0,1,17,4000], "group___peripheral___registers___bits___definition.html#ga2b96de7db8b71ac7e414f247b871a53c":[2,16,0,6,0,3830], "group___peripheral___registers___bits___definition.html#ga2bb650676aaae4a5203f372d497d5947":[5,0,0,2,0,1,17,4145], "group___peripheral___registers___bits___definition.html#ga2bb650676aaae4a5203f372d497d5947":[2,16,0,6,0,3965], "group___peripheral___registers___bits___definition.html#ga2bd34f98ee23b7a58ac63cd195c00d70":[2,16,0,6,0,2731], "group___peripheral___registers___bits___definition.html#ga2bd34f98ee23b7a58ac63cd195c00d70":[5,0,0,2,0,1,17,2815], "group___peripheral___registers___bits___definition.html#ga2bdc4ba1d0e44ba4d7a03cfd3197b687":[5,0,0,2,0,1,17,747], "group___peripheral___registers___bits___definition.html#ga2bdc4ba1d0e44ba4d7a03cfd3197b687":[2,16,0,6,0,722], "group___peripheral___registers___bits___definition.html#ga2bf4701d3b15924e657942ce3caa4105":[2,16,0,6,0,1665], "group___peripheral___registers___bits___definition.html#ga2bf4701d3b15924e657942ce3caa4105":[5,0,0,2,0,1,17,1696], "group___peripheral___registers___bits___definition.html#ga2bf6fff2ca4adf6e093a13b2db77adbb":[5,0,0,2,0,1,17,879], "group___peripheral___registers___bits___definition.html#ga2bf6fff2ca4adf6e093a13b2db77adbb":[2,16,0,6,0,854], "group___peripheral___registers___bits___definition.html#ga2c008055878f08bc33b006847890ac53":[5,0,0,2,0,1,17,1828], "group___peripheral___registers___bits___definition.html#ga2c008055878f08bc33b006847890ac53":[2,16,0,6,0,1765], "group___peripheral___registers___bits___definition.html#ga2c039206fc5c1506aba666387c5d34c8":[5,0,0,2,0,1,17,3604], "group___peripheral___registers___bits___definition.html#ga2c039206fc5c1506aba666387c5d34c8":[2,16,0,6,0,3479], "group___peripheral___registers___bits___definition.html#ga2c0c02829fb41ac2a1b1852c19931de8":[2,16,0,6,0,531], "group___peripheral___registers___bits___definition.html#ga2c0c02829fb41ac2a1b1852c19931de8":[5,0,0,2,0,1,17,556], "group___peripheral___registers___bits___definition.html#ga2c1b7aeeb196a6564b2b3f049590520e":[5,0,0,2,0,1,17,888], "group___peripheral___registers___bits___definition.html#ga2c1b7aeeb196a6564b2b3f049590520e":[2,16,0,6,0,863], "group___peripheral___registers___bits___definition.html#ga2c28625ee031527a29f7cb7db1bb97cf":[5,0,0,2,0,1,17,2414], "group___peripheral___registers___bits___definition.html#ga2c28625ee031527a29f7cb7db1bb97cf":[2,16,0,6,0,2330], "group___peripheral___registers___bits___definition.html#ga2c295b6482aa91ef51198e570166f60f":[5,0,0,2,0,1,17,2921], "group___peripheral___registers___bits___definition.html#ga2c295b6482aa91ef51198e570166f60f":[2,16,0,6,0,2836], "group___peripheral___registers___bits___definition.html#ga2c2b20d6c7ba5ec12ed0aa8aacade921":[5,0,0,2,0,1,17,1795], "group___peripheral___registers___bits___definition.html#ga2c2b20d6c7ba5ec12ed0aa8aacade921":[2,16,0,6,0,1760], "group___peripheral___registers___bits___definition.html#ga2c301fd37e3fa27d3bd28a1f3f553e77":[5,0,0,2,0,1,17,745], "group___peripheral___registers___bits___definition.html#ga2c301fd37e3fa27d3bd28a1f3f553e77":[2,16,0,6,0,720], "group___peripheral___registers___bits___definition.html#ga2c34e5ad0c5f961f4cec16fdf9db4340":[5,0,0,2,0,1,17,4378], "group___peripheral___registers___bits___definition.html#ga2c34e5ad0c5f961f4cec16fdf9db4340":[2,16,0,6,0,4198], "group___peripheral___registers___bits___definition.html#ga2c415fa87c556bd8a4fc0f680d25f160":[5,0,0,2,0,1,17,869], "group___peripheral___registers___bits___definition.html#ga2c415fa87c556bd8a4fc0f680d25f160":[2,16,0,6,0,844], "group___peripheral___registers___bits___definition.html#ga2c43be5f3bf427d9e5c5cb53c71c56c5":[5,0,0,2,0,1,17,1785], "group___peripheral___registers___bits___definition.html#ga2c43be5f3bf427d9e5c5cb53c71c56c5":[2,16,0,6,0,1750], "group___peripheral___registers___bits___definition.html#ga2c46dd0f30ef85094ca0cde2e8c00dac":[2,16,0,6,0,207], "group___peripheral___registers___bits___definition.html#ga2c46dd0f30ef85094ca0cde2e8c00dac":[5,0,0,2,0,1,17,221], "group___peripheral___registers___bits___definition.html#ga2c49c90d83a0e3746b56b2a0a3b0ddcb":[5,0,0,2,0,1,17,4173], "group___peripheral___registers___bits___definition.html#ga2c49c90d83a0e3746b56b2a0a3b0ddcb":[2,16,0,6,0,3993], "group___peripheral___registers___bits___definition.html#ga2c5558cc37c62c5570a5e2716e30ed99":[5,0,0,2,0,1,17,793], "group___peripheral___registers___bits___definition.html#ga2c5558cc37c62c5570a5e2716e30ed99":[2,16,0,6,0,768], "group___peripheral___registers___bits___definition.html#ga2c66ffcbfaa2ef979d04c608f16d61b1":[5,0,0,2,0,1,17,4559], "group___peripheral___registers___bits___definition.html#ga2c66ffcbfaa2ef979d04c608f16d61b1":[2,16,0,6,0,4379], "group___peripheral___registers___bits___definition.html#ga2c67e2279804a83ef24438267d9d4a6c":[5,0,0,2,0,1,17,3550], "group___peripheral___registers___bits___definition.html#ga2c67e2279804a83ef24438267d9d4a6c":[2,16,0,6,0,3429], "group___peripheral___registers___bits___definition.html#ga2c6fab9b1d06bb3f26eb038a1d7e55f5":[2,16,0,6,0,3467], "group___peripheral___registers___bits___definition.html#ga2c6fab9b1d06bb3f26eb038a1d7e55f5":[5,0,0,2,0,1,17,3591], "group___peripheral___registers___bits___definition.html#ga2c6ffdcee5dc3de1402bd8b644d6ecf4":[2,16,0,6,0,2191], "group___peripheral___registers___bits___definition.html#ga2c6ffdcee5dc3de1402bd8b644d6ecf4":[5,0,0,2,0,1,17,2275], "group___peripheral___registers___bits___definition.html#ga2c7ca44fb42b772ff1f75b6481a75c9c":[5,0,0,2,0,1,17,1914], "group___peripheral___registers___bits___definition.html#ga2c7ca44fb42b772ff1f75b6481a75c9c":[2,16,0,6,0,1851], "group___peripheral___registers___bits___definition.html#ga2c804c5fca2b891e63c691872c440253":[2,16,0,6,0,2953], "group___peripheral___registers___bits___definition.html#ga2c804c5fca2b891e63c691872c440253":[5,0,0,2,0,1,17,3038], "group___peripheral___registers___bits___definition.html#ga2c967f124b03968372d801e1393fa209":[5,0,0,2,0,1,17,784], "group___peripheral___registers___bits___definition.html#ga2c967f124b03968372d801e1393fa209":[2,16,0,6,0,759], "group___peripheral___registers___bits___definition.html#ga2ca45b282f2582c91450d4e1204121cf":[2,16,0,6,0,1561], "group___peripheral___registers___bits___definition.html#ga2ca45b282f2582c91450d4e1204121cf":[5,0,0,2,0,1,17,1586], "group___peripheral___registers___bits___definition.html#ga2ca7f18dd5bc1130dbefae4ff8736143":[2,16,0,6,0,3001], "group___peripheral___registers___bits___definition.html#ga2ca7f18dd5bc1130dbefae4ff8736143":[5,0,0,2,0,1,17,3110], "group___peripheral___registers___bits___definition.html#ga2cb6cde5f88a5d2b635a830dd401c4e0":[2,16,0,6,0,3619], "group___peripheral___registers___bits___definition.html#ga2cb6cde5f88a5d2b635a830dd401c4e0":[5,0,0,2,0,1,17,3746], "group___peripheral___registers___bits___definition.html#ga2cb8a5551d90c8d79b09b4d82f3f59c2":[2,16,0,6,0,1175], "group___peripheral___registers___bits___definition.html#ga2cb8a5551d90c8d79b09b4d82f3f59c2":[5,0,0,2,0,1,17,1200], "group___peripheral___registers___bits___definition.html#ga2cd2741b81e7c3962b75be28af6a35f6":[5,0,0,2,0,1,17,4298], "group___peripheral___registers___bits___definition.html#ga2cd2741b81e7c3962b75be28af6a35f6":[2,16,0,6,0,4118], "group___peripheral___registers___bits___definition.html#ga2cd97fc37fa6ffadbb7af4f9ddf1d014":[2,16,0,6,0,1329], "group___peripheral___registers___bits___definition.html#ga2cd97fc37fa6ffadbb7af4f9ddf1d014":[5,0,0,2,0,1,17,1354], "group___peripheral___registers___bits___definition.html#ga2cdbfb907f2b03485e5555d986245595":[5,0,0,2,0,1,17,1900], "group___peripheral___registers___bits___definition.html#ga2cdbfb907f2b03485e5555d986245595":[2,16,0,6,0,1837], "group___peripheral___registers___bits___definition.html#ga2cdd3f5cad389fbe7c96458fb115035b":[2,16,0,6,0,2914], "group___peripheral___registers___bits___definition.html#ga2cdd3f5cad389fbe7c96458fb115035b":[5,0,0,2,0,1,17,2999], "group___peripheral___registers___bits___definition.html#ga2cf72c1527c7610bcecb03816338b262":[5,0,0,2,0,1,17,1845], "group___peripheral___registers___bits___definition.html#ga2cf72c1527c7610bcecb03816338b262":[2,16,0,6,0,1782], "group___peripheral___registers___bits___definition.html#ga2d06168a43b4845409f2fb9193ee474a":[2,16,0,6,0,210], "group___peripheral___registers___bits___definition.html#ga2d06168a43b4845409f2fb9193ee474a":[5,0,0,2,0,1,17,224], "group___peripheral___registers___bits___definition.html#ga2d129b27c2af41ae39e606e802a53386":[2,16,0,6,0,1472], "group___peripheral___registers___bits___definition.html#ga2d129b27c2af41ae39e606e802a53386":[5,0,0,2,0,1,17,1497], "group___peripheral___registers___bits___definition.html#ga2d37c20686faa340a77021117f5908b7":[5,0,0,2,0,1,17,3522], "group___peripheral___registers___bits___definition.html#ga2d37c20686faa340a77021117f5908b7":[2,16,0,6,0,3401], "group___peripheral___registers___bits___definition.html#ga2d400044261146be3deb722d9cf3d5c1":[5,0,0,2,0,1,17,945], "group___peripheral___registers___bits___definition.html#ga2d400044261146be3deb722d9cf3d5c1":[2,16,0,6,0,920], "group___peripheral___registers___bits___definition.html#ga2d41a4027853783633d929a43f8d6d85":[5,0,0,2,0,1,17,1780] };
MyEmbeddedWork/ARM_CORTEX_M3-STM32
1. Docs/Doxygen/html/navtreeindex43.js
JavaScript
gpl-3.0
28,480
<?php defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' ); /** * Add Lazy Load JavaScript in the header * No jQuery or other library is required !! * * @since 1.3.5 It's possible to exclude LazyLoad process by used do_rocket_lazyload filter * @since 1.1.0 This code is insert in head with inline script for more performance * @since 1.0 */ add_action( 'wp_head', 'rocket_lazyload_script', PHP_INT_MAX ); function rocket_lazyload_script() { if ( ( ! get_rocket_option( 'lazyload' ) && ! get_rocket_option( 'lazyload_iframes' ) ) || ( ! apply_filters( 'do_rocket_lazyload', true ) && ! apply_filters( 'do_rocket_lazyload_iframes', true ) ) ) { return; } $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $lazyload_url = get_rocket_cdn_url( WP_ROCKET_FRONT_JS_URL . 'lazyload.' . WP_ROCKET_LAZYLOAD_JS_VERSION . $suffix . '.js', array( 'all', 'css_and_js', 'js' ) ); echo '<script data-no-minify="1" data-cfasync="false">(function(w,d){function a(){var b=d.createElement("script");b.async=!0;b.src="' . $lazyload_url .'";var a=d.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)}w.attachEvent?w.attachEvent("onload",a):w.addEventListener("load",a,!1)})(window,document);</script>'; } /** * Replace Gravatar, thumbnails, images in post content and in widget text by LazyLoad * * @since 2.6 Add the get_image_tag filter * @since 2.2 Better regex pattern in a replace_callback * @since 1.3.5 It's possible to exclude LazyLoad process by used do_rocket_lazyload filter * @since 1.2.0 It's possible to not lazyload an image with data-no-lazy attribute * @since 1.1.0 Don't lazyload if the thumbnail has already been run through previously * @since 1.0.1 Add priority of hooks at maximum later with PHP_INT_MAX * @since 1.0 */ add_filter( 'get_avatar' , 'rocket_lazyload_images', PHP_INT_MAX ); add_filter( 'the_content' , 'rocket_lazyload_images', PHP_INT_MAX ); add_filter( 'widget_text' , 'rocket_lazyload_images', PHP_INT_MAX ); add_filter( 'get_image_tag' , 'rocket_lazyload_images', PHP_INT_MAX ); add_filter( 'post_thumbnail_html' , 'rocket_lazyload_images', PHP_INT_MAX ); function rocket_lazyload_images( $html ) { // Don't LazyLoad if process is stopped for these reasons if ( ! get_rocket_option( 'lazyload' ) || ! apply_filters( 'do_rocket_lazyload', true ) || is_feed() || is_preview() || empty( $html ) || ( defined( 'DONOTLAZYLOAD' ) && DONOTLAZYLOAD ) || wp_script_is( 'twentytwenty-twentytwenty', 'enqueued' ) ) { return $html; } $html = preg_replace_callback( '#<img([^>]*) src=("(?:[^"]+)"|\'(?:[^\']+)\'|(?:[^ >]+))([^>]*)>#', '__rocket_lazyload_replace_callback', $html ); return $html; } /** * Used to check if we have to LazyLoad this or not * * @since 2.5.5 Don't apply LazyLoad on images from WP Retina x2 * @since 2.5 Don't apply LazyLoad on all images from LayerSlider * @since 2.4.2 Don't apply LazyLoad on all images from Media Grid * @since 2.3.11 Don't apply LazyLoad on all images from Timthumb * @since 2.3.10 Don't apply LazyLoad on all images from Revolution Slider & Justified Image Grid * @since 2.3.8 Don't apply LazyLoad on captcha from Really Simple CAPTCHA * @since 2.2 */ function __rocket_lazyload_replace_callback( $matches ) { // Don't apply LazyLoad on images from WP Retina x2 if( function_exists( 'wr2x_picture_rewrite' ) ) { if( wr2x_get_retina( trailingslashit( ABSPATH ) . wr2x_get_pathinfo_from_image_src( trim( $matches[2], '"' ) ) ) ) { return $matches[0]; } } // TO DO - improve this code with a preg_match - it's ugly!!!! if ( strpos( $matches[1] . $matches[3], 'data-no-lazy=' ) === false && strpos( $matches[1] . $matches[3], 'data-lazy-original=' ) === false && strpos( $matches[1] . $matches[3], 'data-lazy-src=' ) === false && strpos( $matches[1] . $matches[3], 'data-lazysrc=' ) === false && strpos( $matches[1] . $matches[3], 'data-src=' ) === false && strpos( $matches[1] . $matches[3], 'data-lazyload=' ) === false && strpos( $matches[1] . $matches[3], 'data-bgposition=' ) === false && strpos( $matches[2], '/wpcf7_captcha/' ) === false && strpos( $matches[2], 'timthumb.php?src' ) === false && strpos( $matches[1] . $matches[3], 'data-envira-src=' ) === false && strpos( $matches[1] . $matches[3], 'fullurl=' ) === false && strpos( $matches[1] . $matches[3], 'lazy-slider-img=' ) === false && strpos( $matches[1] . $matches[3], 'data-srcset=' ) === false && strpos( $matches[1] . $matches[3], 'class="ls-l' ) === false && strpos( $matches[1] . $matches[3], 'class="ls-bg' ) === false ) { /** * Filter the LazyLoad placeholder on src attribute * * @since 2.6 * * @param string Output that will be printed */ $placeholder = apply_filters( 'rocket_lazyload_placeholder', 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=' ); $html = sprintf( '<img%1$s src="%4$s" data-lazy-src=%2$s%3$s>', $matches[1], $matches[2], $matches[3], $placeholder ); $html_noscript = sprintf( '<noscript><img%1$s src=%2$s%3$s></noscript>', $matches[1], $matches[2], $matches[3] ); /** * Filter the LazyLoad HTML output on images * * @since 2.3.8 * * @param string $html Output that will be printed */ $html = apply_filters( 'rocket_lazyload_html', $html, true ); return $html . $html_noscript; } else { return $matches[0]; } } /** * Replace WordPress smilies by Lazy Load * * @since 2.0 New system for replace smilies by Lazy Load * @since 1.3.5 It's possible to exclude LazyLoad process by used do_rocket_lazyload filter * @since 1.1.0 Don't lazy-load if the thumbnail has already been run through previously * @since 1.0.1 Add priority of hooks at maximum later with PHP_INT_MAX * @since 1.0 */ add_action( 'init', 'rocket_lazyload_smilies' ); function rocket_lazyload_smilies() { if ( ! get_rocket_option( 'lazyload' ) || ! apply_filters( 'do_rocket_lazyload', true, 'smilies' ) || ( defined( 'DONOTLAZYLOAD' ) && DONOTLAZYLOAD ) ) { return; } remove_filter( 'the_content', 'convert_smilies' ); remove_filter( 'the_excerpt', 'convert_smilies' ); remove_filter( 'comment_text', 'convert_smilies', 20 ); add_filter( 'the_content', 'rocket_convert_smilies' ); add_filter( 'the_excerpt', 'rocket_convert_smilies' ); add_filter( 'comment_text', 'rocket_convert_smilies', 20 ); } /** * Convert text equivalent of smilies to images. * * @source convert_smilies() in /wp-includes/formattings.php * @since 2.0 */ function rocket_convert_smilies( $text ) { global $wp_smiliessearch; $output = ''; if ( get_option( 'use_smilies' ) && ! empty( $wp_smiliessearch ) ) { // HTML loop taken from texturize function, could possible be consolidated $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between $stop = count( $textarr );// loop stuff // Ignore proessing of specific tags $tags_to_ignore = 'code|pre|style|script|textarea'; $ignore_block_element = ''; for ( $i = 0; $i < $stop; $i++ ) { $content = $textarr[ $i ]; // If we're in an ignore block, wait until we find its closing tag if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { $ignore_block_element = $matches[1]; } // If it's not a tag and not in ignore block if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) { $content = preg_replace_callback( $wp_smiliessearch, 'rocket_translate_smiley', $content ); } // did we exit ignore block if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) { $ignore_block_element = ''; } $output .= $content; } } else { // return default text. $output = $text; } return $output; } /** * Convert one smiley code to the icon graphic file equivalent. * * @source translate_smiley() in /wp-includes/formattings.php * @since 2.0 */ function rocket_translate_smiley( $matches ) { global $wpsmiliestrans; if ( count( $matches ) == 0 ) return ''; $smiley = trim( reset( $matches ) ); $img = $wpsmiliestrans[ $smiley ]; $matches = array(); $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false; $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ); // Don't convert smilies that aren't images - they're probably emoji. if ( ! in_array( $ext, $image_exts ) ) { return $img; } /** * Filter the Smiley image URL before it's used in the image element. * * @since 2.9.0 * * @param string $smiley_url URL for the smiley image. * @param string $img Filename for the smiley image. * @param string $site_url Site URL, as returned by site_url(). */ $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() ); // Don't LazyLoad if process is stopped for these reasons if ( ! is_feed() && ! is_preview() ) { /** This filter is documented in inc/front/lazyload.php */ $placeholder = apply_filters( 'rocket_lazyload_placeholder', 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=' ); return sprintf( ' <img src="%s" data-lazy-src="%s" alt="%s" class="wp-smiley" /> ', $placeholder, esc_url( $src_url ), esc_attr( $smiley ) ); } else { return sprintf( ' <img src="%s" alt="%s" class="wp-smiley" /> ', esc_url( $src_url ), esc_attr( $smiley ) ); } } /** * Replace iframes by LazyLoad * * @since 2.6 */ add_filter( 'rocket_buffer', 'rocket_lazyload_iframes', PHP_INT_MAX ); function rocket_lazyload_iframes( $html ) { // Don't LazyLoad if process is stopped for these reasons if ( ! get_rocket_option( 'lazyload_iframes' ) || ! apply_filters( 'do_rocket_lazyload_iframes', true ) || is_feed() || is_preview() || empty( $html ) || ( defined( 'DONOTLAZYLOAD' ) && DONOTLAZYLOAD ) ) { return $html; } $matches = array(); preg_match_all( '/<iframe\s+.*?>/', $html, $matches ); foreach ( $matches[0] as $k=>$iframe ) { // Don't mess with the Gravity Forms ajax iframe if ( strpos( $iframe, 'gform_ajax_frame' ) ) { continue; } // Don't lazyload if iframe has data-no-lazy attribute if ( strpos( $iframe, 'data-no-lazy=' ) ) { continue; } /** This filter is documented in inc/front/lazyload.php */ $placeholder = apply_filters( 'rocket_lazyload_placeholder', 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=' ); $iframe = preg_replace( '/<iframe(.*?)src=/is', '<iframe$1src="' . $placeholder . '" data-lazy-src=', $iframe ); $html = str_replace( $matches[0][ $k ], $iframe, $html ); /** * Filter the LazyLoad HTML output on iframes * * @since 2.6 * * @param array $html Output that will be printed */ $html = apply_filters( 'rocket_lazyload_iframe_html', $html ); } return $html; } /** * Check if we need to exclude LazyLoad on specific posts * * @since 2.5 */ add_action( 'wp', '__rocket_deactivate_lazyload_on_specific_posts' ); function __rocket_deactivate_lazyload_on_specific_posts() { if ( is_rocket_post_excluded_option( 'lazyload' ) ) { add_filter( 'do_rocket_lazyload', '__return_false' ); } if ( is_rocket_post_excluded_option( 'lazyload_iframes' ) ) { add_filter( 'do_rocket_lazyload_iframes', '__return_false' ); } } /** * Compatibility with images with srcset attribute * * @author Remy Perona * * @since 2.8 Also add sizes to the data-lazy-* attributes to prevent error in W3C validator * @since 2.7 * */ add_filter( 'rocket_lazyload_html', '__rocket_lazyload_on_srcset' ); function __rocket_lazyload_on_srcset( $html ) { if( preg_match( '/srcset=("(?:[^"]+)"|\'(?:[^\']+)\'|(?:[^ >]+))/i', $html ) ) { $html = str_replace( 'srcset=', 'data-lazy-srcset=', $html ); } if( preg_match( '/sizes=("(?:[^"]+)"|\'(?:[^\']+)\'|(?:[^ >]+))/i', $html ) ) { $html = str_replace( 'sizes=', 'data-lazy-sizes=', $html ); } return $html; }
jslyonnais/wordpress-theme-boilerplate
plugins/wp-rocket/inc/front/lazyload.php
PHP
gpl-3.0
12,266
/** * Hub Miner: a hubness-aware machine learning experimentation library. * Copyright (C) 2014 Nenad Tomasev. Email: nenad.tomasev at gmail.com * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package images.mining.clustering; import algref.Author; import algref.ConferencePublication; import algref.Publication; import data.neighbors.NeighborSetFinder; import data.representation.DataInstance; import data.representation.DataSet; import data.representation.images.sift.LFeatRepresentation; import data.representation.images.sift.util.ClusteredSIFTRepresentation; import data.representation.images.sift.util.ClusteredSIFTVector; import data.representation.util.DataMineConstants; import distances.primary.CombinedMetric; import distances.primary.LocalImageFeatureMetric; import distances.primary.SIFTSpatialMetric; import images.mining.calc.AverageColorGrabber; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashMap; import java.util.Random; import learning.unsupervised.Cluster; import learning.unsupervised.ClusteringAlg; import learning.unsupervised.evaluation.quality.OptimalConfigurationFinder; import learning.unsupervised.methods.KMeans; /** * This class implements an adapted K-means approach for performing intra-image * SIFT feature clustering, as described in the paper "Two pass k-means * algorithm for finding SIFT clusters in an image" in 2010 at the Slovenian KDD * conference which is a part of the larger Information Society * multi-conference. This is one of the K-means implementations that was used in * the experiments. This code should be merged with IntraImageKMeansAdapted, but * these experiments were a one-off, so it was not worth the effort afterwards * to re-factor things completely. * * @author Nenad Tomasev <nenad.tomasev at gmail.com> */ public class IntraImageKMeansWeighted extends ClusteringAlg { private float alpha = 1; // Weight of the decriptors. private float beta = 1; // Weight of the color information. public static final float XY_PRIORITY = 1; public static final float COLOR_PRIORITY = 0.4f; public static final float DESC_PRIORITY = 0.5f; private float error; private static final float ERROR_THRESHOLD = 0.001f; private int minClusters = 1; private int maxClusters = 1; private int repetitions = 1; // How many times to repeat for each K. private Cluster[][] configurations = null; private int[][] colorNeighborhoods = null; private boolean colorNeighborhoodsCalculated = false; private boolean randomInit = false; private BufferedImage image; @Override public HashMap<String, String> getParameterNamesAndDescriptions() { HashMap<String, String> paramMap = new HashMap<>(); paramMap.put("alpha", "Weight of the descriptors."); paramMap.put("beta", "Weight of the color information."); paramMap.put("minClusters", "Minimal number of clusters to try."); paramMap.put("maxClusters", "Maximal number of clusters to try."); paramMap.put("repetitions", "How many times to repeat for each K."); return paramMap; } @Override public Publication getPublicationInfo() { ConferencePublication pub = new ConferencePublication(); pub.setConferenceName("Slovenian KDD Conference, Information Society " + "Multiconference"); pub.addAuthor(Author.NENAD_TOMASEV); pub.addAuthor(Author.DUNJA_MLADENIC); pub.setTitle("Two pass k-means algorithm for finding SIFT clusters in " + "an image"); pub.setYear(2010); return pub; } /** * Initialization. * * @param bi BufferedImage that is being clustered into SIFT feature groups. * @param rep SIFTRepresentation that is a set of all the SIFT features from * the image. * @param numClusters Number of clusters to cluster to. * @param alpha Float value that is the weight of the descriptors in the * distance. * @param beta Float value that is the weight of the color in the distance. */ public IntraImageKMeansWeighted(BufferedImage bi, LFeatRepresentation rep, int numClusters, float alpha, float beta) { setDataSet(rep); setNumClusters(numClusters); minClusters = numClusters; maxClusters = numClusters; repetitions = 1; this.alpha = alpha; this.beta = beta; image = bi; } /** * Initialization. * * @param bi BufferedImage that is being clustered into SIFT feature groups. * @param rep SIFTRepresentation that is a set of all the SIFT features from * the image. * @param minClusters Integer that is the minimum number of clusters to try. * @param maxClusters Integer that is the maximum number of clusters to try. * @param repetitions Integer that is the number of repetitions. * @param randomInit Boolean indicating whether to use random * initialization. * @param alpha Float value that is the weight of the descriptors in the * distance. * @param beta Float value that is the weight of the color in the distance. */ public IntraImageKMeansWeighted(BufferedImage bi, LFeatRepresentation rep, int minClusters, int maxClusters, int repetitions, boolean randomInit, float alpha, float beta) { setDataSet(rep); setNumClusters(minClusters); this.minClusters = minClusters; this.maxClusters = maxClusters; this.repetitions = repetitions; this.randomInit = randomInit; this.alpha = alpha; this.beta = beta; image = bi; } /** * Reinitialize before another clustering run. */ public void reinit() { error = Float.MAX_VALUE; setClusterAssociations(null); } @Override public void cluster() throws Exception { flagAsActive(); int diffKs = maxClusters - minClusters + 1; if (repetitions < 1) { throw new Exception("Must be at least one repetition," + "variable repetitions = " + repetitions); } if (minClusters > maxClusters) { throw new Exception("minClusters must be less than maxClusters," + "minClusters = " + minClusters + ", maxClusters = " + maxClusters); } if ((minClusters == maxClusters) && (repetitions == 1)) { // In this case, we are not testing across a range. clusterOnce(); return; } configurations = new Cluster[diffKs * repetitions][]; for (int cIndex = minClusters; cIndex <= maxClusters; cIndex++) { setNumClusters(cIndex); for (int rIndex = 0; rIndex < repetitions; rIndex++) { reinit(); System.out.println("Clustering for k: " + cIndex); clusterOnce(); configurations[(cIndex - minClusters) * repetitions + rIndex] = getClusters(); } } flagAsInactive(); } /** * Get the best configuration after all the clustering runs. * * @return Cluster[] representing the best achieved clustering * representation according to the Dunn index. * @throws Exception */ public Cluster[] getBestConfiguration() throws Exception { if (configurations == null) { return getClusters(); } CombinedMetric cmet = new CombinedMetric(null, new SIFTSpatialMetric(), CombinedMetric.DEFAULT); OptimalConfigurationFinder selector = new OptimalConfigurationFinder( configurations, getDataSet(), cmet, OptimalConfigurationFinder.DUNN_INDEX); return selector.findBestConfiguration(); } /** * Gets all the generated clustering configurations. * * @return Cluster[][] containing all the produced clusterings during the * run. */ public Cluster[][] getClusterConfigurations() { if (configurations != null) { return configurations; } else { configurations = new Cluster[1][]; configurations[0] = getClusters(); return configurations; } } /** * Perform a single clustering run for a fixed K value. * * @throws Exception */ public void clusterOnce() throws Exception { LFeatRepresentation dset = (LFeatRepresentation) (getDataSet()); int numClusters = getNumClusters(); performBasicChecks(); boolean trivial = checkIfTrivial(); if (trivial) { return; } int[] clusterAssociations = new int[dset.data.size()]; if (numClusters == 1) { setClusterAssociations(clusterAssociations); } else if (numClusters == clusterAssociations.length) { for (int i = 0; i < clusterAssociations.length; i++) { clusterAssociations[i] = i; } } else { setClusterAssociations(clusterAssociations); // Calculate the color neighborhoods. DataInstance instance; AverageColorGrabber avg = new AverageColorGrabber(image); // Since there may be multiple runs, this array is reused to avoid // calculating it all over again. if (!colorNeighborhoodsCalculated) { colorNeighborhoods = new int[dset.size()][3]; for (int i = 0; i < dset.size(); i++) { instance = dset.data.get(i); colorNeighborhoods[i] = avg.getAverageColorInArray( instance.fAttr[1], instance.fAttr[0]); } colorNeighborhoodsCalculated = true; } // Centroid initialization. ClusteredSIFTVector[] centroids = new ClusteredSIFTVector[numClusters]; ClusteredSIFTRepresentation clusterCentroidDSet = new ClusteredSIFTRepresentation(128); for (int i = 0; i < clusterAssociations.length; i++) { clusterAssociations[i] = -1; } if (randomInit) { Random initializer = new Random(); int centroidIndex; for (int cIndex = 0; cIndex < numClusters; cIndex++) { centroidIndex = initializer.nextInt( clusterAssociations.length); while (clusterAssociations[centroidIndex] != -1) { centroidIndex = initializer.nextInt( clusterAssociations.length); } clusterAssociations[centroidIndex] = cIndex; centroids[cIndex] = new ClusteredSIFTVector(clusterCentroidDSet); clusterCentroidDSet. addDataInstance(centroids[cIndex]); centroids[cIndex].fAttr = (dset.data.get(centroidIndex)).fAttr; centroids[cIndex].iAttr[0] = cIndex; } } else { // Smart initalization. It is very important for the initial // centroids to be well positioned. First we do spatial KMeans // to fix centroids in dense areas, then get these final // centroids there for the initial seed of the secondary K-means // pass through the feature data. CombinedMetric cmet = new CombinedMetric(null, new SIFTSpatialMetric(), CombinedMetric.DEFAULT); KMeans clusterer = new KMeans(dset, cmet, numClusters); clusterer.cluster(); Cluster[] seedClusters = clusterer.getClusters(); for (int cIndex = 0; cIndex < numClusters; cIndex++) { if (!seedClusters[cIndex].isEmpty()) { centroids[cIndex] = new ClusteredSIFTVector( seedClusters[cIndex].getCentroid()); clusterCentroidDSet.addDataInstance( centroids[cIndex]); centroids[cIndex].setContext(clusterCentroidDSet); centroids[cIndex].iAttr[0] = cIndex; } else { Random initializer = new Random(); int centroidIndex = -1; boolean different = false; while (!different) { different = true; centroidIndex = initializer.nextInt( clusterAssociations.length); while (clusterAssociations[centroidIndex] != -1) { centroidIndex = initializer.nextInt( clusterAssociations.length); } int j = -1; while (++j < cIndex) { if ((dset.data.get(centroidIndex)). equalsByFloatValue(centroids[j])) { different = false; break; } } } centroids[cIndex] = new ClusteredSIFTVector( clusterCentroidDSet); centroids[cIndex].fAttr = (dset.data.get(centroidIndex)).fAttr; clusterCentroidDSet.addDataInstance(centroids[cIndex]); centroids[cIndex].iAttr[0] = cIndex; } } } // Preparations for the main clustering loop. Cluster[] clusters; float errorPrevious; float errorCurrent = Float.MAX_VALUE; setIterationIndex(0); boolean noReassignments; boolean errorDifferenceSignificant = true; LocalImageFeatureMetric smet = new LocalImageFeatureMetric(); do { nextIteration(); // Dynamically calculate the iteration error. error = 0; // Cluster assignments. noReassignments = true; // Find the average colors for the centroids. int[][] centroidColorNeighborhoods = new int[numClusters][3]; for (int cIndex = 0; cIndex < numClusters; cIndex++) { centroidColorNeighborhoods[cIndex] = avg.getAverageColorInArray(centroids[cIndex].getX(), centroids[cIndex].getY()); } for (int i = 0; i < clusterAssociations.length; i++) { int closestCentroidIndex = -1; instance = dset.getInstance(i); float[] colorDists = new float[numClusters]; float[] xyDists = new float[numClusters]; float[] descDists = new float[numClusters]; float[] totalDists = new float[numClusters]; // Calculate all the individual types of distances. for (int cIndex = 0; cIndex < numClusters; cIndex++) { colorDists[cIndex] += Math.abs(colorNeighborhoods[i][0] - centroidColorNeighborhoods[cIndex][0]); colorDists[cIndex] += Math.abs(colorNeighborhoods[i][1] - centroidColorNeighborhoods[cIndex][1]); colorDists[cIndex] += Math.abs(colorNeighborhoods[i][2] - centroidColorNeighborhoods[cIndex][2]); xyDists[cIndex] += Math.pow(instance.fAttr[1] - centroids[cIndex].getX(), 2); xyDists[cIndex] += Math.pow(instance.fAttr[0] - centroids[cIndex].getY(), 2); // No need to take the root for, as it doesn't affect // the ordering. descDists[cIndex] = smet.dist(instance.fAttr, centroids[cIndex].fAttr); totalDists[cIndex] = xyDists[cIndex] + alpha * descDists[cIndex] + beta * colorDists[cIndex]; } float currMin = Float.MAX_VALUE; for (int cIndex = 0; cIndex < numClusters; cIndex++) { if (totalDists[cIndex] < currMin) { closestCentroidIndex = cIndex; currMin = totalDists[cIndex]; } } if (closestCentroidIndex != clusterAssociations[i]) { noReassignments = false; } clusterAssociations[i] = closestCentroidIndex; error += totalDists[closestCentroidIndex]; } clusters = getClusters(); clusterCentroidDSet.data = new ArrayList<>(numClusters); for (int cIndex = 0; cIndex < numClusters; cIndex++) { centroids[cIndex] = new ClusteredSIFTVector( clusters[cIndex].getCentroid()); centroids[cIndex].iAttr[0] = cIndex; centroids[cIndex].setContext(clusterCentroidDSet); clusterCentroidDSet.addDataInstance(centroids[cIndex]); } errorPrevious = errorCurrent; errorCurrent = error; if (getIterationIndex() >= MIN_ITERATIONS) { if (DataMineConstants.isAcceptableDouble( errorPrevious) && DataMineConstants. isAcceptableDouble(errorCurrent) && (Math.abs(errorCurrent / errorPrevious) - 1f) < ERROR_THRESHOLD) { errorDifferenceSignificant = false; } else { errorDifferenceSignificant = true; } } } while (errorDifferenceSignificant && !noReassignments); } } @Override public int[] assignPointsToModelClusters(DataSet dset, NeighborSetFinder nsfTest) { // A dummy method to satisfy the interface, since this is not used in // the context of the experiments where it is being run. return new int[dset.size()]; } }
datapoet/hubminer
src/main/java/images/mining/clustering/IntraImageKMeansWeighted.java
Java
gpl-3.0
19,559
/** * */ package by.pvt.kish.aircompany.command.employee; import by.pvt.kish.aircompany.command.ActionCommand; import by.pvt.kish.aircompany.constants.Attribute; import by.pvt.kish.aircompany.constants.Page; import by.pvt.kish.aircompany.pojos.Employee; import by.pvt.kish.aircompany.exceptions.ServiceException; import by.pvt.kish.aircompany.services.impl.EmployeeService; import by.pvt.kish.aircompany.utils.ErrorHandler; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * @author Kish Alexey */ public class GetAllEmployeesCommand implements ActionCommand { @Override public String execute(HttpServletRequest request, HttpServletResponse response) { String className = GetAllEmployeesCommand.class.getName(); try { List<Employee> employees = EmployeeService.getInstance().getAll(); request.setAttribute(Attribute.EMPLOYEES_ATTRIBUTE, employees); } catch (ServiceException e) { return ErrorHandler.returnErrorPage(e.getMessage(), className); } return Page.EMPLOYEES; } }
alexeykish/aircompany-hibernate
web/src/main/java/by/pvt/kish/aircompany/command/employee/GetAllEmployeesCommand.java
Java
gpl-3.0
1,076
namespace Maticsoft.Web.Areas.SNS.Controllers { using Maticsoft.BLL.SNS; using Maticsoft.Components.Setting; using Maticsoft.Model.SNS; using Maticsoft.Model.SysManage; using Maticsoft.Web.Components.Setting.SNS; using System; using System.Collections.Generic; using System.Web.Mvc; using Webdiyer.WebControls.Mvc; public class AudioController : SNSControllerBase { private int _basePageSize = 6; private int _waterfallDetailCount = 1; private int _waterfallSize = 0x20; private int commentPagesize = 5; private Maticsoft.BLL.SNS.Posts postBll = new Maticsoft.BLL.SNS.Posts(); [HttpPost] public ActionResult AudiosWaterfall(int startIndex) { ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; startIndex = (startIndex > 1) ? (startIndex + 1) : 0; int endIndex = (startIndex > 1) ? ((startIndex + this._waterfallDetailCount) - 1) : this._waterfallDetailCount; if (this.postBll.GetRecordCount(" Status=1 and AudioUrl IS NOT NULL AND AudioUrl <>'' ") < 1) { return new EmptyResult(); } List<Maticsoft.Model.SNS.Posts> model = this.postBll.GetAudioListByPage(-1, startIndex, endIndex); return base.View(base.CurrentThemeViewPath + "/Audio/AudioListWaterfall.cshtml", model); } public ActionResult Detail(int id) { Maticsoft.Model.SNS.Posts model = this.postBll.GetModel(id); if (model == null) { return base.RedirectToAction("Index", "Home"); } ((dynamic) base.ViewBag).CommentPageSize = this.commentPagesize; ((dynamic) base.ViewBag).Commentcount = new Maticsoft.BLL.SNS.Comments().GetCommentCount(0, id); IPageSetting pageSetting = PageSetting.GetPageSetting("PhotoDetail", ApplicationKeyType.SNS); string[][] values = new string[1][]; values[0] = new string[] { "{cname}", model.Description ?? (model.CreatedNickName + "分享的音乐") }; pageSetting.Replace(values); ((dynamic) base.ViewBag).Title = pageSetting.Title; ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords; ((dynamic) base.ViewBag).Description = pageSetting.Description; return base.View(model); } public ActionResult Index(int? pageIndex) { int pageSize = this._basePageSize + this._waterfallSize; ((dynamic) base.ViewBag).BasePageSize = this._basePageSize; IPageSetting pageSetting = PageSetting.GetPageSetting("Base", ApplicationKeyType.SNS); ((dynamic) base.ViewBag).Title = pageSetting.Title; ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords; ((dynamic) base.ViewBag).Description = pageSetting.Description; pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1); int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0; int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize; int recordCount = 0; recordCount = this.postBll.GetRecordCount(" Status=1 and AudioUrl IS NOT NULL AND AudioUrl <>'' "); ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex; int num5 = pageIndex.Value * pageSize; ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > recordCount) ? recordCount : num5; if (recordCount < 1) { return base.View(); } int? nullable = pageIndex; PagedList<Maticsoft.Model.SNS.Posts> model = this.postBll.GetAudioListByPage(-1, startIndex, endIndex).ToPagedList<Maticsoft.Model.SNS.Posts>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(recordCount)); if (base.Request.IsAjaxRequest()) { return this.PartialView("AudioList", model); } return base.View(model); } } }
51zhaoshi/myyyyshop
Maticsoft.Web_Source/Maticsoft.Web.Areas.SNS.Controllers/AudioController.cs
C#
gpl-3.0
4,190
#ifndef genomic_SplitRawSampleSet_h #define genomic_SplitRawSampleSet_h #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <map> #include <algorithm> #include <stdexcept> #include <cstdlib> #include "AlleleSpecific.hpp" #include "SampleSet.hpp" extern marker::Manager marker::manager; template <typename V> class RawSampleSet; template <typename V> class SplitRawSampleSet : public RawSampleSet<V> { public: typedef RawSampleSet<V> Base; private: size_t dataColumn; void _read(fstream& file); void readSampleValue(istringstream& stream, typename Base::RawSample* sample, size_t chromIndex, const char delim); public: SplitRawSampleSet() : dataColumn(1) {} SplitRawSampleSet(size_t sampleDataColumn) : dataColumn(sampleDataColumn) {} }; /* Template implementation */ template <typename V> void SplitRawSampleSet<V>::_read(fstream& file) { const char delim = Base::Base::io.delim; const size_t nSkippedLines = Base::Base::io.nSkippedLines, headerLine = Base::Base::io.headerLine; // assume M makers and N samples // no headerLine marker::Set::ChromosomeMarkers& allMarkers = Base::Base::markers->unsortedChromosome(); marker::Set::ChromosomeMarkers::iterator markerIt = allMarkers.begin(); marker::Set::ChromosomeMarkers::const_iterator markerEnd = allMarkers.end(); // Use fileName without extension as sampleName string sampleName = name::filestem(Base::fileName); typename Base::RawSample* sample = Base::create(sampleName); size_t lineCount = 0; string line, markerName, chromName, discard; while (true) { getline(file, line); if (file.eof()) break; if (++lineCount > nSkippedLines && lineCount != headerLine) { istringstream stream(line); // discard previous columns size_t colCount = 0; while (++colCount < dataColumn) { //stream >> discard; getline(stream, discard, delim); } if (markerIt == markerEnd) { throw runtime_error("Number of markers do not match the number of values for sample"); } readSampleValue(stream, sample, (*markerIt)->chromosome-1, delim); // next marker ++markerIt; } else { // discard line } } } template <typename V> inline void SplitRawSampleSet<V>::readSampleValue(istringstream& stream, typename Base::RawSample* sample, size_t chromIndex, const char delim) { typename Base::Value value; string s; getline(stream, s, delim); value = atof(s.c_str()); sample->addToChromosome(chromIndex, value); } /* Template Specialization */ // Use the same specialization for alleles_cn and alleles_rcn #define SPECIALIZATION_TYPE alleles_cn #include "SplitRawSampleSet_special.hpp" #undef SPECIALIZATION_TYPE #define SPECIALIZATION_TYPE alleles_rcn #include "SplitRawSampleSet_special.hpp" #undef SPECIALIZATION_TYPE #endif
djhshih/genomic
SplitRawSampleSet.hpp
C++
gpl-3.0
2,818
"use strict"; var path = require("path"); var assert = require("chai").assert; var request = require("supertest"); var fork = require("child_process").fork; var index = path.resolve(__dirname + "/../../../index.js"); describe.skip("E2E CLI Snippet test", function () { // use `mocha --timeout` option instead //this.timeout(5000); var bs, options; before(function (done) { bs = fork(index, ["start", "--logLevel=silent"]); bs.on("message", function (data) { options = data.options; done(); }); bs.send({send: "options"}); }); after(function (done) { bs.kill("SIGINT"); setTimeout(done, 200); // Allow server to close successfully }); it("can serve the client JS", function (done) { request(options.urls.local) .get(options.scriptPaths.versioned) .expect(200) .end(function (err, res) { assert.include(res.text, "Connected to BrowserSync"); done(); }); }); });
xuboso/browser-sync
test/specs/e2e/e2e.cli.snippet.js
JavaScript
gpl-3.0
1,077
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.16"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Arionide: ch.innovazion.arionide.lang.EvaluationException Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Arionide &#160;<span id="projectnumber">1.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.16 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacech.html">ch</a></li><li class="navelem"><a class="el" href="namespacech_1_1innovazion.html">innovazion</a></li><li class="navelem"><a class="el" href="namespacech_1_1innovazion_1_1arionide.html">arionide</a></li><li class="navelem"><a class="el" href="namespacech_1_1innovazion_1_1arionide_1_1lang.html">lang</a></li><li class="navelem"><a class="el" href="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception.html">EvaluationException</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pri-static-attribs">Static Private Attributes</a> &#124; <a href="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">ch.innovazion.arionide.lang.EvaluationException Class Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for ch.innovazion.arionide.lang.EvaluationException:</div> <div class="dyncontent"> <div class="center"><img src="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception__inherit__graph.png" border="0" usemap="#ch_8innovazion_8arionide_8lang_8_evaluation_exception_inherit__map" alt="Inheritance graph"/></div> <map name="ch_8innovazion_8arionide_8lang_8_evaluation_exception_inherit__map" id="ch_8innovazion_8arionide_8lang_8_evaluation_exception_inherit__map"> <area shape="rect" title=" " alt="" coords="5,79,192,117"/> <area shape="rect" title=" " alt="" coords="59,5,139,31"/> </map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for ch.innovazion.arionide.lang.EvaluationException:</div> <div class="dyncontent"> <div class="center"><img src="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception__coll__graph.png" border="0" usemap="#ch_8innovazion_8arionide_8lang_8_evaluation_exception_coll__map" alt="Collaboration graph"/></div> <map name="ch_8innovazion_8arionide_8lang_8_evaluation_exception_coll__map" id="ch_8innovazion_8arionide_8lang_8_evaluation_exception_coll__map"> <area shape="rect" title=" " alt="" coords="5,79,192,117"/> <area shape="rect" title=" " alt="" coords="59,5,139,31"/> </map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:afa9e488bafba827038b3495f9df98cdc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception.html#afa9e488bafba827038b3495f9df98cdc">EvaluationException</a> (String message)</td></tr> <tr class="separator:afa9e488bafba827038b3495f9df98cdc"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-attribs"></a> Static Private Attributes</h2></td></tr> <tr class="memitem:af3383db2308541a3e68ceb132883cffc"><td class="memItemLeft" align="right" valign="top">static final long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception.html#af3383db2308541a3e68ceb132883cffc">serialVersionUID</a> = 5410650315425267817L</td></tr> <tr class="separator:af3383db2308541a3e68ceb132883cffc"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a id="afa9e488bafba827038b3495f9df98cdc"></a> <h2 class="memtitle"><span class="permalink"><a href="#afa9e488bafba827038b3495f9df98cdc">&#9670;&nbsp;</a></span>EvaluationException()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">ch.innovazion.arionide.lang.EvaluationException.EvaluationException </td> <td>(</td> <td class="paramtype">String&#160;</td> <td class="paramname"><em>message</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a id="af3383db2308541a3e68ceb132883cffc"></a> <h2 class="memtitle"><span class="permalink"><a href="#af3383db2308541a3e68ceb132883cffc">&#9670;&nbsp;</a></span>serialVersionUID</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">final long ch.innovazion.arionide.lang.EvaluationException.serialVersionUID = 5410650315425267817L</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>src/ch/innovazion/arionide/lang/<a class="el" href="_evaluation_exception_8java.html">EvaluationException.java</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.16 </small></address> </body> </html>
thedreamer979/Arionide
doc/html/classch_1_1innovazion_1_1arionide_1_1lang_1_1_evaluation_exception.html
HTML
gpl-3.0
8,153
// Copyright 2015 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. #include "blimp/engine/feature/engine_render_widget_feature.h" #include "base/numerics/safe_conversions.h" #include "base/strings/utf_string_conversions.h" #include "blimp/common/create_blimp_message.h" #include "blimp/common/proto/blimp_message.pb.h" #include "blimp/common/proto/compositor.pb.h" #include "blimp/common/proto/input.pb.h" #include "blimp/common/proto/render_widget.pb.h" #include "blimp/net/input_message_converter.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" #include "net/base/net_errors.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "ui/events/event.h" #include "ui/events/keycodes/dom/dom_code.h" namespace blimp { namespace engine { EngineRenderWidgetFeature::EngineRenderWidgetFeature(SettingsManager* settings) : settings_manager_(settings), weak_factory_(this) { DCHECK(settings_manager_); settings_manager_->AddObserver(this); } EngineRenderWidgetFeature::~EngineRenderWidgetFeature() { DCHECK(settings_manager_); settings_manager_->RemoveObserver(this); } void EngineRenderWidgetFeature::set_render_widget_message_sender( std::unique_ptr<BlimpMessageProcessor> message_processor) { DCHECK(message_processor); render_widget_message_sender_ = std::move(message_processor); } void EngineRenderWidgetFeature::set_input_message_sender( std::unique_ptr<BlimpMessageProcessor> message_processor) { DCHECK(message_processor); input_message_sender_ = std::move(message_processor); } void EngineRenderWidgetFeature::set_ime_message_sender( std::unique_ptr<BlimpMessageProcessor> message_processor) { DCHECK(message_processor); ime_message_sender_ = std::move(message_processor); } void EngineRenderWidgetFeature::set_compositor_message_sender( std::unique_ptr<BlimpMessageProcessor> message_processor) { DCHECK(message_processor); compositor_message_sender_ = std::move(message_processor); } void EngineRenderWidgetFeature::OnRenderWidgetCreated( const int tab_id, content::RenderWidgetHost* render_widget_host) { DCHECK(render_widget_host); int render_widget_id = AddRenderWidget(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); RenderWidgetMessage* render_widget_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&render_widget_message, tab_id); render_widget_message->set_type(RenderWidgetMessage::CREATED); render_widget_message->set_render_widget_id(render_widget_id); render_widget_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::OnRenderWidgetInitialized( const int tab_id, content::RenderWidgetHost* render_widget_host) { DCHECK(render_widget_host); int render_widget_id = GetRenderWidgetId(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); RenderWidgetMessage* render_widget_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&render_widget_message, tab_id); render_widget_message->set_type(RenderWidgetMessage::INITIALIZE); render_widget_message->set_render_widget_id(render_widget_id); render_widget_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::OnRenderWidgetDeleted( const int tab_id, content::RenderWidgetHost* render_widget_host) { DCHECK(render_widget_host); int render_widget_id = DeleteRenderWidget(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); RenderWidgetMessage* render_widget_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&render_widget_message, tab_id); render_widget_message->set_type(RenderWidgetMessage::DELETED); render_widget_message->set_render_widget_id(render_widget_id); render_widget_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::SendCompositorMessage( const int tab_id, content::RenderWidgetHost* render_widget_host, const std::vector<uint8_t>& message) { CompositorMessage* compositor_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&compositor_message, tab_id); int render_widget_id = GetRenderWidgetId(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); compositor_message->set_render_widget_id(render_widget_id); // TODO(dtrainor): Move the transport medium to std::string* and use // set_allocated_payload. compositor_message->set_payload(message.data(), base::checked_cast<int>(message.size())); compositor_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::SendShowImeRequest( const int tab_id, content::RenderWidgetHost* render_widget_host, const ui::TextInputClient* client) { DCHECK(client); ImeMessage* ime_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&ime_message, tab_id); int render_widget_id = GetRenderWidgetId(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); ime_message->set_render_widget_id(render_widget_id); ime_message->set_type(ImeMessage::SHOW_IME); ime_message->set_text_input_type( InputMessageConverter::TextInputTypeToProto(client->GetTextInputType())); gfx::Range text_range; base::string16 existing_text; client->GetTextRange(&text_range); client->GetTextFromRange(text_range, &existing_text); ime_message->set_ime_text(base::UTF16ToUTF8(existing_text)); ime_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::SendHideImeRequest( const int tab_id, content::RenderWidgetHost* render_widget_host) { ImeMessage* ime_message; std::unique_ptr<BlimpMessage> blimp_message = CreateBlimpMessage(&ime_message, tab_id); int render_widget_id = GetRenderWidgetId(tab_id, render_widget_host); DCHECK_GT(render_widget_id, 0); ime_message->set_render_widget_id(render_widget_id); ime_message->set_type(ImeMessage::HIDE_IME); ime_message_sender_->ProcessMessage(std::move(blimp_message), net::CompletionCallback()); } void EngineRenderWidgetFeature::SetDelegate( const int tab_id, RenderWidgetMessageDelegate* delegate) { DCHECK(!FindDelegate(tab_id)); delegates_[tab_id] = delegate; } void EngineRenderWidgetFeature::RemoveDelegate(const int tab_id) { DelegateMap::iterator it = delegates_.find(tab_id); if (it != delegates_.end()) delegates_.erase(it); } void EngineRenderWidgetFeature::ProcessMessage( std::unique_ptr<BlimpMessage> message, const net::CompletionCallback& callback) { DCHECK(!callback.is_null()); DCHECK(message->feature_case() == BlimpMessage::kRenderWidget || message->feature_case() == BlimpMessage::kIme || message->feature_case() == BlimpMessage::kInput || message->feature_case() == BlimpMessage::kCompositor); int target_tab_id = message->target_tab_id(); RenderWidgetMessageDelegate* delegate = FindDelegate(target_tab_id); DCHECK(delegate); content::RenderWidgetHost* render_widget_host = nullptr; switch (message->feature_case()) { case BlimpMessage::kInput: render_widget_host = GetRenderWidgetHost(target_tab_id, message->input().render_widget_id()); if (render_widget_host) { std::unique_ptr<blink::WebGestureEvent> event = input_message_converter_.ProcessMessage(message->input()); if (event) delegate->OnWebGestureEvent(render_widget_host, std::move(event)); } break; case BlimpMessage::kCompositor: render_widget_host = GetRenderWidgetHost(target_tab_id, message->compositor().render_widget_id()); if (render_widget_host) { std::vector<uint8_t> payload(message->compositor().payload().size()); memcpy(payload.data(), message->compositor().payload().data(), payload.size()); delegate->OnCompositorMessageReceived(render_widget_host, payload); } break; case BlimpMessage::kIme: DCHECK(message->ime().type() == ImeMessage::SET_TEXT); render_widget_host = GetRenderWidgetHost(target_tab_id, message->ime().render_widget_id()); if (render_widget_host && render_widget_host->GetView()) { SetTextFromIME(render_widget_host, message->ime().ime_text(), message->ime().auto_submit()); // TODO(shaktisahu): Remove this fake HIDE_IME request once the blimp // IME design is completed (crbug/661328). base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::Bind(&EngineRenderWidgetFeature::SendHideImeRequest, weak_factory_.GetWeakPtr(), target_tab_id, render_widget_host), base::TimeDelta::FromMilliseconds(1500)); } break; default: NOTREACHED(); } callback.Run(net::OK); } void EngineRenderWidgetFeature::OnWebPreferencesChanged() { for (TabMap::iterator tab_it = tabs_.begin(); tab_it != tabs_.end(); tab_it++) { RenderWidgetMaps render_widget_maps = tab_it->second; RenderWidgetToIdMap render_widget_to_id = render_widget_maps.first; for (RenderWidgetToIdMap::iterator it = render_widget_to_id.begin(); it != render_widget_to_id.end(); it++) { content::RenderWidgetHost* render_widget_host = it->first; content::RenderViewHost* render_view_host = content::RenderViewHost::From(render_widget_host); if (render_view_host) render_view_host->OnWebkitPreferencesChanged(); } } } void EngineRenderWidgetFeature::SetTextFromIME( content::RenderWidgetHost* render_widget_host, std::string text, bool auto_submit) { ui::TextInputClient* client = render_widget_host->GetView()->GetTextInputClient(); DCHECK(client); if (!client || client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) return; // Clear out any existing text first and then insert new text entered // through IME. gfx::Range text_range; client->GetTextRange(&text_range); client->ExtendSelectionAndDelete(text_range.length(), text_range.length()); client->InsertText(base::UTF8ToUTF16(text)); if (auto_submit) { // Send a synthetic key event to the renderer notifying that user has hit // Return key. This should submit the current form. ui::KeyEvent press(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::DomCode::ENTER, 0); ui::KeyEvent char_event('\r', ui::VKEY_RETURN, 0); ui::KeyEvent release(ui::ET_KEY_RELEASED, ui::VKEY_RETURN, ui::DomCode::ENTER, 0); render_widget_host->ForwardKeyboardEvent( content::NativeWebKeyboardEvent(press)); render_widget_host->ForwardKeyboardEvent( content::NativeWebKeyboardEvent(char_event)); render_widget_host->ForwardKeyboardEvent( content::NativeWebKeyboardEvent(release)); } } EngineRenderWidgetFeature::RenderWidgetMessageDelegate* EngineRenderWidgetFeature::FindDelegate(const int tab_id) { DelegateMap::const_iterator it = delegates_.find(tab_id); if (it != delegates_.end()) return it->second; return nullptr; } int EngineRenderWidgetFeature::AddRenderWidget( const int tab_id, content::RenderWidgetHost* render_widget_host) { TabMap::iterator tab_it = tabs_.find(tab_id); if (tab_it == tabs_.end()) { tabs_[tab_id] = std::make_pair(RenderWidgetToIdMap(), IdToRenderWidgetMap()); tab_it = tabs_.find(tab_id); } int render_widget_id = next_widget_id_.GetNext() + 1; RenderWidgetMaps* render_widget_maps = &tab_it->second; RenderWidgetToIdMap* render_widget_to_id = &render_widget_maps->first; IdToRenderWidgetMap* id_to_render_widget = &render_widget_maps->second; DCHECK(render_widget_to_id->find(render_widget_host) == render_widget_to_id->end()); DCHECK(id_to_render_widget->find(render_widget_id) == id_to_render_widget->end()); (*render_widget_to_id)[render_widget_host] = render_widget_id; (*id_to_render_widget)[render_widget_id] = render_widget_host; return render_widget_id; } int EngineRenderWidgetFeature::DeleteRenderWidget( const int tab_id, content::RenderWidgetHost* render_widget_host) { TabMap::iterator tab_it = tabs_.find(tab_id); DCHECK(tab_it != tabs_.end()); RenderWidgetMaps* render_widget_maps = &tab_it->second; RenderWidgetToIdMap* render_widget_to_id = &render_widget_maps->first; RenderWidgetToIdMap::iterator widget_to_id_it = render_widget_to_id->find(render_widget_host); DCHECK(widget_to_id_it != render_widget_to_id->end()); int render_widget_id = widget_to_id_it->second; render_widget_to_id->erase(widget_to_id_it); IdToRenderWidgetMap* id_to_render_widget = &render_widget_maps->second; IdToRenderWidgetMap::iterator id_to_widget_it = id_to_render_widget->find(render_widget_id); DCHECK(id_to_widget_it->second == render_widget_host); id_to_render_widget->erase(id_to_widget_it); return render_widget_id; } int EngineRenderWidgetFeature::GetRenderWidgetId( const int tab_id, content::RenderWidgetHost* render_widget_host) { TabMap::const_iterator tab_it = tabs_.find(tab_id); if (tab_it == tabs_.end()) return 0; const RenderWidgetMaps* render_widget_maps = &tab_it->second; const RenderWidgetToIdMap* render_widget_to_id = &render_widget_maps->first; RenderWidgetToIdMap::const_iterator widget_it = render_widget_to_id->find(render_widget_host); if (widget_it == render_widget_to_id->end()) return 0; return widget_it->second; } content::RenderWidgetHost* EngineRenderWidgetFeature::GetRenderWidgetHost( const int tab_id, const int render_widget_id) { TabMap::const_iterator tab_it = tabs_.find(tab_id); if (tab_it == tabs_.end()) return nullptr; const RenderWidgetMaps* render_widget_maps = &tab_it->second; const IdToRenderWidgetMap* id_to_render_widget = &render_widget_maps->second; IdToRenderWidgetMap::const_iterator widget_id_it = id_to_render_widget->find(render_widget_id); if (widget_id_it == id_to_render_widget->end()) return nullptr; return widget_id_it->second; } } // namespace engine } // namespace blimp
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/blimp/engine/feature/engine_render_widget_feature.cc
C++
gpl-3.0
14,910
/* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library] This file is part of the Beyond Dying Skies. Beyond Dying Skies is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Beyond Dying Skies is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Beyond Dying Skies. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _BDS_UI_MENU_BDS_ #define _BDS_UI_MENU_BDS_ #include <array> #include <game/def.h> #include <game/id.h> #include <game/ui_bg_assets.h> #include <string> namespace game { class ui_menu { private: static constexpr size_t _size = ui_bg_assets::max_menu_ext_size(); const std::string _start; const std::string _load; const std::string _delete; const std::string _quit; const std::string _slot0; const std::string _slot1; const std::string _slot2; const std::string _slot3; const std::string _slot4; const std::string _empty_save; const std::string _normal; const std::string _hardcore; const std::string _creative; const std::string _back; const std::string _title; const std::string _save_quit; const std::string _controls; const std::string _menu_back; const std::string _empty; std::array<const std::string *, _size> _prefix; std::array<const std::string *, _size> _str; std::array<menu_call, _size> _callback; bool _extended; bool _dirty; public: ui_menu() : _start("New Game"), _load("Load Game"), _delete("Delete Game"), _quit("Exit Game"), _slot0("Slot 1"), _slot1("Slot 2"), _slot2("Slot 3"), _slot3("Slot 4"), _slot4("Slot 5"), _empty_save("Empty"), _normal("Normal"), _hardcore("Hardcore"), _creative("Creative"), _back("Back to Game"), _title("Return to Title"), _save_quit("Save and Exit Game"), _controls("Controls"), _menu_back("Back"), _empty(), _prefix{}, _str{}, _callback{}, _extended(false), _dirty(true) { // Set all menu string pointers to empty const size_t size = _size; for (size_t i = 0; i < size; i++) { _prefix[i] = &_empty; _str[i] = &_empty; } } inline void reset_menu() { // Reset all strings and callbacks const size_t size = _size; for (size_t i = 0; i < size; i++) { _prefix[i] = &_empty; _str[i] = &_empty; _callback[i] = nullptr; } } inline void reset_game_menu() { // Reset menu reset_menu(); // Set the game menu strings _str[0] = &_back; _str[1] = &_title; _str[2] = &_save_quit; _str[3] = &_controls; _str[4] = &_empty; // Set dirty flag _extended = false; _dirty = true; } inline void reset_game_mode_menu() { // Reset menu reset_menu(); // Set the game mode strings _str[id_value(game_type::NORMAL)] = &_normal; _str[id_value(game_type::HARDCORE)] = &_hardcore; _str[id_value(game_type::CREATIVE)] = &_creative; // Set dirty flag _extended = false; _dirty = true; } inline void reset_save_menu() { // Reset menu reset_menu(); // Set the save slot menu strings _str[0] = &_slot0; _str[1] = &_slot1; _str[2] = &_slot2; _str[3] = &_slot3; _str[4] = &_slot4; // Set dirty flag _extended = false; _dirty = true; } inline void reset_title_menu() { // Reset menu reset_menu(); // Set the title menu strings _str[0] = &_start; _str[1] = &_load; _str[2] = &_delete; _str[3] = &_quit; // Set dirty flag _extended = false; _dirty = true; } inline bool callback(const size_t index) { if (_callback[index]) { // Call the menu function _callback[index](); // A call happened return true; } // No call happened return false; } inline void clean() { _dirty = false; } inline const std::array<const std::string *, _size> &get_prefixs() const { return _prefix; } inline const std::array<const std::string *, _size> &get_strings() const { return _str; } inline bool is_dirty() const { return _dirty; } inline bool is_extended() const { return _extended; } inline void make_dirty() { _dirty = true; } inline min::vec2<float> position_text(const uint_fast16_t center_w, const size_t index) const { if (_extended) { // Get row and col const unsigned row = index & 7; const unsigned col = index / 8; return ui_bg_assets::menu_ext_text_position(center_w, row, col); } else { return ui_bg_assets::menu_base_text_position(center_w, index); } } inline void set_callback(const size_t index, const menu_call &f) { _callback[index] = f; } inline void set_extended(const bool flag) { _extended = flag; _dirty = true; } inline void set_prefix(const size_t index, const std::string *str) { _prefix[index] = str; } inline void set_prefix_empty(const size_t index) { _prefix[index] = &_empty; } inline void set_string(const size_t index, const std::string *str) { _str[index] = str; } inline void set_string_back(const size_t index) { _str[index] = &_menu_back; } inline void set_string_empty(const size_t index) { _str[index] = &_empty; } inline void set_string_empty_save(const size_t index) { _str[index] = &_empty_save; } inline static constexpr size_t max_size() { return _size; } }; } #endif
Aaron-SP/mglcraft
source/game/ui_menu.h
C
gpl-3.0
6,405
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Class Overtrue\Wechat\Http</title> <link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e"> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Namespaces</h3> <ul> <li class="active"> <a href="namespace-Overtrue.html"> Overtrue<span></span> </a> <ul> <li class="active"> <a href="namespace-Overtrue.Wechat.html"> Wechat<span></span> </a> <ul> <li> <a href="namespace-Overtrue.Wechat.Messages.html"> Messages </a> </li> <li> <a href="namespace-Overtrue.Wechat.Utils.html"> Utils </a> </li> </ul></li></ul></li> </ul> </div> <hr> <div id="elements"> <h3>Classes</h3> <ul> <li><a href="class-Overtrue.Wechat.AccessToken.html">AccessToken</a></li> <li><a href="class-Overtrue.Wechat.Alias.html">Alias</a></li> <li><a href="class-Overtrue.Wechat.Auth.html">Auth</a></li> <li><a href="class-Overtrue.Wechat.Cache.html">Cache</a></li> <li><a href="class-Overtrue.Wechat.Card.html">Card</a></li> <li><a href="class-Overtrue.Wechat.Color.html">Color</a></li> <li><a href="class-Overtrue.Wechat.Crypt.html">Crypt</a></li> <li><a href="class-Overtrue.Wechat.Group.html">Group</a></li> <li class="active"><a href="class-Overtrue.Wechat.Http.html">Http</a></li> <li><a href="class-Overtrue.Wechat.Image.html">Image</a></li> <li><a href="class-Overtrue.Wechat.Input.html">Input</a></li> <li><a href="class-Overtrue.Wechat.Js.html">Js</a></li> <li><a href="class-Overtrue.Wechat.Media.html">Media</a></li> <li><a href="class-Overtrue.Wechat.Menu.html">Menu</a></li> <li><a href="class-Overtrue.Wechat.MenuItem.html">MenuItem</a></li> <li><a href="class-Overtrue.Wechat.Message.html">Message</a></li> <li><a href="class-Overtrue.Wechat.Notice.html">Notice</a></li> <li><a href="class-Overtrue.Wechat.QRCode.html">QRCode</a></li> <li><a href="class-Overtrue.Wechat.Semantic.html">Semantic</a></li> <li><a href="class-Overtrue.Wechat.Server.html">Server</a></li> <li><a href="class-Overtrue.Wechat.Staff.html">Staff</a></li> <li><a href="class-Overtrue.Wechat.Stats.html">Stats</a></li> <li><a href="class-Overtrue.Wechat.Store.html">Store</a></li> <li><a href="class-Overtrue.Wechat.Url.html">Url</a></li> <li><a href="class-Overtrue.Wechat.User.html">User</a></li> </ul> <h3>Exceptions</h3> <ul> <li><a href="class-Overtrue.Wechat.Exception.html">Exception</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value=""> <input type="hidden" name="ie" value="UTF-8"> <input type="text" name="q" class="text" placeholder="Search"> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <a href="namespace-Overtrue.Wechat.html" title="Summary of Overtrue\Wechat"><span>Namespace</span></a> </li> <li class="active"> <span>Class</span> </li> </ul> <ul> </ul> <ul> </ul> </div> <div id="content" class="class"> <h1>Class Http</h1> <dl class="tree"> <dd style="padding-left:0px"> <a href="class-Overtrue.Wechat.Utils.Http.html"><span>Overtrue\Wechat\Utils\Http</span></a> </dd> <dd style="padding-left:30px"> <img src="resources/inherit.png" alt="Extended by"> <b><span>Overtrue\Wechat\Http</span></b> </dd> </dl> <div class="info"> <b>Namespace:</b> <a href="namespace-Overtrue.html">Overtrue</a>\<a href="namespace-Overtrue.Wechat.html">Wechat</a><br> <b>Located at</b> <a href="source-class-Overtrue.Wechat.Http.html#7-127" title="Go to source code">Wechat/Http.php</a> <br> </div> <table class="summary methods" id="methods"> <caption>Methods summary</caption> <tr data-order="__construct" id="___construct"> <td class="attributes"><code> public </code> </td> <td class="name"><div> <a class="anchor" href="#___construct">#</a> <code><a href="source-class-Overtrue.Wechat.Http.html#33-42" title="Go to source code">__construct</a>( <span>string <var>$token</var> = <span class="php-keyword1">null</span></span> )</code> <div class="description short"> <p>constructor</p> </div> <div class="description detailed hidden"> <p>constructor</p> <h4>Parameters</h4> <div class="list"><dl> <dt><var>$token</var></dt> <dd>AccessToken $token</dd> </dl></div> <h4>Overrides</h4> <div class="list"><code><a href="class-Overtrue.Wechat.Utils.Http.html#___construct">Overtrue\Wechat\Utils\Http::__construct()</a></code></div> </div> </div></td> </tr> <tr data-order="setToken" id="_setToken"> <td class="attributes"><code> public </code> </td> <td class="name"><div> <a class="anchor" href="#_setToken">#</a> <code><a href="source-class-Overtrue.Wechat.Http.html#44-52" title="Go to source code">setToken</a>( <span>string <var>$token</var></span> )</code> <div class="description short"> <p>设置请求access_token</p> </div> <div class="description detailed hidden"> <p>设置请求access_token</p> <h4>Parameters</h4> <div class="list"><dl> <dt><var>$token</var></dt> <dd></dd> </dl></div> </div> </div></td> </tr> <tr data-order="request" id="_request"> <td class="attributes"><code> public array </code> </td> <td class="name"><div> <a class="anchor" href="#_request">#</a> <code><a href="source-class-Overtrue.Wechat.Http.html#54-106" title="Go to source code">request</a>( <span>string <var>$url</var></span>, <span>string <var>$method</var> = <code><a href="class-Overtrue.Wechat.Utils.Http.html#GET">Overtrue\Wechat\Utils\Http::<b>GET</b></a></code></span>, <span>array <var>$params</var> = <span class="php-keyword1">array</span>()</span>, <span>array <var>$options</var> = <span class="php-keyword1">array</span>()</span> )</code> <div class="description short"> <p>发起一个HTTP/HTTPS的请求</p> </div> <div class="description detailed hidden"> <p>发起一个HTTP/HTTPS的请求</p> <h4>Parameters</h4> <div class="list"><dl> <dt><var>$url</var></dt> <dd>接口的URL</dd> <dt><var>$method</var></dt> <dd>请求类型 GET | POST</dd> <dt><var>$params</var></dt> <dd>接口参数</dd> <dt><var>$options</var></dt> <dd>其它选项</dd> </dl></div> <h4>Returns</h4> <div class="list"> array<br>| boolean </div> <h4>Overrides</h4> <div class="list"><code><a href="class-Overtrue.Wechat.Utils.Http.html#_request">Overtrue\Wechat\Utils\Http::request()</a></code></div> </div> </div></td> </tr> <tr data-order="__call" id="___call"> <td class="attributes"><code> public mixed </code> </td> <td class="name"><div> <a class="anchor" href="#___call">#</a> <code><a href="source-class-Overtrue.Wechat.Http.html#108-126" title="Go to source code">__call</a>( <span>string <var>$method</var></span>, <span>array <var>$args</var></span> )</code> <div class="description short"> <p>魔术调用</p> </div> <div class="description detailed hidden"> <p>魔术调用</p> <h4>Parameters</h4> <div class="list"><dl> <dt><var>$method</var></dt> <dd></dd> <dt><var>$args</var></dt> <dd></dd> </dl></div> <h4>Returns</h4> <div class="list"> mixed </div> </div> </div></td> </tr> </table> <table class="summary inherited"> <caption>Methods inherited from <a href="class-Overtrue.Wechat.Utils.Http.html#methods">Overtrue\Wechat\Utils\Http</a></caption> <tr> <td><code> <a href="class-Overtrue.Wechat.Utils.Http.html#___destruct">__destruct()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_createCurlFile">createCurlFile()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_delete">delete()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_doCurl">doCurl()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_encode">encode()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_get">get()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_getCurl">getCurl()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_patch">patch()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_post">post()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_put">put()</a>, <a href="class-Overtrue.Wechat.Utils.Http.html#_splitHeaders">splitHeaders()</a> </code></td> </tr> </table> <table class="summary methods" id="magicMethods"> <caption>Magic methods summary</caption> <tr data-order="jsonPost" id="m_jsonPost"> <td class="attributes"><code> public mixed </code> </td> <td class="name"><div> <a class="anchor" href="#m_jsonPost">#</a> <code><a href="source-class-Overtrue.Wechat.Http.html#8" title="Go to source code">jsonPost</a>( <span> <var>$url</var></span>, <span> <var>$params</var> = <span class="php-keyword1">array</span>()</span>, <span> <var>$options</var> = <span class="php-keyword1">array</span>()</span> )</code> <div class="description short"> </div> <div class="description detailed hidden"> <h4>Parameters</h4> <div class="list"><dl> <dt><var>$url</var></dt> <dd></dd> <dt><var>$params</var></dt> <dd></dd> <dt><var>$options</var></dt> <dd></dd> </dl></div> <h4>Returns</h4> <div class="list"> mixed </div> </div> </div></td> </tr> </table> <table class="summary inherited"> <caption>Constants inherited from <a href="class-Overtrue.Wechat.Utils.Http.html#constants">Overtrue\Wechat\Utils\Http</a></caption> <tr> <td><code> <a href="class-Overtrue.Wechat.Utils.Http.html#DELETE"><b>DELETE</b></a>, <a href="class-Overtrue.Wechat.Utils.Http.html#GET"><b>GET</b></a>, <a href="class-Overtrue.Wechat.Utils.Http.html#PATCH"><b>PATCH</b></a>, <a href="class-Overtrue.Wechat.Utils.Http.html#POST"><b>POST</b></a>, <a href="class-Overtrue.Wechat.Utils.Http.html#PUT"><b>PUT</b></a> </code></td> </tr> </table> <table class="summary properties" id="properties"> <caption>Properties summary</caption> <tr data-order="token" id="$token"> <td class="attributes"><code> protected string </code></td> <td class="name"> <a href="source-class-Overtrue.Wechat.Http.html#12-17" title="Go to source code"><var>$token</var></a> <div class="description short"> <p>token</p> </div> <div class="description detailed hidden"> <p>token</p> </div> </td> <td class="value"> <div> <a href="#$token" class="anchor">#</a> <code></code> </div> </td> </tr> <tr data-order="json" id="$json"> <td class="attributes"><code> protected boolean </code></td> <td class="name"> <a href="source-class-Overtrue.Wechat.Http.html#19-24" title="Go to source code"><var>$json</var></a> <div class="description short"> <p>json请求</p> </div> <div class="description detailed hidden"> <p>json请求</p> </div> </td> <td class="value"> <div> <a href="#$json" class="anchor">#</a> <code><span class="php-keyword1">false</span></code> </div> </td> </tr> <tr data-order="cache" id="$cache"> <td class="attributes"><code> protected <code><a href="class-Overtrue.Wechat.Cache.html">Overtrue\Wechat\Cache</a></code> </code></td> <td class="name"> <a href="source-class-Overtrue.Wechat.Http.html#26-31" title="Go to source code"><var>$cache</var></a> <div class="description short"> <p>缓存类</p> </div> <div class="description detailed hidden"> <p>缓存类</p> </div> </td> <td class="value"> <div> <a href="#$cache" class="anchor">#</a> <code></code> </div> </td> </tr> </table> </div> <div id="footer"> API documentation generated by <a href="http://apigen.org">ApiGen</a> </div> </div> </div> <script src="resources/combined.js"></script> <script src="elementlist.js"></script> </body> </html>
phoenixg/wechat-api
api-overtrue/apidoc/class-Overtrue.Wechat.Http.html
HTML
gpl-3.0
12,396
using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using NSubstitute; using NUnit.Framework; using Selkie.Common; using Selkie.Geometry.Shapes; using Selkie.WPF.Common.Interfaces; using Selkie.WPF.Converters.Interfaces; namespace Selkie.WPF.Converters.Tests.NUnit { //ncrunch: no coverage start [TestFixture] [ExcludeFromCodeCoverage] internal sealed class LineToLineNodeConverterToDisplayLineConverterTests { [SetUp] public void Setup() { m_NodeOne = CreateNode(); m_NodeTwo = CreateNode(); m_Disposer = Substitute.For <IDisposer>(); m_Factory = Substitute.For <IDisplayLineFactory>(); m_Converter = new LineToLineNodeConverterToDisplayLineConverter(m_Disposer, m_Factory); } private LineToLineNodeConverterToDisplayLineConverter m_Converter; private IDisplayLineFactory m_Factory; private ILineToLineNodeConverter m_NodeOne; private ILineToLineNodeConverter m_NodeTwo; private IDisposer m_Disposer; private ILineToLineNodeConverter CreateNode() { var fromConverter = Substitute.For <ILine>(); var toConverter = Substitute.For <ILine>(); var node = Substitute.For <ILineToLineNodeConverter>(); node.From.Returns(fromConverter); node.FromDirection.Returns(Constants.LineDirection.Forward); node.To.Returns(toConverter); node.ToDirection.Returns(Constants.LineDirection.Reverse); return node; } [Test] public void ConstructorAddsToDisposerTest() { m_Disposer.Received().AddResource(m_Converter.ReleaseDisplayLines); } [Test] public void ConvertersRoundtripTest() { var nodesOld = new[] { Substitute.For <ILineToLineNodeConverter>() }; var nodesNew = new[] { Substitute.For <ILineToLineNodeConverter>(), Substitute.For <ILineToLineNodeConverter>() }; m_Converter.Converters = nodesOld; Assert.AreEqual(nodesOld, m_Converter.Converters, "Old"); m_Converter.Converters = nodesNew; Assert.AreEqual(nodesNew, m_Converter.Converters, "New"); } [Test] public void ConvertersSetTest() { var nodesOld = new[] { Substitute.For <ILineToLineNodeConverter>() }; m_Converter.Converters = nodesOld; Assert.AreEqual(nodesOld, m_Converter.Converters); } [Test] public void CreateDisplayLinesForNodesCallsCreateCallsCreateForNodeTwoFromLineTest() { var nodes = new[] { m_NodeOne, m_NodeTwo }; m_Converter.CreateDisplayLinesForNodes(nodes); m_Factory.Received().Create(m_NodeTwo.From, m_NodeTwo.FromDirection); } [Test] public void CreateDisplayLinesForNodesCallsCreateCallsCreateForNodeTwoToLineTest() { var nodes = new[] { m_NodeOne, m_NodeTwo }; m_Converter.CreateDisplayLinesForNodes(nodes); m_Factory.Received().Create(m_NodeTwo.To, m_NodeTwo.ToDirection); } [Test] public void CreateDisplayLinesForNodesForTwoNodesCountTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>(), Substitute.For <ILineToLineNodeConverter>() }; List <IDisplayLine> actual = m_Converter.CreateDisplayLinesForNodes(nodes); Assert.AreEqual(3, actual.Count); } [Test] public void CreateDisplayLinesForOneNodeCountTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>() }; List <IDisplayLine> actual = m_Converter.CreateDisplayLines(nodes); Assert.AreEqual(2, actual.Count); } [Test] public void CreateDisplayLinesForTwoNodesCountTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>(), Substitute.For <ILineToLineNodeConverter>() }; List <IDisplayLine> actual = m_Converter.CreateDisplayLines(nodes); Assert.AreEqual(3, actual.Count); } [Test] public void CreateDisplayLinesSingleNodeCallsCreateForFromLineTest() { var nodes = new[] { m_NodeOne }; m_Converter.CreateDisplayLinesSingleNode(nodes); m_Factory.Received().Create(m_NodeOne.From, m_NodeOne.FromDirection); } [Test] public void CreateDisplayLinesSingleNodeCallsCreateForNodeOneFromLineOneTest() { var nodes = new[] { m_NodeOne, m_NodeTwo }; m_Converter.CreateDisplayLinesForNodes(nodes); m_Factory.Received().Create(m_NodeOne.From, m_NodeOne.FromDirection); } [Test] public void CreateDisplayLinesSingleNodeCallsCreateForToLineTest() { var nodes = new[] { m_NodeOne }; m_Converter.CreateDisplayLinesSingleNode(nodes); m_Factory.Received().Create(m_NodeOne.To, m_NodeOne.ToDirection); } [Test] public void CreateDisplayLinesSingleNodeCountTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>() }; List <IDisplayLine> actual = m_Converter.CreateDisplayLinesSingleNode(nodes); Assert.AreEqual(2, actual.Count); } [Test] public void DefaultConvertersTest() { Assert.NotNull(m_Converter.Converters); } [Test] public void DefaultDisplayLinesTest() { Assert.NotNull(m_Converter.DisplayLines); } [Test] public void DisposeTest() { var converter = new LineToLineNodeConverterToDisplayLineConverter(m_Disposer, m_Factory); converter.Dispose(); m_Disposer.Received().Dispose(); } [Test] public void ReleaseDisplayLinesCallsClearsListTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>() }; m_Converter.Converters = nodes; m_Converter.Convert(); m_Converter.ReleaseDisplayLines(); Assert.AreEqual(0, m_Converter.DisplayLines.Count()); } [Test] public void ReleaseDisplayLinesCallsReleaseForTwoNodesTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>(), Substitute.For <ILineToLineNodeConverter>() }; m_Converter.Converters = nodes; m_Converter.Convert(); m_Converter.ReleaseDisplayLines(); m_Factory.Received(3).Release(Arg.Any <IDisplayLine>()); } [Test] public void ReleaseDisplayLinesCallsReleaseTest() { var nodes = new[] { Substitute.For <ILineToLineNodeConverter>() }; m_Converter.Converters = nodes; m_Converter.Convert(); m_Converter.ReleaseDisplayLines(); m_Factory.Received(2).Release(Arg.Any <IDisplayLine>()); } } }
tschroedter/Selkie.WPF
Selkie.WPF.Converters.Tests/NUnit/LineToLineNodeConverterToDisplayLineConverter.cs
C#
gpl-3.0
9,184
// Decompiled with JetBrains decompiler // Type: System.Web.UI.HtmlControls.HtmlTable // Assembly: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a // MVID: 7E68A73E-4066-4F24-AB0A-F147209F50EC // Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Web.dll using System; using System.ComponentModel; using System.Globalization; using System.Runtime; using System.Web; using System.Web.UI; namespace System.Web.UI.HtmlControls { /// <summary> /// Allows programmatic access on the server to the HTML &lt;table&gt; element. /// </summary> [ParseChildren(true, "Rows")] public class HtmlTable : HtmlContainerControl { private HtmlTableRowCollection rows; /// <summary> /// Gets or sets the alignment of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control in relation to other elements on the Web page. /// </summary> /// /// <returns> /// The alignment of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control in relation to other elements on the Web page. The default value is <see cref="F:System.String.Empty"/>, which indicates that this property is not set. /// </returns> [WebCategory("Layout")] [DefaultValue("")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Align { get { return this.Attributes["align"] ?? string.Empty; } set { this.Attributes["align"] = HtmlControl.MapStringAttributeToString(value); } } /// <summary> /// Gets or sets the background color of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The background color of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. The default value is <see cref="F:System.String.Empty"/>, which indicates that this property is not set. /// </returns> [DefaultValue("")] [WebCategory("Appearance")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string BgColor { get { return this.Attributes["bgcolor"] ?? string.Empty; } set { this.Attributes["bgcolor"] = HtmlControl.MapStringAttributeToString(value); } } /// <summary> /// Gets or sets the width (in pixels) of the border of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The width (in pixels) of the border of an <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. The default is -1, which indicates that the border width is not set. /// </returns> [WebCategory("Appearance")] [DefaultValue(-1)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int Border { get { string s = this.Attributes["border"]; if (s == null) return -1; return int.Parse(s, (IFormatProvider) CultureInfo.InvariantCulture); } set { this.Attributes["border"] = HtmlControl.MapIntegerAttributeToString(value); } } /// <summary> /// Gets or sets the border color of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The border color of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. The default value is <see cref="F:System.String.Empty"/>, which indicates that this property is not set. /// </returns> [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DefaultValue("")] [WebCategory("Appearance")] public string BorderColor { get { return this.Attributes["bordercolor"] ?? string.Empty; } set { this.Attributes["bordercolor"] = HtmlControl.MapStringAttributeToString(value); } } /// <summary> /// Gets or sets the amount of space (in pixels) between the contents of a cell and the cell's border in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The amount of space (in pixels) between the contents of a cell and the cell's border in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. The default value is -1, which indicates that this property is not set. /// </returns> [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DefaultValue("")] [WebCategory("Appearance")] public int CellPadding { get { string s = this.Attributes["cellpadding"]; if (s == null) return -1; return int.Parse(s, (IFormatProvider) CultureInfo.InvariantCulture); } set { this.Attributes["cellpadding"] = HtmlControl.MapIntegerAttributeToString(value); } } /// <summary> /// Gets or sets the amount of space (in pixels) between adjacent cells in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The amount of space (in pixels) between adjacent cells in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. The default value is -1, which indicates that this property is not set. /// </returns> [WebCategory("Appearance")] [DefaultValue("")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int CellSpacing { get { string s = this.Attributes["cellspacing"]; if (s == null) return -1; return int.Parse(s, (IFormatProvider) CultureInfo.InvariantCulture); } set { this.Attributes["cellspacing"] = HtmlControl.MapIntegerAttributeToString(value); } } /// <summary> /// Gets or sets the content between the opening and closing tags of the control, without automatically converting special characters to their equivalent HTML entities. This property is not supported for this control. /// </summary> /// /// <returns> /// The content between the opening and closing tags of the control. /// </returns> /// <exception cref="T:System.NotSupportedException">An attempt was made to read from or assign a value to this property. </exception> public override string InnerHtml { get { throw new NotSupportedException(System.Web.SR.GetString("InnerHtml_not_supported", new object[1] { (object) this.GetType().Name })); } set { throw new NotSupportedException(System.Web.SR.GetString("InnerHtml_not_supported", new object[1] { (object) this.GetType().Name })); } } /// <summary> /// Gets or sets the content between the opening and closing tags of the control, with automatic conversion of special characters to their equivalent HTML entities. This property is not supported for this control. /// </summary> /// /// <returns> /// The content between the opening and closing tags of the control. /// </returns> /// <exception cref="T:System.NotSupportedException">An attempt was made to read from or assign a value to this property. </exception> public override string InnerText { get { throw new NotSupportedException(System.Web.SR.GetString("InnerText_not_supported", new object[1] { (object) this.GetType().Name })); } set { throw new NotSupportedException(System.Web.SR.GetString("InnerText_not_supported", new object[1] { (object) this.GetType().Name })); } } /// <summary> /// Gets or sets the height of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The height of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </returns> [DefaultValue("")] [WebCategory("Layout")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Height { get { return this.Attributes["height"] ?? string.Empty; } set { this.Attributes["height"] = HtmlControl.MapStringAttributeToString(value); } } /// <summary> /// Gets or sets the width of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// The width of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </returns> [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [WebCategory("Layout")] [DefaultValue("")] public string Width { get { return this.Attributes["width"] ?? string.Empty; } set { this.Attributes["width"] = HtmlControl.MapStringAttributeToString(value); } } /// <summary> /// Gets an <see cref="T:System.Web.UI.HtmlControls.HtmlTableRowCollection"/> collection that contains all the rows in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// An <see cref="T:System.Web.UI.HtmlControls.HtmlTableRowCollection"/> that contains all the rows in the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </returns> [Browsable(false)] [IgnoreUnknownContent] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual HtmlTableRowCollection Rows { get { if (this.rows == null) this.rows = new HtmlTableRowCollection(this); return this.rows; } } /// <summary> /// Initializes a new instance of the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> class. /// </summary> public HtmlTable() : base("table") { } /// <summary> /// Renders the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control's child controls to the specified <see cref="T:System.Web.UI.HtmlTextWriter"/> object. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> that receives the rendered content. </param> protected internal override void RenderChildren(HtmlTextWriter writer) { writer.WriteLine(); ++writer.Indent; base.RenderChildren(writer); --writer.Indent; } /// <summary> /// Renders the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control's end tag. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> that receives the rendered content. </param> protected override void RenderEndTag(HtmlTextWriter writer) { base.RenderEndTag(writer); writer.WriteLine(); } /// <summary> /// Creates a new <see cref="T:System.Web.UI.ControlCollection"/> object for the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> /// /// <returns> /// A <see cref="T:System.Web.UI.ControlCollection"/> that contains the <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control's child server controls. /// </returns> protected override ControlCollection CreateControlCollection() { return (ControlCollection) new HtmlTable.HtmlTableRowControlCollection((Control) this); } /// <summary> /// Represents a collection of <see cref="T:System.Web.UI.HtmlControls.HtmlTableRow"/> objects that are the rows of an <see cref="T:System.Web.UI.HtmlControls.HtmlTable"/> control. /// </summary> protected class HtmlTableRowControlCollection : ControlCollection { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] internal HtmlTableRowControlCollection(Control owner) : base(owner) { } /// <summary> /// Adds the specified <see cref="T:System.Web.UI.Control"/> object to the collection. /// </summary> /// <param name="child">The <see cref="T:System.Web.UI.Control"/> to add to the collection.</param><exception cref="T:System.ArgumentException">The added control must be of type <see cref="T:System.Web.UI.HtmlControls.HtmlTableRow"/>.</exception> public override void Add(Control child) { if (child is HtmlTableRow) base.Add(child); else throw new ArgumentException(System.Web.SR.GetString("Cannot_Have_Children_Of_Type", (object) "HtmlTable", (object) child.GetType().Name.ToString((IFormatProvider) CultureInfo.InvariantCulture))); } /// <summary> /// Adds the specified <see cref="T:System.Web.UI.Control"/> object to the collection. The new control is added to the array at the specified index location. /// </summary> /// <param name="index">The location in the array at which to add the child control. </param><param name="child">The <see cref="T:System.Web.UI.Control"/> to add to the collection. </param><exception cref="T:System.ArgumentException">The added control must be of type <see cref="T:System.Web.UI.HtmlControls.HtmlTableRow"/>. </exception> public override void AddAt(int index, Control child) { if (child is HtmlTableRow) base.AddAt(index, child); else throw new ArgumentException(System.Web.SR.GetString("Cannot_Have_Children_Of_Type", (object) "HtmlTable", (object) child.GetType().Name.ToString((IFormatProvider) CultureInfo.InvariantCulture))); } } } }
mater06/LEGOChimaOnlineReloaded
LoCO Client Files/Decompressed Client/Extracted DLL/System.Web/System/Web/UI/HtmlControls/HtmlTable.cs
C#
gpl-3.0
13,619
package pl.gratitude.it_ebooks.common.helpers; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import org.joda.time.DateTime; import java.lang.reflect.Type; /** * Created 09.11.2015. * * @author Sławomir */ public class DateTimeSerializer implements JsonSerializer<DateTime> { public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) { return new JsonPrimitive(src.toString()); } }
MrOnyszko/it-ebooks.info
app/src/main/java/pl/gratitude/it_ebooks/common/helpers/DateTimeSerializer.java
Java
gpl-3.0
557
package net.minecraft.src; import java.util.List; import java.util.Random; public class EntityMinecart extends Entity implements IInventory { private ItemStack cargoItems[]; private int fuel; private boolean field_856_i; /** The type of minecart, 2 for powered, 1 for storage. */ public int minecartType; public double pushX; public double pushZ; private static final int field_855_j[][][] = { { { 0, 0, -1 }, { 0, 0, 1 } }, { { -1, 0, 0 }, { 1, 0, 0 } }, { { -1, -1, 0 }, { 1, 0, 0 } }, { { -1, 0, 0 }, { 1, -1, 0 } }, { { 0, 0, -1 }, { 0, -1, 1 } }, { { 0, -1, -1 }, { 0, 0, 1 } }, { { 0, 0, 1 }, { 1, 0, 0 } }, { { 0, 0, 1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { 1, 0, 0 } } }; /** appears to be the progress of the turn */ private int turnProgress; private double minecartX; private double minecartY; private double minecartZ; private double minecartYaw; private double minecartPitch; private double velocityX; private double velocityY; private double velocityZ; public EntityMinecart(World par1World) { super(par1World); cargoItems = new ItemStack[36]; fuel = 0; field_856_i = false; preventEntitySpawning = true; setSize(0.98F, 0.7F); yOffset = height / 2.0F; } /** * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to * prevent them from trampling crops */ protected boolean canTriggerWalking() { return false; } protected void entityInit() { dataWatcher.addObject(16, new Byte((byte)0)); dataWatcher.addObject(17, new Integer(0)); dataWatcher.addObject(18, new Integer(1)); dataWatcher.addObject(19, new Integer(0)); } /** * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be * pushable on contact, like boats or minecarts. */ public AxisAlignedBB getCollisionBox(Entity par1Entity) { return par1Entity.boundingBox; } /** * returns the bounding box for this entity */ public AxisAlignedBB getBoundingBox() { return null; } /** * Returns true if this entity should push and be pushed by other entities when colliding. */ public boolean canBePushed() { return true; } public EntityMinecart(World par1World, double par2, double par4, double par6, int par8) { this(par1World); setPosition(par2, par4 + (double)yOffset, par6); motionX = 0.0D; motionY = 0.0D; motionZ = 0.0D; prevPosX = par2; prevPosY = par4; prevPosZ = par6; minecartType = par8; } /** * Returns the Y offset from the entity's position for any entity riding this one. */ public double getMountedYOffset() { return (double)height * 0.0D - 0.30000001192092896D; } /** * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { if (worldObj.isRemote || isDead) { return true; } func_41029_h(-func_41030_m()); func_41028_c(10); setBeenAttacked(); setDamage(getDamage() + par2 * 10); if (getDamage() > 40) { if (riddenByEntity != null) { riddenByEntity.mountEntity(this); } setDead(); dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F); if (minecartType == 1) { EntityMinecart entityminecart = this; label0: for (int i = 0; i < entityminecart.getSizeInventory(); i++) { ItemStack itemstack = entityminecart.getStackInSlot(i); if (itemstack == null) { continue; } float f = rand.nextFloat() * 0.8F + 0.1F; float f1 = rand.nextFloat() * 0.8F + 0.1F; float f2 = rand.nextFloat() * 0.8F + 0.1F; do { if (itemstack.stackSize <= 0) { continue label0; } int j = rand.nextInt(21) + 10; if (j > itemstack.stackSize) { j = itemstack.stackSize; } itemstack.stackSize -= j; EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, j, itemstack.getItemDamage())); float f3 = 0.05F; entityitem.motionX = (float)rand.nextGaussian() * f3; entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float)rand.nextGaussian() * f3; worldObj.spawnEntityInWorld(entityitem); } while (true); } dropItemWithOffset(Block.chest.blockID, 1, 0.0F); } else if (minecartType == 2) { dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F); } } return true; } /** * Setups the entity to do the hurt animation. Only used by packets in multiplayer. */ public void performHurtAnimation() { func_41029_h(-func_41030_m()); func_41028_c(10); setDamage(getDamage() + getDamage() * 10); } /** * Returns true if other Entities should be prevented from moving through this Entity. */ public boolean canBeCollidedWith() { return !isDead; } /** * Will get destroyed next tick. */ public void setDead() { label0: for (int i = 0; i < getSizeInventory(); i++) { ItemStack itemstack = getStackInSlot(i); if (itemstack == null) { continue; } float f = rand.nextFloat() * 0.8F + 0.1F; float f1 = rand.nextFloat() * 0.8F + 0.1F; float f2 = rand.nextFloat() * 0.8F + 0.1F; do { if (itemstack.stackSize <= 0) { continue label0; } int j = rand.nextInt(21) + 10; if (j > itemstack.stackSize) { j = itemstack.stackSize; } itemstack.stackSize -= j; EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, j, itemstack.getItemDamage())); if (itemstack.hasTagCompound()) { entityitem.item.setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); } float f3 = 0.05F; entityitem.motionX = (float)rand.nextGaussian() * f3; entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float)rand.nextGaussian() * f3; worldObj.spawnEntityInWorld(entityitem); } while (true); } super.setDead(); } /** * Called to update the entity's position/logic. */ public void onUpdate() { if (func_41023_l() > 0) { func_41028_c(func_41023_l() - 1); } if (getDamage() > 0) { setDamage(getDamage() - 1); } if (posY < -64D) { kill(); } if (isMinecartPowered() && rand.nextInt(4) == 0) { worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D); } if (worldObj.isRemote) { if (turnProgress > 0) { double d = posX + (minecartX - posX) / (double)turnProgress; double d1 = posY + (minecartY - posY) / (double)turnProgress; double d3 = posZ + (minecartZ - posZ) / (double)turnProgress; double d5; for (d5 = minecartYaw - (double)rotationYaw; d5 < -180D; d5 += 360D) { } for (; d5 >= 180D; d5 -= 360D) { } rotationYaw += d5 / (double)turnProgress; rotationPitch += (minecartPitch - (double)rotationPitch) / (double)turnProgress; turnProgress--; setPosition(d, d1, d3); setRotation(rotationYaw, rotationPitch); } else { setPosition(posX, posY, posZ); setRotation(rotationYaw, rotationPitch); } return; } prevPosX = posX; prevPosY = posY; prevPosZ = posZ; motionY -= 0.039999999105930328D; int i = MathHelper.floor_double(posX); int j = MathHelper.floor_double(posY); int k = MathHelper.floor_double(posZ); if (BlockRail.isRailBlockAt(worldObj, i, j - 1, k)) { j--; } double d2 = 0.40000000000000002D; double d4 = 0.0078125D; int l = worldObj.getBlockId(i, j, k); if (BlockRail.isRailBlock(l)) { Vec3D vec3d = func_514_g(posX, posY, posZ); int i1 = worldObj.getBlockMetadata(i, j, k); posY = j; boolean flag = false; boolean flag1 = false; if (l == Block.railPowered.blockID) { flag = (i1 & 8) != 0; flag1 = !flag; } if (((BlockRail)Block.blocksList[l]).isPowered()) { i1 &= 7; } if (i1 >= 2 && i1 <= 5) { posY = j + 1; } if (i1 == 2) { motionX -= d4; } if (i1 == 3) { motionX += d4; } if (i1 == 4) { motionZ += d4; } if (i1 == 5) { motionZ -= d4; } int ai[][] = field_855_j[i1]; double d9 = ai[1][0] - ai[0][0]; double d10 = ai[1][2] - ai[0][2]; double d11 = Math.sqrt(d9 * d9 + d10 * d10); double d12 = motionX * d9 + motionZ * d10; if (d12 < 0.0D) { d9 = -d9; d10 = -d10; } double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ); motionX = (d13 * d9) / d11; motionZ = (d13 * d10) / d11; if (flag1) { double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ); if (d16 < 0.029999999999999999D) { motionX *= 0.0D; motionY *= 0.0D; motionZ *= 0.0D; } else { motionX *= 0.5D; motionY *= 0.0D; motionZ *= 0.5D; } } double d17 = 0.0D; double d18 = (double)i + 0.5D + (double)ai[0][0] * 0.5D; double d19 = (double)k + 0.5D + (double)ai[0][2] * 0.5D; double d20 = (double)i + 0.5D + (double)ai[1][0] * 0.5D; double d21 = (double)k + 0.5D + (double)ai[1][2] * 0.5D; d9 = d20 - d18; d10 = d21 - d19; if (d9 == 0.0D) { posX = (double)i + 0.5D; d17 = posZ - (double)k; } else if (d10 == 0.0D) { posZ = (double)k + 0.5D; d17 = posX - (double)i; } else { double d22 = posX - d18; double d24 = posZ - d19; double d26 = (d22 * d9 + d24 * d10) * 2D; d17 = d26; } posX = d18 + d9 * d17; posZ = d19 + d10 * d17; setPosition(posX, posY + (double)yOffset, posZ); double d23 = motionX; double d25 = motionZ; if (riddenByEntity != null) { d23 *= 0.75D; d25 *= 0.75D; } if (d23 < -d2) { d23 = -d2; } if (d23 > d2) { d23 = d2; } if (d25 < -d2) { d25 = -d2; } if (d25 > d2) { d25 = d2; } moveEntity(d23, 0.0D, d25); if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2]) { setPosition(posX, posY + (double)ai[0][1], posZ); } else if (ai[1][1] != 0 && MathHelper.floor_double(posX) - i == ai[1][0] && MathHelper.floor_double(posZ) - k == ai[1][2]) { setPosition(posX, posY + (double)ai[1][1], posZ); } if (riddenByEntity != null) { motionX *= 0.99699997901916504D; motionY *= 0.0D; motionZ *= 0.99699997901916504D; } else { if (minecartType == 2) { double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); if (d27 > 0.01D) { pushX /= d27; pushZ /= d27; double d29 = 0.040000000000000001D; motionX *= 0.80000001192092896D; motionY *= 0.0D; motionZ *= 0.80000001192092896D; motionX += pushX * d29; motionZ += pushZ * d29; } else { motionX *= 0.89999997615814209D; motionY *= 0.0D; motionZ *= 0.89999997615814209D; } } motionX *= 0.95999997854232788D; motionY *= 0.0D; motionZ *= 0.95999997854232788D; } Vec3D vec3d1 = func_514_g(posX, posY, posZ); if (vec3d1 != null && vec3d != null) { double d28 = (vec3d.yCoord - vec3d1.yCoord) * 0.050000000000000003D; double d14 = Math.sqrt(motionX * motionX + motionZ * motionZ); if (d14 > 0.0D) { motionX = (motionX / d14) * (d14 + d28); motionZ = (motionZ / d14) * (d14 + d28); } setPosition(posX, vec3d1.yCoord, posZ); } int k1 = MathHelper.floor_double(posX); int l1 = MathHelper.floor_double(posZ); if (k1 != i || l1 != k) { double d15 = Math.sqrt(motionX * motionX + motionZ * motionZ); motionX = d15 * (double)(k1 - i); motionZ = d15 * (double)(l1 - k); } if (minecartType == 2) { double d30 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); if (d30 > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) { pushX /= d30; pushZ /= d30; if (pushX * motionX + pushZ * motionZ < 0.0D) { pushX = 0.0D; pushZ = 0.0D; } else { pushX = motionX; pushZ = motionZ; } } } if (flag) { double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ); if (d31 > 0.01D) { double d32 = 0.059999999999999998D; motionX += (motionX / d31) * d32; motionZ += (motionZ / d31) * d32; } else if (i1 == 1) { if (worldObj.isBlockNormalCube(i - 1, j, k)) { motionX = 0.02D; } else if (worldObj.isBlockNormalCube(i + 1, j, k)) { motionX = -0.02D; } } else if (i1 == 0) { if (worldObj.isBlockNormalCube(i, j, k - 1)) { motionZ = 0.02D; } else if (worldObj.isBlockNormalCube(i, j, k + 1)) { motionZ = -0.02D; } } } } else { if (motionX < -d2) { motionX = -d2; } if (motionX > d2) { motionX = d2; } if (motionZ < -d2) { motionZ = -d2; } if (motionZ > d2) { motionZ = d2; } if (onGround) { motionX *= 0.5D; motionY *= 0.5D; motionZ *= 0.5D; } moveEntity(motionX, motionY, motionZ); if (!onGround) { motionX *= 0.94999998807907104D; motionY *= 0.94999998807907104D; motionZ *= 0.94999998807907104D; } } rotationPitch = 0.0F; double d6 = prevPosX - posX; double d7 = prevPosZ - posZ; if (d6 * d6 + d7 * d7 > 0.001D) { rotationYaw = (float)((Math.atan2(d7, d6) * 180D) / Math.PI); if (field_856_i) { rotationYaw += 180F; } } double d8; for (d8 = rotationYaw - prevRotationYaw; d8 >= 180D; d8 -= 360D) { } for (; d8 < -180D; d8 += 360D) { } if (d8 < -170D || d8 >= 170D) { rotationYaw += 180F; field_856_i = !field_856_i; } setRotation(rotationYaw, rotationPitch); List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); if (list != null && list.size() > 0) { for (int j1 = 0; j1 < list.size(); j1++) { Entity entity = (Entity)list.get(j1); if (entity != riddenByEntity && entity.canBePushed() && (entity instanceof EntityMinecart)) { entity.applyEntityCollision(this); } } } if (riddenByEntity != null && riddenByEntity.isDead) { if (riddenByEntity.ridingEntity == this) { riddenByEntity.ridingEntity = null; } riddenByEntity = null; } if (fuel > 0) { fuel--; } if (fuel <= 0) { pushX = pushZ = 0.0D; } setMinecartPowered(fuel > 0); } public Vec3D func_515_a(double par1, double par3, double par5, double par7) { int i = MathHelper.floor_double(par1); int j = MathHelper.floor_double(par3); int k = MathHelper.floor_double(par5); if (BlockRail.isRailBlockAt(worldObj, i, j - 1, k)) { j--; } int l = worldObj.getBlockId(i, j, k); if (BlockRail.isRailBlock(l)) { int i1 = worldObj.getBlockMetadata(i, j, k); if (((BlockRail)Block.blocksList[l]).isPowered()) { i1 &= 7; } par3 = j; if (i1 >= 2 && i1 <= 5) { par3 = j + 1; } int ai[][] = field_855_j[i1]; double d = ai[1][0] - ai[0][0]; double d1 = ai[1][2] - ai[0][2]; double d2 = Math.sqrt(d * d + d1 * d1); d /= d2; d1 /= d2; par1 += d * par7; par5 += d1 * par7; if (ai[0][1] != 0 && MathHelper.floor_double(par1) - i == ai[0][0] && MathHelper.floor_double(par5) - k == ai[0][2]) { par3 += ai[0][1]; } else if (ai[1][1] != 0 && MathHelper.floor_double(par1) - i == ai[1][0] && MathHelper.floor_double(par5) - k == ai[1][2]) { par3 += ai[1][1]; } return func_514_g(par1, par3, par5); } else { return null; } } public Vec3D func_514_g(double par1, double par3, double par5) { int i = MathHelper.floor_double(par1); int j = MathHelper.floor_double(par3); int k = MathHelper.floor_double(par5); if (BlockRail.isRailBlockAt(worldObj, i, j - 1, k)) { j--; } int l = worldObj.getBlockId(i, j, k); if (BlockRail.isRailBlock(l)) { int i1 = worldObj.getBlockMetadata(i, j, k); par3 = j; if (((BlockRail)Block.blocksList[l]).isPowered()) { i1 &= 7; } if (i1 >= 2 && i1 <= 5) { par3 = j + 1; } int ai[][] = field_855_j[i1]; double d = 0.0D; double d1 = (double)i + 0.5D + (double)ai[0][0] * 0.5D; double d2 = (double)j + 0.5D + (double)ai[0][1] * 0.5D; double d3 = (double)k + 0.5D + (double)ai[0][2] * 0.5D; double d4 = (double)i + 0.5D + (double)ai[1][0] * 0.5D; double d5 = (double)j + 0.5D + (double)ai[1][1] * 0.5D; double d6 = (double)k + 0.5D + (double)ai[1][2] * 0.5D; double d7 = d4 - d1; double d8 = (d5 - d2) * 2D; double d9 = d6 - d3; if (d7 == 0.0D) { par1 = (double)i + 0.5D; d = par5 - (double)k; } else if (d9 == 0.0D) { par5 = (double)k + 0.5D; d = par1 - (double)i; } else { double d10 = par1 - d1; double d11 = par5 - d3; double d12 = (d10 * d7 + d11 * d9) * 2D; d = d12; } par1 = d1 + d7 * d; par3 = d2 + d8 * d; par5 = d3 + d9 * d; if (d8 < 0.0D) { par3++; } if (d8 > 0.0D) { par3 += 0.5D; } return Vec3D.createVector(par1, par3, par5); } else { return null; } } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setInteger("Type", minecartType); if (minecartType == 2) { par1NBTTagCompound.setDouble("PushX", pushX); par1NBTTagCompound.setDouble("PushZ", pushZ); par1NBTTagCompound.setShort("Fuel", (short)fuel); } else if (minecartType == 1) { NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < cargoItems.length; i++) { if (cargoItems[i] != null) { NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.setByte("Slot", (byte)i); cargoItems[i].writeToNBT(nbttagcompound); nbttaglist.appendTag(nbttagcompound); } } par1NBTTagCompound.setTag("Items", nbttaglist); } } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { minecartType = par1NBTTagCompound.getInteger("Type"); if (minecartType == 2) { pushX = par1NBTTagCompound.getDouble("PushX"); pushZ = par1NBTTagCompound.getDouble("PushZ"); fuel = par1NBTTagCompound.getShort("Fuel"); } else if (minecartType == 1) { NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items"); cargoItems = new ItemStack[getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); i++) { NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.tagAt(i); int j = nbttagcompound.getByte("Slot") & 0xff; if (j >= 0 && j < cargoItems.length) { cargoItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); } } } } public float getShadowSize() { return 0.0F; } /** * Applies a velocity to each of the entities pushing them away from each other. Args: entity */ public void applyEntityCollision(Entity par1Entity) { if (worldObj.isRemote) { return; } if (par1Entity == riddenByEntity) { return; } if ((par1Entity instanceof EntityLiving) && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && minecartType == 0 && motionX * motionX + motionZ * motionZ > 0.01D && riddenByEntity == null && par1Entity.ridingEntity == null) { par1Entity.mountEntity(this); } double d = par1Entity.posX - posX; double d1 = par1Entity.posZ - posZ; double d2 = d * d + d1 * d1; if (d2 >= 9.9999997473787516E-005D) { d2 = MathHelper.sqrt_double(d2); d /= d2; d1 /= d2; double d3 = 1.0D / d2; if (d3 > 1.0D) { d3 = 1.0D; } d *= d3; d1 *= d3; d *= 0.10000000149011612D; d1 *= 0.10000000149011612D; d *= 1.0F - entityCollisionReduction; d1 *= 1.0F - entityCollisionReduction; d *= 0.5D; d1 *= 0.5D; if (par1Entity instanceof EntityMinecart) { double d4 = par1Entity.posX - posX; double d5 = par1Entity.posZ - posZ; Vec3D vec3d = Vec3D.createVector(d4, 0.0D, d5).normalize(); Vec3D vec3d1 = Vec3D.createVector(MathHelper.cos((rotationYaw * (float)Math.PI) / 180F), 0.0D, MathHelper.sin((rotationYaw * (float)Math.PI) / 180F)).normalize(); double d6 = Math.abs(vec3d.dotProduct(vec3d1)); if (d6 < 0.80000001192092896D) { return; } double d7 = par1Entity.motionX + motionX; double d8 = par1Entity.motionZ + motionZ; if (((EntityMinecart)par1Entity).minecartType == 2 && minecartType != 2) { motionX *= 0.20000000298023224D; motionZ *= 0.20000000298023224D; addVelocity(par1Entity.motionX - d, 0.0D, par1Entity.motionZ - d1); par1Entity.motionX *= 0.94999998807907104D; par1Entity.motionZ *= 0.94999998807907104D; } else if (((EntityMinecart)par1Entity).minecartType != 2 && minecartType == 2) { par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D; par1Entity.addVelocity(motionX + d, 0.0D, motionZ + d1); motionX *= 0.94999998807907104D; motionZ *= 0.94999998807907104D; } else { d7 /= 2D; d8 /= 2D; motionX *= 0.20000000298023224D; motionZ *= 0.20000000298023224D; addVelocity(d7 - d, 0.0D, d8 - d1); par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D; par1Entity.addVelocity(d7 + d, 0.0D, d8 + d1); } } else { addVelocity(-d, 0.0D, -d1); par1Entity.addVelocity(d / 4D, 0.0D, d1 / 4D); } } } /** * Returns the number of slots in the inventory. */ public int getSizeInventory() { return 27; } /** * Returns the stack in slot i */ public ItemStack getStackInSlot(int par1) { return cargoItems[par1]; } /** * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a * new stack. */ public ItemStack decrStackSize(int par1, int par2) { if (cargoItems[par1] != null) { if (cargoItems[par1].stackSize <= par2) { ItemStack itemstack = cargoItems[par1]; cargoItems[par1] = null; return itemstack; } ItemStack itemstack1 = cargoItems[par1].splitStack(par2); if (cargoItems[par1].stackSize == 0) { cargoItems[par1] = null; } return itemstack1; } else { return null; } } /** * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - * like when you close a workbench GUI. */ public ItemStack getStackInSlotOnClosing(int par1) { if (cargoItems[par1] != null) { ItemStack itemstack = cargoItems[par1]; cargoItems[par1] = null; return itemstack; } else { return null; } } /** * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). */ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { cargoItems[par1] = par2ItemStack; if (par2ItemStack != null && par2ItemStack.stackSize > getInventoryStackLimit()) { par2ItemStack.stackSize = getInventoryStackLimit(); } } /** * Returns the name of the inventory. */ public String getInvName() { return "container.minecart"; } /** * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't * this more of a set than a get?* */ public int getInventoryStackLimit() { return 64; } /** * Called when an the contents of an Inventory change, usually */ public void onInventoryChanged() { } /** * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. */ public boolean interact(EntityPlayer par1EntityPlayer) { if (minecartType == 0) { if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != par1EntityPlayer) { return true; } if (!worldObj.isRemote) { par1EntityPlayer.mountEntity(this); } } else if (minecartType == 1) { if (!worldObj.isRemote) { par1EntityPlayer.displayGUIChest(this); } } else if (minecartType == 2) { ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex) { if (--itemstack.stackSize == 0) { par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); } fuel += 3600; } pushX = posX - par1EntityPlayer.posX; pushZ = posZ - par1EntityPlayer.posZ; } return true; } /** * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, * posY, posZ, yaw, pitch */ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { minecartX = par1; minecartY = par3; minecartZ = par5; minecartYaw = par7; minecartPitch = par8; turnProgress = par9 + 2; motionX = velocityX; motionY = velocityY; motionZ = velocityZ; } /** * Sets the velocity to the args. Args: x, y, z */ public void setVelocity(double par1, double par3, double par5) { velocityX = motionX = par1; velocityY = motionY = par3; velocityZ = motionZ = par5; } /** * Do not make give this method the name canInteractWith because it clashes with Container */ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { if (isDead) { return false; } return par1EntityPlayer.getDistanceSqToEntity(this) <= 64D; } /** * Is this minecart powered (Fuel > 0) */ protected boolean isMinecartPowered() { return (dataWatcher.getWatchableObjectByte(16) & 1) != 0; } /** * Set if this minecart is powered (Fuel > 0) */ protected void setMinecartPowered(boolean par1) { if (par1) { dataWatcher.updateObject(16, Byte.valueOf((byte)(dataWatcher.getWatchableObjectByte(16) | 1))); } else { dataWatcher.updateObject(16, Byte.valueOf((byte)(dataWatcher.getWatchableObjectByte(16) & -2))); } } public void openChest() { } public void closeChest() { } /** * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over * 40. */ public void setDamage(int par1) { dataWatcher.updateObject(19, Integer.valueOf(par1)); } /** * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over * 40. */ public int getDamage() { return dataWatcher.getWatchableObjectInt(19); } public void func_41028_c(int par1) { dataWatcher.updateObject(17, Integer.valueOf(par1)); } public int func_41023_l() { return dataWatcher.getWatchableObjectInt(17); } public void func_41029_h(int par1) { dataWatcher.updateObject(18, Integer.valueOf(par1)); } public int func_41030_m() { return dataWatcher.getWatchableObjectInt(18); } }
sethten/MoDesserts
mcp50/src/minecraft/net/minecraft/src/EntityMinecart.java
Java
gpl-3.0
36,770
# flighttracker.js Small express js page loading the json content of a Flightradar24 feeder/decoder with a openlayer map. Before running, change the url to the feeder status page in the routes/index.js
ntim/flighttracker.js
README.md
Markdown
gpl-3.0
203
package R; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import RowAnalyses.JobLineWriter; import RowAnalyses.RowAboveCutoffCounter; import RowAnalyses.RowAverageCalculator; import RowAnalyses.RowBelowCutoffCounter; import RowAnalyses.RowColumnGetter; import RowAnalyses.RowJob; import RowAnalyses.RowJobExecutor; import RowAnalyses.RowJobExecutorThread; import RowAnalyses.RowMaxGetter; import RowAnalyses.RowMedianGetter; import RowAnalyses.RowStdevCalculator; import RowAnalyses.RowZscoreCalculator; import RowAnalyses.RowCenterer; import STAR.OutlierSpliceSiteRetriever; import Tools.FileUtils; import Tools.Script; import Tools.StringFilter; import Tools.StringFilters; import Tools.StringFilters.ForbiddenStringChecker; import Tools.StringFilters.RequiredStringChecker; public class SplicingAnalysisPipeline2 extends Script<SplicingAnalysisPipeline> { //creates files per patient with z-scores based on BIOS averages and stdevs and z-scores based on non-family members of the same study averages and stdevs. //Also adds gene network scores and mutations String correctedMatrixFn = null; String uncorrectedMatrixFn = null; String rawMatrixFn = null; String[] ourStudyStrings = new String[] { "SN163", "NB501043_0096" }; String gnFolder = null; String patientSampleToFamilyIdFn = null; String parentSampleToFamilyIdFn = null; String ensgNameToGeneSymbolFn = null; String enstToEnsgFn = null; String vcfFolder = null; String sampleNameToFamilySampleNamesFn = null;//has patient sampleId in first column and sampleId (including patient) of all family members in second column (so 3 lines per patient) int summaryCutoff = 2; //any genes with a z-scores larger then this value will be in the summary file String writeFolder = null; double maxOutlierCount = 4; //maximum number of times a gene is allowed to be an outleir in the other parents. Also maximum number of times a gene is allowed to be an outleir in the other cases double medianCutoff = 8; int nThreads = 6;//Do not run this multithreaded. I got halfway implementing it, but did not finish. Some writeVariables are used by multiple threads simultaneously which is dangerous. private transient int zScoreCutoff = 3;//cutoff die Patrick gebruikt voor het excluderen van outliers die vaker voorkomen. @Override public void run() { try { HashMap<String, String> patientSampleNameToFamilyId = FileUtils.readStringStringHash( patientSampleToFamilyIdFn, 1); HashMap<String, String> parentSampleNameToFamilyId = FileUtils.readStringStringHash(parentSampleToFamilyIdFn, 1); HashMap<String, HashMap<String, Integer>> caseSampleNameToFamilySampleNames = FileUtils.readStringMultiStringHash( sampleNameToFamilySampleNamesFn, 0, 1, false, true); HashMap<String, String> ensgNameToGeneSymbol = FileUtils.readStringStringHash( ensgNameToGeneSymbolFn, false, 1, 1, 0,null); //get all the different index lists over which the statistics should be calculated StringFilters stringFiltersBios = new StringFilters(); stringFiltersBios.addFilter(stringFiltersBios.new ForbiddenStringChecker(ourStudyStrings)); int[] biosIndexes = getIndexes( this.rawMatrixFn, stringFiltersBios); StringFilters stringFiltersStudy = new StringFilters(); stringFiltersStudy.addFilter(stringFiltersStudy.new RequiredStringChecker(ourStudyStrings)); int[] studyIndexes = getIndexes(this.rawMatrixFn, stringFiltersStudy); HashMap<String, int[]> sampleToOtherIndexesStudy = getStudyIndexesPerSample(this.rawMatrixFn, stringFiltersStudy, caseSampleNameToFamilySampleNames); createWriteFolder(); String biosBasedResultsFolder = this.writeFolder + "bios/"; //jobs to be executed on each row String averagesFn = "averages.txt"; RowAverageCalculator rowAverageCalculator = new RowAverageCalculator(); rowAverageCalculator.setWriteFn(averagesFn); String stDevFn = "standardDeviations.txt"; RowStdevCalculator rowStdevCalculator = new RowStdevCalculator(); rowStdevCalculator.setWriteFn(stDevFn); RowCenterer rowBiosBasedZscoreCalculator = new RowCenterer(); String biosBasedZscoreFn = "biosBasedZscores.txt"; rowBiosBasedZscoreCalculator.setWriteFn(biosBasedZscoreFn); ArrayList<RowJobExecutor> rowJobExecutors = new ArrayList<RowJobExecutor>(); //bios indexes FileUtils.makeDir(biosBasedResultsFolder); RowJobExecutor rowJobExecutorBiosIndexes = new RowJobExecutor(nThreads); rowJobExecutorBiosIndexes.addJob(rowAverageCalculator); rowJobExecutorBiosIndexes.addJob(rowStdevCalculator); rowJobExecutorBiosIndexes.addJob(rowBiosBasedZscoreCalculator); rowJobExecutorBiosIndexes.setIncludeIndexes(biosIndexes); rowJobExecutorBiosIndexes.setWriteFolder(biosBasedResultsFolder); /////////////////////////////////////////////////////////////////////////////////////////////////////////// //Study indexes //jobs to be executed on each row RowAverageCalculator rowAverageCalculatorStudy = new RowAverageCalculator(); rowAverageCalculatorStudy.setWriteFn(averagesFn); RowStdevCalculator rowStdevCalculatorStudy = new RowStdevCalculator(); rowStdevCalculatorStudy.setWriteFn(stDevFn); RowZscoreCalculator rowBiosBasedZscoreCalculatorStudy = new RowZscoreCalculator(); String biosBasedZscoreFnStudy = "biosBasedZscores.txt"; rowBiosBasedZscoreCalculatorStudy.setWriteFn(biosBasedZscoreFnStudy); rowBiosBasedZscoreCalculatorStudy.setExecutorWithAvgStdevsToUse(rowJobExecutorBiosIndexes); rowBiosBasedZscoreCalculatorStudy.setRowAverageCalculator(rowAverageCalculatorStudy); rowBiosBasedZscoreCalculatorStudy.setRowStdevCalculator(rowStdevCalculatorStudy); String studyBasedResultsFolder = this.writeFolder + "study/"; FileUtils.makeDir(studyBasedResultsFolder); RowJobExecutor rowJobExecutorStudyIndexes = new RowJobExecutor(nThreads); rowJobExecutorStudyIndexes.addJob(rowAverageCalculatorStudy); rowJobExecutorStudyIndexes.addJob(rowStdevCalculatorStudy); rowJobExecutorStudyIndexes.addJob(rowBiosBasedZscoreCalculatorStudy); rowJobExecutorStudyIndexes.setIncludeIndexes(studyIndexes); rowJobExecutorStudyIndexes.setWriteFolder(studyBasedResultsFolder); //add the jobExecutors to the executor list rowJobExecutors.add(rowJobExecutorBiosIndexes); rowJobExecutors.add(rowJobExecutorStudyIndexes); double nanoTime = System.nanoTime(); RowJobExecutor.useExecutorsOnFile( rowJobExecutors, correctedMatrixFn); double timeUsed = (System.nanoTime() - nanoTime) / 1000 / 1000 / 1000; System.out.println("timeused = " + ((int)timeUsed) + " seconds"); Thread.sleep(1000); //OUTLIERCOUNTS Z-SCORES///////////////////////////////////////////////////////////////////////////////////////////////////////// //calculate outlierCounts in other parents //calculate outlierCounts in other patients String zScoreFn = studyBasedResultsFolder + biosBasedZscoreFn; HashMap<String, int[]> sampleToOtherParentIndexesStudy = getStudyIndexesPerSample( zScoreFn, stringFiltersStudy, caseSampleNameToFamilySampleNames, parentSampleNameToFamilyId); HashMap<String, int[]> sampleToOtherChildIndexesStudy = getStudyIndexesPerSample( zScoreFn, stringFiltersStudy, caseSampleNameToFamilySampleNames, patientSampleNameToFamilyId); ArrayList<RowJobExecutor> rowJobExecutors2 = new ArrayList<RowJobExecutor>(); String cutoffPositiveCountFn = "parentOutlierCountsPositive.txt"; RowAboveCutoffCounter rowAboveCutoffCounter = new RowAboveCutoffCounter(); rowAboveCutoffCounter.setWriteFn(cutoffPositiveCountFn); rowAboveCutoffCounter.setCutoff(3); String belowNegativeCutoffCountFn = "parentOutlierCountsNegative.txt"; RowBelowCutoffCounter rowBelowCutoffCounter = new RowBelowCutoffCounter(); rowBelowCutoffCounter.setWriteFn(belowNegativeCutoffCountFn); rowBelowCutoffCounter.setCutoff(-3); for (String sampleName : sampleToOtherParentIndexesStudy.keySet()) { String resultsFolder = this.writeFolder + sampleName + "/"; FileUtils.makeDir(resultsFolder); RowJobExecutor rowJobExecutor = new RowJobExecutor(nThreads); rowJobExecutor.addJob(rowAboveCutoffCounter); rowJobExecutor.addJob(rowBelowCutoffCounter); rowJobExecutor.setIncludeIndexes(sampleToOtherParentIndexesStudy.get(sampleName)); rowJobExecutor.setWriteFolder(resultsFolder); rowJobExecutors2.add(rowJobExecutor); } String cutoffPositiveCountFnChildren = "childOutlierCountsPositive.txt"; RowAboveCutoffCounter rowAboveCutoffCounterChildren = new RowAboveCutoffCounter(); rowAboveCutoffCounterChildren.setWriteFn(cutoffPositiveCountFnChildren); rowAboveCutoffCounterChildren.setCutoff(3); String belowNegativeCutoffCountFnChildren = "childOutlierCountsNegative.txt"; RowBelowCutoffCounter rowBelowCutoffCounterChildren = new RowBelowCutoffCounter(); rowBelowCutoffCounterChildren.setWriteFn(belowNegativeCutoffCountFnChildren); rowBelowCutoffCounterChildren.setCutoff(-3); for (String sampleName : sampleToOtherChildIndexesStudy.keySet()) { String resultsFolder = this.writeFolder + sampleName + "/"; FileUtils.makeDir(resultsFolder); RowJobExecutor rowJobExecutor = new RowJobExecutor(nThreads); rowJobExecutor.addJob(rowAboveCutoffCounterChildren); rowJobExecutor.addJob(rowBelowCutoffCounterChildren); rowJobExecutor.setIncludeIndexes(sampleToOtherChildIndexesStudy.get(sampleName)); rowJobExecutor.setWriteFolder(resultsFolder); rowJobExecutors2.add(rowJobExecutor); } RowJobExecutor.useExecutorsOnFile( rowJobExecutors2, zScoreFn); //MERGE Z-SCORES FAMILY///////////////////////////////////////////////////////////////////////////////////////////////////////// //merge family files for z-scores based on BIOS ArrayList<RowJobExecutor> rowJobExecutors3 = new ArrayList<RowJobExecutor>(); String zScoreFnFamily = "familyZscores.txt"; RowColumnGetter columnGetter = new RowColumnGetter(); columnGetter.setWriteFn(zScoreFnFamily); for (String sampleName : caseSampleNameToFamilySampleNames.keySet()) { ArrayList<String> includeColnames = new ArrayList<String>(); includeColnames.add(sampleName); includeColnames = addParentSamples( caseSampleNameToFamilySampleNames, sampleName, includeColnames); //get family z_scores RowJobExecutor rowJobExecutor = new RowJobExecutor(nThreads); rowJobExecutor.setIncludeColHeaders(includeColnames); rowJobExecutor.addJob(columnGetter); String resultsFolder = this.writeFolder + sampleName + "/"; rowJobExecutor.setWriteFolder(resultsFolder); rowJobExecutors3.add(rowJobExecutor); } RowJobExecutor.useExecutorsOnFile( rowJobExecutors3, studyBasedResultsFolder + biosBasedZscoreFn); //RAWDATA///////////////////////////////////////////////////////////////////////////////////////////////////////// //calculate medians rawData BIOS String mediansFn = "medians_Bios.txt"; RowMedianGetter rowMedianGetter = new RowMedianGetter(); rowMedianGetter.setWriteFn(mediansFn); String maxRawCountBiosFn = "maxRawCountBios.txt"; RowMaxGetter rowMaxGetter = new RowMaxGetter(); rowMaxGetter.setWriteFn(maxRawCountBiosFn); String maxRawCountNonFamilyFn = "maxRawCountNonFamily.txt"; RowMaxGetter rowMaxGetterNonFamily = new RowMaxGetter(); rowMaxGetterNonFamily.setWriteFn(maxRawCountNonFamilyFn); String biosBasedResultsFolderRawData = this.writeFolder + "bios/rawData/"; FileUtils.makeDir(biosBasedResultsFolderRawData); RowJobExecutor rowJobExecutorBiosIndexesRawData = new RowJobExecutor(nThreads); rowJobExecutorBiosIndexesRawData.addJob(rowMedianGetter); rowJobExecutorBiosIndexesRawData.addJob(rowMaxGetter); rowJobExecutorBiosIndexesRawData.setIncludeIndexes(biosIndexes); rowJobExecutorBiosIndexesRawData.setWriteFolder(biosBasedResultsFolderRawData); String rawCountFn = "rawCount.txt"; RowColumnGetter rawCountColumnGetter = new RowColumnGetter(); rawCountColumnGetter.setWriteFn(rawCountFn); ArrayList<RowJobExecutor> rowJobExecutorsOnRawData = new ArrayList<RowJobExecutor>(); for (String sampleName : caseSampleNameToFamilySampleNames.keySet()) { //get raw counts RowJobExecutor rowJobExecutorGetRawCounts = new RowJobExecutor(nThreads); ArrayList<String> includeColnamesCaseSample = new ArrayList<String>(); includeColnamesCaseSample.add(sampleName); rowJobExecutorGetRawCounts.setIncludeColHeaders(includeColnamesCaseSample); rowJobExecutorGetRawCounts.addJob(rawCountColumnGetter); String resultsFolder = this.writeFolder + sampleName + "/"; rowJobExecutorGetRawCounts.setWriteFolder(resultsFolder); rowJobExecutorsOnRawData.add(rowJobExecutorGetRawCounts); } //get max raw counts non family members for (String sampleName : sampleToOtherIndexesStudy.keySet()) { int[] otherStudyIndexes = sampleToOtherIndexesStudy.get(sampleName); RowJobExecutor rowJobExecutorGetRawCounts = new RowJobExecutor(nThreads); ArrayList<String> includeColnamesCaseSample = new ArrayList<String>(); includeColnamesCaseSample.add(sampleName); rowJobExecutorGetRawCounts.setIncludeIndexes(otherStudyIndexes); rowJobExecutorGetRawCounts.addJob(rowMaxGetterNonFamily); String resultsFolder = this.writeFolder + sampleName + "/"; rowJobExecutorGetRawCounts.setWriteFolder(resultsFolder); rowJobExecutorsOnRawData.add(rowJobExecutorGetRawCounts); } rowJobExecutorsOnRawData.add(rowJobExecutorBiosIndexesRawData); RowJobExecutor.useExecutorsOnFile( rowJobExecutorsOnRawData, this.rawMatrixFn); /////////////////////////////////////////////////////////////////////////////////////////////////////////// //MergeFiles and write Patrick files String patrickFolder = writeFolder + "patrickFolder/"; for (String caseSampleName : caseSampleNameToFamilySampleNames.keySet()) { String familyName = getFamilyName( caseSampleName, patientSampleNameToFamilyId, parentSampleNameToFamilyId); if (familyName == null) continue; String gnScoreFn = gnFolder + familyName + "_fixed.txt"; HashMap<String, String> geneToGnScores = FileUtils.readStringStringHash(gnScoreFn, false, 2, 1, 9,null); String vcfFn = vcfFolder + familyName + ".txt"; HashMap<String, ArrayList<String>> ensgToPositions = FileUtils.readGavinVcfHash(vcfFn, enstToEnsgFn); String sampleFolder = writeFolder + caseSampleName + "/"; BufferedReader zScoreFamilyReader = FileUtils.createReader(sampleFolder + zScoreFnFamily); BufferedReader biosMedianReader = FileUtils.createReader(biosBasedResultsFolderRawData + mediansFn); BufferedReader otherParentsAboveCutoffCountReader = FileUtils.createReader(sampleFolder + cutoffPositiveCountFn); BufferedReader otherParentsBelowCutoffCountReader = FileUtils.createReader(sampleFolder + belowNegativeCutoffCountFn); BufferedReader caseAboveCutoffCountReader = FileUtils.createReader(sampleFolder + cutoffPositiveCountFnChildren); BufferedReader caseBelowCutoffCountReader = FileUtils.createReader(sampleFolder + belowNegativeCutoffCountFnChildren); BufferedReader rawCountReader = FileUtils.createReader(sampleFolder + rawCountFn); BufferedReader maxRawCountBiosReader = FileUtils.createReader(biosBasedResultsFolderRawData + maxRawCountBiosFn); BufferedReader maxRawCountNonFamilyReader = FileUtils.createReader(sampleFolder + maxRawCountNonFamilyFn); String mergeWriteFn = sampleFolder + "merged.txt"; BufferedWriter mergedWriter = FileUtils.createWriter(mergeWriteFn); String patrickWriteFn = sampleFolder + caseSampleName + "_patrick.txt"; BufferedWriter patrickWriter = FileUtils.createWriter(patrickWriteFn); FileUtils.makeDir(patrickFolder); String patrickFolderWriteFn = patrickFolder + caseSampleName + ".txt"; BufferedWriter patrickFolderWriter = FileUtils.createWriter(patrickFolderWriteFn); String rescueWriteFn = sampleFolder + caseSampleName + "_rescue.txt"; BufferedWriter rescueWriter = FileUtils.createWriter(rescueWriteFn); String rescueFolder = writeFolder + "rescueFolder/"; FileUtils.makeDir(rescueFolder); String rescueFolderWriteFn = rescueFolder + caseSampleName + ".txt"; BufferedWriter rescueFolderWriter = FileUtils.createWriter(rescueFolderWriteFn); String line = null; boolean isHeaderLine = true; int l = 0; while ((line = zScoreFamilyReader.readLine()) != null)//assumes all files have the same rowNames in the same order { String[] rowName_zScoreFamily = line.split( "\t", 2); String rowName = rowName_zScoreFamily[0]; String zScoreFamily = rowName_zScoreFamily[1]; String biosMedian = biosMedianReader.readLine().split( "\t", 2)[1]; String otherParentsAboveCutoffCount = otherParentsAboveCutoffCountReader.readLine().split( "\t", 2)[1]; String caseAboveCutoffCount = caseAboveCutoffCountReader.readLine().split( "\t", 2)[1]; String otherParentsBelowCutoffCount = otherParentsBelowCutoffCountReader.readLine().split( "\t", 2)[1]; String caseBelowCutoffCount = caseBelowCutoffCountReader.readLine().split( "\t", 2)[1]; String rawCountStr = rawCountReader.readLine().split( "\t", 2)[1]; String maxRawCountBios = maxRawCountBiosReader.readLine().split("\t", 2)[1]; String maxRawCountNonFamily = maxRawCountNonFamilyReader.readLine().split( "\t", 2)[1]; String mergedLine = getMergedLine( rowName, zScoreFamily, biosMedian, otherParentsAboveCutoffCount, caseAboveCutoffCount, rawCountStr, maxRawCountBios, maxRawCountNonFamily); mergedWriter.write(mergedLine); writeCriteriaDependantLines(patrickWriter, patrickFolderWriter, rescueWriter, rescueFolderWriter, mergedLine, ensgNameToGeneSymbol, isHeaderLine, geneToGnScores, ensgToPositions, biosMedian, otherParentsAboveCutoffCount, caseAboveCutoffCount, zScoreFamily, rawCountStr, maxRawCountBios, maxRawCountNonFamily, otherParentsBelowCutoffCount, caseBelowCutoffCount); isHeaderLine = false; l++; } patrickWriter.close(); patrickFolderWriter.close(); rescueWriter.close(); rescueFolderWriter.close(); mergedWriter.close(); } //OutlierSpliceSiteRetriever moet hier nog onder OutlierSpliceSiteRetriever outlierSpliceSiteRetriever = new OutlierSpliceSiteRetriever(); outlierSpliceSiteRetriever.setInputFolder(patrickFolder); outlierSpliceSiteRetriever.setRawMatrixFn(rawMatrixFn); outlierSpliceSiteRetriever.setCorrectedMatrixFn(correctedMatrixFn); outlierSpliceSiteRetriever.setSpliceNameCol(1); } catch (Exception e) { e.printStackTrace(); } } private void writeRescueLine( BufferedWriter rescueWriter, String mergedLine) { } private String getMergedLine( String rowName, String zScoreFamily, String biosMedian, String biosCutoffCount, String caseCutoffCount, String rawCount, String maxRawCountBios, String maxRawCountNonFamily) throws IOException { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(rowName); stringBuilder.append("\t"); stringBuilder.append(zScoreFamily); stringBuilder.append("\t"); stringBuilder.append(biosMedian); stringBuilder.append("\t"); stringBuilder.append(biosCutoffCount); stringBuilder.append("\t"); stringBuilder.append(caseCutoffCount); stringBuilder.append("\t"); stringBuilder.append(rawCount); stringBuilder.append("\t"); stringBuilder.append(maxRawCountBios); stringBuilder.append("\t"); stringBuilder.append(maxRawCountNonFamily); stringBuilder.append("\n"); String writeLine = stringBuilder.toString(); return writeLine; } private String getFamilyName( String sampleName, HashMap<String, String> patientSampleNameToFamilyId, HashMap<String, String> parentSampleNameToFamilyId) { String familyName = patientSampleNameToFamilyId.get(sampleName); if (familyName == null) { familyName = parentSampleNameToFamilyId.get(sampleName); if (familyName != null) { log("Sample is parent: " + sampleName + ". Skipping"); return null; } } log("familyName =\t" + familyName); if (familyName == null) { log("Sample to family name missing for sample: " + sampleName + ". Skipping"); return null; } return familyName; } private void writeCriteriaDependantLines( BufferedWriter patrickWriter, BufferedWriter patrickFolderWriter, BufferedWriter rescueWriter, BufferedWriter rescueFolderWriter, String line, HashMap<String, String> ensgNameToGeneSymbol, boolean isHeaderLine, HashMap<String, String> geneToGnScores, HashMap<String, ArrayList<String>> ensgToPositions, String biosMedian, String otherparentsCutoffCount, String caseCutoffCount, String zScoreFamily, String rawCountStr, String maxRawCountBios, String maxRawCountNonFamily, String otherParentsBelowCutoffCount, String caseBelowCutoffCount) throws IOException { if (!isHeaderLine) { double median = Double.parseDouble(biosMedian); double outlierCountParents = Double.parseDouble(otherparentsCutoffCount); double outlierCountCases = Double.parseDouble(caseCutoffCount); double negativeOutlierCountParents = Double.parseDouble(otherParentsBelowCutoffCount); double negativeOutlierCountCases = Double.parseDouble(caseBelowCutoffCount); String patientZscoreAsString = zScoreFamily.split("\t")[0]; double patientZscore = Double.parseDouble(patientZscoreAsString); String parent1ZscoreAsString = zScoreFamily.split("\t")[1]; String parent2ZscoreAsString = zScoreFamily.split("\t")[2]; double rawCount = Double.parseDouble(rawCountStr); double maxBiosRawCount = Double.parseDouble(maxRawCountBios); double maxStudyRawCount = Double.parseDouble(maxRawCountNonFamily); //get the variables that are needed to determine if the line is passing the criteria //I should get the indexes from the columnheaders but cant be bothered at the moment... String[] ensembl_spliceName = line.split( "\t", 2)[0].split("__"); String ensemblName = ensembl_spliceName[0]; String spliceName = ensembl_spliceName[1]; if (ensemblName.equals("null")) { ensemblName = "unannotated"; } String[] valuesAsString = line.split( "\t", 2)[1].split("\t"); String geneSymbol = getFromHash(ensgNameToGeneSymbol, ensemblName); String geneNetworkScore = getFromHash( geneToGnScores, ensemblName); patrickCriteriaPassWrite( outlierCountParents, outlierCountCases, patientZscore, ensgNameToGeneSymbol, ensemblName, geneToGnScores, patrickWriter, patrickFolderWriter, ensgToPositions, spliceName, median, patientZscoreAsString, parent1ZscoreAsString, parent2ZscoreAsString, geneSymbol, geneNetworkScore, negativeOutlierCountParents, negativeOutlierCountCases); rescueCriteriaPassWrite(outlierCountParents, outlierCountCases, patientZscore, ensgNameToGeneSymbol, ensemblName, geneToGnScores, rescueWriter, rescueFolderWriter, ensgToPositions, spliceName, median, patientZscoreAsString, parent1ZscoreAsString, parent2ZscoreAsString, geneSymbol, geneNetworkScore, rawCount, maxBiosRawCount, maxStudyRawCount); } else { String patrickHeader = "Gene ENSG geneNetwork Z-score Case expression Father expression Mother expression Variant chr Variant pos Variant ID Ref Allele Alt Allele Case genotype Exac MAF\n"; patrickWriter.write(patrickHeader); patrickFolderWriter.write(patrickHeader); String rescueHeader = "Gene ENSG geneNetwork Z-score Case expression Father expression Mother expression Variant chr Variant pos Variant ID Ref Allele Alt Allele Case genotype Exac MAF\n"; rescueWriter.write(rescueHeader); rescueFolderWriter.write(rescueHeader); } } private void rescueCriteriaPassWrite( double outlierCountParents, double outlierCountCases, double patientZscore, HashMap<String, String> ensgNameToGeneSymbol, String ensemblName, HashMap<String, String> geneToGnScores, BufferedWriter rescueWriter, BufferedWriter rescueFolderWriter, HashMap<String, ArrayList<String>> ensgToPositions, String spliceName, double median, String patientZscoreAsString, String parent1ZscoreAsString, String parent2ZscoreAsString, String geneSymbol, String geneNetworkScore, double rawCount, double maxBiosRawCount, double maxStudyRawCount) throws IOException { boolean isMuchLargerThanBios = rawCount > maxBiosRawCount * 5 || maxBiosRawCount == 0; boolean isMuchLargerThanStudy = rawCount > maxStudyRawCount * 2; if (median <= medianCutoff && isMuchLargerThanBios && isMuchLargerThanStudy && Math.abs(patientZscore) > zScoreCutoff) { String rescueLine = geneSymbol.concat("\t").concat(ensemblName).concat("__").concat(spliceName).concat("\t").concat(geneNetworkScore).concat("\t").concat(patientZscoreAsString).concat("\t").concat(parent1ZscoreAsString).concat("\t").concat(parent2ZscoreAsString); addVariantsAndWriteLine(rescueLine, rescueWriter, rescueFolderWriter, ensgToPositions, ensemblName); } } private void patrickCriteriaPassWrite( double outlierCountParents, double outlierCountCases, double patientZscore, HashMap<String, String> ensgNameToGeneSymbol, String ensemblName, HashMap<String, String> geneToGnScores, BufferedWriter patrickWriter, BufferedWriter patrickFolderWriter, HashMap<String, ArrayList<String>> ensgToPositions, String spliceName, double median, String patientZscoreAsString, String parent1ZscoreAsString, String parent2ZscoreAsString, String geneSymbol, String geneNetworkScore, double negativeOutlierCountParents, double negativeOutlierCountCases) throws IOException { boolean isMedianPass = median > medianCutoff; boolean isPositivePass = outlierCountParents < maxOutlierCount && outlierCountCases < maxOutlierCount && patientZscore > zScoreCutoff; boolean isNegativepass = negativeOutlierCountParents < maxOutlierCount && negativeOutlierCountCases < maxOutlierCount && patientZscore < -zScoreCutoff; if (isMedianPass && (isPositivePass || isNegativepass)) { String patrickLine = geneSymbol.concat("\t").concat(ensemblName).concat("__").concat(spliceName).concat("\t").concat(geneNetworkScore).concat("\t").concat(patientZscoreAsString).concat("\t").concat(parent1ZscoreAsString).concat("\t").concat(parent2ZscoreAsString); addVariantsAndWriteLine(patrickLine, patrickWriter, patrickFolderWriter, ensgToPositions, ensemblName); } } private void addVariantsAndWriteLine( String patrickLine, BufferedWriter patrickWriter, BufferedWriter patrickFolderWriter, HashMap<String, ArrayList<String>> ensgToPositions, String ensemblName) throws IOException { String writeLine = patrickLine; ArrayList<String> positions = null; if (ensgToPositions != null) { positions = ensgToPositions.get(ensemblName); } if (positions != null) for (String position : positions) { writeLine = patrickLine; String[] eles = position.split("\t"); writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(eles[0]);//chromosome writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(eles[1]);//position writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(eles[2]);//rs number writeLine = writeLine.concat("\t"); writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(eles[4]);//alt allele //case genotype String genotype = eles[5].split(":")[0]; writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(genotype); //exacMaf String exacMaf = eles[7]; writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(exacMaf); writeLine = writeLine.concat("\n"); patrickWriter.write(writeLine); if (patrickFolderWriter != null) patrickFolderWriter.write(writeLine); } else { for (int i = 0; i < 7; i++) { writeLine = writeLine.concat("\t"); writeLine = writeLine.concat(""); } writeLine = writeLine.concat("\n"); patrickWriter.write(writeLine); if (patrickFolderWriter != null) patrickFolderWriter.write(writeLine); } } private ArrayList<String> addParentSamples( HashMap<String, HashMap<String, Integer>> sampleNameToFamilySampleNames, String sampleName, ArrayList<String> includeColnames) { HashMap<String, Integer> includeSamples = sampleNameToFamilySampleNames.get(sampleName); includeSamples.remove(sampleName); for (String includeSample : includeSamples.keySet()) { includeColnames.add(includeSample); } return includeColnames; } // private void setRowJobExecutorVariables(ArrayList<RowJobExecutor> rowJobExecutors, // String rowName, // double[] values, // int lineNumber) // { // for (RowJobExecutor rowJobExecutor : rowJobExecutors) // { // rowJobExecutor.setRowName(rowName); // // setValuesUsingIncludeIndexes( values, // rowJobExecutor); // } // } // public void setValuesUsingIncludeIndexes( double[] values, // RowJobExecutor rowJobExecutor) // { // rowJobExecutor.initiateStorageVariables(); // int[] includeIndexes = rowJobExecutor.getIncludeIndexes(); // double[] includeValues = new double[includeIndexes.length]; // for (int i = 0; i < includeIndexes.length; i++) // { // int e = includeIndexes[i]; // includeValues[i] = values[e]; // } // rowJobExecutor.setValuesUsingIncludeIndexes(values); // } //Thread done: 1 linenumber =789 // private void executeJobs(ArrayList<RowJobExecutor> rowJobExecutors) // { // for (RowJobExecutor rowJobExecutor : rowJobExecutors) // { // rowJobExecutor.execute(0); // } // } private void createWriteFolder() { if (writeFolder == null) writeFolder = new File(correctedMatrixFn).getParent() + "/R.SplicingAnalysisPipeline2/"; writeFolder = FileUtils.makeFolderNameEndWithSlash(writeFolder); new File(writeFolder).mkdir(); } private int[] getIndexes( String correctedMatrixFn2, StringFilters stringFilters) throws FileNotFoundException, IOException { return getIndexes( correctedMatrixFn2, stringFilters, null, null); } private int[] getIndexes( String matrixFn, StringFilters stringFilters, HashMap<String, Integer> excludeSamples, HashMap<String, String> includeSamples) throws FileNotFoundException, IOException { BufferedReader reader = FileUtils.createReader(matrixFn); String header = reader.readLine(); String[] colNames = header.split( "\t", 2)[1].split("\t");//first split the first column off boolean[] include = new boolean[colNames.length]; int n = 0; for (int c = 0; c < colNames.length; c++) { include[c] = stringFilters.check(colNames[c]); //exclude family samples if (excludeSamples != null && excludeSamples.containsKey(colNames[c]) || (includeSamples != null && !includeSamples.containsKey(colNames[c]))) { include[c] = false; } if (include[c]) n++; } int[] biosIndexes = new int[n]; int arrayIndex = 0; for (int b = 0; b < include.length; b++) { if (!include[b]) continue; biosIndexes[arrayIndex] = b; arrayIndex++; } reader.close(); return biosIndexes; } private HashMap<String, int[]> getStudyIndexesPerSample(String correctedMatrixFn, StringFilters stringFilters, HashMap<String, HashMap<String, Integer>> sampleNameToFamilySampleNames) throws FileNotFoundException, IOException { return getStudyIndexesPerSample(correctedMatrixFn, stringFilters, sampleNameToFamilySampleNames, null); } private HashMap<String, int[]> getStudyIndexesPerSample(String matrixFn, StringFilters stringFilters, HashMap<String, HashMap<String, Integer>> sampleNameToFamilySampleNames, HashMap<String, String> includeSamples) throws FileNotFoundException, IOException { BufferedReader reader = FileUtils.createReader(matrixFn); String header = reader.readLine(); String[] colNames = header.split( "\t", 2)[1].split("\t");//first split the first column off reader.close(); HashMap<String, int[]> studyIndexesPerSample = new HashMap<String, int[]>(); for (int c = 0; c < colNames.length; c++) { if (stringFilters.check(colNames[c])) { String sampleName = colNames[c]; HashMap<String, Integer> familySampleNames = sampleNameToFamilySampleNames.get(sampleName); if (familySampleNames != null) { int[] sampleIncludeIndexes = getIndexes(matrixFn, stringFilters, familySampleNames, includeSamples); studyIndexesPerSample.put( sampleName, sampleIncludeIndexes); } else//is probably not a child, but a parent ;//p("Warning, sampleName: " + sampleName + " not found in sampleNameToFamilySampleNames file:\t" + this.sampleNameToFamilySampleNamesFn); } } return studyIndexesPerSample; } private String getFromHash( HashMap<String, String> geneToMedianBios, String geneName) throws IOException { String median = null; if (geneToMedianBios != null) { median = geneToMedianBios.get(geneName); } if (median == null) { //System.out.println("Warning key "+geneName+" not found, using -1"); median = ""; } return median; } }
Sipkovandam/PCrotation
Sipko/src/main/java/R/SplicingAnalysisPipeline2.java
Java
gpl-3.0
36,833
using System.Windows.Input; using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using MALClient.Models.Enums; using MALClient.Models.Models.Forums; namespace MALClient.XShared.ViewModels.Forums.Items { public class ForumTopicEntryViewModel : ViewModelBase { public ForumTopicEntry Data { get; set; } public ForumTopicEntryViewModel(ForumTopicEntry data) { Data = data; } public FontAwesomeIcon FontAwesomeIcon => TypeToIcon(Data.Type); private FontAwesomeIcon TypeToIcon(string type) { switch (type) { case "Poll: ": return FontAwesomeIcon.BarChart; case "Sticky:": return FontAwesomeIcon.StickyNote; } return FontAwesomeIcon.None; } private ICommand _pinCommand; public ICommand PinCommand => _pinCommand ?? (_pinCommand = new RelayCommand(() => { Pin(false); })); private ICommand _pinLastpostCommand; public ICommand PinLastpostCommand => _pinLastpostCommand ?? (_pinLastpostCommand = new RelayCommand(() => { Pin(true); })); private void Pin(bool lastpost) { var topic = ForumTopicLightEntry.FromTopicEntry(Data); topic.Lastpost = lastpost; if (ViewModelLocator.ForumsBoard.PrevArgs.Scope != null) topic.SourceBoard = ViewModelLocator.ForumsBoard.PrevArgs.Scope.Value; else topic.SourceBoard = ViewModelLocator.ForumsBoard.PrevArgs.TargetBoard; ViewModelLocator.ForumsMain.PinnedTopics.Add(topic); } } }
Drutol/MALClient
MALClient.XShared/ViewModels/Forums/Items/ForumTopicEntryViewModel.cs
C#
gpl-3.0
1,759
/* $Id$ */ /* Copyright (c) 2009-2021 Pierre Pronchery <khorben@defora.org> */ /* This file is part of DeforaOS Desktop Panel */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <System.h> #include <Desktop.h> #include <sys/stat.h> #ifdef __NetBSD__ # include <sys/param.h> # include <sys/sysctl.h> #else # include <fcntl.h> #endif #include <dirent.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <limits.h> #include <errno.h> #include <libintl.h> #include <gtk/gtk.h> #include <gdk/gdkx.h> #include <X11/X.h> #include "window.h" #include "panel.h" #include "../config.h" #define _(string) gettext(string) #define N_(string) string /* constants */ #ifndef PROGNAME_PANEL # define PROGNAME_PANEL "panel" #endif #ifndef PREFIX # define PREFIX "/usr/local" #endif #ifndef LIBDIR # define LIBDIR PREFIX "/lib" #endif /* Panel */ /* private */ /* types */ struct _Panel { Config * config; PanelPrefs prefs; PanelAppletHelper helpers[PANEL_POSITION_COUNT]; PanelWindow * windows[PANEL_POSITION_COUNT]; GdkScreen * screen; GdkWindow * root; gint root_width; /* width of the root window */ gint root_height; /* height of the root window */ guint source; #if 1 /* XXX for tests */ guint timeout; #endif /* preferences */ GtkWidget * pr_window; GtkWidget * pr_notebook; GtkWidget * pr_accept_focus; GtkWidget * pr_keep_above; GtkListStore * pr_store; GtkWidget * pr_view; GtkWidget * pr_panels_panel; GtkWidget * pr_panels_view; struct { GtkWidget * enabled; GtkWidget * size; GtkListStore * store; } pr_panels[PANEL_POSITION_COUNT]; /* dialogs */ GtkWidget * ab_window; GtkWidget * lk_window; GtkWidget * lo_window; GtkWidget * sh_window; GtkWidget * su_window; }; typedef void (*PanelPositionMenuHelper)(Panel * panel, GtkMenu * menu, gint * x, gint * y, gboolean * push_in); /* constants */ static char const * _authors[] = { "Pierre Pronchery <khorben@defora.org>", NULL }; static const struct { char const * name; char const * alias; GtkIconSize iconsize; gint size; } _panel_sizes[] = { { "panel-large", N_("Large"), GTK_ICON_SIZE_LARGE_TOOLBAR, 48 }, { "panel-small", N_("Small"), GTK_ICON_SIZE_SMALL_TOOLBAR, 24 }, { "panel-smaller", N_("Smaller"), GTK_ICON_SIZE_MENU, 16 } }; /* prototypes */ /* accessors */ static gboolean _panel_can_shutdown(void); static gboolean _panel_can_suspend(void); static char const * _panel_get_applets(Panel * panel, PanelPosition position); static char const * _panel_get_section(Panel * panel, PanelPosition position); /* useful */ static void _panel_reset(Panel * panel, GdkRectangle * rect); /* helpers */ #include "helper.c" /* public */ /* panel_new */ static int _new_config(Panel * panel); static void _new_helper(Panel * panel, PanelPosition position); static void _new_prefs(Config * config, GdkScreen * screen, PanelPrefs * prefs, PanelPrefs const * user); /* callbacks */ static int _new_on_message(void * data, uint32_t value1, uint32_t value2, uint32_t value3); static GdkFilterReturn _on_root_event(GdkXEvent * xevent, GdkEvent * event, gpointer data); static GdkFilterReturn _event_configure_notify(Panel * panel); Panel * panel_new(PanelPrefs const * prefs) { Panel * panel; size_t i; if((panel = object_new(sizeof(*panel))) == NULL) return NULL; panel->screen = gdk_screen_get_default(); if(_new_config(panel) == 0) _new_prefs(panel->config, panel->screen, &panel->prefs, prefs); /* helpers */ for(i = 0; i < PANEL_POSITION_COUNT; i++) { panel->windows[i] = NULL; _new_helper(panel, i); } panel->pr_window = NULL; panel->ab_window = NULL; panel->lk_window = NULL; panel->lo_window = NULL; panel->sh_window = NULL; panel->su_window = NULL; if(panel->config == NULL) { panel_error(NULL, NULL, 0); /* XXX put up a dialog box */ panel_delete(panel); return NULL; } /* root window */ panel->root = gdk_screen_get_root_window(panel->screen); panel->source = 0; panel->timeout = 0; /* panel windows */ if(panel_reset(panel) != 0) { panel_error(NULL, NULL, 0); /* XXX as above */ panel_delete(panel); return NULL; } /* messages */ desktop_message_register(NULL, PANEL_CLIENT_MESSAGE, _new_on_message, panel); /* manage root window events */ gdk_window_set_events(panel->root, gdk_window_get_events(panel->root) | GDK_PROPERTY_CHANGE_MASK); gdk_window_add_filter(panel->root, _on_root_event, panel); return panel; } static int _new_config(Panel * panel) { size_t i; gint width; gint height; for(i = 0; i < sizeof(_panel_sizes) / sizeof(*_panel_sizes); i++) { if(gtk_icon_size_from_name(_panel_sizes[i].name) != GTK_ICON_SIZE_INVALID) continue; if(gtk_icon_size_lookup(_panel_sizes[i].iconsize, &width, &height) != TRUE) width = height = _panel_sizes[i].size; gtk_icon_size_register(_panel_sizes[i].name, width, height); } if((panel->config = config_new()) == NULL) return -1; if(config_load_preferences(panel->config, PANEL_CONFIG_VENDOR, PACKAGE, PANEL_CONFIG_FILE) != 0) /* we can ignore this error */ panel_error(NULL, _("Could not load configuration"), 1); return 0; } static void _new_helper(Panel * panel, PanelPosition position) { PanelAppletHelper * helper = &panel->helpers[position]; const PanelPositionMenuHelper positions[PANEL_POSITION_COUNT] = { _panel_helper_position_menu_bottom, _panel_helper_position_menu_top, _panel_helper_position_menu_top, /* XXX */ _panel_helper_position_menu_top /* XXX */ }; String const * p; helper->panel = panel; helper->window = panel->windows[position]; helper->config_get = _panel_helper_config_get; helper->config_set = _panel_helper_config_set; helper->error = _panel_helper_error; helper->about_dialog = _panel_helper_about_dialog; helper->lock = _panel_helper_lock; helper->lock_dialog = (p = panel_get_config(panel, NULL, "lock")) == NULL || strtol(p, NULL, 0) != 0 ? _panel_helper_lock_dialog : NULL; helper->logout = _panel_helper_logout; #ifndef EMBEDDED if((p = panel_get_config(panel, NULL, "logout")) == NULL || strtol(p, NULL, 0) != 0) #else if((p = panel_get_config(panel, NULL, "logout")) != NULL && strtol(p, NULL, 0) != 0) #endif helper->logout_dialog = _panel_helper_logout_dialog; else helper->logout_dialog = NULL; helper->position_menu = positions[position]; helper->preferences_dialog = _panel_helper_preferences_dialog; helper->rotate_screen = _panel_helper_rotate_screen; helper->shutdown = _panel_can_shutdown() ? _panel_helper_shutdown : NULL; helper->shutdown_dialog = (helper->shutdown != NULL) && ((p = panel_get_config(panel, NULL, "shutdown")) == NULL || strtol(p, NULL, 0) != 0) ? _panel_helper_shutdown_dialog : NULL; helper->suspend = _panel_can_suspend() ? _panel_helper_suspend : NULL; helper->suspend_dialog = (helper->suspend != NULL) && ((p = panel_get_config(panel, NULL, "suspend")) == NULL || strtol(p, NULL, 0) != 0) ? _panel_helper_suspend_dialog : NULL; } static void _new_prefs(Config * config, GdkScreen * screen, PanelPrefs * prefs, PanelPrefs const * user) { char const * p; char * q; if(user != NULL) memcpy(prefs, user, sizeof(*prefs)); else { prefs->iconsize = PANEL_ICON_SIZE_DEFAULT; prefs->monitor = -1; } if((p = config_get(config, NULL, "monitor")) != NULL) { prefs->monitor = strtol(p, &q, 0); if(p[0] == '\0' || *q != '\0') prefs->monitor = -1; } #if GTK_CHECK_VERSION(2, 20, 0) if(prefs->monitor == -1) prefs->monitor = gdk_screen_get_primary_monitor(screen); #endif } static int _new_on_message(void * data, uint32_t value1, uint32_t value2, uint32_t value3) { Panel * panel = data; PanelMessage message = value1; PanelMessageShow what; gboolean show; PanelPosition position; PanelWindow * window; switch(message) { case PANEL_MESSAGE_SHOW: what = value2; show = value3; if(what & PANEL_MESSAGE_SHOW_PANEL_BOTTOM) { position = PANEL_POSITION_BOTTOM; if((window = panel->windows[position]) != NULL) panel_window_show(window, show); } if(what & PANEL_MESSAGE_SHOW_PANEL_LEFT) { position = PANEL_POSITION_LEFT; if((window = panel->windows[position]) != NULL) panel_window_show(window, show); } if(what & PANEL_MESSAGE_SHOW_PANEL_RIGHT) { position = PANEL_POSITION_RIGHT; if((window = panel->windows[position]) != NULL) panel_window_show(window, show); } if(what & PANEL_MESSAGE_SHOW_PANEL_TOP) { position = PANEL_POSITION_TOP; if((window = panel->windows[position]) != NULL) panel_window_show(window, show); } if(what & PANEL_MESSAGE_SHOW_SETTINGS) panel_show_preferences(panel, show); break; case PANEL_MESSAGE_EMBED: /* ignore it (not meant to be handled here) */ break; } return 0; } static GdkFilterReturn _on_root_event(GdkXEvent * xevent, GdkEvent * event, gpointer data) { Panel * panel = data; XEvent * xe = xevent; (void) event; if(xe->type == ConfigureNotify) return _event_configure_notify(panel); return GDK_FILTER_CONTINUE; } static GdkFilterReturn _event_configure_notify(Panel * panel) { GdkRectangle rect; size_t i; _panel_reset(panel, &rect); for(i = 0; i < sizeof(panel->windows) / sizeof(*panel->windows); i++) if(panel->windows[i] != NULL) panel_window_reset(panel->windows[i], &rect); return GDK_FILTER_CONTINUE; } /* panel_delete */ void panel_delete(Panel * panel) { size_t i; if(panel->timeout != 0) g_source_remove(panel->timeout); if(panel->source != 0) g_source_remove(panel->source); for(i = 0; i < sizeof(panel->windows) / sizeof(*panel->windows); i++) if(panel->windows[i] != NULL) panel_window_delete(panel->windows[i]); if(panel->config != NULL) config_delete(panel->config); object_delete(panel); } /* accessors */ /* panel_get_config */ char const * panel_get_config(Panel * panel, char const * section, char const * variable) { /* XXX implement */ return config_get(panel->config, section, variable); } /* useful */ /* panel_error */ static int _error_text(char const * message, int ret); static gboolean _error_on_closex(GtkWidget * widget); static void _error_on_response(GtkWidget * widget); int panel_error(Panel * panel, char const * message, int ret) { GtkWidget * dialog; if(panel == NULL) return _error_text(message, ret); dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, #if GTK_CHECK_VERSION(2, 6, 0) "%s", _("Error")); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), #endif "%s", (message != NULL) ? message : error_get(NULL)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); gtk_window_set_title(GTK_WINDOW(dialog), _("Error")); g_signal_connect(dialog, "delete-event", G_CALLBACK(_error_on_closex), NULL); g_signal_connect(dialog, "response", G_CALLBACK(_error_on_response), NULL); gtk_widget_show_all(dialog); return ret; } static int _error_text(char const * message, int ret) { if(message == NULL) error_print(PROGNAME_PANEL); else fprintf(stderr, "%s: %s\n", PROGNAME_PANEL, message); return ret; } static gboolean _error_on_closex(GtkWidget * widget) { gtk_widget_hide(widget); return FALSE; } static void _error_on_response(GtkWidget * widget) { gtk_widget_destroy(widget); } /* panel_load */ int panel_load(Panel * panel, PanelPosition position, char const * applet) { int ret; PanelWindow * window = panel->windows[position]; ret = panel_window_append(window, applet); #if 0 /* FIXME re-implement */ if(pad->settings != NULL && (widget = pad->settings(pa, FALSE, FALSE)) != NULL) { # if GTK_CHECK_VERSION(3, 0, 0) vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); # else vbox = gtk_vbox_new(FALSE, 4); # endif /* XXX ugly */ g_object_set_data(G_OBJECT(vbox), "definition", pad); g_object_set_data(G_OBJECT(vbox), "applet", pa); gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0); gtk_widget_show(vbox); gtk_notebook_append_page(GTK_NOTEBOOK(panel->pr_notebook), vbox, gtk_label_new(pad->name)); } #endif if(ret == 0) panel_window_show(window, TRUE); return (ret == 0) ? 0 : -1; } /* panel_reset */ static GtkIconSize _reset_iconsize(Panel * panel, String const * section); static void _reset_window_delete(Panel * panel, PanelPosition position); static int _reset_window_new(Panel * panel, PanelAppletHelper * helper, PanelPosition position, GtkIconSize iconsize, GdkRectangle * rect, gboolean focus, gboolean above); /* callbacks */ static gboolean _reset_on_idle(gpointer data); static void _reset_on_idle_load(Panel * panel, PanelPosition position); int panel_reset(Panel * panel) { GdkRectangle rect; PanelWindowPosition position; GtkIconSize iconsize; String const * section; gboolean focus; gboolean above; gboolean enabled; String const * applets; String const * p; String * s; _panel_reset(panel, &rect); focus = ((p = panel_get_config(panel, NULL, "accept_focus")) == NULL || strcmp(p, "1") == 0) ? TRUE : FALSE; above = ((p = panel_get_config(panel, NULL, "keep_above")) == NULL || strcmp(p, "1") == 0) ? TRUE : FALSE; for(position = 0; position < PANEL_POSITION_COUNT; position++) { if((section = _panel_get_section(panel, position)) == NULL || (s = string_new_append("panel::", section, NULL)) == NULL) return -1; /* enabled */ enabled = ((p = panel_get_config(panel, s, "enabled")) == NULL || strcmp(p, "1") == 0) ? TRUE : FALSE; iconsize = _reset_iconsize(panel, s); /* applets */ if((applets = panel_get_config(panel, s, "applets")) != NULL && string_get_length(applets) == 0) applets = NULL; string_delete(s); if(enabled == FALSE || applets == NULL) { _reset_window_delete(panel, position); continue; } if(_reset_window_new(panel, &panel->helpers[position], position, iconsize, &rect, focus, above) != 0) return -panel_error(NULL, NULL, 1); } /* create at least PANEL_POSITION_DEFAULT */ for(position = 0; position < PANEL_POSITION_COUNT; position++) if(panel->windows[position] != NULL) break; if(position == PANEL_POSITION_COUNT) { position = PANEL_POSITION_DEFAULT; iconsize = _reset_iconsize(panel, NULL); if(_reset_window_new(panel, &panel->helpers[position], position, iconsize, &rect, focus, above) != 0) return -1; } /* load applets when idle */ if(panel->source != 0) g_source_remove(panel->source); panel->source = g_idle_add(_reset_on_idle, panel); return 0; } static GtkIconSize _reset_iconsize(Panel * panel, String const * section) { GtkIconSize ret = GTK_ICON_SIZE_INVALID; String const * p = NULL; p = panel_get_config(panel, section, "size"); if(p == NULL && section != NULL) p = panel_get_config(panel, NULL, "size"); if(p != NULL) ret = gtk_icon_size_from_name(p); if(ret == GTK_ICON_SIZE_INVALID) ret = GTK_ICON_SIZE_SMALL_TOOLBAR; return ret; } static int _reset_window_new(Panel * panel, PanelAppletHelper * helper, PanelPosition position, GtkIconSize iconsize, GdkRectangle * rect, gboolean focus, gboolean above) { if(panel->windows[position] == NULL && (panel->windows[position] = panel_window_new(helper, PANEL_WINDOW_TYPE_NORMAL, position, iconsize, rect)) == NULL) return -1; panel->helpers[position].window = panel->windows[position]; panel_window_set_accept_focus(panel->windows[position], focus); panel_window_set_keep_above(panel->windows[position], above); return 0; } static void _reset_window_delete(Panel * panel, PanelPosition position) { if(panel->windows[position] != NULL) panel_window_delete(panel->windows[position]); panel->windows[position] = NULL; panel->helpers[position].window = NULL; } static gboolean _reset_on_idle(gpointer data) { Panel * panel = data; PanelPosition position; panel->source = 0; if(panel->pr_window == NULL) panel_show_preferences(panel, FALSE); for(position = 0; position < PANEL_POSITION_COUNT; position++) if(panel->windows[position] != NULL) _reset_on_idle_load(panel, position); return FALSE; } static void _reset_on_idle_load(Panel * panel, PanelPosition position) { char const * applets; char * p; char * q; size_t i; if((applets = _panel_get_applets(panel, position)) == NULL || strlen(applets) == 0) return; if((p = string_new(applets)) == NULL) { panel_error(panel, NULL, FALSE); return; } for(q = p, i = 0;;) { if(q[i] == '\0') { if(panel_load(panel, position, q) != 0) /* ignore errors */ error_print(PROGNAME_PANEL); break; } if(q[i++] != ',') continue; q[i - 1] = '\0'; if(panel_load(panel, position, q) != 0) /* ignore errors */ error_print(PROGNAME_PANEL); q += i; i = 0; } free(p); } /* panel_save */ int panel_save(Panel * panel) { return config_save_preferences_user(panel->config, PANEL_CONFIG_VENDOR, PACKAGE, PANEL_CONFIG_FILE); } /* panel_show_preferences */ static void _show_preferences_window(Panel * panel); static GtkWidget * _preferences_window_general(Panel * panel); static GtkWidget * _preferences_window_panel(Panel * panel); static GtkWidget * _preferences_window_panels(Panel * panel); static void _preferences_window_panels_add(GtkListStore * store, char const * name); static GtkListStore * _preferences_window_panels_model(void); static GtkWidget * _preferences_window_panels_view(GtkListStore * store, gboolean reorderable); static gboolean _preferences_on_closex(gpointer data); static void _preferences_on_response(GtkWidget * widget, gint response, gpointer data); static void _preferences_on_response_apply(gpointer data); static void _preferences_on_response_apply_panel(Panel * panel, PanelPosition position); static void _preferences_on_response_cancel(gpointer data); static void _cancel_general(Panel * panel); static void _cancel_applets(Panel * panel); static void _preferences_on_panel_toggled(gpointer data); static void _preferences_on_response_ok(gpointer data); static void _preferences_on_panel_add(gpointer data); static void _preferences_on_panel_changed(gpointer data); static void _preferences_on_panel_down(gpointer data); static void _preferences_on_panel_remove(gpointer data); static void _preferences_on_panel_up(gpointer data); void panel_show_preferences(Panel * panel, gboolean show) { if(panel->pr_window == NULL) _show_preferences_window(panel); if(show == FALSE) gtk_widget_hide(panel->pr_window); else gtk_window_present(GTK_WINDOW(panel->pr_window)); } static void _show_preferences_window(Panel * panel) { GtkWidget * vbox; GtkWidget * widget; panel->pr_window = gtk_dialog_new_with_buttons(_("Panel preferences"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); gtk_window_set_default_size(GTK_WINDOW(panel->pr_window), 400, 300); gtk_window_set_position(GTK_WINDOW(panel->pr_window), GTK_WIN_POS_CENTER); g_signal_connect_swapped(panel->pr_window, "delete-event", G_CALLBACK( _preferences_on_closex), panel); g_signal_connect(panel->pr_window, "response", G_CALLBACK( _preferences_on_response), panel); panel->pr_notebook = gtk_notebook_new(); gtk_notebook_set_scrollable(GTK_NOTEBOOK(panel->pr_notebook), TRUE); /* applets */ widget = _preferences_window_general(panel); gtk_notebook_append_page(GTK_NOTEBOOK(panel->pr_notebook), widget, gtk_label_new(_("General"))); /* panels */ widget = _preferences_window_panels(panel); gtk_notebook_append_page(GTK_NOTEBOOK(panel->pr_notebook), widget, gtk_label_new(_("Panels"))); #if GTK_CHECK_VERSION(2, 14, 0) vbox = gtk_dialog_get_content_area(GTK_DIALOG(panel->pr_window)); #else vbox = GTK_DIALOG(panel->pr_window)->vbox; #endif gtk_box_pack_start(GTK_BOX(vbox), panel->pr_notebook, TRUE, TRUE, 0); _preferences_on_response_cancel(panel); gtk_widget_show_all(vbox); } static GtkWidget * _preferences_window_general(Panel * panel) { GtkWidget * vbox; #if GTK_CHECK_VERSION(3, 0, 0) vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); #else vbox = gtk_vbox_new(FALSE, 4); #endif panel->pr_accept_focus = gtk_check_button_new_with_mnemonic( _("Accept focus")); gtk_box_pack_start(GTK_BOX(vbox), panel->pr_accept_focus, FALSE, TRUE, 0); panel->pr_keep_above = gtk_check_button_new_with_mnemonic( _("Keep above other windows")); gtk_box_pack_start(GTK_BOX(vbox), panel->pr_keep_above, FALSE, TRUE, 0); return vbox; } static GtkWidget * _preferences_window_panel(Panel * panel) { const char * titles[PANEL_POSITION_COUNT] = { N_("Bottom panel:"), N_("Top panel:"), N_("Left panel:"), N_("Right panel:") }; GtkWidget * frame; GtkWidget * vbox3; GtkWidget * widget; size_t i; size_t j; frame = gtk_frame_new(NULL); #if GTK_CHECK_VERSION(2, 24, 0) widget = gtk_combo_box_text_new(); #else widget = gtk_combo_box_new_text(); #endif panel->pr_panels_panel = widget; gtk_frame_set_label_widget(GTK_FRAME(frame), widget); #if GTK_CHECK_VERSION(3, 0, 0) vbox3 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); #else vbox3 = gtk_vbox_new(FALSE, 4); #endif gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4); for(i = 0; i < sizeof(titles) / sizeof(*titles); i++) { #if GTK_CHECK_VERSION(2, 24, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _(titles[i])); #else gtk_combo_box_append_text(GTK_COMBO_BOX(widget), _(titles[i])); #endif /* enabled */ panel->pr_panels[i].enabled = gtk_check_button_new_with_mnemonic( _("_Enabled")); g_signal_connect_swapped(panel->pr_panels[i].enabled, "toggled", G_CALLBACK(_preferences_on_panel_toggled), panel); gtk_box_pack_start(GTK_BOX(vbox3), panel->pr_panels[i].enabled, FALSE, TRUE, 0); gtk_widget_set_no_show_all(panel->pr_panels[i].enabled, TRUE); /* size */ #if GTK_CHECK_VERSION(2, 24, 0) panel->pr_panels[i].size = gtk_combo_box_text_new(); gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(panel->pr_panels[i].size), _("Default")); #else panel->pr_panels[i].size = gtk_combo_box_new_text(); gtk_combo_box_append_text( GTK_COMBO_BOX(panel->pr_panels[i].size), _("Default")); #endif for(j = 0; j < sizeof(_panel_sizes) / sizeof(*_panel_sizes); j++) { #if GTK_CHECK_VERSION(2, 24, 0) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT( panel->pr_panels[i].size), _(_panel_sizes[j].alias)); #else gtk_combo_box_append_text( GTK_COMBO_BOX(panel->pr_panels[i].size), _(_panel_sizes[j].alias)); #endif } gtk_widget_set_no_show_all(panel->pr_panels[i].size, TRUE); gtk_box_pack_start(GTK_BOX(vbox3), panel->pr_panels[i].size, FALSE, TRUE, 0); panel->pr_panels[i].store = _preferences_window_panels_model(); } gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0); g_signal_connect_swapped(widget, "changed", G_CALLBACK( _preferences_on_panel_changed), panel); widget = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(widget), GTK_SHADOW_ETCHED_IN); panel->pr_panels_view = _preferences_window_panels_view(NULL, TRUE); gtk_container_add(GTK_CONTAINER(widget), panel->pr_panels_view); gtk_box_pack_start(GTK_BOX(vbox3), widget, TRUE, TRUE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox3); return frame; } static GtkWidget * _preferences_window_panels(Panel * panel) { GtkWidget * vbox; GtkWidget * vbox2; GtkWidget * hbox; GtkWidget * frame; GtkWidget * widget; #if GTK_CHECK_VERSION(3, 0, 0) vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); #else vbox = gtk_vbox_new(FALSE, 4); #endif gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); #if GTK_CHECK_VERSION(3, 0, 0) hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4); #else hbox = gtk_hbox_new(FALSE, 4); #endif /* applets */ frame = gtk_frame_new(_("Applets:")); widget = gtk_scrolled_window_new(NULL, NULL); gtk_container_set_border_width(GTK_CONTAINER(widget), 4); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(widget), GTK_SHADOW_ETCHED_IN); panel->pr_store = _preferences_window_panels_model(); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(panel->pr_store), 2, GTK_SORT_ASCENDING); panel->pr_view = _preferences_window_panels_view(panel->pr_store, FALSE); gtk_container_add(GTK_CONTAINER(widget), panel->pr_view); gtk_container_add(GTK_CONTAINER(frame), widget); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); /* controls */ #if GTK_CHECK_VERSION(3, 0, 0) vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); #else vbox2 = gtk_vbox_new(FALSE, 4); #endif /* remove */ widget = gtk_button_new(); gtk_button_set_image(GTK_BUTTON(widget), #if GTK_CHECK_VERSION(3, 10, 0) gtk_image_new_from_icon_name( #else gtk_image_new_from_stock( #endif GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON)); g_signal_connect_swapped(widget, "clicked", G_CALLBACK( _preferences_on_panel_remove), panel); gtk_box_pack_end(GTK_BOX(vbox2), widget, FALSE, TRUE, 0); #ifndef EMBEDDED /* bottom */ widget = gtk_button_new(); gtk_button_set_image(GTK_BUTTON(widget), #if GTK_CHECK_VERSION(3, 10, 0) gtk_image_new_from_icon_name( #else gtk_image_new_from_stock( #endif GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON)); g_signal_connect_swapped(widget, "clicked", G_CALLBACK( _preferences_on_panel_down), panel); gtk_box_pack_end(GTK_BOX(vbox2), widget, FALSE, TRUE, 0); /* top */ widget = gtk_button_new(); gtk_button_set_image(GTK_BUTTON(widget), #if GTK_CHECK_VERSION(3, 10, 0) gtk_image_new_from_icon_name( #else gtk_image_new_from_stock( #endif GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON)); g_signal_connect_swapped(widget, "clicked", G_CALLBACK( _preferences_on_panel_up), panel); gtk_box_pack_end(GTK_BOX(vbox2), widget, FALSE, TRUE, 0); #endif /* add */ widget = gtk_button_new(); gtk_button_set_image(GTK_BUTTON(widget), #if GTK_CHECK_VERSION(3, 10, 0) gtk_image_new_from_icon_name( #else gtk_image_new_from_stock( #endif GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON)); g_signal_connect_swapped(widget, "clicked", G_CALLBACK( _preferences_on_panel_add), panel); gtk_box_pack_end(GTK_BOX(vbox2), widget, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); #if GTK_CHECK_VERSION(3, 0, 0) vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4); #else vbox2 = gtk_vbox_new(FALSE, 4); #endif /* panel applets */ frame = _preferences_window_panel(panel); gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); return vbox; } static void _preferences_window_panels_add(GtkListStore * store, char const * name) { Plugin * p; PanelAppletDefinition * pad; GtkTreeIter iter; GtkIconTheme * theme; GdkPixbuf * pixbuf = NULL; if((p = plugin_new(LIBDIR, PACKAGE, "applets", name)) == NULL) return; if((pad = plugin_lookup(p, "applet")) == NULL) { plugin_delete(p); return; } theme = gtk_icon_theme_get_default(); if(pad->icon != NULL) pixbuf = gtk_icon_theme_load_icon(theme, pad->icon, 24, 0, NULL); if(pixbuf == NULL) pixbuf = gtk_icon_theme_load_icon(theme, "gnome-settings", 24, 0, NULL); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, name, 1, pixbuf, 2, _(pad->name), -1); plugin_delete(p); } static GtkListStore * _preferences_window_panels_model(void) { return gtk_list_store_new(3, G_TYPE_STRING, /* name */ GDK_TYPE_PIXBUF, /* icon */ G_TYPE_STRING); /* full name */ } static GtkWidget * _preferences_window_panels_view(GtkListStore * store, gboolean reorderable) { GtkWidget * view; GtkTreeSelection * treesel; GtkCellRenderer * renderer; GtkTreeViewColumn * column; view = (store != NULL) ? gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)) : gtk_tree_view_new(); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); gtk_tree_view_set_reorderable(GTK_TREE_VIEW(view), reorderable); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); gtk_tree_selection_set_mode(treesel, GTK_SELECTION_SINGLE); renderer = gtk_cell_renderer_pixbuf_new(); column = gtk_tree_view_column_new_with_attributes("", renderer, "pixbuf", 1, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); renderer = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 2, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(view), column); return view; } static gboolean _preferences_on_closex(gpointer data) { Panel * panel = data; _preferences_on_response_cancel(panel); return TRUE; } static void _preferences_on_response(GtkWidget * widget, gint response, gpointer data) { if(response == GTK_RESPONSE_APPLY) _preferences_on_response_apply(data); else { if(response == GTK_RESPONSE_OK) _preferences_on_response_ok(data); else if(response == GTK_RESPONSE_CANCEL) _preferences_on_response_cancel(data); gtk_widget_hide(widget); } } static void _preferences_on_response_apply(gpointer data) { Panel * panel = data; gint i; gint cnt; GtkWidget * widget; PanelAppletDefinition * pad; PanelApplet * pa; size_t j; /* general */ if(config_set(panel->config, NULL, "accept_focus", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( panel->pr_accept_focus)) ? "1" : "0") != 0) panel_error(NULL, NULL, 1); if(config_set(panel->config, NULL, "keep_above", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( panel->pr_keep_above)) ? "1" : "0") != 0) panel_error(NULL, NULL, 1); /* panels */ for(j = 0; j < sizeof(panel->pr_panels) / sizeof(*panel->pr_panels); j++) _preferences_on_response_apply_panel(panel, j); /* XXX applets should be known from Panel already */ cnt = gtk_notebook_get_n_pages(GTK_NOTEBOOK(panel->pr_notebook)); for(i = 1; i < cnt; i++) { widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK( panel->pr_notebook), i); if(widget == NULL || (pad = g_object_get_data(G_OBJECT(widget), "definition")) == NULL || (pa = g_object_get_data(G_OBJECT(widget), "applet")) == NULL) continue; pad->settings(pa, TRUE, FALSE); } /* remove the applets from every active panel */ for(j = 0; j < sizeof(panel->windows) / sizeof(*panel->windows); j++) if(panel->windows[j] != NULL) panel_window_remove_all(panel->windows[j]); panel_reset(panel); } static void _preferences_on_response_apply_panel(Panel * panel, PanelPosition position) { char const * section; gint i; const gint cnt = sizeof(_panel_sizes) / sizeof(*_panel_sizes); GtkTreeModel * model; GtkTreeIter iter; gboolean valid; gboolean enabled; gchar * p; String * value; String * sep; String * s; section = _panel_get_section(panel, position); if((s = string_new_append("panel::", section, NULL)) == NULL) { panel_error(NULL, NULL, 1); return; } enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( panel->pr_panels[position].enabled)); if(config_set(panel->config, s, "enabled", enabled ? "1" : "0") != 0) panel_error(NULL, NULL, 1); i = gtk_combo_box_get_active( GTK_COMBO_BOX(panel->pr_panels[position].size)); if(i >= 0 && i <= cnt) if(config_set(panel->config, s, "size", (i > 0) ? _panel_sizes[i - 1].name : NULL) != 0) panel_error(NULL, NULL, 1); model = GTK_TREE_MODEL(panel->pr_panels[position].store); value = NULL; sep = ""; for(valid = gtk_tree_model_get_iter_first(model, &iter); valid == TRUE; valid = gtk_tree_model_iter_next(model, &iter)) { gtk_tree_model_get(model, &iter, 0, &p, -1); string_append(&value, sep); string_append(&value, p); sep = ","; g_free(p); } if(config_set(panel->config, s, "applets", value) != 0) panel_error(NULL, NULL, 1); string_delete(value); string_delete(s); } static void _preferences_on_response_cancel(gpointer data) { Panel * panel = data; size_t i; size_t cnt = sizeof(_panel_sizes) / sizeof(*_panel_sizes); GtkWidget * widget; PanelAppletDefinition * pad; PanelApplet * pa; gtk_widget_hide(panel->pr_window); /* general */ _cancel_general(panel); /* applets */ _cancel_applets(panel); /* XXX applets should be known from Panel already */ cnt = gtk_notebook_get_n_pages(GTK_NOTEBOOK(panel->pr_notebook)); for(i = 1; i < cnt; i++) { widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK( panel->pr_notebook), i); if(widget == NULL || (pad = g_object_get_data(G_OBJECT(widget), "definition")) == NULL || (pa = g_object_get_data(G_OBJECT(widget), "applet")) == NULL) continue; pad->settings(pa, FALSE, TRUE); } gtk_notebook_set_current_page(GTK_NOTEBOOK(panel->pr_notebook), 0); } static void _cancel_applets(Panel * panel) { DIR * dir; struct dirent * de; #ifdef __APPLE__ char const ext[] = ".dylib"; #else char const ext[] = ".so"; #endif size_t len; String const * section; String * s; char const * p; char * q; gboolean enabled; char c; size_t i; size_t j; const size_t cnt = sizeof(_panel_sizes) / sizeof(*_panel_sizes); gtk_list_store_clear(panel->pr_store); for(j = 0; j < sizeof(panel->pr_panels) / sizeof(*panel->pr_panels); j++) gtk_list_store_clear(panel->pr_panels[j].store); if((dir = opendir(LIBDIR "/" PACKAGE "/applets")) == NULL) return; /* applets */ while((de = readdir(dir)) != NULL) { if((len = strlen(de->d_name)) < sizeof(ext)) continue; if(strcmp(&de->d_name[len - sizeof(ext) + 1], ext) != 0) continue; de->d_name[len - sizeof(ext) + 1] = '\0'; #ifdef DEBUG fprintf(stderr, "DEBUG: %s() \"%s\"\n", __func__, de->d_name); #endif _preferences_window_panels_add(panel->pr_store, de->d_name); } closedir(dir); /* panels */ for(j = 0; j < sizeof(panel->pr_panels) / sizeof(*panel->pr_panels); j++) { section = _panel_get_section(panel, j); if((s = string_new_append("panel::", section, NULL)) == NULL) { panel_error(NULL, NULL, 1); continue; } /* enabled */ enabled = ((p = panel_get_config(panel, s, "enabled")) != NULL && strtol(p, NULL, 0) != 0) ? TRUE : FALSE; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( panel->pr_panels[j].enabled), enabled); /* applets */ p = _panel_get_applets(panel, j); q = (p != NULL) ? strdup(p) : NULL; for(i = 0, p = q; q != NULL; i++) { if(q[i] != '\0' && q[i] != ',') continue; c = q[i]; q[i] = '\0'; _preferences_window_panels_add( panel->pr_panels[j].store, p); if(c == '\0') break; p = &q[i + 1]; } free(q); /* size */ if((p = panel_get_config(panel, s, "size")) == NULL && (p = panel_get_config(panel, NULL, "size")) == NULL) gtk_combo_box_set_active(GTK_COMBO_BOX( panel->pr_panels[j].size), 0); else for(i = 0; i < cnt; i++) { if(strcmp(p, _panel_sizes[i].name) != 0) continue; gtk_combo_box_set_active(GTK_COMBO_BOX( panel->pr_panels[j].size), i + 1); break; } string_delete(s); } _preferences_on_panel_changed(panel); } static void _cancel_general(Panel * panel) { char const * p; gboolean b; b = ((p = panel_get_config(panel, NULL, "accept_focus")) == NULL || strcmp(p, "1") == 0) ? TRUE : FALSE; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel->pr_accept_focus), b); b = ((p = panel_get_config(panel, NULL, "keep_above")) == NULL || strcmp(p, "1") == 0) ? TRUE : FALSE; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel->pr_keep_above), b); } static void _preferences_on_panel_toggled(gpointer data) { Panel * panel = data; PanelPosition position; size_t i; gboolean active; position = gtk_combo_box_get_active(GTK_COMBO_BOX( panel->pr_panels_panel)); for(i = 0; i < sizeof(panel->pr_panels) / sizeof(*panel->pr_panels); i++) { active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( panel->pr_panels[i].enabled)); gtk_widget_set_sensitive(panel->pr_panels[i].size, active); if(i == position) gtk_widget_set_sensitive(panel->pr_panels_view, active); } } static void _preferences_on_response_ok(gpointer data) { Panel * panel = data; gtk_widget_hide(panel->pr_window); _preferences_on_response_apply(panel); panel_save(panel); } static void _preferences_on_panel_add(gpointer data) { Panel * panel = data; PanelPosition position; GtkTreeModel * model; GtkTreeIter iter; GtkTreeSelection * treesel; gchar * p; position = gtk_combo_box_get_active(GTK_COMBO_BOX( panel->pr_panels_panel)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(panel->pr_view)); if(!gtk_tree_selection_get_selected(treesel, &model, &iter)) return; gtk_tree_model_get(model, &iter, 0, &p, -1); _preferences_window_panels_add(panel->pr_panels[position].store, p); g_free(p); } static void _preferences_on_panel_changed(gpointer data) { Panel * panel = data; PanelPosition position; size_t i; gboolean active; position = gtk_combo_box_get_active(GTK_COMBO_BOX( panel->pr_panels_panel)); for(i = 0; i < PANEL_POSITION_COUNT; i++) if(i == position) { gtk_widget_show(panel->pr_panels[i].enabled); gtk_widget_show(panel->pr_panels[i].size); } else { gtk_widget_hide(panel->pr_panels[i].enabled); gtk_widget_hide(panel->pr_panels[i].size); } active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( panel->pr_panels[position].enabled)); gtk_widget_set_sensitive(panel->pr_panels_view, active); gtk_tree_view_set_model(GTK_TREE_VIEW(panel->pr_panels_view), GTK_TREE_MODEL(panel->pr_panels[position].store)); } static void _preferences_on_panel_down(gpointer data) { Panel * panel = data; PanelPosition position; GtkTreeModel * model; GtkTreeIter iter; GtkTreeIter iter2; GtkTreeSelection * treesel; position = gtk_combo_box_get_active(GTK_COMBO_BOX( panel->pr_panels_panel)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW( panel->pr_panels_view)); if(!gtk_tree_selection_get_selected(treesel, &model, &iter)) return; iter2 = iter; if(!gtk_tree_model_iter_next(model, &iter)) return; gtk_list_store_swap(panel->pr_panels[position].store, &iter, &iter2); } static void _preferences_on_panel_remove(gpointer data) { Panel * panel = data; GtkTreeModel * model; GtkTreeIter iter; GtkTreeSelection * treesel; treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW( panel->pr_panels_view)); if(gtk_tree_selection_get_selected(treesel, &model, &iter)) gtk_list_store_remove(GTK_LIST_STORE(model), &iter); } static void _preferences_on_panel_up(gpointer data) { Panel * panel = data; PanelPosition position; GtkTreeModel * model; GtkTreeIter iter; GtkTreeIter iter2; GtkTreePath * path; GtkTreeSelection * treesel; position = gtk_combo_box_get_active(GTK_COMBO_BOX( panel->pr_panels_panel)); treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW( panel->pr_panels_view)); if(!gtk_tree_selection_get_selected(treesel, &model, &iter)) return; path = gtk_tree_model_get_path(model, &iter); gtk_tree_path_prev(path); gtk_tree_model_get_iter(model, &iter2, path); gtk_tree_path_free(path); gtk_list_store_swap(panel->pr_panels[position].store, &iter, &iter2); } /* private */ /* functions */ /* accessors */ /* panel_can_shutdown */ static gboolean _panel_can_shutdown(void) { char const shutdown[] = "/sbin/shutdown"; if(geteuid() == 0) return TRUE; return (access(shutdown, R_OK | X_OK) == 0) ? TRUE : FALSE; } /* panel_can_suspend */ static gboolean _panel_can_suspend(void) { #ifdef __NetBSD__ char const * names[] = { "machdep.sleep_state", "hw.acpi.sleep.state" }; int sleep_state = -1; size_t size = sizeof(sleep_state); /* FIXME check that this works properly */ if(sysctlbyname(names[0], &sleep_state, &size, NULL, 0) == 0 && sleep_state == 0 && sysctlbyname(names[0], &sleep_state, &size, &sleep_state, size) == 0) return TRUE; if(sysctlbyname(names[1], &sleep_state, &size, NULL, 0) == 0 && sleep_state == 0 && sysctlbyname(names[1], &sleep_state, &size, &sleep_state, size) == 0) return TRUE; #else struct stat st; if(access("/sys/power/state", W_OK) == 0) return TRUE; if(lstat("/proc/apm", &st) == 0) return TRUE; #endif return FALSE; } /* panel_get_applets */ static char const * _panel_get_applets(Panel * panel, PanelPosition position) { #ifndef EMBEDDED char const * applets = "menu,desktop,lock,logout,pager,tasks" ",gsm,gps,bluetooth,battery,cpufreq,volume,embed,systray,clock"; #else /* EMBEDDED */ /* XXX the "keyboard" applet is in a separate repository now */ char const * applets = "menu,desktop,keyboard,tasks,spacer" ",gsm,gps,bluetooth,battery,cpufreq,volume,embed,systray,clock" ",close"; #endif String const * section; String * s; String const * p = NULL; section = _panel_get_section(panel, position); if((s = string_new_append("panel::", section, NULL)) == NULL) return NULL; switch(position) { case PANEL_POSITION_LEFT: case PANEL_POSITION_RIGHT: case PANEL_POSITION_TOP: p = panel_get_config(panel, s, "applets"); break; case PANEL_POSITION_BOTTOM: p = panel_get_config(panel, s, "applets"); if(p == NULL) p = panel_get_config(panel, NULL, "applets"); if(p == NULL) p = applets; break; } string_delete(s); return p; } /* panel_get_section */ static char const * _panel_get_section(Panel * panel, PanelPosition position) { char const * sections[PANEL_POSITION_COUNT] = { "bottom", "top", "left", "right" }; (void) panel; return sections[position]; } /* useful */ /* panel_reset */ static void _panel_reset(Panel * panel, GdkRectangle * rect) { gdk_screen_get_monitor_geometry(panel->screen, (panel->prefs.monitor > 0 && panel->prefs.monitor < gdk_screen_get_n_monitors(panel->screen)) ? panel->prefs.monitor : 0, rect); panel->root_height = rect->height; panel->root_width = rect->width; }
DeforaOS/Panel
src/panel.c
C
gpl-3.0
42,512
' UITypeEditor for Pipe Results ' Copyright 2008 Daniel Wagner O. de Medeiros ' ' This file is part of DWSIM. ' ' DWSIM is free software: you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation, either version 3 of the License, or ' (at your option) any later version. ' ' DWSIM is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with DWSIM. If not, see <http://www.gnu.org/licenses/>. Imports System.Windows.Forms.Design Imports System.Drawing.Design Imports System.ComponentModel Namespace DWSIM.Editors.Results <System.Serializable()> Public Class UIFormTable Inherits System.Drawing.Design.UITypeEditor Private editorService As IWindowsFormsEditorService Public Overrides Function GetEditStyle(ByVal context As System.ComponentModel.ITypeDescriptorContext) As UITypeEditorEditStyle Return UITypeEditorEditStyle.Modal End Function Public Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As Object) As Object If (provider IsNot Nothing) Then editorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), _ IWindowsFormsEditorService) End If If (editorService IsNot Nothing) Then Dim selectionControl As New UnitOperations.EditingForm_Pipe_ResultsTable selectionControl.PipeOp = value Dim f As New Form f.Controls.Add(selectionControl) f.Size = selectionControl.Size editorService.ShowDialog(f) End If Return value End Function End Class End Namespace
DanWBR/dwsim5
DWSIM/Forms/LegacyEditors/UITypeEditors/Results/Pipe/UIFormTable.vb
Visual Basic
gpl-3.0
2,118
package architecture.dao.impl; import architecture.dao.BaseDao; import architecture.jest.BeanResult; import architecture.jest.ClientFactory; import architecture.jest.JestService; import architecture.utils.JsonMapping; import architecture.utils.SRSLogger; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.searchbox.client.JestClient; import io.searchbox.client.JestResult; import io.searchbox.core.DocumentResult; import io.searchbox.core.SearchResult; import org.springframework.stereotype.Repository; import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * base dao template impl * */ @Repository public class BaseDaoImpl<T> implements BaseDao<T> { @Resource private ClientFactory clientFactory; @Resource private JestService jestService; @Resource private SRSLogger logger; private final String INDEX_NAME = "srs"; public List<BeanResult<T>> findAll(int offset, int size, String type, Class<T> clazz) { JestClient client = clientFactory.getClient(); Map<String,Object> query = new HashMap<>(); if (offset>=0 && size>=0) { query.put("size",size); query.put("from", offset); } String queryJson = JsonMapping.toJson(query); SearchResult result = jestService.search(client,INDEX_NAME,type,queryJson); List<BeanResult<T>> results = new ArrayList<>(); if (result!=null && result.isSucceeded()) { List<SearchResult.Hit<T,Void>> hits = result.getHits(clazz); JsonObject jsonObject = result.getJsonObject(); JsonArray hitsArray = jsonObject.getAsJsonObject("hits").getAsJsonArray("hits"); for (int i = 0; i < result.getTotal()&&i<hitsArray.size(); i++) { JsonObject object = hitsArray.get(i).getAsJsonObject(); results.add(new BeanResult<T>(hits.get(i).source,object.get("_id").getAsString())); } } else { logger.log(BaseDaoImpl.class, result==null?"null result":result.getErrorMessage()); } return results; } public BeanResult<T> create(T entity, String type, Class<T> clazz) { JestClient client = clientFactory.getClient(); DocumentResult result = jestService.index(client,INDEX_NAME, type, entity); if (result!=null && result.isSucceeded()) { return new BeanResult<T>(findById(result.getId(), type, clazz),result.getId()); } else { logger.log(BaseDaoImpl.class, result==null?"null result":result.getErrorMessage()); } return null; } public T update(T entity, String id, String type, Class<T> clazz) { JestClient client = clientFactory.getClient(); DocumentResult result = jestService.index(client,INDEX_NAME, type, id+"", entity); if (result!=null && result.isSucceeded()) { return result.getSourceAsObject(clazz); } else { logger.log(BaseDaoImpl.class, result==null?"null result":result.getErrorMessage()); } return null; } public T findById(String id, String type, Class<T> clazz) { JestClient client = clientFactory.getClient(); JestResult result = jestService.get(client,INDEX_NAME, type, id+""); if (result!=null && result.isSucceeded()) { return result.getSourceAsObject(clazz); } else { logger.log(BaseDaoImpl.class, result==null?"null result":result.getErrorMessage()); } return null; } public T delete(String id, String type, Class<T> clazz) { JestClient client = clientFactory.getClient(); T data = findById(id, type, clazz); JestResult result = jestService.delete(client, INDEX_NAME, type, id); if (result!=null && result.isSucceeded()) { return data; } else { logger.log(BaseDaoImpl.class, result==null?"null result":result.getErrorMessage()); } return null; } }
ArchitectureNJU/PriceParity
src/main/java/architecture/dao/impl/BaseDaoImpl.java
Java
gpl-3.0
4,115
<?php /** * Copyright 2011-2017 Nick Korbel * * This file is part of Booked Scheduler. * * Booked Scheduler is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Booked Scheduler is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Booked Scheduler. If not, see <http://www.gnu.org/licenses/>. */ require_once(ROOT_DIR . 'Domain/Access/namespace.php'); require_once(ROOT_DIR . 'Presenters/ActionPresenter.php'); require_once(ROOT_DIR . 'lib/Application/Authorization/namespace.php'); require_once(ROOT_DIR . 'lib/Email/Messages/AnnouncementEmail.php'); class ManageAnnouncementsActions { const Add = 'addAnnouncement'; const Change = 'changeAnnouncement'; const Delete = 'deleteAnnouncement'; const Email = 'emailAnnouncement'; } class ManageAnnouncementsPresenter extends ActionPresenter { /** * @var IManageAnnouncementsPage */ private $page; /** * @var IAnnouncementRepository */ private $announcementRepository; /** * @var IGroupViewRepository */ private $groupViewRepository; /** * @var IResourceRepository */ private $resourceRepository; /** * @var IPermissionService */ private $permissionService; /** * @var IUserViewRepository */ private $userViewRepository; /** * @param IManageAnnouncementsPage $page * @param IAnnouncementRepository $announcementRepository * @param IGroupViewRepository $groupViewRepository * @param IResourceRepository $resourceRepository * @param IPermissionService $permissionService * @param IUserViewRepository $userViewRepository */ public function __construct(IManageAnnouncementsPage $page, IAnnouncementRepository $announcementRepository, IGroupViewRepository $groupViewRepository, IResourceRepository $resourceRepository, IPermissionService $permissionService, IUserViewRepository $userViewRepository) { parent::__construct($page); $this->page = $page; $this->announcementRepository = $announcementRepository; $this->groupViewRepository = $groupViewRepository; $this->resourceRepository = $resourceRepository; $this->permissionService = $permissionService; $this->userViewRepository = $userViewRepository; $this->AddAction(ManageAnnouncementsActions::Add, 'AddAnnouncement'); $this->AddAction(ManageAnnouncementsActions::Change, 'ChangeAnnouncement'); $this->AddAction(ManageAnnouncementsActions::Delete, 'DeleteAnnouncement'); $this->AddAction(ManageAnnouncementsActions::Email, 'EmailAnnouncement'); } public function PageLoad() { $this->page->BindAnnouncements($this->announcementRepository->GetAll($this->page->GetSortField(), $this->page->GetSortDirection())); $this->page->BindGroups($this->GetGroups()); $this->page->BindResources($this->GetResources()); } public function AddAnnouncement() { $user = ServiceLocator::GetServer()->GetUserSession(); $text = $this->page->GetText(); $start = Date::Parse($this->page->GetStart(), $user->Timezone); $end = Date::Parse($this->page->GetEnd(), $user->Timezone); $priority = $this->page->GetPriority(); $groupIds = $this->page->GetGroups(); $resourceIds = $this->page->GetResources(); $sendAsEmail = $this->page->GetSendAsEmail(); Log::Debug('Adding new Announcement'); $announcement = Announcement::Create($text, $start, $end, $priority, $groupIds, $resourceIds); $this->announcementRepository->Add($announcement); if ($sendAsEmail) { $this->SendAsEmail($announcement, $user); } } public function ChangeAnnouncement() { $user = ServiceLocator::GetServer()->GetUserSession(); $id = $this->page->GetAnnouncementId(); $text = $this->page->GetText(); $start = Date::Parse($this->page->GetStart(), $user->Timezone); $end = Date::Parse($this->page->GetEnd(), $user->Timezone); $priority = $this->page->GetPriority(); Log::Debug('Changing Announcement with id %s', $id); $announcement = $this->announcementRepository->LoadById($id); $announcement->SetText($text); $announcement->SetDates($start, $end); $announcement->SetPriority($priority); $this->announcementRepository->Update($announcement); } public function DeleteAnnouncement() { $id = $this->page->GetAnnouncementId(); Log::Debug('Deleting Announcement with id %s', $id); $this->announcementRepository->Delete($id); } public function EmailAnnouncement() { $announcementId = $this->page->GetAnnouncementId(); $announcement = $this->announcementRepository->LoadById($announcementId); $this->SendAsEmail($announcement, ServiceLocator::GetServer()->GetUserSession()); } private function SendAsEmail(Announcement $announcement, UserSession $user) { $usersToSendTo = $this->GetUsersToSendTo($announcement, $user); $emailService = ServiceLocator::GetEmailService(); foreach ($usersToSendTo as $userToSendTo) { $emailService->Send(new AnnouncementEmail($announcement->Text(), $user, $userToSendTo)); } } /** * @return GroupItemView[] */ private function GetGroups() { /** @var GroupItemView[] $groups */ $groups = $this->groupViewRepository->GetList()->Results(); $indexedGroups = array(); foreach ($groups as $group) { $indexedGroups[$group->Id] = $group; } return $indexedGroups; } /** * @return BookableResource[] */ private function GetResources() { /** @var BookableResource[] $resources */ $resources = $this->resourceRepository->GetList(null, null)->Results(); $indexedResources = array(); foreach ($resources as $resource) { $indexedResources[$resource->GetId()] = $resource; } return $indexedResources; } public function ProcessDataRequest($dataRequest) { if ($dataRequest == 'emailCount') { $announcementId = $this->page->GetAnnouncementId(); $announcement = $this->announcementRepository->LoadById($announcementId); $user = ServiceLocator::GetServer()->GetUserSession(); $this->page->BindNumberOfUsersToBeSent(count($this->GetUsersToSendTo($announcement, $user))); } } /** * @param Announcement $announcement * @param UserSession $user * @return UserItemView[] */ private function GetUsersToSendTo(Announcement $announcement, UserSession $user) { $allUsers = array(); $usersToSendTo = array(); $validUsers = array(); $groupIds = $announcement->GroupIds(); $resourceIds = $announcement->ResourceIds(); if (empty($groupIds) && empty($resourceIds)) { $userList = $this->userViewRepository->GetList(null, null, null, null, null, AccountStatus::ACTIVE)->Results(); foreach ($userList as $user) { $allUsers[$user->Id] = $user; $usersToSendTo[] = $user->Id; } return array($allUsers, $usersToSendTo); } else { $groupUserIds = array(); $resourceUserIds = array(); $groupUsers = $this->groupViewRepository->GetUsersInGroup($announcement->GroupIds())->Results(); foreach ($groupUsers as $groupUser) { $groupUserIds[] = $groupUser->Id; $allUsers[$groupUser->Id] = $groupUser; } foreach ($announcement->ResourceIds() as $resourceId) { $resourceUsers = $this->resourceRepository->GetUsersWithPermissionsIncludingGroups($resourceId)->Results(); foreach ($resourceUsers as $resourceUser) { $resourceUserIds[] = $resourceUser->Id; $allUsers[$resourceUser->Id] = $resourceUser; } } //Log::Debug(var_export($groupUserIds, true)); //Log::Debug(var_export($resourceUserIds, true)); $usersToSendTo = array_unique(array_merge($groupUserIds, $resourceUserIds)); // Log::Debug(var_export($usersToSendTo, true)); foreach ($usersToSendTo as $userId) { $validUsers[] = $allUsers[$userId]; } return $validUsers; } } }
rafaelperazzo/ufca-web
booked/Presenters/Admin/ManageAnnouncementsPresenter.php
PHP
gpl-3.0
9,452
#!/usr/bin/env node 'use strict'; var colors = require('ansicolors') var table = require('text-table') if (process.argv.length < 3) { fromStdin(); } else { var steps= require(process.argv[2]).steps print(steps); } function fromStdin() { var data = []; function onerror(err) { console.error('gai-pring-js ', err) } process.stdin .on('data', ondata) .on('end', onend) .on('error', onerror) function ondata(d) { data.push(d); } function onend() { var json = Buffer.concat(data).toString(); try { print(JSON.parse(json).steps); } catch(err) { console.error(json); console.error(err); } } } function tableize(step) { var first = true; function toString(acc, k) { if (k === 'eip') return acc; // instruction pointer always changes and isn't important here var d = step.diff[k]; var s = acc; s += first ? ';' : ','; s += ' ' + k + ': ' + d.prev.hex + ' -> ' + d.curr.hex; if (k === 'eflags') s += ' ' + d.curr.flagsString; first = false; return s; } var diffString = step.diff ? Object.keys(step.diff).reduce(toString, '') : '' var m = step.instruction.match(/^([a-f0-9]{2} )+/); var opcodes = m[0].trim() , inst = step.instruction.replace(opcodes, '').trim(); return [ colors.brightBlack(step.address), colors.brightBlue(opcodes), colors.green(inst), colors.brightBlack(diffString) ]; } function print(steps) { var tableized = steps.map(tableize); console.log(table(tableized)); }
thlorenz/gai
gai-print.js
JavaScript
gpl-3.0
1,525
/* LIBGIMP - The GIMP Library * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * * gimpstringcombobox.h * Copyright (C) 2007 Sven Neumann <sven@gimp.org> * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef __GIMP_STRING_COMBO_BOX_H__ #define __GIMP_STRING_COMBO_BOX_H__ G_BEGIN_DECLS #define GIMP_TYPE_STRING_COMBO_BOX (gimp_string_combo_box_get_type ()) #define GIMP_STRING_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBox)) #define GIMP_STRING_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBoxClass)) #define GIMP_IS_STRING_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_STRING_COMBO_BOX)) #define GIMP_IS_STRING_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_STRING_COMBO_BOX)) #define GIMP_STRING_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_STRING_COMBO_BOX, GimpStringComboBoxClass)) typedef struct _GimpStringComboBoxClass GimpStringComboBoxClass; struct _GimpStringComboBox { GtkComboBox parent_instance; /*< private >*/ gpointer priv; }; struct _GimpStringComboBoxClass { GtkComboBoxClass parent_class; /* Padding for future expansion */ void (* _gimp_reserved1) (void); void (* _gimp_reserved2) (void); void (* _gimp_reserved3) (void); void (* _gimp_reserved4) (void); }; GType gimp_string_combo_box_get_type (void) G_GNUC_CONST; GtkWidget * gimp_string_combo_box_new (GtkTreeModel *model, gint id_column, gint label_column); gboolean gimp_string_combo_box_set_active (GimpStringComboBox *combo_box, const gchar *id); gchar * gimp_string_combo_box_get_active (GimpStringComboBox *combo_box); G_END_DECLS #endif /* __GIMP_STRING_COMBO_BOX_H__ */
MichaelMure/Gimp-Cage-Tool
libgimpwidgets/gimpstringcombobox.h
C
gpl-3.0
2,656
package com.fr.grid; import com.fr.design.constants.UIConstants; import java.awt.*; public abstract class GridHeader<T> extends BaseGridComponent { public final static int SIZE_ADJUST = 4; //属性 private Color separatorLineColor = UIConstants.RULER_LINE_COLOR; //separator lines private Color selectedForeground = Color.black; private Color selectedBackground = new Color(208, 240, 252); protected int resolution; public GridHeader() { //清除所有的Key Action. this.getInputMap().clear(); this.getActionMap().clear(); this.setFocusable(false); this.setOpaque(true); initByConstructor(); } public void setResolution(int resolution) { this.resolution = resolution; } public int getResolution() { return this.resolution; } protected abstract void initByConstructor(); protected abstract T getDisplay(int index); /** * Gets separator line color. * * @return the separator line color. */ public Color getSeparatorLineColor() { return this.separatorLineColor; } /** * Sets row separator line color. * * @param separatorLineColor the new row color of separator line. */ public void setSeparatorLineColor(Color separatorLineColor) { Color old = this.separatorLineColor; this.separatorLineColor = separatorLineColor; this.firePropertyChange("separatorLineColor", old, this.separatorLineColor); this.repaint(); } /** * Gets selected foreground. * * @return the selected foreground. */ public Color getSelectedForeground() { return this.selectedForeground; } /** * Sets row selected foreground. * * @param selectedForeground the new row selected foreground. */ public void setSelectedForeground(Color selectedForeground) { Color old = this.selectedForeground; this.selectedForeground = selectedForeground; this.firePropertyChange("selectedForeground", old, this.selectedForeground); this.repaint(); } /** * Gets selected background. * * @return the selected background. */ public Color getSelectedBackground() { return this.selectedBackground; } /** * Sets row selected background. * * @param selectedBackground the new row selected background. */ public void setSelectedBackground(Color selectedBackground) { Color old = this.selectedBackground; this.selectedBackground = selectedBackground; this.firePropertyChange("selectedBackground", old, this.selectedBackground); this.repaint(); } }
fanruan/finereport-design
designer/src/com/fr/grid/GridHeader.java
Java
gpl-3.0
2,845
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>AFL Match Statistics : Fremantle defeats Adelaide at Domain Stadium Round 18 Saturday, 27th July 2013</TITLE> <meta NAME="description" CONTENT="Fremantle defeats Adelaide at Domain Stadium Round 18 Saturday, 27th July 2013 AFL match statistics"> <meta NAME="keywords" CONTENT="AFL Match Statistics, AFL Game Statistics, AFL Match Stats"> <link rel="canonical" href="https://www.footywire.com/afl/footy/ft_match_statistics?mid=5698&advv=Y"/> <style> .tabbg { background-color: #000077; vertical-align: middle; } .blkbg { background-color: #000000; vertical-align: middle; } .tabbdr { background-color: #d8dfea; vertical-align: middle; } .wspace { background-color: #ffffff; vertical-align: middle; } .greybg { background-color: #f4f5f1; } .greybdr { background-color: #e3e4e0; } .blackbdr { background-color: #000000; } .lbgrey { background-color: #d4d5d1; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; font-weight: bold; } .caprow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; font-weight: bold; } .ylwbg { background-color: #eeffee; text-decoration: none; color: #000000; vertical-align: middle; } .ylwbgmid { background-color: #eeffee; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; } .ylwbgtop { background-color: #eeffee; text-decoration: none; color: #000000; vertical-align: top; } .ylwbgbottom { background-color: #eeffee; text-decoration: none; color: #000000; vertical-align: bottom; text-align: center; } .ylwbg2 { background-color: #ddeedd; } .ylwbdr { background-color: #ccddcc; } .mtabbg { background-color: #f2f4f7; vertical-align: top; text-align: center; } .error { background-color: #ffffff; text-decoration: none; color: #ff0000; vertical-align: middle; text-align: left; font-weight: bold; } .cerror { background-color: #ffffff; text-decoration: none; color: #ff0000; vertical-align: middle; text-align: center; font-weight: bold; } .greytxt { color: #777777; } .bluetxt { color: #003399; } .normtxt { color: #000000; } .norm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; } .drow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; } .lnorm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; } .rnorm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: right; } .rdrow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: right; } .ldrow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; } .bnorm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; font-weight: bold; } .rbnorm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: right; font-weight: bold; } .lbnorm { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; font-weight: bold; } .bdrow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; font-weight: bold; } .lbdrow { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; font-weight: bold; } .lylw { background-color: #eeffee; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; } .normtop { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: top; text-align: center; } .lnormtop { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: top; text-align: left; } .drowtop { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: top; text-align: center; } .ldrowtop { background-color: #f2f4f7; text-decoration: none; color: #000000; vertical-align: top; text-align: left; } a.tblink:link { color: #ffffff; font-weight: bold; vertical-align: middle; } .dvr { color: #999999; font-weight: normal; vertical-align: middle; } .hltitle { text-decoration: none; color: #000000; font-size: 16px; font-weight: bold; } .whltitle { background-color: #ffffff; text-decoration: none; color: #000000; font-size: 16px; font-weight: bold; } .idxhltitle { text-decoration: none; color: #990099; font-size: 16px; font-weight: bold; } .tbtitle { text-decoration:none; color:#3B5998; font-weight:bold; border-top:1px solid #e4ebf6; border-bottom:1px solid #D8DFEA; background:#D8DFEA url(/afl/img/icon/tbback.png); bottom left repeat-x; } .innertbtitle { background-color:#D8DFEA; text-decoration:none; color:#3B5998; font-weight:normal; background:#D8DFEA url(/afl/img/icon/tbback.png); bottom left repeat-x; } .tabopt { background-color: #5555cc; vertical-align: middle; text-align: center; } .tabsel { background-color: #ffffff; text-decoration: underline; color: #000000; font-weight: bold; vertical-align: middle; text-align: center; } a.tablink { font-weight:bold; vertical-align:middle; } a.tablink:link { color: #ffffff; } a.tablink:hover { color: #eeeeee; } .lnitxt { } .lseltxt { } .lselbldtxt { font-weight: bold; } .formcls { background-color:#f2f4f7; vertical-align:middle; text-align:left } .formclsright { background-color:#f2f4f7; vertical-align:middle; text-align:right } li { background-color: #ffffff; color: #000000; } p { color: #000000; } th { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; font-weight: bold; } a.wire { font-weight:bold } .menubg { background-color: #000077; text-decoration: none; color: #000000; vertical-align: middle; text-align: center; } .menubdr { background-color: #f2f4f7; vertical-align: middle; } table#wiretab { border-spacing:0px; border-collapse:collapse; background-color:#F2F4F7; width:450px; height:250px; } table#wiretab td.section { border-bottom:1px solid #D8DFEA; } table#wirecell { background-color:#F2F4F7; border:0px; } table#wirecell td#wirecelltitle { vertical-align:top; } table#wirecell td#wirecellblurb { vertical-align:top; } .smnt { background-color: #ffffff; text-decoration: none; color: #000000; vertical-align: middle; text-align: left; } a.peep { font-weight:bold; font-size: 12px; line-height: 14px; } form { padding:0px; margin:0px; } table.thickouter { border:1px solid #D8DFEA; } table.thickouter td.padded { padding:2px; } div.notice { border:1px solid #D8DFEA; padding:8px; background:#D8DFEA url(/afl/img/icon/customback.png); text-align:center; vertical-align:middle; margin-bottom:10px; font-size: 12px; } div.notice div.clickable { font-weight:bold; cursor:pointer; display:inline; color:#3B5998; } div.datadiv td.data, div.datadiv td.bdata { padding:3px; vertical-align:top; } div.datadiv td.bdata { font-weight:bold; } a:focus { outline:none; } h1.centertitle { padding-top:10px; font-size:20px; font-weight:bold; text-align:center; } #matchscoretable { background-color : #eeffee; border:1px solid #ccddcc; } #matchscoretable td, #matchscoretable th { background-color : #eeffee; text-decoration: none; color: #000000; vertical-align: middle; } #matchscoretable th, #matchscoretable th.leftbold { border-bottom:1px solid #ccddcc; font-weight:bold; } #matchscoretable td.leftbold { font-weight:bold; } #matchscoretable td.leftbold, #matchscoretable th.leftbold { text-align:left; padding-left:10px; } body { margin-top:0px; margin-bottom:5px; margin-left:5px; margin-right:5px; background-color:#ffffff; overflow-x: auto; overflow-y: auto; } body, p, td, th, textarea, input, select, h1, h2, h3, h4, h5, h6 { font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size:11px; text-decoration: none; } table.plain { border-spacing:0px; border-collapse:collapse; padding:0px; } table.leftmenu { background-color:#F7F7F7; } table.leftmenu td { padding:2px 2px 2px 5px; } table.leftmenu td#skyscraper { padding:2px 0px 2px 0px; text-align:left; margin:auto; vertical-align:top; background-color:#ffffff; } table.leftmenu td#topborder { padding:0px 0px 0px 0px; border-top:5px solid #b7b7b7; font-size:5px; } table.leftmenu td#bottomborder { padding:0px 0px 0px 0px; border-bottom:1px solid #b7b7b7; font-size:5px; } table.leftmenu td#bottomborderpad { padding:0px 0px 0px 0px; border-bottom:0px solid #b7b7b7; font-size:3px; } td#headercell { text-align:left; vertical-align:bottom; background:#3B5998 url(/afl/img/logo/header-logo-bg-2011.png); } a.leftmenu { color:#3B5998; display:block; width:100%; text-decoration:none; } a.leftmenu:hover { text-decoration:none; } a { color:#3B5998; } a:link { text-decoration:none; } a:visited { text-decoration:none; } a:active { text-decoration:none; } a:hover { text-decoration:underline; } table#footer { border-spacing:0px; border-collapse:collapse; padding:0px; color:#868686; width:760px; } table#footer td#footercopy { text-align:left; } table#footer td#footerlinks { text-align:right; } table#footer a { padding:0px 2px 0px 2px; } .textinput { border:1px solid #BDC7D8; padding:2px 2px 2px 2px; } .button { color:#ffffff; height:18px; padding:0px 4px 4px 4px; border:1px solid #3B5998; background:#5b79b8 url(/afl/img/icon/btback.png); bottom left repeat-x; vertical-align:middle; cursor:pointer; } .button:focus { outline:none; } .button::-moz-focus-inner { border: 0; } a.button:link, a.button:visited, a.button:hover { text-decoration:none; } td.blocklink { padding:3px 3px 3px 3px; } a.blocklink { padding:2px 2px 2px 2px; } a.blocklink:hover { background-color:#3B5998; color:#ffffff; text-decoration:none; } table#teammenu, table#playermenu, table#playerrankmenu, table#teamrankmenu, table#draftmenu, table#risingstarmenu, table#matchmenu, table#laddermenu, table#brownlowmenu, table#attendancemenu, table#coachmenu, table#supercoachmenu, table#dreamteammenu, table#highlightsmenu, table#selectionsmenu, table#pastplayermenu, table#tweetmenu, table#contractsmenu { border-spacing:0px; border-collapse:collapse; background-color:#F7F7F7; z-index:1; position:absolute; left:0px; top:0px; visibility:hidden; border:1px solid #b7b7b7; opacity:.95; filter:alpha(opacity=95); width:220px; } a.submenuitem { padding:3px; color:#3B5998; text-decoration:none; border:0px solid #3B5998; } a.submenuitem:link { text-decoration:none; } a.submenuitem:hover { text-decoration:underline; } div.submenux, div.submenutitle { font-size:9px; color:#676767; font-weight:bold; } div.submenux { color:#676767; cursor:pointer; } div.submenutitle { color:#353535; padding:4px 2px 2px 2px; } td#teamArrow, td#playerArrow, td#playerrankArrow, td#teamrankArrow, td#draftArrow, td#risingstarArrow, td#matchArrow, td#ladderArrow, td#brownlowArrow, td#attendanceArrow, td#coachArrow, td#supercoachArrow, td#dreamteamArrow, td#highlightsArrow, td#selectionsArrow, td#pastplayerArrow, td#tweetArrow, td#contractsArrow { color:#676767; font-weight:bold; display:block; text-decoration:none; border-left:1px solid #F7F7F7; cursor:pointer; text-align:center; width:10px; } table#header { border-spacing:0px; border-collapse:collapse; margin:auto; width:100%; } table#header td { border:0px solid #3B5998; } table#header td#logo { vertical-align:middle; text-align:center; } table#header td#mainlinks { vertical-align:bottom; text-align:left; padding-bottom:10px; } table#header td#memberStatus { vertical-align:bottom; text-align:right; padding-bottom:10px; } a.emptylink, a.emptylink:link, a.emptylink:visited, a.emptylink:active, a.emptylink:hover { border:0px; margin:0px; text-decoration:none; } table#header a.headerlink { font-size:12px; font-weight:bold; color:#ffffff; padding:4px; } table#header a.headerlink:link { background-color:#3B5998; text-decoration:none; } table#header a.headerlink:visited { background-color:#3B5998; text-decoration:none; } table#header a.headerlink:active { background-color:#3B5998; text-decoration:none; } table#header a.headerlink:hover { background-color:#6D84B4; text-decoration:none; } table#header a.userlink { font-size:11px; font-weight:normal; color:#D8DFEA; padding:5px; } table#header a.userlink:link { color:#D8DFEA; text-decoration:none; } table#header a.userlink:visited { color:#D8DFEA; text-decoration:none; } table#header a.userlink:active { color:#D8DFEA; text-decoration:none; } table#header a.userlink:hover { color:#ffffff; text-decoration:underline; } table#header div#welcome { display:inline; font-size:11px; font-weight:bold; color:#D8DFEA; padding:5px; } td.hdbar { text-decoration:none; border-top:1px solid #92201e; border-bottom:1px solid #760402; background:#D8DFEA url(/afl/img/icon/hdback.png); bottom left repeat-x; padding:0px 5px 0px 5px; } td.hdbar div { color:#ffffff; display:inline; padding:0px 5px 0px 5px; } td.hdbar div a { font-size:11px; font-weight:normal; color:#ffffff; font-weight:bold; } td.hdbar div a:link { text-decoration:none; } td.hdbar div a:hover { text-decoration:underline; } div#membersbgdiv { background:#888888; opacity:.50; filter:alpha(opacity=50); z-index:1; position:absolute; left:0px; top:0px; width:100%; height:100%; text-align:center; vertical-align:middle; display:none; } div#memberswhitediv { width:610px; height:380px; border:3px solid #222222; background:#ffffff; opacity:1; filter:alpha(opacity=100); z-index:2; position:absolute; left:0; top:0; border-radius:20px; -moz-border-radius:20px; /* Old Firefox */ padding:15px; display:none; } #membersx { color:#222222; font-weight:bold; font-size:16px; cursor:pointer; } </style> <script type="text/javascript"> function flipSubMenu(cellid, tableid) { var table = document.getElementById(tableid); if (table.style.visibility == 'visible') { hideSubMenu(tableid); } else { showSubMenu(cellid, tableid); } } function showSubMenu(cellid, tableid) { hideAllSubMenus(); var cell = document.getElementById(cellid); var coors = findPos(cell); var table = document.getElementById(tableid); table.style.visibility = 'visible'; table.style.top = (coors[1]) + 'px'; table.style.left = (coors[0] + 175) + 'px'; } function hideSubMenu(tableid) { var table = document.getElementById(tableid); if (table != null) { table.style.visibility = 'hidden'; } } function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft,curtop]; } function highlightCell(tag) { var cell = document.getElementById(tag + 'linkcell'); cell.style.backgroundColor = "#E7E7E7"; highlightArrow(tag + 'Arrow'); } function dehighlightCell(tag) { var cell = document.getElementById(tag + 'linkcell'); cell.style.backgroundColor = "transparent"; dehighlightArrow(tag + 'Arrow'); } function highlightArrow(arrowId) { var arrow = document.getElementById(arrowId); arrow.style.backgroundColor = "#E7E7E7"; } function dehighlightArrow(arrowId) { var arrow = document.getElementById(arrowId); arrow.style.backgroundColor = "transparent"; } function hideAllSubMenus() { hideSubMenu('teammenu'); hideSubMenu('playermenu'); hideSubMenu('teamrankmenu'); hideSubMenu('playerrankmenu'); hideSubMenu('draftmenu'); hideSubMenu('risingstarmenu'); hideSubMenu('matchmenu'); hideSubMenu('brownlowmenu'); hideSubMenu('laddermenu'); hideSubMenu('attendancemenu'); hideSubMenu('supercoachmenu'); hideSubMenu('dreamteammenu'); hideSubMenu('coachmenu'); hideSubMenu('highlightsmenu'); hideSubMenu('selectionsmenu'); hideSubMenu('pastplayermenu'); hideSubMenu('contractsmenu'); hideSubMenu('tweetmenu'); } function GetMemberStatusXmlHttpObject() { var xmlMemberStatusHttp=null; try { // Firefox, Opera 8.0+, Safari xmlMemberStatusHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlMemberStatusHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlMemberStatusHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlMemberStatusHttp; } function rememberMember() { xmlMemberStatusHttp=GetMemberStatusXmlHttpObject(); url="/club/sports/member-remember.html?sid=" + Math.random(); xmlMemberStatusHttp.onreadystatechange=showAlert; xmlMemberStatusHttp.open("GET",url,true); xmlMemberStatusHttp.send(null); } function quickLogout() { xmlMemberStatusHttp=GetMemberStatusXmlHttpObject(); url="/afl/club/quick-logout.html?sid=" + Math.random(); xmlMemberStatusHttp.onreadystatechange=showAlert; xmlMemberStatusHttp.open("GET",url,true); xmlMemberStatusHttp.send(null); } function showMemberStatus() { xmlMemberStatusHttp = GetMemberStatusXmlHttpObject(); url = "/afl/club/member-status.html?sid=" + Math.random(); fetchShowMemberStatus(xmlMemberStatusHttp, url); } function showMemberStatusWithUrl(url) { xmlMemberStatusHttp = GetMemberStatusXmlHttpObject(); url = "/afl/club/member-status.html?url=" + url + "&sid=" + Math.random(); fetchShowMemberStatus(xmlMemberStatusHttp, url); } function showMemberStatusSkipAds() { xmlMemberStatusHttp = GetMemberStatusXmlHttpObject(); url = "/afl/club/member-status.html?skipAds=Y&sid=" + Math.random(); fetchShowMemberStatus(xmlMemberStatusHttp, url); } function showMemberStatusWithUrlSkipAds(url) { xmlMemberStatusHttp = GetMemberStatusXmlHttpObject(); url = "/afl/club/member-status.html?skipAds=Y&url=" + url + "&sid=" + Math.random(); fetchShowMemberStatus(xmlMemberStatusHttp, url); } function fetchShowMemberStatus(xmlMemberStatusHttp, url) { xmlMemberStatusHttp.onreadystatechange = memberStatusChanged; xmlMemberStatusHttp.open("GET", url, true); xmlMemberStatusHttp.send(null); } function showAlert() { if (xmlMemberStatusHttp.readyState==4) { alertMessage = xmlMemberStatusHttp.responseText; showMemberStatus(); alert(alertMessage); } } function memberStatusChanged() { if (xmlMemberStatusHttp.readyState==4) { response = xmlMemberStatusHttp.responseText; if (response.indexOf("<!-- MEMBER STATUS -->") < 0) { response = " "; } document.getElementById("memberStatus").innerHTML = response; } } function pushSignUpEvent(signUpSource) { _gaq.push(['_trackEvent', 'Member Activity', 'Sign Up', signUpSource]); } function pushContent(category, page) { _gaq.push(['_trackEvent', 'Content', category, page]); } function GetXmlHttpObject() { var xmlWireHttp=null; try { // Firefox, Opera 8.0+, Safari xmlWireHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlWireHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlWireHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlWireHttp; } function showWire() { xmlWireHttp=GetXmlHttpObject() url="/afl/club/forum-threads-wire.html?sid=" + Math.random(); fetchWire(xmlWireHttp, url); } function showWireSkipAds() { xmlWireHttp=GetXmlHttpObject() url="/afl/club/forum-threads-wire.html?skipAds=Y&sid=" + Math.random(); fetchWire(xmlWireHttp, url); } function fetchWire(xmlWireHttp, url) { xmlWireHttp.onreadystatechange = wireChanged; xmlWireHttp.open("GET", url, true); xmlWireHttp.send(null); } function wireChanged() { if (xmlWireHttp.readyState==4) { response = xmlWireHttp.responseText; if (response.indexOf("<!-- WIRE -->") < 0) { response = " "; } document.getElementById("threadsWire").innerHTML=response; } } function positionMemberDivs() { var bodyOffsetHeight = document.body.offsetHeight; document.getElementById('membersbgdiv').style.width = '100%'; document.getElementById('membersbgdiv').style.height = '100%'; var leftOffset = (document.getElementById('membersbgdiv').offsetWidth - document.getElementById('memberswhitediv').offsetWidth) / 2; var topOffset = ((document.getElementById('membersbgdiv').offsetHeight - document.getElementById('memberswhitediv').offsetHeight) / 2); document.getElementById('memberswhitediv').style.left = leftOffset; document.getElementById('memberswhitediv').style.top = topOffset; document.getElementById('membersbgdiv').style.height = bodyOffsetHeight; } function closeMemberDivs() { document.getElementById('membersbgdiv').style.display = 'none'; document.getElementById('memberswhitediv').style.display = 'none'; } function displayMemberDivs() { document.getElementById('membersbgdiv').style.display = 'block'; document.getElementById('memberswhitediv').style.display = 'block'; positionMemberDivs(); } function openRegistrationLoginDialog() { document.getElementById('memberscontent').innerHTML = "<iframe src='/afl/footy/custom_login' width=600 height=350 hspace=0 vspace=0 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>"; document.getElementById('memberswhitediv').style.width = '610px'; document.getElementById('memberswhitediv').style.height = '380px'; displayMemberDivs(); } function openRegistrationLoginDialogWithNextPage(nextPage) { document.getElementById('memberscontent').innerHTML = "<div><iframe src='/afl/footy/custom_login?p=" + nextPage + "' width=600 height=350 hspace=0 vspace=0 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe></div>" document.getElementById('memberswhitediv').style.width = '610px'; document.getElementById('memberswhitediv').style.height = '380px'; displayMemberDivs(); } function openChangePasswordDialog() { document.getElementById('memberscontent').innerHTML = "<div><iframe src='/afl/footy/custom_login?action=changePasswordForm' width=250 height=190 hspace=0 vspace=0 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe></div>" document.getElementById('memberswhitediv').style.width = '250px'; document.getElementById('memberswhitediv').style.height = '240px'; displayMemberDivs(); } function openManageSettingsDialog() { document.getElementById('memberscontent').innerHTML = "<div><iframe src='/afl/footy/custom_login?action=manageSettingsForm' width=380 height=210 hspace=0 vspace=0 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe></div>" document.getElementById('memberswhitediv').style.width = '380px'; document.getElementById('memberswhitediv').style.height = '260px'; displayMemberDivs(); } var xmlLoginHttp; function GetLoginXmlHttpObject() { var xmlLoginHttp=null; try { // Firefox, Opera 8.0+, Safari xmlLoginHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlLoginHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlLoginHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlLoginHttp; } function postLogout() { var params = "action=logout"; xmlLoginHttp=GetLoginXmlHttpObject(); xmlLoginHttp.onreadystatechange = validateLogoutResponse; xmlLoginHttp.open("POST", '/afl/footy/custom_login', true); xmlLoginHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlLoginHttp.setRequestHeader("Content-length", params.length); xmlLoginHttp.setRequestHeader("Connection", "close"); xmlLoginHttp.send(params); } function getPlugContent(type) { xmlLoginHttp=GetLoginXmlHttpObject() xmlLoginHttp.onreadystatechange = plugCustomFantasy; xmlLoginHttp.open("GET", '/afl/footy/custom_login?action=plug&type=' + type, true); xmlLoginHttp.send(null); } function validateResponse() { if(xmlLoginHttp.readyState == 4 && xmlLoginHttp.status == 200) { var result = xmlLoginHttp.responseText; if (result == 'PASS') { self.parent.location.reload(true); } else if (result.indexOf('ERROR:') == 0) { result = result.substring(6); alert(result + ". Please try again."); } else { alert("An error occurred during registration."); } } } function plugCustomFantasy() { if (xmlLoginHttp.readyState == 4 && xmlLoginHttp.status == 200) { var response = xmlLoginHttp.responseText; if (response.indexOf("<!-- PLUG -->") < 0) { response = ""; } document.getElementById("customPlugDiv").innerHTML=response; } } function validateLogoutResponse() { if(xmlLoginHttp.readyState == 4 && xmlLoginHttp.status == 200) { var result = xmlLoginHttp.responseText; if (result == 'PASS') { selfReload(); } else if (result.indexOf('ERROR:') == 0) { result = result.substring(6); alert(result + ". Please try again."); } else { alert("Oops! An error occurred!"); } } } function selfReload() { if (xmlLoginHttp.readyState == 4 && xmlLoginHttp.status == 200) { self.parent.location.reload(true); } } </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-3312858-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </HEAD> <BODY onload="pushContent('Match Statistics', 'Match Statistics');showMemberStatusWithUrl('https%3A%2F%2Fwww.footywire.com%2Fafl%2Ffooty%2Fft_match_statistics');showWire();hideAllSubMenus();" onresize="positionMemberDivs();"> <DIV align="CENTER"> <table cellpadding="0" cellspacing="0" border="0" id="frametable2008" width="948"> <tr><td colspan="4" height="102" id="headercell" width="948"> <table id="header"> <tr> <td id="logo" valign="middle" height="102" width="200"> <a class="emptylink" href="//www.footywire.com/"><div style="width:200px;height:54px;cursor:pointer;">&nbsp;</div></a> </td> <td id="mainlinks" width="200"> </td> <td style="padding-top:3px;padding-right:4px;"> <div style="margin-left:-3px;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Footywire 728x90 Prime --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-1151582373407200" data-ad-slot="7204222137"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </td> </tr> </table> </td></tr> <tr><td colspan="4" height="21" class="hdbar" align="right" valign="middle" id="memberStatus"></td></tr> <tr> <td rowspan="4" width="175" valign="top"> <table width="175" cellpadding="0" cellspacing="0" border="0" class="leftmenu"> <tr><td colspan="2" id="topborder">&nbsp;</td></tr> <tr><td width="175" colspan="2" onMouseOver="this.style.backgroundColor='#e7e7e7';" onMouseOut="this.style.backgroundColor='transparent';"><a class="leftmenu" href="//www.footywire.com/">AFL Statistics Home</a></td></tr> <tr> <td id="matchlinkcell" width="165"><a onMouseOver="highlightCell('match')" onMouseOut="dehighlightCell('match')" class="leftmenu" href="/afl/footy/ft_match_list">AFL Fixture</a></td> <td id="matchArrow" onMouseOver="highlightArrow('matchArrow')" onMouseOut="dehighlightArrow('matchArrow')" onClick="flipSubMenu('matchlinkcell','matchmenu')">&#187;</td> </tr> <tr> <td id="playerlinkcell" width="165"><a onMouseOver="highlightCell('player')" onMouseOut="dehighlightCell('player')" class="leftmenu" href="/afl/footy/ft_players">Players</a></td> <td id="playerArrow" onMouseOver="highlightArrow('playerArrow')" onMouseOut="dehighlightArrow('playerArrow')" onClick="flipSubMenu('playerlinkcell','playermenu')">&#187;</td> </tr> <tr> <td id="teamlinkcell" width="165"><a onMouseOver="highlightCell('team')" onMouseOut="dehighlightCell('team')" class="leftmenu" href="/afl/footy/ft_teams">Teams</a></td> <td id="teamArrow" onMouseOver="highlightArrow('teamArrow')" onMouseOut="dehighlightArrow('teamArrow')" onClick="flipSubMenu('teamlinkcell','teammenu')">&#187;</td> </tr> <tr> <td id="playerranklinkcell" width="165"><a onMouseOver="highlightCell('playerrank')" onMouseOut="dehighlightCell('playerrank')" class="leftmenu" href="/afl/footy/ft_player_rankings">Player Rankings</a></td> <td id="playerrankArrow" onMouseOver="highlightArrow('playerrankArrow')" onMouseOut="dehighlightArrow('playerrankArrow')" onClick="flipSubMenu('playerranklinkcell','playerrankmenu')">&#187;</td> </tr> <tr> <td id="teamranklinkcell" width="165"><a onMouseOver="highlightCell('teamrank')" onMouseOut="dehighlightCell('teamrank')" class="leftmenu" href="/afl/footy/ft_team_rankings">Team Rankings</a></td> <td id="teamrankArrow" onMouseOver="highlightArrow('teamrankArrow')" onMouseOut="dehighlightArrow('teamrankArrow')" onClick="flipSubMenu('teamranklinkcell','teamrankmenu')">&#187;</td> </tr> <tr> <td id="risingstarlinkcell" width="165"><a onMouseOver="highlightCell('risingstar')" onMouseOut="dehighlightCell('risingstar')" class="leftmenu" href="/afl/footy/ft_rising_stars_round_performances">Rising Stars</a></td> <td id="risingstarArrow" onMouseOver="highlightArrow('risingstarArrow')" onMouseOut="dehighlightArrow('risingstarArrow')" onClick="flipSubMenu('risingstarlinkcell','risingstarmenu')">&#187;</td> </tr> <tr> <td id="draftlinkcell" width="165"><a onMouseOver="highlightCell('draft')" onMouseOut="dehighlightCell('draft')" class="leftmenu" href="/afl/footy/ft_drafts">AFL Draft</a></td> <td id="draftArrow" onMouseOver="highlightArrow('draftArrow')" onMouseOut="dehighlightArrow('draftArrow')" onClick="flipSubMenu('draftlinkcell','draftmenu')">&#187;</td> </tr> <tr> <td id="brownlowlinkcell" width="165"><a onMouseOver="highlightCell('brownlow')" onMouseOut="dehighlightCell('brownlow')" class="leftmenu" href="/afl/footy/brownlow_medal">Brownlow Medal</a></td> <td id="brownlowArrow" onMouseOver="highlightArrow('brownlowArrow')" onMouseOut="dehighlightArrow('brownlowArrow')" onClick="flipSubMenu('brownlowlinkcell','brownlowmenu')">&#187;</td> </tr> <tr> <td id="ladderlinkcell" width="165"><a onMouseOver="highlightCell('ladder')" onMouseOut="dehighlightCell('ladder')" class="leftmenu" href="/afl/footy/ft_ladder">AFL Ladder</a></td> <td id="ladderArrow" onMouseOver="highlightArrow('ladderArrow')" onMouseOut="dehighlightArrow('ladderArrow')" onClick="flipSubMenu('ladderlinkcell','laddermenu')">&#187;</td> </tr> <tr> <td id="coachlinkcell" width="165"><a onMouseOver="highlightCell('coach')" onMouseOut="dehighlightCell('coach')" class="leftmenu" href="/afl/footy/afl_coaches">Coaches</a></td> <td id="coachArrow" onMouseOver="highlightArrow('coachArrow')" onMouseOut="dehighlightArrow('coachArrow')" onClick="flipSubMenu('coachlinkcell','coachmenu')">&#187;</td> </tr> <tr> <td id="attendancelinkcell" width="165"><a onMouseOver="highlightCell('attendance')" onMouseOut="dehighlightCell('attendance')" class="leftmenu" href="/afl/footy/attendances">Attendances</a></td> <td id="attendanceArrow" onMouseOver="highlightArrow('attendanceArrow')" onMouseOut="dehighlightArrow('attendanceArrow')" onClick="flipSubMenu('attendancelinkcell','attendancemenu')">&#187;</td> </tr> <tr> <td id="supercoachlinkcell" width="165"><a onMouseOver="highlightCell('supercoach')" onMouseOut="dehighlightCell('supercoach')" class="leftmenu" href="/afl/footy/supercoach_round">Supercoach</a></td> <td id="supercoachArrow" onMouseOver="highlightArrow('supercoachArrow')" onMouseOut="dehighlightArrow('supercoachArrow')" onClick="flipSubMenu('supercoachlinkcell','supercoachmenu')">&#187;</td> </tr> <tr> <td id="dreamteamlinkcell" width="165"><a onMouseOver="highlightCell('dreamteam')" onMouseOut="dehighlightCell('dreamteam')" class="leftmenu" href="/afl/footy/dream_team_round">AFL Fantasy</a></td> <td id="dreamteamArrow" onMouseOver="highlightArrow('dreamteamArrow')" onMouseOut="dehighlightArrow('dreamteamArrow')" onClick="flipSubMenu('dreamteamlinkcell','dreamteammenu')">&#187;</td> </tr> <tr> <td id="highlightslinkcell" width="165"><a onMouseOver="highlightCell('highlights')" onMouseOut="dehighlightCell('highlights')" class="leftmenu" href="/afl/footy/afl_highlights">AFL Highlights</a></td> <td id="highlightsArrow" onMouseOver="highlightArrow('highlightsArrow')" onMouseOut="dehighlightArrow('highlightsArrow')" onClick="flipSubMenu('highlightslinkcell','highlightsmenu')">&#187;</td> </tr> <tr> <td id="selectionslinkcell" width="165"><a onMouseOver="highlightCell('selections')" onMouseOut="dehighlightCell('selections')" class="leftmenu" href="/afl/footy/afl_team_selections">AFL Team Selections</a></td> <td id="selectionsArrow" onMouseOver="highlightArrow('selectionsArrow')" onMouseOut="dehighlightArrow('selectionsArrow')" onClick="flipSubMenu('selectionslinkcell','selectionsmenu')">&#187;</td> </tr> <tr> <td id="pastplayerlinkcell" width="165"><a onMouseOver="highlightCell('pastplayer')" onMouseOut="dehighlightCell('pastplayer')" class="leftmenu" href="/afl/footy/past_players">Past Players</a></td> <td id="pastplayerArrow" onMouseOver="highlightArrow('pastplayerArrow')" onMouseOut="dehighlightArrow('pastplayerArrow')" onClick="flipSubMenu('pastplayerlinkcell','pastplayermenu')">&#187;</td> </tr> <tr> <td id="contractslinkcell" width="165"><a onMouseOver="highlightCell('contracts')" onMouseOut="dehighlightCell('contracts')" class="leftmenu" href="/afl/footy/out_of_contract_players">AFL Player Contracts</a></td> <td id="contractsArrow" onMouseOver="highlightArrow('contractsArrow')" onMouseOut="dehighlightArrow('contractsArrow')" onClick="flipSubMenu('contractslinkcell','contractsmenu')">&#187;</td> </tr> <tr><td width="175" colspan="2" onMouseOver="this.style.backgroundColor='#e7e7e7';" onMouseOut="this.style.backgroundColor='transparent';"><a class="leftmenu" href="/afl/footy/afl_betting">AFL Betting</a></td></tr> <tr><td width="175" colspan="2" onMouseOver="this.style.backgroundColor='#e7e7e7';" onMouseOut="this.style.backgroundColor='transparent';"><a class="leftmenu" href="/afl/footy/injury_list">AFL Injury List</a></td></tr> <tr><td width="175" colspan="2" onMouseOver="this.style.backgroundColor='#e7e7e7';" onMouseOut="this.style.backgroundColor='transparent';"><a class="leftmenu" href="/afl/footy/ft_season_records">Records</a></td></tr> <tr><td colspan="2" id="bottomborder">&nbsp;</td></tr> <tr><td colspan="2" class="norm" style="height:10px"></td></tr> <tr><td colspan="2" id="skyscraper"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Footywire 160x600 Prime --> <ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-1151582373407200" data-ad-slot="2707810136"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </td></tr> </table> </td> <td rowspan="3" bgcolor="#b7b7b7" style="width:1px"></td> <td height="900" width="761" valign="top" align="center" style="padding:5px 5px 5px 5px"> <div id="liveStatus" style="margin:0px;padding:0px;"></div> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="760"> <TR> <TD id="threadsWire" WIDTH="450" HEIGHT="250" VALIGN="TOP"> </TD> <td rowspan="2" class="norm" style="width:10px"></td> <TD WIDTH="300" HEIGHT="250" ROWSPAN="2"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Footywire 300x250 Prime --> <ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="ca-pub-1151582373407200" data-ad-slot="4250755734"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </TD> </TR> </TABLE> </td></tr> <tr><td colspan="1" class="norm" style="height:10px"></td></tr> <tr><td> <div class="notice" width="760"> Advanced stats currently displayed. <a href="/afl/footy/ft_match_statistics?mid=5698"><b>View Basic Stats</b></a>. </div> </td></tr> <tr><td> <style> td.statdata { text-align:center; cursor:default; } </style> <script type="text/javascript"> function getStats() { document.stat_select.submit(); } </script> <TABLE WIDTH="760" BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR><TD CLASS="lnormtop"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="760"> <TR> <TD WIDTH="375" class="lnormtop"> <table border="0" cellspacing="0" cellpadding="0" width="375"> <tr><td width="375" valign="top" height="22" align="left" class="hltitle"> Fremantle defeats Adelaide </td></tr> <tr><td class="lnorm" height="15">Round 18, Domain Stadium, Attendance: 28765</td></tr> <tr><td class="lnorm" height="15"> Saturday, 27th July 2013, 5:40 PM AWST</td></tr> <tr><td class="lnorm" height="19" style="padding-top:4px;"> Fremantle Betting Odds: Win 1.26, Line -24.5 @ 1.91 </td></tr> <tr><td class="lnorm" height="19" style="padding-bottom:4px;"> Adelaide Betting Odds: Win 4.00, Line +24.5 @ 1.91 </td></tr> <tr><td class="lnorm" height="15"> <b>Brownlow Votes:</b> 3: <a href="pp-fremantle-dockers--nathan-fyfe">N Fyfe</a>, 2: <a href="pp-adelaide-crows--rory-sloane">R Sloane</a>, 1: <a href="pp-fremantle-dockers--michael-johnson">M Johnson</a></td></tr> </table> </TD> <td rowspan="1" class="norm" style="width:9px"></td> <TD WIDTH="376" class="lnormtop"> <table border="0" cellspacing="0" cellpadding="0" width="376" id="matchscoretable"> <tr> <th class="leftbold" height="23" width="100">Team</td> <th width="49" align="center">Q1</td> <th width="49" align="center">Q2</td> <th width="49" align="center">Q3</td> <th width="49" align="center">Q4</td> <th width="49" align="center">Final</td> </tr> <tr> <td class="leftbold" height="22"><a href="th-fremantle-dockers">Fremantle</a></td> <td align="center">3.2 <td align="center">6.5 <td align="center">9.8 <td align="center">11.9 <td align="center">75 </tr> <tr> <td class="leftbold" height="22"><a href="th-adelaide-crows">Adelaide</a></td> <td align="center">2.4 <td align="center">2.6 <td align="center">5.9 <td align="center">7.11 <td align="center">53 </tr> </table> </TD></TR> <TR><TD COLSPAN="3" HEIGHT="30" CLASS="norm"> <a href="#t1">Fremantle Player Stats</a> | <a href="#t2">Adelaide Player Stats</a> | <a href="#hd">Match Head to Head Stats</a> | <a href="#brk">Scoring Breakdown</a> | <a href="highlights?id=866">Highlights</a> </TD></TR> </TABLE></TD></TR> <tr><td colspan="1" class="norm" style="height:5px"></td></tr> <TR><TD> <table border="0" cellspacing="0" cellpadding="0" width="760"> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" width="585"> <tr> <td height="21" align="center" colspan="3" class="tbtitle" width="585"> <table border="0" cellspacing="0" cellpadding="0" width="585"> <tr> <td class="innertbtitle" align="left">&nbsp;&nbsp;<b><a name=t1></a>Fremantle Match Statistics (Sorted by Disposals)</b></td> <td class="innertbtitle" align="right">Coach: <a href="cp-ross-lyon--13">Ross Lyon</a>&nbsp;&nbsp;</td> </tr> </table> </td> </tr> <tr> <td rowspan="1" class="tabbdr" style="width:1px"></td> <td> <table border="0" cellspacing="0" cellpadding="3" width="583"> <tr> <td width="148" class="lbnorm" height="21">Player</td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=23&advv=Y#t1" title="Contested Possessions">CP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=24&advv=Y#t1" title="Uncontested Possessions">UP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=25&advv=Y#t1" title="Effective Disposals">ED</a></td> <td width="34" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=34&advv=Y#t1" title="Disposal Efficiency %">DE%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=27&advv=Y#t1" title="Contested Marks">CM</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=21&advv=Y#t1" title="Goal Assists">GA</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=28&advv=Y#t1" title="Marks Inside 50">MI5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=31&advv=Y#t1" title="One Percenters">1%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=32&advv=Y#t1" title="Bounces">BO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=42&advv=Y#t1" title="Time On Ground %">TOG%</a></td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--nathan-fyfe" title="Nathan Fyfe">Nathan Fyfe</a></td> <td class="statdata">6</td> <td class="statdata">24</td> <td class="statdata">17</td> <td class="statdata">58.6</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">4</td> <td class="statdata">81</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--stephen-hill" title="Stephen Hill">Stephen Hill</a></td> <td class="statdata">7</td> <td class="statdata">19</td> <td class="statdata">25</td> <td class="statdata">92.6</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">81</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--michael-barlow" title="Michael Barlow">Michael Barlow</a></td> <td class="statdata">12</td> <td class="statdata">15</td> <td class="statdata">19</td> <td class="statdata">73.1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">79</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--lachie-neale" title="Lachie Neale">Lachie Neale</a></td> <td class="statdata">11</td> <td class="statdata">16</td> <td class="statdata">24</td> <td class="statdata">92.3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">78</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--clancee-pearce" title="Clancee Pearce">Clancee Pearce</a></td> <td class="statdata">7</td> <td class="statdata">17</td> <td class="statdata">23</td> <td class="statdata">92</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">94</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--michael-johnson" title="Michael Johnson">Michael Johnson</a></td> <td class="statdata">4</td> <td class="statdata">17</td> <td class="statdata">22</td> <td class="statdata">91.7</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">100</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--david-mundy" title="David Mundy">David Mundy</a></td> <td class="statdata">13</td> <td class="statdata">12</td> <td class="statdata">18</td> <td class="statdata">78.3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">75</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--nicholas-suban" title="Nicholas Suban">Nicholas Suban</a></td> <td class="statdata">7</td> <td class="statdata">13</td> <td class="statdata">15</td> <td class="statdata">75</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">75</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--paul-duffield" title="Paul Duffield">Paul Duffield</a></td> <td class="statdata">2</td> <td class="statdata">18</td> <td class="statdata">16</td> <td class="statdata">84.2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">98</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-greater-western-sydney-giants--tendai-mzungu" title="Tendai Mzungu">Tendai Mzungu</a></td> <td class="statdata">4</td> <td class="statdata">13</td> <td class="statdata">12</td> <td class="statdata">70.6</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">83</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--zac-dawson" title="Zac Dawson">Zac Dawson</a></td> <td class="statdata">7</td> <td class="statdata">10</td> <td class="statdata">12</td> <td class="statdata">75</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">11</td> <td class="statdata">0</td> <td class="statdata">98</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-collingwood-magpies--christopher-mayne" title="Christopher Mayne">Christopher Mayne</a></td> <td class="statdata">4</td> <td class="statdata">12</td> <td class="statdata">14</td> <td class="statdata">87.5</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">87</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-greater-western-sydney-giants--matthew-deboer" title="Matthew De Boer">Matthew De Boer</a></td> <td class="statdata">7</td> <td class="statdata">10</td> <td class="statdata">13</td> <td class="statdata">81.2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">88</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--danyle-pearce" title="Danyle Pearce">Danyle Pearce</a></td> <td class="statdata">3</td> <td class="statdata">12</td> <td class="statdata">12</td> <td class="statdata">80</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">75</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--zachary-clarke" title="Zachary Clarke">Zachary Clarke</a></td> <td class="statdata">8</td> <td class="statdata">7</td> <td class="statdata">10</td> <td class="statdata">66.7</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">83</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--lee-spurr" title="Lee Spurr">Lee Spurr</a></td> <td class="statdata">5</td> <td class="statdata">11</td> <td class="statdata">13</td> <td class="statdata">86.7</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">97</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-essendon-bombers--ryan-crowley" title="Ryan Crowley">Ryan Crowley</a></td> <td class="statdata">3</td> <td class="statdata">11</td> <td class="statdata">11</td> <td class="statdata">78.6</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">92</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--michael-walters" title="Michael Walters">Michael Walters</a></td> <td class="statdata">4</td> <td class="statdata">9</td> <td class="statdata">10</td> <td class="statdata">71.4</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">84</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--aaron-sandilands" title="Aaron Sandilands">Aaron Sandilands</a></td> <td class="statdata">8</td> <td class="statdata">5</td> <td class="statdata">6</td> <td class="statdata">50</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">75</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--garrick-ibbotson" title="Garrick Ibbotson">Garrick Ibbotson</a></td> <td class="statdata">2</td> <td class="statdata">10</td> <td class="statdata">7</td> <td class="statdata">58.3</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">92</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-fremantle-dockers--matthew-taberner" title="Matthew Taberner">Matthew Taberner</a></td> <td class="statdata">4</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">33.3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">51</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-fremantle-dockers--cameron-sutcliffe" title="Cameron Sutcliffe">Cameron Sutcliffe</a></td> <td class="statdata">1</td> <td class="statdata">3</td> <td class="statdata">4</td> <td class="statdata">100</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">33</td> </tr> </table> </td> <td rowspan="1" class="tabbdr" style="width:1px"></td> </tr> <tr><td colspan="3" class="tabbdr" style="height:1px"></td></tr> </table> </td> <td rowspan="1" class="norm" style="width:15px"></td> <td rowspan="4" width="160" align="center" valign="top"> <table border="0" cellspacing="0" cellpadding="5" width="160" style="border:1px solid #D8DFEA"> <tr><td height="15" valign="top"><a href="/afl/footy/custom_supercoach_latest_scores" class="peep"><a href='/afl/footy/custom_supercoach_latest_scores' class='peep'>Track your favourite Fantasy Players!</a></a></td></tr> <tr> <td height="100" align="center" valign="middle"> <a href="/afl/footy/custom_supercoach_latest_scores"><img src="/afl/img/peep/peep4.jpg" border="0" height="100"/></a> </td> </tr> <tr><td valign="top">Create and save your own custom list of <a href='/afl/footy/custom_supercoach_latest_scores'>Supercoach</a> or <a href='/afl/footy/custom_dream_team_latest_scores'>AFL Fantasy</a> players to track their stats!</td></tr> </table> <div style="padding-top:10px;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Footywire 160x600 Right --> <ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-1151582373407200" data-ad-slot="4900122530"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </td> </tr> <tr><td colspan="2" class="norm" style="height:20px"></td></tr> <tr><td> <table border="0" cellspacing="0" cellpadding="0" width="585"> <tr> <td height="21" align="center" colspan="3" class="tbtitle" width="585"> <table border="0" cellspacing="0" cellpadding="0" width="585"> <tr> <td class="innertbtitle" align="left">&nbsp;&nbsp;<b><a name=t1></a>Adelaide Match Statistics (Sorted by Disposals)</b></td> <td class="innertbtitle" align="right">Coach: <a href="cp-brenton-sanderson--88">Brenton Sanderson</a>&nbsp;&nbsp;</td> </tr> </table> </td> </tr> <tr> <td rowspan="1" class="tabbdr" style="width:1px"></td> <td> <table border="0" cellspacing="0" cellpadding="3" width="583"> <tr> <td width="148" class="lbnorm" height="21">Player</td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=23&advv=Y#t2" title="Contested Possessions">CP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=24&advv=Y#t2" title="Uncontested Possessions">UP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=25&advv=Y#t2" title="Effective Disposals">ED</a></td> <td width="34" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=34&advv=Y#t2" title="Disposal Efficiency %">DE%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=27&advv=Y#t2" title="Contested Marks">CM</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=21&advv=Y#t2" title="Goal Assists">GA</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=28&advv=Y#t2" title="Marks Inside 50">MI5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=31&advv=Y#t2" title="One Percenters">1%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=32&advv=Y#t2" title="Bounces">BO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=5698&sby=42&advv=Y#t2" title="Time On Ground %">TOG%</a></td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--rory-sloane" title="Rory Sloane">Rory Sloane</a></td> <td class="statdata">17</td> <td class="statdata">13</td> <td class="statdata">22</td> <td class="statdata">73.3</td> <td class="statdata">3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">89</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--brad-crouch" title="Brad Crouch">Brad Crouch</a></td> <td class="statdata">8</td> <td class="statdata">20</td> <td class="statdata">24</td> <td class="statdata">85.7</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">88</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-melbourne-demons--bernie-vince" title="Bernie Vince">Bernie Vince</a></td> <td class="statdata">5</td> <td class="statdata">19</td> <td class="statdata">16</td> <td class="statdata">64</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">85</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-hawthorn-hawks--ricky-henderson" title="Ricky Henderson">Ricky Henderson</a></td> <td class="statdata">7</td> <td class="statdata">16</td> <td class="statdata">18</td> <td class="statdata">78.3</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">1</td> <td class="statdata">83</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--scott-thompson" title="Scott Thompson">Scott Thompson</a></td> <td class="statdata">11</td> <td class="statdata">10</td> <td class="statdata">14</td> <td class="statdata">66.7</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">92</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--nathan-van-berlo" title="Nathan Van Berlo">Nathan Van Berlo</a></td> <td class="statdata">11</td> <td class="statdata">9</td> <td class="statdata">12</td> <td class="statdata">57.1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">83</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--david-mackay" title="David MacKay">David MacKay</a></td> <td class="statdata">6</td> <td class="statdata">16</td> <td class="statdata">16</td> <td class="statdata">76.2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">93</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--brodie-smith" title="Brodie Smith">Brodie Smith</a></td> <td class="statdata">4</td> <td class="statdata">16</td> <td class="statdata">19</td> <td class="statdata">90.5</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">85</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--rory-laird" title="Rory Laird">Rory Laird</a></td> <td class="statdata">4</td> <td class="statdata">17</td> <td class="statdata">19</td> <td class="statdata">90.5</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--tom-lynch" title="Tom Lynch">Tom Lynch</a></td> <td class="statdata">9</td> <td class="statdata">11</td> <td class="statdata">11</td> <td class="statdata">55</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">84</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--jarryd-lyons" title="Jarryd Lyons">Jarryd Lyons</a></td> <td class="statdata">3</td> <td class="statdata">15</td> <td class="statdata">12</td> <td class="statdata">60</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">76</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-carlton-blues--matthew-wright" title="Matthew Wright">Matthew Wright</a></td> <td class="statdata">7</td> <td class="statdata">13</td> <td class="statdata">14</td> <td class="statdata">73.7</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">86</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--kyle-hartigan" title="Kyle Hartigan">Kyle Hartigan</a></td> <td class="statdata">3</td> <td class="statdata">16</td> <td class="statdata">16</td> <td class="statdata">84.2</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--andy-otten" title="Andy Otten">Andy Otten</a></td> <td class="statdata">5</td> <td class="statdata">13</td> <td class="statdata">11</td> <td class="statdata">61.1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">92</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--daniel-talia" title="Daniel Talia">Daniel Talia</a></td> <td class="statdata">6</td> <td class="statdata">12</td> <td class="statdata">14</td> <td class="statdata">82.4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">6</td> <td class="statdata">0</td> <td class="statdata">96</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--luke-brown" title="Luke Brown">Luke Brown</a></td> <td class="statdata">3</td> <td class="statdata">14</td> <td class="statdata">15</td> <td class="statdata">88.2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">86</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--richard-douglas" title="Richard Douglas">Richard Douglas</a></td> <td class="statdata">9</td> <td class="statdata">6</td> <td class="statdata">11</td> <td class="statdata">68.8</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">89</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--sam-jacobs" title="Sam Jacobs">Sam Jacobs</a></td> <td class="statdata">3</td> <td class="statdata">11</td> <td class="statdata">11</td> <td class="statdata">84.6</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">94</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--jason-porplyzia" title="Jason Porplyzia">Jason Porplyzia</a></td> <td class="statdata">5</td> <td class="statdata">6</td> <td class="statdata">7</td> <td class="statdata">63.6</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-essendon-bombers--shaun-mckernan" title="Shaun McKernan">Shaun McKernan</a></td> <td class="statdata">4</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">25</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">55</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-adelaide-crows--richard-tambling" title="Richard Tambling">Richard Tambling</a></td> <td class="statdata">1</td> <td class="statdata">6</td> <td class="statdata">6</td> <td class="statdata">85.7</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">28</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-adelaide-crows--josh-jenkins" title="Josh Jenkins">Josh Jenkins</a></td> <td class="statdata">5</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">33.3</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">77</td> </tr> </table> </td> <td rowspan="1" class="tabbdr" style="width:1px"></td> </tr> <tr><td colspan="3" class="tabbdr" style="height:1px"></td></tr> </table> </td> <td rowspan="1" class="norm" style="width:10px"></td> </tr> </table> </TD></TR> <tr><td colspan="1" class="norm" style="height:20px"></td></tr> <TR><TD valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="760"> <tr><td valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="375"> <tr><td height="21" align="center" colspan="5" class="tbtitle"><a name=hd></a>Head to Head</td></tr> <tr> <td rowspan="24" class="tabbdr" style="width:1px"></td> <td width="124" class="bnorm" height="21">Fremantle</td> <td width="125" class="bnorm">Statistic</td> <td width="124" class="bnorm">Adelaide</td> <td rowspan="24" class="tabbdr" style="width:1px"></td> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">129</td> <td class="statdata">Contested Possessions</td> <td class="statdata">136</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">266</td> <td class="statdata">Uncontested Possessions</td> <td class="statdata">264</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">305</td> <td class="statdata">Effective Disposals</td> <td class="statdata">292</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">78%</td> <td class="statdata">Disposal Efficiency %</td> <td class="statdata">72.6%</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">40</td> <td class="statdata">Clangers</td> <td class="statdata">44</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">11</td> <td class="statdata">Contested Marks</td> <td class="statdata">11</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">14</td> <td class="statdata">Marks Inside 50</td> <td class="statdata">7</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">26</td> <td class="statdata">Clearances</td> <td class="statdata">33</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">35</td> <td class="statdata">Rebound 50s</td> <td class="statdata">17</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">38</td> <td class="statdata">One Percenters</td> <td class="statdata">35</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">8</td> <td class="statdata">Bounces</td> <td class="statdata">2</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">9</td> <td class="statdata">Goal Assists</td> <td class="statdata">4</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">81.8%</td> <td class="statdata">% Goals Assisted</td> <td class="statdata">57.1%</td> </tr> <tr><td colspan="5" class="tabbdr" style="height:1px"></td></tr> </tr> </table> </td> <td rowspan="1" class="norm" style="width:11px"></td> <td valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="374"> <tr><td height="21" align="center" colspan="5" class="tbtitle">Average Attributes</td></tr> <tr> <td rowspan="5" class="tabbdr" style="width:1px"></td> <td width="124" class="bnorm" height="20">Fremantle</td> <td width="124" class="bnorm">Attribute</td> <td width="124" class="bnorm">Adelaide</td> <td rowspan="5" class="tabbdr" style="width:1px"></td> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">188.0cm</td> <td class="statdata">Height</td> <td class="statdata">186.5cm</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">87.9kg</td> <td class="statdata">Weight</td> <td class="statdata">87.2kg</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">25yr 1mth</td> <td class="statdata">Age</td> <td class="statdata">24yr 1mth</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">89.7</td> <td class="statdata">Games</td> <td class="statdata">71.8</td> </tr> <tr><td colspan="5" class="tabbdr" style="height:1px"></td></tr> <tr><td colspan="5" class="norm" style="height:7px"></td></tr> <tr><td height="21" align="center" colspan="5" class="tbtitle">Total Players By Games</td></tr> <tr> <td rowspan="5" class="tabbdr" style="width:1px"></td> <td width="124" class="bnorm" height="20">Fremantle</td> <td width="124" class="bnorm">Games</td> <td width="124" class="bnorm">Adelaide</td> <td rowspan="5" class="tabbdr" style="width:1px"></td> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">0</td> <td class="statdata">Less than 50</td> <td class="statdata">0</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">1</td> <td class="statdata">50 to 99</td> <td class="statdata">4</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">7</td> <td class="statdata">100 to 149</td> <td class="statdata">8</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">14</td> <td class="statdata">150 or more</td> <td class="statdata">10</td> </tr> <tr><td colspan="5" class="tabbdr" style="height:1px"></td></tr> </tr> <tr><td colspan="5" align="center" style="padding-top:20px;"> </td></tr> </table> </td></tr> </table> </TD></TR> <tr><td colspan="1" class="norm" style="height:20px"></td></tr> <TR><TD> <table border="0" cellspacing="0" cellpadding="0" width="760"> <tr><td height="21" align="center" colspan="7" class="tbtitle"><a name=brk></a>Quarter by Quarter Scoring Breakdown</td></tr> <tr> <td rowspan="6" class="ylwbdr" style="width:1px"></td> <td rowspan="5" class="ylwbg2" style="width:4px"></td> <td colspan="1" class="ylwbg2" style="height:4px"></td> <td rowspan="5" class="ylwbg2" style="width:4px"></td> <td colspan="1" class="ylwbg2" style="height:4px"></td> <td rowspan="5" class="ylwbg2" style="width:4px"></td> <td rowspan="6" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>First Quarter</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">3.2 20</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">2.4 16</td> </tr> <tr> <td class="ylwbgmid">5</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">6</td> </tr> <tr> <td class="ylwbgmid">60.0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">33.3%</td> </tr> <tr> <td class="ylwbgmid">Won quarter by 4</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Lost quarter by 4</td> </tr> <tr> <td class="ylwbgmid">Leading by 4</td> <td class="ylwbgmid">End of Quarter</td> <td class="ylwbgmid">Trailing by 4</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>Second Quarter</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">3.3 21</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">0.2 2</td> </tr> <tr> <td class="ylwbgmid">6</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">2</td> </tr> <tr> <td class="ylwbgmid">50.0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">0%</td> </tr> <tr> <td class="ylwbgmid">Won quarter by 19</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Lost quarter by 19</td> </tr> <tr> <td class="ylwbgmid">Leading by 23</td> <td class="ylwbgmid">Halftime</td> <td class="ylwbgmid">Trailing by 23</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> </tr> <tr><td colspan="3" class="ylwbg2" style="height:4px"></td></tr> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>Third Quarter</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">3.3 21</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">3.3 21</td> </tr> <tr> <td class="ylwbgmid">6</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">6</td> </tr> <tr> <td class="ylwbgmid">50.0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">50.0%</td> </tr> <tr> <td class="ylwbgmid">Draw</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Draw</td> </tr> <tr> <td class="ylwbgmid">Leading by 23</td> <td class="ylwbgmid">End of Quarter</td> <td class="ylwbgmid">Trailing by 23</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>Final Quarter</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">2.1 13</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">2.2 14</td> </tr> <tr> <td class="ylwbgmid">3</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">4</td> </tr> <tr> <td class="ylwbgmid">66.7%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">50.0%</td> </tr> <tr> <td class="ylwbgmid">Lost quarter by 1</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won quarter by 1</td> </tr> <tr> <td class="ylwbgmid">Won game by 22</td> <td class="ylwbgmid">End of Game</td> <td class="ylwbgmid">Lost game by 22</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> </tr> <tr><td colspan="3" class="ylwbg2" style="height:4px"></td></tr> <tr><td colspan="5" class="ylwbdr" style="height:1px"></td></tr> </table> </TD></TR> <tr><td colspan="1" class="norm" style="height:20px"></td></tr> <TR><TD> <table border="0" cellspacing="0" cellpadding="0" width="760"> <tr><td height="21" align="center" colspan="7" class="tbtitle">Scoring Breakdown For Each Half</td></tr> <tr> <td rowspan="4" class="ylwbdr" style="width:1px"></td> <td rowspan="3" class="ylwbg2" style="width:4px"></td> <td colspan="1" class="ylwbg2" style="height:4px"></td> <td rowspan="3" class="ylwbg2" style="width:4px"></td> <td colspan="1" class="ylwbg2" style="height:4px"></td> <td rowspan="3" class="ylwbg2" style="width:4px"></td> <td rowspan="4" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>First Half</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">6.5 41</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">2.6 18</td> </tr> <tr> <td class="ylwbgmid">11</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">8</td> </tr> <tr> <td class="ylwbgmid">54.5%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">25.0%</td> </tr> <tr> <td class="ylwbgmid">Won half by 23</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Lost half by 23</td> </tr> <tr> <td class="ylwbgmid">Leading by 23</td> <td class="ylwbgmid">Halftime</td> <td class="ylwbgmid">Trailing by 23</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> <td> <table border="0" cellspacing="0" cellpadding="0" width="373"> <tr> <td rowspan="9" class="ylwbdr" style="width:1px"></td> <td colspan="3" class="ylwbdr" style="height:1px"></td> <td rowspan="9" class="ylwbdr" style="width:1px"></td> </tr> <tr> <td class="ylwbgmid" height="20" width="124"><b>Fremantle</b></td> <td class="ylwbgmid" width="125"><b>Second Half</b></td> <td class="ylwbgmid" width="124"><b>Adelaide</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">5.4 34</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">5.5 35</td> </tr> <tr> <td class="ylwbgmid">9</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">10</td> </tr> <tr> <td class="ylwbgmid">55.6%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">50.0%</td> </tr> <tr> <td class="ylwbgmid">Lost half by 1</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won half by 1</td> </tr> <tr> <td class="ylwbgmid">Won game by 22</td> <td class="ylwbgmid">End of Game</td> <td class="ylwbgmid">Lost game by 22</td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> </table> </td> </tr> <tr><td colspan="3" class="ylwbg2" style="height:4px"></td></tr> <tr><td colspan="5" class="ylwbdr" style="height:1px"></td></tr> </table> </TD></TR> </TABLE> </td></tr> </table></td> <td rowspan="3" bgcolor="#b7b7b7" style="width:1px"></td> </tr> <tr><td align="center" valign="middle" height="40"> </td></tr> <tr> <td colspan="1" bgcolor="#b7b7b7" style="height:1px"></td> </tr> <tr><td colspan="3" align="center" valign="middle" height="25"> <table id="footer"> <tr> <td id="footercopy">Footywire.com &copy; 2018</td> <td id="footerlinks"> <a href="/afl/footy/info?if=a">about</a> <a href="/afl/footy/info?if=t">terms</a> <a href="/afl/footy/info?if=p">privacy</a> <a target="_smaq" href="http://www.smaqtalk.com/">discussions</a> <a href="/afl/footy/contact_us">contact us</a> </td> </tr> </table> </td></tr> </table> </DIV> <table id="teammenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" >x</div></td></tr> <tr> <td colspan="3"><a class="submenuitem" href="/afl/footy/ft_teams">Compare Teams</a></td> </tr> <tr> <td colspan="3"><div class="submenutitle">Team Home Pages</div></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" class="submenuitem" href="/afl/footy/th-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('teammenu')" onMouseUp="hideSubMenu('teammenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="playermenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/ft_players">All Players</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/player_search">Player Search</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/past_players">Past Players</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/other_players">Other Players</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/ft_player_compare">Compare Players</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">Team Playing Lists</div></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" class="submenuitem" href="/afl/footy/tp-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('playermenu')" onMouseUp="hideSubMenu('playermenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="playerrankmenu"> <tr><td colspan="3" align="right"><div class="submenux" onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/ft_player_rankings?rt=LA">League Averages</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/ft_player_rankings?rt=LT">League Totals</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/ft_player_rankings?rt=RA">Rising Star Averages</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/ft_player_rankings?rt=RT">Rising Star Totals</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/ft_goal_kickers">Season Goalkickers</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">Player Rankings by Team</div></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" class="submenuitem" href="/afl/footy/tr-richmond-tigers">Tigers</a></td> </tr> <tr><td colspan="3" align="right"><div class="submenux" onClick="hideSubMenu('playerrankmenu')" onMouseUp="hideSubMenu('playerrankmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="teamrankmenu"> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" >x</div></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=TA">Team Averages</a></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=TT">Team Totals</a></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=OA">Opponent Averages</a></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=OT">Opponent Totals</a></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=DA">Team/Opponent Differential Averages</a></td></tr> <tr><td><a onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" class="submenuitem" href="/afl/footy/ft_team_rankings?type=DT">Team/Opponent Differential Totals</a></td></tr> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('teamrankmenu')" onMouseUp="hideSubMenu('teamrankmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="draftmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/ft_drafts">Full AFL Draft History</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/ft_team_draft_summaries">Draft Summary by Team</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">AFL Draft History by Team</div></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" class="submenuitem" href="/afl/footy/td-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('draftmenu')" onMouseUp="hideSubMenu('draftmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="risingstarmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ft_rising_stars_round_performances">Rising Star Round by Round Performances</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/rising_star_nominations">Rising Star Nominees</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/rising_star_winners">Rising Star Winners</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">Eligible Rising Stars by Team</div></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" class="submenuitem" href="/afl/footy/ty-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('risingstarmenu')" onMouseUp="hideSubMenu('risingstarmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="matchmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/ft_match_list">Full Season AFL Fixture</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">Played and Scheduled Matches by Team</div></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" class="submenuitem" href="/afl/footy/tg-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('matchmenu')" onMouseUp="hideSubMenu('matchmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="laddermenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder">Full Season</a></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/live_ladder">Live Ladder</a></td></tr> <tr> <td colspan="3"><div class="submenutitle">Filter Ladder by</div></td> </tr> <tr> <td><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder?pt=RD&st=01&sb=p">Round</a></td> <td><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder?pt=PD&st=Q1&sb=p">Match Period</a></td> <td><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder?pt=LC&st=LC&sb=p">Location</a></td> </tr> <tr> <td><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder?pt=VN&st=10&sb=p">Venue</a></td> <td><a onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" class="submenuitem" href="/afl/footy/ft_ladder?pt=ST&st=disposals&sb=p">Stats</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('laddermenu')" onMouseUp="hideSubMenu('laddermenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="brownlowmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/brownlow_medal">Full Brownlow Medal Count</a></td></tr><tr> <tr><td colspan="3"><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/brownlow_medal_winners">Brownlow Medal Winners</a></td></tr><tr> <tr><td colspan="3"><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/team_brownlow_medal_summaries">Summary by Team</a></td></tr><tr> <tr> <td colspan="3"><div class="submenutitle">Brownlow Medal Vote Getters By Club</div></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" class="submenuitem" href="/afl/footy/tb-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('brownlowmenu')" onMouseUp="hideSubMenu('brownlowmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="attendancemenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/attendances">AFL Crowds & Attendances</a></td></tr><tr> <tr> <td colspan="3"><div class="submenutitle">Historical Attendance by Team</div></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" class="submenuitem" href="/afl/footy/ta-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('attendancemenu')" onMouseUp="hideSubMenu('attendancemenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="coachmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/afl_coaches">AFL Coaches</a></td></tr><tr> <tr> <td colspan="3"><div class="submenutitle">AFL Club Coaches</div></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" class="submenuitem" href="/afl/footy/tc-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('coachmenu')" onMouseUp="hideSubMenu('coachmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="highlightsmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" >x</div></td></tr> <tr><td colspan="3"><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/afl_highlights">AFL Highlights</a></td></tr><tr> <tr> <td colspan="3"><div class="submenutitle">AFL Club Highlights</div></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" class="submenuitem" href="/afl/footy/tv-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('highlightsmenu')" onMouseUp="hideSubMenu('highlightsmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="supercoachmenu"> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" >x</div></td></tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/supercoach_round">Round by Round Player Rankings</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/supercoach_season">Season Player Rankings</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/supercoach_breakevens">Supercoach Breakevens</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/supercoach_scores">Supercoach Scores</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/supercoach_prices">Supercoach Prices</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/custom_supercoach_latest_scores">Custom Supercoach Player List</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" class="submenuitem" href="/afl/footy/pre_season_supercoach">Pre-Season Supercoach Stats</a></td></tr><tr> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('supercoachmenu')" onMouseUp="hideSubMenu('supercoachmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="dreamteammenu"> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" >x</div></td></tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/dream_team_round">Round by Round Player Rankings</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/dream_team_season">Season Player Rankings</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/dream_team_breakevens">AFL Fantasy Breakevens</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/dream_team_scores">AFL Fantasy Scores</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/dream_team_prices">AFL Fantasy Prices</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/custom_dream_team_latest_scores">Custom AFL Fantasy Player List</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" class="submenuitem" href="/afl/footy/pre_season_dream_team">Pre-Season AFL Fantasy Stats</a></td></tr><tr> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('dreamteammenu')" onMouseUp="hideSubMenu('dreamteammenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="selectionsmenu"> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('selectionsmenu')" onMouseUp="hideSubMenu('selectionsmenu')" >x</div></td></tr> <tr><td><a onClick="hideSubMenu('selectionsmenu')" onMouseUp="hideSubMenu('selectionsmenu')" class="submenuitem" href="/afl/footy/afl_team_selections">Latest Team Selections</a></td></tr><tr> <tr><td><a onClick="hideSubMenu('selectionsmenu')" onMouseUp="hideSubMenu('selectionsmenu')" class="submenuitem" href="/afl/footy/custom_all_team_selections">Custom Team Selections List</a></td></tr><tr> <tr><td align="right"><div class="submenux" onClick="hideSubMenu('selectionsmenu')" onMouseUp="hideSubMenu('selectionsmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="pastplayermenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" >x</div></td></tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" class="submenuitem" href="/afl/footy/ti-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('pastplayermenu')" onMouseUp="hideSubMenu('pastplayermenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <table id="contractsmenu"> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" >x</div></td></tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-carlton-blues">Blues</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-essendon-bombers">Bombers</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-western-bulldogs">Bulldogs</a></td> </tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-geelong-cats">Cats</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-adelaide-crows">Crows</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-melbourne-demons">Demons</a></td> </tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-fremantle-dockers">Dockers</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-west-coast-eagles">Eagles</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-greater-western-sydney-giants">Giants</a></td> </tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-hawthorn-hawks">Hawks</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-kangaroos">Kangaroos</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-brisbane-lions">Lions</a></td> </tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-collingwood-magpies">Magpies</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-port-adelaide-power">Power</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-st-kilda-saints">Saints</a></td> </tr> <tr> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-gold-coast-suns">Suns</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-sydney-swans">Swans</a></td> <td><a onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" class="submenuitem" href="/afl/footy/to-richmond-tigers">Tigers</a></td> </tr> <tr><td align="right" colspan="3"><div class="submenux" onClick="hideSubMenu('contractsmenu')" onMouseUp="hideSubMenu('contractsmenu')" style="padding-top:6px;">hide menu</div></td></tr> </table> <div id="membersbgdiv" onClick="closeMemberDivs();"></div> <div id="memberswhitediv"> <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr><td height="30" align="right" valign="top"><span id="membersx" onClick="closeMemberDivs();">X</span></td></tr> <tr><td id="memberscontent" valign="top" align="center"> &nbsp; </td></tr> </table> </div> </BODY> </HTML>
criffy/aflengine
matchfiles/footywire_adv/footywire_adv5698.html
HTML
gpl-3.0
136,446
# # @Authors: # Brizuela Lucia lula.brizuela@gmail.com # Guerra Brenda brenda.guerra.7@gmail.com # Crosa Fernando fernandocrosa@hotmail.com # Branciforte Horacio horaciob@gmail.com # Luna Juan juancluna@gmail.com # # @copyright (C) 2010 MercadoLibre S.R.L # # # @license GNU/GPL, see license.txt # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # class VersionExtras def self.clean_versions(type) end end
mercadolibre/cacique
app/models/version_extras.rb
Ruby
gpl-3.0
1,158
/************************************************************************ ** ** @file dialognewpattern.cpp ** @author Roman Telezhynskyi <dismine(at)gmail.com> ** @date 22 2, 2014 ** ** @brief ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. ** Copyright (C) 2013-2015 Valentina project ** <https://bitbucket.org/dismine/valentina> All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** Valentina is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with Valentina. If not, see <http://www.gnu.org/licenses/>. ** *************************************************************************/ #include "dialognewpattern.h" #include "ui_dialognewpattern.h" #include "../core/vapplication.h" #include "../vmisc/vsettings.h" #include "../vpatterndb/vcontainer.h" #include "../ifc/xml/vdomdocument.h" #include <QFileDialog> #include <QMessageBox> #include <QPushButton> #include <QSettings> #include <QDesktopWidget> //--------------------------------------------------------------------------------------------------------------------- DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPieceName, QWidget *parent) :QDialog(parent), ui(new Ui::DialogNewPattern), data(data), isInitialized(false) { ui->setupUi(this); #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) ui->lineEditName->setClearButtonEnabled(true); #endif qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c()); QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); ui->lineEditName->setText(patternPieceName); InitUnits(); CheckState(); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogNewPattern::CheckState); } //--------------------------------------------------------------------------------------------------------------------- DialogNewPattern::~DialogNewPattern() { delete ui; } //--------------------------------------------------------------------------------------------------------------------- Unit DialogNewPattern::PatternUnit() const { const qint32 index = ui->comboBoxUnits->currentIndex(); return VDomDocument::StrToUnits(ui->comboBoxUnits->itemData(index).toString()); } //--------------------------------------------------------------------------------------------------------------------- void DialogNewPattern::CheckState() { bool flagName = false; if (ui->lineEditName->text().isEmpty() == false) { flagName = true; } QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr) bOk->setEnabled(flagName); } //--------------------------------------------------------------------------------------------------------------------- void DialogNewPattern::showEvent(QShowEvent *event) { QDialog::showEvent( event ); if ( event->spontaneous() ) { return; } if (isInitialized) { return; } // do your init stuff here setMaximumSize(size()); setMinimumSize(size()); isInitialized = true;//first show windows are held } //--------------------------------------------------------------------------------------------------------------------- void DialogNewPattern::InitUnits() { ui->comboBoxUnits->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm))); ui->comboBoxUnits->addItem(tr("Millimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm))); ui->comboBoxUnits->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); // set default unit const qint32 indexUnit = ui->comboBoxUnits->findData(qApp->ValentinaSettings()->GetUnit()); if (indexUnit != -1) { ui->comboBoxUnits->setCurrentIndex(indexUnit); } } //--------------------------------------------------------------------------------------------------------------------- QString DialogNewPattern::name() const { return ui->lineEditName->text(); }
dismine/Valentina_sonar
src/app/valentina/dialogs/dialognewpattern.cpp
C++
gpl-3.0
4,633
#include <stdio.h> #include <iostream> #include "DB.hpp" #include "Helper.hpp" #include <string> #include <vector> #include "Bestellung_Detail.hpp" int main(int argc, char* argv[]) { //erstelle eine Datenbank oder verbinde mit einer schon bestehenden DB db("test.db"); //lies SQL aus einer Datei ein und erstelle in der Datenbank entsprechende Tabellen //db.createTables(Helper::getSqlFromFile("db.sql")); //Inserts //fügt einen Datensatz in Warengruppe ein //db.insertRecordWarengruppe("Reh"); //fügt einen Datensatz in Ware ein //db.insertRecordWare("Haxe2", 1); //fügt einen Datensatz in Bestellung ein //db.insertRecordBestellung("2016-12-05", "10:15", "Bitte rote Kisten mitgeben."); //fügt einen Datensatz in Bestellung_Detail ein //db.insertRecordBestellungDetail(2,5,3.5,4.4,32.50,"Nicht gefrostet."); //fügte einen Datensatz in Preis_History ein //db.insertRecordPreisHistory(1, 2, "2015-10-16", 12.30, 10, true); //Selects //gibt alle Warengruppen zurück // std::vector<Warengruppe> testVectWarengruppe = db.getAlleWarengruppenFromDB(); // for (Warengruppe i : testVectWarengruppe) // { // std::cout << i.l_id << ", " << i.s_name << ", " << i.s_kommentar << std::endl; // } //gibt alle Waren einer Warengruppe aus // std::vector<Ware> testVectWare = db.getAlleWarenOfOneWarengruppeFromDB("Reh"); // for (Ware i : testVectWare) // { // std::cout << i.l_id << ", " << i.s_name << ", " << i.s_warengruppe << ", " << i.f_preis_pro_kg << \ // ", " << i.f_preis_pro_stueck << ", " << i.s_warennummer << ", " << i.s_kommentar << std::endl; // } //gibt alle Preise einer Warengruppe und optional einer Ware an // std::vector<Preis_History> testVectPreis = db.getAllePreiseOfOneWarengruppeAndOnePreis("Hirsch"); // for (Preis_History i : testVectPreis) // { // std::cout << i.l_id << ", " << i.s_ware << ", " << i.s_warengruppe << ", " << i.s_datum << \ // ", " << i.b_aktuell << ", " << i.f_preis_pro_kg << ", " << i.f_preis_pro_stueck << std::endl; // } //gibt alle Bestellungen aus oder nur solche bestimmten Datums // std::vector<Bestellung> testVectBestellung = db.getAlleBestellungenOrOne("2016-11-30"); // for (Bestellung i : testVectBestellung) // { // std::cout << i.l_id << ", " << i.s_zieldatum << ", " << i.s_zielzeit << ", " << i.s_kommentar << std::endl; // } Bestellung_Detail test(5, "ware", "warengruppe", 2, "Woche 1", 0, 0, 0, 6); std::cout << test.f_bestellpreis << std::endl; //schließ die Datenbank wieder db.closeDatabase(); }
AchimMenzel/UniversalOrderProgram
datenbank/main.cpp
C++
gpl-3.0
2,636
package org.obiba.mica.micaConfig.service; import org.obiba.opal.core.domain.taxonomy.Vocabulary; public class VocabularyDuplicateAliasException extends AbstractVocabularyException { private static final long serialVersionUID = 1184806332897637307L; public VocabularyDuplicateAliasException() { super(); } public VocabularyDuplicateAliasException(Vocabulary v) { super("Duplicate vocabulary alias.", v); } }
Rima-B/mica2
mica-core/src/main/java/org/obiba/mica/micaConfig/service/VocabularyDuplicateAliasException.java
Java
gpl-3.0
431
/* -*- c++ -*- */ /* * Copyright 2004 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <alibaba_file_ring_source.h> #include <gr_io_signature.h> #include <cstdio> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdexcept> #include <stdio.h> //for remove, fseek // win32 (mingw/msvc) specific #ifdef HAVE_IO_H #include <io.h> #endif #ifdef O_BINARY #define OUR_O_BINARY O_BINARY #else #define OUR_O_BINARY 0 #endif // should be handled via configure #ifdef O_LARGEFILE #define OUR_O_LARGEFILE O_LARGEFILE #else #define OUR_O_LARGEFILE 0 #endif alibaba_file_ring_source::alibaba_file_ring_source (size_t itemsize) : gr_sync_block ("file_ring_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (1, 1, itemsize)), d_itemsize (itemsize), d_fp (NULL), d_open_file_index (0), next_file (true) { } void alibaba_file_ring_source::set_open_file_index(int n) { int nfiles = this->d_str_filename_vector.size(); if(nfiles != 0) this->d_open_file_index = n % nfiles; else this->d_open_file_index = n; } void alibaba_file_ring_source::append_filename(std::string s) { this->d_str_filename_vector.push_back(s); this->d_open_file_index %= this->d_str_filename_vector.size(); } int alibaba_file_ring_source::proceed_to_file() { void * old_fp = d_fp; // we use "open" to use to the O_LARGEFILE flag const char * filename = this->d_str_filename_vector[this->d_open_file_index].c_str(); int fd; if ((fd = open (filename, O_RDONLY | OUR_O_LARGEFILE | OUR_O_BINARY)) < 0) { perror (filename); if(d_fp != NULL) if (fseek ((FILE *) d_fp, 0, SEEK_SET) == -1) { fprintf(stderr, "[%s] fseek failed\n", __FILE__); fclose ((FILE *) d_fp); this->d_fp = NULL; exit(-1); } return 1; } if ((d_fp = fdopen (fd, "rb")) == NULL){ d_fp = old_fp; perror (filename); if(d_fp != NULL) if (fseek ((FILE *) d_fp, 0, SEEK_SET) == -1) { fprintf(stderr, "[%s] fseek failed\n", __FILE__); fclose ((FILE *) d_fp); this->d_fp = NULL; exit(-1); } return 1; } if( remove(filename) != 0 ){ perror( "Error deleting file" ); throw std::runtime_error ("can't delete file"); } if(old_fp != NULL){ fclose ((FILE *) old_fp); old_fp = NULL; } this->d_open_file_index ++; this->d_open_file_index %= this->d_str_filename_vector.size(); return 0; } // public constructor that returns a shared_ptr alibaba_file_ring_source_sptr alibaba_make_file_ring_source (size_t itemsize) { return alibaba_file_ring_source_sptr (new alibaba_file_ring_source (itemsize)); } alibaba_file_ring_source::~alibaba_file_ring_source () { if(d_fp != NULL) fclose ((FILE *) d_fp); } int alibaba_file_ring_source::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { char *o = (char *) output_items[0]; int i; int size = noutput_items; if(this->next_file) this->proceed_to_file(); while (size) { i = 0; if(this->d_fp != NULL){ i = fread(o, d_itemsize, size, (FILE *) d_fp); size -= i; o += i * d_itemsize; } if (size == 0) // done break; if (i > 0) // short read, try again continue; // We got a zero from fread. This is either EOF or error. In // any event,try to proceed to next file next_file = true; break; } if (size > 0){ // EOF or error //if (size == noutput_items) // we didn't read anything; say we're done // return -1; return noutput_items - size; // else return partial result } return noutput_items; }
ouspg/ridac
ali-baba/src/lib/alibaba_file_ring_source.cc
C++
gpl-3.0
4,439
<?php /** * Cold damage affix entity. * * PHP version 5 * * @category D3W * @package D3W\Calculator * @author Angel <angel.blizzard.mvp@gmail.com> * @copyright 2015 Diablo3-Web * @license GNU GPLv3 * @link https://github.com/Diablo3-Web */ namespace D3W\Calculator\Dto\Affix\ElementalDamage; use D3W\Calculator\Dto\Affix\ElementalDamage; use D3W\Calculator\Dto\Slot as CommonSlot; /** * Elemental damage. * * PHP version 5 * * @category Domain * @package D3W\Calculator\Dto\Affix\ElementalDamage * @author Angel <angel.blizzard.mvp@gmail.com> * @copyright 2015 Diablo3-Web * @license GNU GPLv3 * @link https://github.com/Diablo3-Web */ abstract class Cold extends ElementalDamage { const NAME = 'Cold damage'; /** * Constructor. * * @param CommonSlot $slot Slot, to which affix is bound. * @param double $minValue Minimum value. * @param double $maxValue Maximum value. * @param double $currentValue Current value. */ public function __construct(CommonSlot $slot, $minValue, $maxValue, $currentValue) { $name = self::NAME; $type = self::TYPE_PRIMARY; parent::__construct($type, $name, $slot, $minValue, $maxValue, $currentValue); } }
Diablo3-Web/d3-calculator-api
src/Dto/Affix/ElementalDamage/Cold.php
PHP
gpl-3.0
1,293
using KotaeteMVC.Helpers; using KotaeteMVC.Models; using KotaeteMVC.Models.ViewModels; using KotaeteMVC.Models.ViewModels.Base; using KotaeteMVC.Service; using Resources; using System.Web.Mvc; namespace KotaeteMVC.Controllers { public class UserController : AlertsController { public const string PreviousQuestionKey = "PreviousQuestionKey"; private PaginationCreator<ProfileViewModel> _paginationCreator = new PaginationCreator<ProfileViewModel>(); private UsersService _usersService; public UserController() { _usersService = new UsersService(Context, GetPageSize()); } [Route("user/{userName}/followers", Name = "userFollowers")] [Route("user/{userName}/followers/{page}", Name = "userPageFollowers")] public ActionResult Followers(string userName, int page = 1) { if (page < 1) { page = 1; } if (_usersService.ExistsUser(userName) == false) { return GetUserNotFoundView(userName); } else if (_usersService.GetFollowerCount(userName) == 0) { return View("NoFollowers", _usersService.GetNoFollowersViewModel(userName)); } var followerModel = _usersService.GetFollowersViewModel(userName, page); if (Request.IsAjaxRequest()) { return PartialView("MiniProfileGrid", followerModel); } else { ViewBag.HeaderImage = followerModel.OwnerProfile.HeaderUrl; return View("Followers", followerModel); } } [Route("user/{userName}/following", Name = "userFollowing")] [Route("user/{userName}/following/{page}", Name = "userPageFollowing")] public ActionResult Following(string userName, int page = 1) { if (page < 1) { page = 1; } if (_usersService.ExistsUser(userName) == false) { return GetUserNotFoundView(userName); } else if (_usersService.GetFollowingCount(userName) == 0) { return View("NoFollowers", _usersService.GetNotFollowingViewModel(userName)); } var followerModel = _usersService.GetFollowingUsersViewModel(userName, page); if (Request.IsAjaxRequest()) { return PartialView("MiniProfileGrid", followerModel); } else { ViewBag.HeaderImage = followerModel.OwnerProfile.HeaderUrl; return View("Following", followerModel); } } [Authorize] [Route("user/{userName}/follow")] public ActionResult FollowUser(string userName) { var result = _usersService.FollowUser(userName); if (result) { if (Request.IsAjaxRequest()) { var model = _usersService.GetFollowButtonViewModel(userName); return PartialView("FollowButton", model); } else { AddAlertSuccess(UsersStrings.FollowingSuccess + _usersService.GetUserScreenName(userName), ""); return RedirectToPrevious(); } } else { return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest); } } public override int GetPageSize() { return 9; } [Route("user/{userName}", Name = "userProfile")] public ActionResult Index(string userName) { if (_usersService.ExistsUser(userName) == false) { return GetUserNotFoundView(userName); } var userProfileModel = _usersService.GetProfileQuestionViewModel(userName); ViewBag.HeaderImage = userProfileModel.Profile.HeaderUrl; return View(userProfileModel); } public PartialViewResult UserProfile(string userName) { if (_usersService.ExistsUser(userName) == false) { return null; } var profile = _usersService.GetUserProfile(userName); return PartialView("Profile", profile); } [Authorize] [Route("user/{userName}/unfollow")] public ActionResult UnfollowUser(string userName) { var result = _usersService.UnfollowUser(userName); if (result) { if (Request.IsAjaxRequest()) { var model = _usersService.GetFollowButtonViewModel(userName); return PartialView("FollowButton", model); } else { AddAlertSuccess(UsersStrings.UnfollowingSuccessFst + _usersService.GetUserScreenName(userName) + UsersStrings.UnfollowingSuccessLst, ""); return RedirectToPrevious(); } } else { return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest); } } private ActionResult GetUserNotFoundView(string user) { var errorModel = new ErrorViewModel() { ErrorTitle = user + MainGlobal.UserNotFoundErrorHeading, ErrorMessage = MainGlobal.UserNotFoundErrorMessage }; return View("Error", errorModel); } private void InitializePagination(FollowersViewModel followerModel, string route, string userName, int page) { var paginator = new PaginationInitializer("userPageFollowers", "follower-grid", userName, GetPageSize()); paginator.InitializePaginationModel(followerModel, page, _usersService.GetFollowingCount(userName)); } } }
seranfuen/kotaete
KotaeteMVC/Controllers/UserController.cs
C#
gpl-3.0
6,071
--- layout: politician2 title: ramkumar v profile: party: IND constituency: Thoothukkudi state: Tamil Nadu education: level: details: not given page missing photo: sex: caste: religion: current-office-title: crime-accusation-instances: 0 date-of-birth: 1965 profession: networth: assets: 40,000 liabilities: pan: twitter: website: youtube-interview: wikipedia: candidature: - election: Lok Sabha 2009 myneta-link: http://myneta.info/ls2009/candidate.php?candidate_id=9220 affidavit-link: expenses-link: constituency: Thoothukkudi party: IND criminal-cases: 0 assets: 40,000 liabilities: result: crime-record: date: 2014-01-28 version: 0.0.5 tags: --- ##Summary ##Education {% include "education.html" %} ##Political Career {% include "political-career.html" %} ##Criminal Record {% include "criminal-record.html" %} ##Personal Wealth {% include "personal-wealth.html" %} ##Public Office Track Record {% include "track-record.html" %} ##References {% include "references.html" %}
vaibhavb/wisevoter
site/politicians/_posts/2013-12-18-ramkumar-v.md
Markdown
gpl-3.0
1,110
# -- Improved X11 forwarding through GNU Screen (or tmux). # If not in screen or tmux, update the DISPLAY cache. # If we are, update the value of DISPLAY to be that in the cache. # http://alexteichman.com/octo/blog/2014/01/01/x11-forwarding-and-terminal-multiplexers/ function update-x11-forwarding { if [ -z "$STY" -a -z "$TMUX" ]; then echo $DISPLAY > ~/.local/tmp/.display.txt else export DISPLAY=`cat ~/.local/tmp/.display.txt` fi } # This is run before every command. preexec() { # Don't cause a preexec for PROMPT_COMMAND. # Beware! This fails if PROMPT_COMMAND is a string containing more than one command. [ "$BASH_COMMAND" = "$PROMPT_COMMAND" ] && return update-x11-forwarding # Debugging. #echo DISPLAY = $DISPLAY, display.txt = `cat ~/.display.txt`, STY = $STY, TMUX = $TMUX } trap 'preexec' DEBUG
digivation/dotfiles
bin/update-x11-forwarding.sh
Shell
gpl-3.0
868
#ifndef _PLATFORM_DEFINES_HPP_ #define _PLATFORM_DEFINES_HPP_ #ifdef WIN32 #define KOVAN_SERIAL_PATH_SEP ("\\") #else #define KOVAN_SERIAL_PATH_SEP ("/") #endif #endif
kipr/libkovanserial
include/kovanserial/platform_defines.hpp
C++
gpl-3.0
170
package cl.smartcities.isci.transportinspector.router.stepInnerStrategy; import android.content.Context; import android.content.res.Resources; import android.support.v4.content.ContextCompat; import android.view.View; import cl.smartcities.isci.transportinspector.R; import cl.smartcities.isci.transportinspector.router.transappStep.StepViewHolder; /** * Created by Agustin Antoine on 26-09-2016. */ public class BusStrategy implements StepStrategy{ private final String busService; private final int busDrawable; public BusStrategy(int busDrawable, String busService) { this.busDrawable = busDrawable; this.busService = busService; } @Override public void setStepHolder(Context context, StepViewHolder holder, String time) { holder.busIcon.setImageDrawable(ContextCompat.getDrawable(context, busDrawable)); holder.busService.setText(busService); Resources res = context.getResources(); holder.stepTimeBus.setText(String.format(res.getString(R.string.transit_step_time), time)); holder.busLayout.setVisibility(View.VISIBLE); } }
InspectorIncognito/androidApp
app/src/main/java/cl/smartcities/isci/transportinspector/router/stepInnerStrategy/BusStrategy.java
Java
gpl-3.0
1,121
# This file contains the hexVal subprogram. # .globl hexVal # function hexVal # # C synopsis: # # int hexVal(char ch) # # MAL call sequence assuming ch is in $s0: # # move $a0, $s0 # jal hexVal # # Effect: # # If ch is a valid hexadecimal digit then its hexadecimal value is returned. # Otherwise -1 is returned. # # Stack usage: # # FIXME # # Temporary registers # # FIXME if necessary (hexVal can be implemented without $s or $t registers) # hexVal: blt $a0, '0', next bgt $a0, '9', next sub $v0, $a0, '0' # int hexVal(char ch) { j end # if ((ch1 >= '0') && (ch <= '9')) { next: # return ch - '0'; # } blt $a0, 'a', next1 # if (ch >= 'a') and (ch <= 'f') { bgt $a0, 'f', next1 # return ch - 'a' + 10; sub $a0, $a0, 'a' # } add $v0, $a0, 10 # if (ch >= 'A') and (ch <= 'F') { j end # return ch - 'A' + 10; next1: # } # return -1; blt $a0, 'A', next2 # } bgt $a0, 'F', next2 sub $a0, $a0, 'A' add $v0, $a0, 10 j end next2: li $v0, -1 end: jr $ra
MichaelCoughlinAN/Odds-N-Ends
Assembly/Hex_Int_Conversion/hexval.asm
Assembly
gpl-3.0
1,566
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ namespace Proyecto\SecurityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; use Proyecto\SecurityBundle\Entity\ConceptosActividad; class ActividadType extends AbstractType { public function buildForm(FormBuilderInterface $builder,array $options) { $builder->add('descripcion', 'text', array( 'required' => false, 'label' => 'Descripción', 'attr' => array( 'placeholder' => 'Escriba una descripción' ) )); $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { $actividad = $event->getData(); $form = $event->getForm(); if (!$actividad || null === $actividad->getId()) { $form->add('nombre', 'text', array( 'required' => true, 'attr' => array( 'placeholder' => 'Escriba un nombre' ) )); } }); //$builder->add('conceptosActividad', new ConceptosActividadType); /*$builder->add('conceptosActividad', 'collection', array( 'type' => new ConceptosActividadType(), 'label' => 'Conceptos', 'allow_delete' => true, 'allow_add' => true, 'by_reference' => false, 'options' => array( 'required' => false ) )); */ } public function getName() { return 'actividad_form'; } //put your code here }
Gaedr/aprendmas
src/Proyecto/SecurityBundle/Form/ActividadType.php
PHP
gpl-3.0
1,929
/* Copyright (C) 2014 PencilBlue, LLC This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * Interface for managing pages */ function ManagePages(){} //dependencies var Pages = require('../pages'); //inheritance util.inherits(ManagePages, pb.BaseController); //statics var SUB_NAV_KEY = 'manage_pages'; ManagePages.prototype.render = function(cb) { var self = this; var dao = new pb.DAO(); dao.query('page', pb.DAO.ANYWHERE, pb.DAO.PROJECT_ALL, {headline: pb.DAO.ASC}).then(function(pages) { if(pages.length === 0) { self.redirect('/admin/content/pages/new_page', cb); return; } pb.users.getAuthors(pages, function(err, pagesWithAuthor) { var angularData = pb.js.getAngularController( { navigation: pb.AdminNavigation.get(self.session, ['content', 'pages'], self.ls), pills: pb.AdminSubnavService.get(SUB_NAV_KEY, self.ls, 'manage_pages'), pages: self.getPageStatuses(pagesWithAuthor) }, [], 'initPagesPagination()'); var title = self.ls.get('MANAGE_PAGES'); self.setPageName(title); self.ts.registerLocal('angular_script', angularData); self.ts.load('admin/content/pages/manage_pages', function(err, data) { var result = '' + data; cb({content: result}); }); }); }); }; ManagePages.prototype.getPageStatuses = function(pages) { var now = new Date(); for(var i = 0; i < pages.length; i++) { if(pages[i].draft) { pages[i].status = this.ls.get('DRAFT'); } else if(pages[i].publish_date > now) { pages[i].status = this.ls.get('UNPUBLISHED'); } else { pages[i].status = this.ls.get('PUBLISHED'); } } return pages; }; ManagePages.getSubNavItems = function(key, ls, data) { var pills = Pages.getPillNavOptions(); pills.unshift( { name: 'manage_pages', title: ls.get('MANAGE_PAGES'), icon: 'refresh', href: '/admin/content/pages/manage_pages' }); return pills; }; //register admin sub-nav pb.AdminSubnavService.registerFor(SUB_NAV_KEY, ManagePages.getSubNavItems); //exports module.exports = ManagePages;
jerlando/pencilblue-koala
controllers/admin/content/pages/manage_pages.js
JavaScript
gpl-3.0
2,915
<?php namespace InstagramAPI\Realtime; use Clue\React\Socks\Client as SocksProxy; use InstagramAPI\Client as HttpClient; use InstagramAPI\Instagram; use InstagramAPI\Realtime; use InstagramAPI\Realtime\Utils\HttpConnectProxy; use React\Dns\Resolver\Factory as DnsFactory; use React\EventLoop\LoopInterface; use React\EventLoop\Timer\TimerInterface; use React\SocketClient\ConnectorInterface; use React\SocketClient\DnsConnector; use React\SocketClient\SecureConnector; use React\SocketClient\TcpConnector; use React\SocketClient\TimeoutConnector; abstract class Client { const DNS_SERVER = '8.8.8.8'; const CONNECTION_TIMEOUT = 5; const KEEPALIVE_INTERVAL = 30; /** @var float Minimum reconnection interval (in sec) */ const MIN_RECONNECT_INTERVAL = 0.5; /** @var float Maximum reconnection interval (in sec) */ const MAX_RECONNECT_INTERVAL = 300; // 5 minutes /** @var string */ protected $_id; /** @var Instagram */ protected $_instagram; /** @var Realtime */ protected $_rtc; /** @var TimerInterface */ protected $_keepaliveTimer; /** @var float */ protected $_keepaliveTimerInterval; /** @var TimerInterface */ protected $_reconnectTimer; /** @var float */ protected $_reconnectTimerInterval; /** @var bool */ protected $_shutdown; /** @var bool */ protected $_isConnected; /** @var bool */ protected $_debug; /** * Handle client-specific params. * * @param array $params * * @return mixed */ abstract protected function _handleParams( array $params); /** * Constructor. * * @param string $id * @param Realtime $rtc * @param Instagram $instagram * @param array $params */ public function __construct( $id, Realtime $rtc, Instagram $instagram, array $params = []) { $this->_id = $id; $this->_rtc = $rtc; $this->_instagram = $instagram; $this->_shutdown = false; $this->_isConnected = false; $this->_debug = $rtc->debug; $this->_handleParams($params); } /** * Return stored Instagram object. * * @return Instagram */ public function getInstagram() { return $this->_instagram; } /** * Return stored Instagram client. * * @return Realtime */ public function getRtc() { return $this->_rtc; } /** * Return client's identifier. * * @return string */ public function getId() { return $this->_id; } /** * @param object $data * @param object $reference * * @throws \JsonMapper_Exception * * @return object */ public function mapToJson( $data, $reference) { $mapper = new \JsonMapper(); $mapper->bStrictNullTypes = false; if ($this->_instagram->apiDeveloperDebug) { // API developer debugging? Throws error if class lacks properties. $mapper->bExceptionOnUndefinedProperty = true; } $result = $mapper->map($data, $reference); return $result; } /** * Print debug message. * * @param string $message */ public function debug( $message) { if (!$this->_debug) { return; } $now = date('H:i:s'); if (func_num_args() > 1) { $args = func_get_args(); $message = array_shift($args); $message = '[%s] [%s] '.$message.PHP_EOL; array_unshift($args, $this->_id); array_unshift($args, $now); array_unshift($args, $message); call_user_func_array('printf', $args); } else { printf('[%s] [%s] %s%s', $now, $this->_id, $message, PHP_EOL); } } /** * onKeepaliveTimer event. */ public function onKeepaliveTimer() { $this->_disconnect(); } /** * Emit onKeepaliveTimer event. * * @param string $pool */ public function emitKeepaliveTimer() { $this->_keepaliveTimer = null; $this->debug('Keepalive timer is fired'); $this->onKeepaliveTimer(); } /** * Cancel keepalive timer. */ public function cancelKeepaliveTimer() { if ($this->_keepaliveTimer === null) { return; } // Cancel existing timer. $this->_keepaliveTimer->cancel(); $this->_keepaliveTimer = null; $this->debug('Existing keepalive timer has been cancelled'); } /** * Cancel reconnect timer. */ public function cancelReconnectTimer() { if ($this->_reconnectTimer === null) { return; } // Cancel existing timer. $this->_reconnectTimer->cancel(); $this->_reconnectTimer = null; $this->debug('Existing reconnect timer has been cancelled'); } /** * Update keepalive interval (if needed) and set keepalive timer. * * @param float|null $interval */ public function setKeepaliveTimer( $interval = null) { // Cancel existing timer to prevent double-firing. $this->cancelKeepaliveTimer(); // Do not keepalive on shutdown. if ($this->_shutdown) { return; } // Do not set timer if we don't have interval yet. if ($interval === null && $this->_keepaliveTimerInterval === null) { return; } // Update interval if new value was supplied. if ($interval !== null) { $this->_keepaliveTimerInterval = max(0, $interval); } // Set up new timer. $this->debug('Setting up keepalive timer to %.1f seconds', $this->_keepaliveTimerInterval); $this->_keepaliveTimer = $this->_rtc->getLoop()->addTimer($this->_keepaliveTimerInterval, function () { $this->emitKeepaliveTimer(); }); } /** * Establish connection. */ abstract protected function _connect(); /** * Update reconnect interval and set up reconnect timer. * * @param float $interval */ public function setReconnectTimer( $interval) { // Cancel existing timers to prevent double-firing. $this->cancelKeepaliveTimer(); $this->cancelReconnectTimer(); // Do not reconnect on shutdown. if ($this->_shutdown) { return; } // We must keep interval sane. $this->_reconnectTimerInterval = max(0.1, min($interval, self::MAX_RECONNECT_INTERVAL)); $this->debug('Setting up connection timer to %.1f seconds', $this->_reconnectTimerInterval); // Set up new timer. $this->_reconnectTimer = $this->_rtc->getLoop()->addTimer($this->_reconnectTimerInterval, function () { $this->_keepaliveTimerInterval = self::KEEPALIVE_INTERVAL; $this->_connect(); }); } /** * Perform first connection in a row. */ final public function connect() { $this->setReconnectTimer(self::MIN_RECONNECT_INTERVAL); } /** * Perform reconnection after previous failed attempt. */ final public function reconnect() { // Implement progressive delay. $this->setReconnectTimer($this->_reconnectTimerInterval * 2); } /** * Disconnect from server. */ abstract protected function _disconnect(); /** * Proxy for _disconnect(). */ final public function shutdown() { if (!$this->_isConnected) { return; } $this->debug('Shutting down'); $this->_shutdown = true; $this->_disconnect(); } /** * Update sequence for given topic. * * @param string $topic * @param string $sequence */ abstract public function onUpdateSequence( $topic, $sequence); /** * Handle requested refresh. */ abstract public function onRefreshRequested(); /** * Handle subscribed event. * * @param string $topic */ abstract public function onSubscribedTo( $topic); /** * Handle unsubscribed event. * * @param string $topic */ abstract public function onUnsubscribedFrom( $topic); /** * @param string $host * * @return null|string */ protected function _getProxyAddress( $host) { $proxy = $this->_instagram->getProxy(); if (!is_array($proxy)) { return $proxy; } if (!isset($proxy['https'])) { throw new \InvalidArgumentException('No proxy with CONNECT method found'); } if (isset($proxy['no']) && \GuzzleHttp\is_host_in_noproxy($host, $proxy['no'])) { return; } return $proxy['https']; } /** * @param string $proxyAddress * @param ConnectorInterface $connector * @param LoopInterface $loop * * @return HttpConnectProxy|SocksProxy */ protected function _getProxyConnector( $proxyAddress, ConnectorInterface $connector, LoopInterface $loop) { if (strpos($proxyAddress, '://') === false) { $scheme = 'http'; } else { $scheme = parse_url($proxyAddress, PHP_URL_SCHEME); } switch ($scheme) { case 'socks': case 'socks4': case 'socks4a': case 'socks5': return new SocksProxy($proxyAddress, $connector); case 'http': return new HttpConnectProxy($proxyAddress, $connector); case 'https': $ssl = new SecureConnector($connector, $loop, $this->_getSecureContext()); return new HttpConnectProxy($proxyAddress, $ssl); default: throw new \InvalidArgumentException(sprintf('Unsupported proxy scheme: %s', $scheme)); } } /** * Fetch secure context from parent Instagram object. * * @return array */ protected function _getSecureContext() { $context = []; $value = $this->_instagram->getVerifySSL(); if ($value === true) { // PHP 5.6 or greater will find the system cert by default. When // < 5.6, use the Guzzle bundled cacert. if (PHP_VERSION_ID < 50600) { $context['cafile'] = \GuzzleHttp\default_ca_bundle(); } } elseif (is_string($value)) { $context['cafile'] = $value; if (!file_exists($value)) { throw new \RuntimeException("SSL CA bundle not found: $value"); } } elseif ($value === false) { $context['verify_peer'] = false; $context['verify_peer_name'] = false; return $context; } else { throw new \InvalidArgumentException('Invalid verify request option'); } $context['verify_peer'] = true; $context['verify_peer_name'] = true; $context['allow_self_signed'] = false; return $context; } /** * @param string $url * @param bool $secure * * @return ConnectorInterface */ public function getConnector( $url, $secure) { $host = parse_url($url, PHP_URL_HOST); $loop = $this->_rtc->getLoop(); // Use Google resolver. $dnsFactory = new DnsFactory(); $resolver = $dnsFactory->create(self::DNS_SERVER, $loop); // Initial connection. $tcp = new TcpConnector($loop); // Lookup hostname / proxy. $dns = new DnsConnector($tcp, $resolver); // Proxy connection (optional). $proxy = $this->_getProxyAddress($host); if ($proxy !== null) { $dns = $this->_getProxyConnector($proxy, $dns, $loop); } // Check for secure. if ($secure) { $dns = new SecureConnector($dns, $loop, $this->_getSecureContext()); } // Set connection timeout. return new TimeoutConnector($dns, self::CONNECTION_TIMEOUT, $loop); } /** * Check if feature is enabled. * * @param array $params * @param string $feature * * @return bool */ public static function isFeatureEnabled( array $params, $feature) { if (!isset($params[$feature])) { return false; } return in_array($params[$feature], ['enabled', 'true', '1']); } /** * Send command. * * @param string $command * * @return bool */ abstract protected function _sendCommand( $command); /** * Checks whether we can send something. * * @return bool */ public function isSendingAvailable() { return $this->_isConnected; } /** * Proxy for _sendCommand(). * * @param string $command * * @return bool */ public function sendCommand( $command) { if (!$this->isSendingAvailable()) { return false; } try { return $this->_sendCommand($command); } catch (\Exception $e) { return false; } } /** * Handle incoming action. * * @param Action $action */ protected function _handleAction( Action $action) { $action->handle($this); } /** * Process incoming action. * * @param object $message */ protected function _processAction( $message) { $this->debug('Received action "%s"', $message->action); switch ($message->action) { case Action::ACK: /** @var Action\Ack $action */ $action = $this->mapToJson($message, new Action\Ack()); break; case Action::UNSEEN_COUNT: /** @var Action\Unseen $action */ $action = $this->mapToJson($message, new Action\Unseen()); break; default: $this->debug('Action "%s" is ignored (unknown type)', $message->action); return; } $this->_handleAction($action); } /** * Handle incoming event. * * @param Event $event */ protected function _handleEvent( Event $event) { $event->handle($this); } /** * Process incoming event. * * @param object $message */ protected function _processEvent( $message) { $this->debug('Received event "%s"', $message->event); switch ($message->event) { case Event::SUBSCRIBED: /** @var Event\Subscribed $event */ $event = $this->mapToJson($message, new Event\Subscribed()); break; case Event::UNSUBSCRIBED: /** @var Event\Unsubscribed $event */ $event = $this->mapToJson($message, new Event\Unsubscribed()); break; case Event::KEEPALIVE: /** @var Event\Keepalive $event */ $event = $this->mapToJson($message, new Event\Keepalive()); break; case Event::PATCH: /** @var Event\Patch $event */ $event = $this->mapToJson($message, new Event\Patch()); break; case Event::BROADCAST_ACK: /** @var Event\BroadcastAck $event */ $event = $this->mapToJson($message, new Event\BroadcastAck()); break; case Event::ERROR: /** @var Event\Error $event */ $event = $this->mapToJson($message, new Event\Error()); break; default: $this->debug('Event "%s" is ignored (unknown type)', $message->event); return; } $this->_handleEvent($event); } /** * Process incoming message. * * @param string $message */ protected function _processMessage( $message) { $this->debug('Received message %s', $message); $message = HttpClient::api_body_decode($message); if (isset($message->event)) { $this->_processEvent($message); } elseif (isset($message->action)) { $this->_processAction($message); } else { $this->debug('Invalid message (both event and action are missing)'); } } }
ping/Instagram-API
src/Realtime/Client.php
PHP
gpl-3.0
16,711
from flask import Blueprint from flask import flash from flask import make_response, render_template from flask_login import current_user from markupsafe import Markup from app.helpers.data_getter import DataGetter from app.helpers.auth import AuthManager from app.helpers.exporters.ical import ICalExporter from app.helpers.exporters.pentabarfxml import PentabarfExporter from app.helpers.exporters.xcal import XCalExporter from app.helpers.permission_decorators import can_access event_export = Blueprint('event_export', __name__, url_prefix='/events/<int:event_id>/export') @event_export.route('/') @can_access def display_export_view(event_id): event = DataGetter.get_event(event_id) export_jobs = DataGetter.get_export_jobs(event_id) user = current_user if not AuthManager.is_verified_user(): flash(Markup("Your account is unverified. " "Please verify by clicking on the confirmation link that has been emailed to you." '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> ' 'click here to resend the confirmation.</a>')) return render_template( 'gentelella/admin/event/export/export.html', event=event, export_jobs=export_jobs, current_user=user ) @event_export.route('/pentabarf.xml') @can_access def pentabarf_export_view(event_id): response = make_response(PentabarfExporter.export(event_id)) response.headers["Content-Type"] = "application/xml" response.headers["Content-Disposition"] = "attachment; filename=pentabarf.xml" return response @event_export.route('/calendar.ical') @can_access def ical_export_view(event_id): response = make_response(ICalExporter.export(event_id)) response.headers["Content-Type"] = "text/calendar" response.headers["Content-Disposition"] = "attachment; filename=calendar.ics" return response @event_export.route('/calendar.xcs') @can_access def xcal_export_view(event_id): response = make_response(XCalExporter.export(event_id)) response.headers["Content-Type"] = "text/calendar" response.headers["Content-Disposition"] = "attachment; filename=calendar.xcs" return response
gaeun/open-event-orga-server
app/views/users/export.py
Python
gpl-3.0
2,211
<?php session_start(); if(isset($_SESSION['user'])){ $value=$_SESSION['user']; //var_dump($value); } if(isset($_GET['id']) && !empty($_GET['id'])){ $id_partida = $_GET['id']; require_once "../../System/Classes/Partida.php"; $partida= new Partida(); $partida= $partida->viewPartida($id_partida); if(empty($partida) || $partida->getId_Usuario()!== $value['id_usuario'] ){ include '../404/404.php'; } $nombre = $partida->getNombre(); $master = $partida->getId_Usuario(); $imagen = $partida->getImagen(); $descripcion = $partida->getDescripcion(); $anyo = $partida->getAnyo(); $nv_sobrenatural = $partida->getNv_Sobrenatural(); $limite = $partida->getLimite(); $token = $partida->getToken(); }else{ include '../404/404.php'; } $title='Panel de la partida'; $migas='#Home|../../index.php#Mesa|../../settings/table/#'.$nombre.'|view_partida.php?id='.$id_partida; include "../../Public/layouts/head.php"; ?> <script> $title = "test"; $body = "test body"; $icon = "favicon.ico"; //DesktopNotifyshow($title, $body, $icon); $(document).ready(function(){ $('#eliminar').click(function(){ swal({ title: "Estas seguro?", text: "No podras recuperar esta partida!", type: "warning", showCancelButton: true, confirmButtonClass: "btn-danger", confirmButtonText: "Eliminar!", closeOnConfirm: false }, function (isConfirm) { if (!isConfirm) return; $.ajax({ url: "../../System/Protocols/Partida_Del.php", type: "POST", data: { id: <?php echo $id_partida ?> }, dataType: "html", success: function (data) { console.log(data); $(location).attr('href', 'index.php'); }, error: function (xhr, ajaxOptions, thrownError) { swal("Error deleting!", "Please try again", "error"); } }); }); }); }); function confirm_click(data){ url = data; swal({ title: "Estas seguro?", type: "warning", showCancelButton: true, confirmButtonClass: "btn-danger", confirmButtonText: "Si, Eliminar!", cancelButtonText: "No, cancelar!", closeOnConfirm: true, closeOnCancel: true }, function(isConfirm) { if (isConfirm) { window.location.href = url.getAttribute("href"); } }); return false; } </script> <!-- Body content box --> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="lv-header-alt clearfix m-b-0 bgm-deeppurple z-depth-1-bottom"> <h2 class="lvh-label c-white f-18"><?php echo ''.$nombre; ?></h2> <ul class="lv-actions actions"> <li class="dropdown"> <a href="#" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> <i class="zmdi zmdi-more-vert c-white"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a <?php echo 'href="mod_partida.php?id='.$id_partida.'"';?>>Modificar Partida</a> </li> <li> <a href="#" id="eliminar">Eliminar partida</a> </li> </ul> </li> </ul> </div> <div class="card-body card-padding table-responsive p-0"> <table class="table b-0"> <thead class="bgm-purple b-0 c-white"> <tr> <th>Descripción</th> <th>Año</th> <th>Nv_Sobrenatural</th> <th>Máx_Jugadores</th> </tr> </thead> <tbody > <tr > <td><?php echo $descripcion; ?></td> <td><?php echo $anyo; ?></td> <td><?php echo $nv_sobrenatural; ?></td> <td><?php echo $limite; ?></td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="lv-header-alt clearfix m-b-0 bgm-green z-depth-1-bottom"> <h2 class="lvh-label c-white f-18">Jugadores </h2> <ul class="lv-actions actions"> <li> <a data-toggle="tooltip" data-placement="right" title="Invita y gestiona a tus Jugadores"> <i class="zmdi zmdi-info c-white"></i> </a> </li> <li class="dropdown"> <a href="#" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> <i class="zmdi zmdi-more-vert c-white"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a <?php echo 'href="invite.php?id='.$id_partida.'"';?>>Gestionar Invitaciones</a> </li> <li> <a <?php echo 'href="gestionar_experiencia.php?id='.$id_partida.'"';?>>Gestionar Experiencia</a> </li> </ul> </li> </ul> </div> <div class="card-body card-padding table-responsive p-0 card-body-partida"> <table class="table b-0"> <thead class="bgm-lightgreen b-0 c-white"> <tr> <th>Usuario</th> <th>Personaje</th> <th class='text-center'>Nivel</th> <th class='text-center'>&nbsp;</th> <th class='text-center'>&nbsp;</th> </tr> </thead> <tbody > <?php require_once "../../System/Classes/Personaje.php"; require_once "../../System/Classes/Usuario.php"; //Buscar per partida-Usuari, id partida, agafar tots els usaris que estan en true i agafem la id_usuari //Tenim tots els usuaris de la pratida acceptats. //agafar la id del usuari a la funció que esborra els usuaris, //i si se vol fer millor, agafo la funció dintre Protocol //comprovar si te personaje en partida i si no es null esborrar el personaje per id_personaje en id_partida $PartidaUsuario = new Partida_Usuari(); $PartidaUsuario = $PartidaUsuario->selectUsers($id_partida); /*Mostrem tots els personatges que siguin d'aquesta partida*/ //Si hi ha personatges en la partida entrem al if if (!empty($PartidaUsuario)) { //per a cada personatge busquem el seu usuari per la id_usuario foreach ($PartidaUsuario as $linia) { // id del usuari $id_Usuari = $linia->getId_Usuario(); // obtenim les dades del usuari $usuari = new Usuario(); $datos = $usuari->return_user($id_Usuari); $nickname = $usuari->getNickname(); // busquem si te un pj i sino mostrem que no en te. //Busquem dinte de personaje si la id del usuari te cap id personaje i si coincideix en la fila les id de partida $personaje = new Personaje(); $personajeUsuarioPartida = $personaje->viewPersonajeUsuario($id_Usuari, $id_partida); if (!empty($personajeUsuarioPartida)){ //si te un pj echo "<tr> <td class='text-capitalize text-success'>".$datos['nickname']."</td> <td class='text-capitalize text-info'>".$personajeUsuarioPartida['nombre']."</td> <td class='text-danger text-center'>".$personajeUsuarioPartida['nivel']."</td> <td class='text-center'> <label class='m-r-10 p-0'> <a href=../character/mod_personaje.php?id=".$id_Usuari."> <i class='zmdi zmdi-edit c-black f-16 c-green '></i> </a> </label> </td> <td class='text-center'> <label class='m-r-10 p-0'> <a onclick='return confirm_click(this);' href='../../System/Protocols/Partida_SignoutMaster.php?idp=".$id_partida."&idu=".$id_Usuari."'> <i class='zmdi zmdi-delete c-black f-16 c-red '></i> </a> </label> </tr>"; }else{ //Si no en te echo "<tr> <td class='text-capitalize text-success'>".$datos['nickname']."</td> <td class='text-capitalize text-info'> ??? </td> <td class='text-danger text-center'> ??? </td> <td class='text-center'> <label class='m-r-10 p-0'> <a href='#'> <i class='zmdi zmdi-edit c-black f-16 c-green '></i> </a> </label> </td> <td class='text-center'> <label class='m-r-10 p-0 ' > <a onclick='return confirm_click(this);' href='../../System/Protocols/Partida_SignoutMaster.php?idp=".$id_partida."&idu=".$id_Usuari."'> <i class='zmdi zmdi-delete c-black f-16 c-red '></i> </a> </label> </tr>"; } } } ?> </tbody> </table> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="lv-header-alt clearfix m-b-0 bgm-orange z-depth-1-bottom"> <h2 class="lvh-label c-white f-18">Objetos</h2> <ul class="lv-actions actions"> <li> <a data-toggle="tooltip" data-placement="right" title="Crea y gestiona tus propios Objetos"> <i class="zmdi zmdi-info c-white"></i> </a> </li> <li class="dropdown"> <a href="#" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> <i class="zmdi zmdi-more-vert c-white"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a href="new_objeto.php?id_partida=<?php echo $id_partida ?>">Nuevo</a> </li> </ul> </li> </ul> </div> <div class="card-body card-padding table-responsive p-0 card-body-partida"> <table class="table b-0"> <thead class="bgm-amber b-0 c-white"> <tr> <th>Nombre</th> <th>Categoría</th> <th class='text-center'>&nbsp;</th> <th class='text-center'>&nbsp;</th> </tr> </thead> <tbody > <?php require_once "../../System/Classes/Partida_Objeto.php"; require_once "../../System/Classes/Objeto.php"; require_once "../../System/Classes/Tipo.php"; $partida_objeto = new Partida_Objeto(); $id_objeto = $partida_objeto->view_Objetos_Partida($id_partida); $tipo = new Tipo(); /*Seleccionem la id de partida i busquem els seus objectes propis de partida*/ foreach ($id_objeto as $row) { $objeto1 = new Objeto(); $objeto1 = $objeto1->viewObj($row->getId_Objeto()); /*Per a cada objecte mostrem el contingut que volem*/ foreach ($objeto1 as $row2) { echo "<tr > <td>".strval($row2->getNombre())."</td>"; /*Per saber el nom del id_tipo hem de fer una select*/ $tipoNombre = $tipo->view_nombre($row2->getId_Tipo()); echo " <td>".strval($tipoNombre->getNombre())."</td> <td class='text-center'><a href='mod_objeto.php?id_objeto=".strval($row2->getId_Objeto())."&id_partida=".$id_partida."'><i class='zmdi zmdi-edit c-black f-20 c-green '></i></a></td> <td class='text-center'><a href='../../System/Protocols/Objeto_Del.php?id_objeto=".strval($row2->getId_Objeto())."&id_partida=".$id_partida."'><i class='zmdi zmdi-delete c-black f-20 c-red '></i></a></td> </tr>"; } } $objeto = new Objeto(); $objeto = $objeto->viewObjetosPublicos(); /*Mostrem tots els objectes que siguin public*/ foreach ($objeto as $row) { echo "<tr > <td>".strval($row->getNombre())."</td>"; /*Per saber el nom del id_tipo hem de fer una select*/ $tipoNombre = $tipo->view_nombre($row->getId_Tipo()); echo " <td>".strval($tipoNombre->getNombre())."</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr>"; } ?> </tbody> </table> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="lv-header-alt clearfix m-b-0 bgm-blue z-depth-1-bottom"> <h2 class="lvh-label c-white f-18">Npc's</h2> <ul class="lv-actions actions"> <li> <a data-toggle="tooltip" data-placement="right" title="Crea y gestiona tus propios NPC's"> <i class="zmdi zmdi-info c-white"></i> </a> </li> <li class="dropdown"> <a href="#" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> <i class="zmdi zmdi-more-vert c-white"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a target='_blank' href="new_personaje1.php?id_partida=<?php echo $id_partida ?>">Nuevo</a> </li> </ul> </li> </ul> </div> <div class="card-body card-padding table-responsive p-0 card-body-partida"> <table class="table b-0"> <thead class="bgm-lightblue b-0 c-white"> <tr> <th>Nombre</th> <th>Nivel</th> <th>Categoria</th> <th>&nbsp;</th> </tr> </thead> <tbody > <?php require_once "../../System/Classes/Personaje.php"; require_once "../../System/Classes/Usuario.php"; require_once "../../System/Classes/Categoria.php"; $personajes = new Personaje(); $personajes = $personajes->viewPNJ($master, $id_partida); if (!empty($personajes)) { foreach ($personajes as $row) { $id_cat = $row->getId_Categoria(); $categoria = new Categoria(); $categoria = $categoria->viewCar($id_cat); $cat = $categoria->getNombre(); $fakeidpart = $row->getId_Partida(); $fakeidnpcs = $row->getId_Personaje(); if($fakeidpart == $id_partida){ echo "<tr > <td class='text-capitalize text-success'>".$row->getNombre()."</td> <td class='text-capitalize text-success'>".$row->getNivel()."</td> <td class='text-capitalize text-success'>".$cat."</td> <td> <label class='m-r-10 p-0'> <a href=view_personaje.php?id_personaje=".$fakeidnpcs."&id_partida=".$fakeidpart."> <i class='zmdi zmdi-eye c-black f-16 c-amber'></i> </a> </label> </td>"; }else{ echo "<tr > <td class='text-capitalize text-success'>".$row->getNombre()."</td> <td class='text-capitalize text-success'>".$row->getNivel()."</td> <td class='text-capitalize text-success'>".$cat."</td> <td> &nbsp; </td>"; } } } ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include "../../Public/layouts/footer.php";?>
AniMasterOnline/AniMasterV2
settings/table/view_partida.php
PHP
gpl-3.0
22,989
/* * Copyright (C) 2013 Piotr Wójcik * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.comcraft.src; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Hashtable; import net.comcraft.client.Comcraft; /** * * @author Piotr Wójcik (Queader) */ public class LangBundle { private Hashtable wordMap; private Hashtable defaultMap; private Comcraft cc; public LangBundle(Comcraft cc) { wordMap = new Hashtable(150); defaultMap = new Hashtable(150); this.cc = cc; } private void loadMap(String fileName, Hashtable map) { map.clear(); BufferedReader bufferedReader; InputStream resource = cc.getResourceAsStream(fileName); if (resource == null) { // A user set a language from a mod and the mod is now missing, resource is null. return; } try { bufferedReader = new BufferedReader(new InputStreamReader(resource, "UTF-8")); } catch (UnsupportedEncodingException ex) { //#debug //# ex.printStackTrace(); bufferedReader = new BufferedReader(new InputStreamReader(resource)); } while (!bufferedReader.getReachedTheEnd()) { String word = bufferedReader.readLine(); if (word != null) { String key; String text; int firstIndex = word.indexOf("="); if (firstIndex != -1) { key = word.substring(0, firstIndex); text = word.substring(firstIndex + 1); map.put(key, text); } } } } public void setDefaultMap(String fileName) { loadMap(fileName, defaultMap); } public void loadBundle(String fileName) { loadMap(fileName, wordMap); } public String getText(String key) { String word = (String) wordMap.get(key); if (word == null) { word = (String) defaultMap.get(key); if (word == null) { return "???"; } } return word; } }
simon816/ComcraftModLoader
src/net/comcraft/src/LangBundle.java
Java
gpl-3.0
2,824
__author__ = 'Mayur M' import ImgIO def add(image1, image2): # add two images together if image1.width == image2.width and image1.height == image2.height: return_red = [] return_green = [] return_blue = [] for i in range(0, len(image1.red)): tmp_r = image1.red[i] + image2.red[i] # adding the RGB values tmp_g = image1.green[i] + image2.green[i] tmp_b = image1.blue[i] + image2.blue[i] if 0 <= tmp_r <= 255: return_red.append(tmp_r) else: return_red.append(tmp_r % 255) # loop values around if saturation if 0 <= tmp_g <= 255: return_green.append(tmp_g) else: return_green.append(tmp_g % 255) # loop values around if saturation if 0 <= tmp_b <= 255: return_blue.append(tmp_b) else: return_blue.append(tmp_b % 255) # loop values around if saturation return return_red, return_green, return_blue else: print "Error: image dimensions do not match!" def main(): # test case print('start!!!!!') ima = ImgIO.ImgIO() imb = ImgIO.ImgIO() ima.read_image("y.jpg") imb.read_image("test1.png") add_r, add_g, add_b = add(ima, imb) imc = ImgIO.ImgIO() imc.read_list(add_r, add_g, add_b, "final1.png", ima.width, ima.height) imc.write_image("final1.png") if __name__ == '__main__': main()
mm10ws/ImPy
ImAdd.py
Python
gpl-3.0
1,485
{ am_pm_abbreviated => [ "\N{U+0635}", "\N{U+0645}" ], available_formats => { E => "ccc", EHm => "E HH:mm", EHms => "E HH:mm:ss", Ed => "E\N{U+060c} d", Ehm => "E h:mm a", Ehms => "E h:mm:ss a", Gy => "y G", GyMMM => "MMM y G", GyMMMEd => "E\N{U+060c} d MMM\N{U+060c} y G", GyMMMd => "d MMM\N{U+060c} y G", H => "HH", Hm => "HH:mm", Hms => "HH:mm:ss", Hmsv => "HH:mm:ss v", Hmv => "HH:mm v", M => "L", MEd => "E\N{U+060c} d/M", MMM => "LLL", MMMEd => "E\N{U+060c} d MMM", MMMMEd => "E\N{U+060c} d MMMM", "MMMMW-count-few" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", "MMMMW-count-many" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", "MMMMW-count-one" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", "MMMMW-count-other" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", "MMMMW-count-two" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", "MMMMW-count-zero" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} W \N{U+0645}\N{U+0646} MMM", MMMMd => "d MMMM", MMMd => "d MMM", MMdd => "dd\N{U+200f}/MM", Md => "d/\N{U+200f}M", d => "d", h => "h a", hm => "h:mm a", hms => "h:mm:ss a", hmsv => "h:mm:ss a v", hmv => "h:mm a v", ms => "mm:ss", y => "y", yM => "M\N{U+200f}/y", yMEd => "E\N{U+060c} d/\N{U+200f}M/\N{U+200f}y", yMM => "MM\N{U+200f}/y", yMMM => "MMM y", yMMMEd => "E\N{U+060c} d MMM\N{U+060c} y", yMMMM => "MMMM y", yMMMd => "d MMM\N{U+060c} y", yMd => "d\N{U+200f}/M\N{U+200f}/y", yQQQ => "QQQ y", yQQQQ => "QQQQ y", "yw-count-few" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y", "yw-count-many" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y", "yw-count-one" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y", "yw-count-other" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y", "yw-count-two" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y", "yw-count-zero" => "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0633}\N{U+0628}\N{U+0648}\N{U+0639} w \N{U+0645}\N{U+0646} \N{U+0633}\N{U+0646}\N{U+0629} y" }, code => "ar-IL", date_format_full => "EEEE\N{U+060c} d MMMM\N{U+060c} y", date_format_long => "d MMMM\N{U+060c} y", date_format_medium => "dd\N{U+200f}/MM\N{U+200f}/y", date_format_short => "d\N{U+200f}/M\N{U+200f}/y", datetime_format_full => "{1} {0}", datetime_format_long => "{1} {0}", datetime_format_medium => "{1} {0}", datetime_format_short => "{1} {0}", day_format_abbreviated => [ "\N{U+0627}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0646}\N{U+064a}\N{U+0646}", "\N{U+0627}\N{U+0644}\N{U+062b}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0631}\N{U+0628}\N{U+0639}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+062e}\N{U+0645}\N{U+064a}\N{U+0633}", "\N{U+0627}\N{U+0644}\N{U+062c}\N{U+0645}\N{U+0639}\N{U+0629}", "\N{U+0627}\N{U+0644}\N{U+0633}\N{U+0628}\N{U+062a}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+062d}\N{U+062f}" ], day_format_narrow => [ "\N{U+0646}", "\N{U+062b}", "\N{U+0631}", "\N{U+062e}", "\N{U+062c}", "\N{U+0633}", "\N{U+062d}" ], day_format_wide => [ "\N{U+0627}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0646}\N{U+064a}\N{U+0646}", "\N{U+0627}\N{U+0644}\N{U+062b}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0631}\N{U+0628}\N{U+0639}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+062e}\N{U+0645}\N{U+064a}\N{U+0633}", "\N{U+0627}\N{U+0644}\N{U+062c}\N{U+0645}\N{U+0639}\N{U+0629}", "\N{U+0627}\N{U+0644}\N{U+0633}\N{U+0628}\N{U+062a}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+062d}\N{U+062f}" ], day_stand_alone_abbreviated => [ "\N{U+0627}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0646}\N{U+064a}\N{U+0646}", "\N{U+0627}\N{U+0644}\N{U+062b}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0631}\N{U+0628}\N{U+0639}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+062e}\N{U+0645}\N{U+064a}\N{U+0633}", "\N{U+0627}\N{U+0644}\N{U+062c}\N{U+0645}\N{U+0639}\N{U+0629}", "\N{U+0627}\N{U+0644}\N{U+0633}\N{U+0628}\N{U+062a}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+062d}\N{U+062f}" ], day_stand_alone_narrow => [ "\N{U+0646}", "\N{U+062b}", "\N{U+0631}", "\N{U+062e}", "\N{U+062c}", "\N{U+0633}", "\N{U+062d}" ], day_stand_alone_wide => [ "\N{U+0627}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0646}\N{U+064a}\N{U+0646}", "\N{U+0627}\N{U+0644}\N{U+062b}\N{U+0644}\N{U+0627}\N{U+062b}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+0631}\N{U+0628}\N{U+0639}\N{U+0627}\N{U+0621}", "\N{U+0627}\N{U+0644}\N{U+062e}\N{U+0645}\N{U+064a}\N{U+0633}", "\N{U+0627}\N{U+0644}\N{U+062c}\N{U+0645}\N{U+0639}\N{U+0629}", "\N{U+0627}\N{U+0644}\N{U+0633}\N{U+0628}\N{U+062a}", "\N{U+0627}\N{U+0644}\N{U+0623}\N{U+062d}\N{U+062f}" ], era_abbreviated => [ "\N{U+0642}.\N{U+0645}", "\N{U+0645}" ], era_narrow => [ "\N{U+0642}.\N{U+0645}", "\N{U+0645}" ], era_wide => [ "\N{U+0642}\N{U+0628}\N{U+0644} \N{U+0627}\N{U+0644}\N{U+0645}\N{U+064a}\N{U+0644}\N{U+0627}\N{U+062f}", "\N{U+0645}\N{U+064a}\N{U+0644}\N{U+0627}\N{U+062f}\N{U+064a}" ], first_day_of_week => 7, glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y", glibc_date_format => "%m/%d/%y", glibc_datetime_format => "%a %b %e %H:%M:%S %Y", glibc_time_12_format => "%I:%M:%S %p", glibc_time_format => "%H:%M:%S", language => "Arabic", month_format_abbreviated => [ "\N{U+064a}\N{U+0646}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0641}\N{U+0628}\N{U+0631}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0645}\N{U+0627}\N{U+0631}\N{U+0633}", "\N{U+0623}\N{U+0628}\N{U+0631}\N{U+064a}\N{U+0644}", "\N{U+0645}\N{U+0627}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0646}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0644}\N{U+064a}\N{U+0648}", "\N{U+0623}\N{U+063a}\N{U+0633}\N{U+0637}\N{U+0633}", "\N{U+0633}\N{U+0628}\N{U+062a}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+0623}\N{U+0643}\N{U+062a}\N{U+0648}\N{U+0628}\N{U+0631}", "\N{U+0646}\N{U+0648}\N{U+0641}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+062f}\N{U+064a}\N{U+0633}\N{U+0645}\N{U+0628}\N{U+0631}" ], month_format_narrow => [ "\N{U+064a}", "\N{U+0641}", "\N{U+0645}", "\N{U+0623}", "\N{U+0648}", "\N{U+0646}", "\N{U+0644}", "\N{U+063a}", "\N{U+0633}", "\N{U+0643}", "\N{U+0628}", "\N{U+062f}" ], month_format_wide => [ "\N{U+064a}\N{U+0646}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0641}\N{U+0628}\N{U+0631}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0645}\N{U+0627}\N{U+0631}\N{U+0633}", "\N{U+0623}\N{U+0628}\N{U+0631}\N{U+064a}\N{U+0644}", "\N{U+0645}\N{U+0627}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0646}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0644}\N{U+064a}\N{U+0648}", "\N{U+0623}\N{U+063a}\N{U+0633}\N{U+0637}\N{U+0633}", "\N{U+0633}\N{U+0628}\N{U+062a}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+0623}\N{U+0643}\N{U+062a}\N{U+0648}\N{U+0628}\N{U+0631}", "\N{U+0646}\N{U+0648}\N{U+0641}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+062f}\N{U+064a}\N{U+0633}\N{U+0645}\N{U+0628}\N{U+0631}" ], month_stand_alone_abbreviated => [ "\N{U+064a}\N{U+0646}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0641}\N{U+0628}\N{U+0631}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0645}\N{U+0627}\N{U+0631}\N{U+0633}", "\N{U+0623}\N{U+0628}\N{U+0631}\N{U+064a}\N{U+0644}", "\N{U+0645}\N{U+0627}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0646}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0644}\N{U+064a}\N{U+0648}", "\N{U+0623}\N{U+063a}\N{U+0633}\N{U+0637}\N{U+0633}", "\N{U+0633}\N{U+0628}\N{U+062a}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+0623}\N{U+0643}\N{U+062a}\N{U+0648}\N{U+0628}\N{U+0631}", "\N{U+0646}\N{U+0648}\N{U+0641}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+062f}\N{U+064a}\N{U+0633}\N{U+0645}\N{U+0628}\N{U+0631}" ], month_stand_alone_narrow => [ "\N{U+064a}", "\N{U+0641}", "\N{U+0645}", "\N{U+0623}", "\N{U+0648}", "\N{U+0646}", "\N{U+0644}", "\N{U+063a}", "\N{U+0633}", "\N{U+0643}", "\N{U+0628}", "\N{U+062f}" ], month_stand_alone_wide => [ "\N{U+064a}\N{U+0646}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0641}\N{U+0628}\N{U+0631}\N{U+0627}\N{U+064a}\N{U+0631}", "\N{U+0645}\N{U+0627}\N{U+0631}\N{U+0633}", "\N{U+0623}\N{U+0628}\N{U+0631}\N{U+064a}\N{U+0644}", "\N{U+0645}\N{U+0627}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0646}\N{U+064a}\N{U+0648}", "\N{U+064a}\N{U+0648}\N{U+0644}\N{U+064a}\N{U+0648}", "\N{U+0623}\N{U+063a}\N{U+0633}\N{U+0637}\N{U+0633}", "\N{U+0633}\N{U+0628}\N{U+062a}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+0623}\N{U+0643}\N{U+062a}\N{U+0648}\N{U+0628}\N{U+0631}", "\N{U+0646}\N{U+0648}\N{U+0641}\N{U+0645}\N{U+0628}\N{U+0631}", "\N{U+062f}\N{U+064a}\N{U+0633}\N{U+0645}\N{U+0628}\N{U+0631}" ], name => "Arabic Israel", native_language => "\N{U+0627}\N{U+0644}\N{U+0639}\N{U+0631}\N{U+0628}\N{U+064a}\N{U+0629}", native_name => "\N{U+0627}\N{U+0644}\N{U+0639}\N{U+0631}\N{U+0628}\N{U+064a}\N{U+0629} \N{U+0625}\N{U+0633}\N{U+0631}\N{U+0627}\N{U+0626}\N{U+064a}\N{U+0644}", native_script => undef, native_territory => "\N{U+0625}\N{U+0633}\N{U+0631}\N{U+0627}\N{U+0626}\N{U+064a}\N{U+0644}", native_variant => undef, quarter_format_abbreviated => [ "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0623}\N{U+0648}\N{U+0644}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0646}\N{U+064a}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0644}\N{U+062b}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0631}\N{U+0627}\N{U+0628}\N{U+0639}" ], quarter_format_narrow => [ "\N{U+0661}", "\N{U+0662}", "\N{U+0663}", "\N{U+0664}" ], quarter_format_wide => [ "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0623}\N{U+0648}\N{U+0644}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0646}\N{U+064a}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0644}\N{U+062b}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0631}\N{U+0627}\N{U+0628}\N{U+0639}" ], quarter_stand_alone_abbreviated => [ "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0623}\N{U+0648}\N{U+0644}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0646}\N{U+064a}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0644}\N{U+062b}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0631}\N{U+0627}\N{U+0628}\N{U+0639}" ], quarter_stand_alone_narrow => [ "\N{U+0661}", "\N{U+0662}", "\N{U+0663}", "\N{U+0664}" ], quarter_stand_alone_wide => [ "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0623}\N{U+0648}\N{U+0644}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0646}\N{U+064a}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+062b}\N{U+0627}\N{U+0644}\N{U+062b}", "\N{U+0627}\N{U+0644}\N{U+0631}\N{U+0628}\N{U+0639} \N{U+0627}\N{U+0644}\N{U+0631}\N{U+0627}\N{U+0628}\N{U+0639}" ], script => undef, territory => "Israel", time_format_full => "H:mm:ss zzzz", time_format_long => "H:mm:ss z", time_format_medium => "H:mm:ss", time_format_short => "H:mm", variant => undef, version => 31 }
mgood7123/UPM
Files/Code/perl/lib/site_perl/5.26.1/auto/share/dist/DateTime-Locale/ar-IL.pl
Perl
gpl-3.0
12,734
#!/usr/bin/perl # Program name: alert_aix.pl # Purpose - Looking at data from the last day alerts AIX machines # concerning consumption of CPU, memory, etc.. sending an # email to one or more mailboxes. # Author - David L—pez San Juan # Disclaimer: this provided "as is". # License: GNU # Date - 02/02/14 # use warnings; use strict; use DBI; use FileHandle; use Time::Local; use POSIX qw/strftime/; use MIME::Lite; use HTML::Table; my $alert_aix="1.1.0 Feb 02, 2014"; ## Your Customizations Go Here ## ################################################# # Location of nmon files (need read/write access) my $LOG_DIR="/opt/nmon2db/log"; # loc my $LOG_FILE="$LOG_DIR/alert_aix.log"; # location of log of process # Database connection my $DBURL="DBI:mysql:database=NMONDB;host=localhost;port=3306"; my $DBUSER="nmon_adm"; my $DBPASS="nmon_adm00"; # Mail address to send alerts my $MAIL_DEST="mybox\@my_domain.com"; ################################################################# # End "Your Customizations Go Here". # You're on your own, if you change anything beyond this line :-) # See below for more information on these variables ################################################################# #################################################################### # Overview #################################################################### # This program provides the following functions # 1. Insert nmon daily performance data (from multiple # partitions) into DB # 2. Provides configuration and AIX tuning change control # # This was written for AIX servers, but will work with linux as well # (Linux nmon provides different charts than AIX) # # # Prereq's # 1. Web server # a. Web server # b. perl # c. cron job to start "nmon2db.pl" script # 2. AIX or Linux servers # a. nmon TOPAS-NMON lauch for smitty topas (Start Persistent nmon recording) # # Process # 1. Use "nmon " on AIX/Linux partitions to collect performance data # 2. Upload nmon data to a staging area ($NMON_DIR) on the web server # a. Upload choices choices ftp, nfs, scp, rsync, ..... # b. Adding servers is automatic. The nmon2db.pl script will create # all necessary Records in BBDD the first time it encounters # data from a new server. # 3. Cron job on web server runs nmon2db.pl, which insert data # into database for the web pages that connect to DB for show charts # 4. Point web browser to provided index.html file # # Key files/directories # A. nmon files # 1. Must have ".nmon" filename extension # 2. Location on web server = $NMON_DIR (or subdir). # a. User id that runs nmon2db.pl must have read/write access # 3. After processing, the nmon files are gzip'd (save space, prevents # redundant processing). # B. Web server directories # 1. $HTTP_DIR is the parent directory for the HTML files # #################################################################### #################################################################### ############# Main Program ############ #################################################################### my $dbh; # Connection to Database &main(); sub main() { my $start_date; my $end_date; my $body = ""; # Get yesterday day complete my ($sec, $min, $hour, $mday, $mon, $year) = localtime(); my $yesterday_midday=timelocal(0,0,12,$mday,$mon,$year) - 24*60*60; ($sec, $min, $hour, $mday, $mon, $year) = localtime($yesterday_midday); $start_date = sprintf("%4d-%02d-%02d 00:00:00", $year+1900, $mon, $mday); $end_date = sprintf("%4d-%02d-%02d 23:59:59", $year+1900, $mon, $mday); # Open file log eval { open FILELOG, ">>$LOG_FILE" or die "unable to open $LOG_FILE $!"; FILELOG->autoflush(1); }; if ($@) { print "ERROR - $@\n"; return 1; } ## Ccombine standard error with standard out, and both send to FILELOG #open STDOUT, "> $LOG_FILE"; #open STDERR, '>&STDOUT'; # First, check de connection with Database and check the data model my $rc = &connect_db(); if( $rc ne 0 ) { TRACE( "ERROR", "Don't connect to DB" ); return 1; } # Process # --------------------------------------------------------------------------- $body .= get_wait_high($start_date, $end_date); ## Memory ## --------------------------------------------------------------------------- $body .= get_memory_fscache_low($start_date, $end_date); $body .= get_memory_mem_virtual_low($start_date, $end_date); $body .= get_memory_mem_high_low($start_date, $end_date); # Page # ---------------------------------------------------------------------------- $body .= get_memory_page_high($start_date, $end_date); # Network # ---------------------------------------------------------------------------- $body .= get_network_high($start_date, $end_date); # FC # ---------------------------------------------------------------------------- $body .= get_fc_high($start_date, $end_date); # WLM # ---------------------------------------------------------------------------- $body .= get_wlm_high($start_date, $end_date); sendMail( $MAIL_DEST, $MAIL_DEST, "Alertas AIX", $body); eval { open FILEHTML, ">/var/www/htdocs/aix/nmonweb/avisos.html" or die "unable to open HTML $!"; FILELOG->autoflush(1); }; print FILEHTML <<HTML; <html> <head> <title>Avisos AIX</title> </head> <body> $body </body> </html> HTML close( FILEHTML ); exit 0; } ############################################ ############# Subroutines ############ ############################################ ################################################################## ## connect_db ################################################################## sub connect_db { # This subroutine make a connection with DB and check then # data model eval { # Connect to Database $dbh = DBI->connect($DBURL, $DBUSER, $DBPASS, { RaiseError=>0, PrintError=>0, AutoCommit=>1, HandleError=>\&dbierrorlog}) or die "ERROR: Error connection to DB $DBI::errstr\n"; # Disabled Autocommit $dbh->{mysql_no_autocommit_cmd} = 1; }; # Return error if there are some problem return 1 if $@; # All correct return 0; } ################################################################## ## dbierrorlog ################################################################## sub dbierrorlog { # Process error DB TRACE( "ERROR", "Callback DBI Error\n" ); TRACE( "ERROR", "$DBI::errstr \n" ); } ################################################################### ### TRACE ################################################################### sub TRACE { my $type = $_[0]; my $output = $_[1]; my $now = strftime('%D %T',localtime); print FILELOG "$now $type $output\n"; } ################################################################### ### sendMail ################################################################### sub sendMail { my $addr_from = $_[0]; my $addr_to = $_[1]; my $subject = $_[2]; my $message = $_[3]; my $msg = MIME::Lite->new( From => $addr_from, To => $addr_to, Subject => $subject, Type => 'multipart/mixed' ); # Add your text message. $msg->attach(Type => 'text/html', Data => qq{ <body> $message </body> } ); $msg->send; } ################################################################### ### get_wait_high ################################################################### sub get_wait_high { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 5; # Query to DB $select = "SELECT HOST.NAME, MAX(LPAR.VP_WAIT_PCT) FROM SAMPLES SMP, LPAR, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = LPAR.ID_SAMPLE AND LPAR.VP_WAIT_PCT > $MAX_VALUE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME UNION SELECT HOST.NAME, MAX(CPU_ALL.WAIT) FROM SAMPLES SMP, CPU_ALL, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = CPU_ALL.ID_SAMPLE AND CPU_ALL.WAIT > $MAX_VALUE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ORDER BY 1"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Alto porcentaje de Wait"; my @head = ( "Máquina", "Wait Máximo" ); my @data = ( ); push @data, [ @head ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_memory_fscache_low ################################################################### sub get_memory_fscache_low { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; # Query to DB $select = "SELECT HOST.NAME, MIN(MEMORY.FSCACHE_PCT), MINPERM_PCT FROM SAMPLES SMP, MEMORY, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = MEMORY.ID_SAMPLE AND MEMORY.FSCACHE_PCT <= MEMORY.MINPERM_PCT AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ORDER BY 1"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Porcentaje de FS cache por debajo del mínimo"; my @head = ( "Máquina", "% Minimo alcanzado", "% Min. Configurado" ); my @data = ( ); push @data, [ @head ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_memory_mem_virtual_low ################################################################### sub get_memory_mem_virtual_low { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 90; # Query to DB $select = "SELECT HOST.NAME, MIN(MEMORY.VIRTUAL_FREE_PCT) FROM SAMPLES SMP, MEMORY, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = MEMORY.ID_SAMPLE AND MEMORY.VIRTUAL_FREE_PCT <= $MAX_VALUE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ORDER BY 1;"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Memoria virtual usada elevada"; my @data = ( ); push @data, [ ( "Máquina", "% Memoria virtual usada" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_memory_mem_high_low ################################################################### sub get_memory_mem_high_low { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 80; # Query to DB $select = "SELECT HOST, FORMAT(TOTAL_MEMORY,2) FROM ( SELECT HOST.NAME AS HOST, AVG(MEMORY.PROCESS_PCT+MEMORY.SYSTEM_PCT) AS TOTAL_MEMORY FROM SAMPLES SMP, MEMORY, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = MEMORY.ID_SAMPLE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ) DAT WHERE TOTAL_MEMORY > $MAX_VALUE ORDER BY 1;"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Memoria alta (sin FS cache)"; my @data = ( ); push @data, [ ( "Máquina", "% Memoria ocupada de media" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_memory_page_high ################################################################### sub get_memory_page_high { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 80; # Query to DB $select = "SELECT HOST, DATO1, DATO2 FROM ( SELECT HOST.NAME AS HOST, MAX(PGSIN) AS DATO1, MAX(PGSOUT) AS DATO2 FROM SAMPLES SMP, PAGE, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = ID_SAMPLE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ) DAT WHERE DAT.DATO1 > $MAX_VALUE OR DAT.DATO2 > $MAX_VALUE"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Alta paginación"; my @data = ( ); push @data, [ ( "Máquina", "Máximo PageIn", "Máximo PageOut" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_network_high ################################################################### sub get_network_high { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 100; # MB/s my $MAX_VALUE2 = 10; # Query to DB $select = "SELECT HOST, DATO1, DATO2, DATO3, DATO4, DATO5 FROM ( SELECT HOST.NAME AS HOST, format(MAX(READ_) / 1024, 2) AS DATO1, FORMAT(MAX(WRITE_) / 1024, 2) AS DATO2, MAX(IERRS) AS DATO3, MAX(OERRS) AS DATO4, MAX(COLLISIONS) AS DATO5 FROM SAMPLES SMP, NET, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = ID_SAMPLE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ) DAT WHERE DAT.DATO1 > $MAX_VALUE OR DAT.DATO2 > $MAX_VALUE OR DAT.DATO3 > $MAX_VALUE2 OR DAT.DATO4 > $MAX_VALUE2 OR DAT.DATO5 > $MAX_VALUE2"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Utilización red alta"; my @data = ( ); push @data, [ ( "Máquina", "Máximo Lecturas (MB/s)", "Máximo Escrituras (MB/s)", "Errores Lectura", "Errores Escritura", "Colisiones" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_fc_high ################################################################### sub get_fc_high { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; my $MAX_VALUE = 100; # MB/s # Query to DB $select = "SELECT HOST, DATO1, DATO2 FROM ( SELECT HOST.NAME AS HOST, format(MAX(READ_) / 1024, 2) AS DATO1, FORMAT(MAX(WRITE_) / 1024, 2) AS DATO2 FROM SAMPLES SMP, FC, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = ID_SAMPLE AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME ) DAT WHERE DAT.DATO1 > $MAX_VALUE OR DAT.DATO2 > $MAX_VALUE"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "Utilización FC alta"; my @data = ( ); push @data, [ ( "Máquina", "Máximo Lecturas (MB/s)", "Máximo Escrituras (MB/s)" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### get_wlm_high ################################################################### sub get_wlm_high { my $start_date= $_[0]; my $end_date = $_[1]; my $select = ""; my $output = ""; my $sth; # Pointer to process SQL to search element my @row; # Query to DB $select = "SELECT HOST, DATO1, DATO2, DATO3 FROM ( SELECT HOST.NAME AS HOST, WLM_CLASS.NAME AS DATO1, MAX(WLM.CPU) AS DATO2, MAX(WLM.MEM) AS DATO3 FROM SAMPLES SMP, WLM, WLM_CLASS, HOST, ENVIRONMENT ENV WHERE SMP.DATE BETWEEN '$start_date' AND '$end_date' AND SMP.ID = ID_SAMPLE AND WLM.ID_NAME = WLM_CLASS.ID AND WLM_CLASS.NAME IN ('System', 'ITM', 'arcsight', 'SYSDIR') AND SMP.SERVER = HOST.ID AND HOST.ENVIRONMENT = ENV.ID AND ENV.NAME = 'PRO' GROUP BY HOST.NAME, WLM_CLASS.NAME ) DAT WHERE (DATO1 = 'System' AND (DAT.DATO2 > 25 OR DAT.DATO3 > 50 )) OR (DATO1 <> 'System' AND (DAT.DATO2 > 5 OR DAT.DATO3 > 10 )) ORDER BY 2, 1"; $sth = $dbh->prepare($select); $sth->execute or die "SQL Error: $DBI::errstr\n"; # If no data, return empty if( $DBI::rows == 0 ) { return ""; } # Format the output my $title = "WLM - Utilización CPU/Memoria alta"; my @data = ( ); push @data, [ ( "Máquina", "Clase WLM", "% Proceso", "% Memoria" ) ]; while (@row = $sth->fetchrow_array) { push @data, [ @row ]; } return to_html_table($title, @data ); } ################################################################### ### to_html_table ################################################################### sub to_html_table { my ($title, @data ) = @_; my $line; # Get number of columns and rows my $columns = $#{$data[0]} + 1; my $rows = $#data + 1; if( $columns == 0 || $rows == 0 ) { return; } ## Format the output my $output = "<h3>$title</h3>"; my $html_table = new HTML::Table( -rows=>$rows, -cols=>$columns, -align=>'center', -rules=>'rows', -width=>'50%', -spacing=>0, -padding=>0, -style=>'background:#D8D8D8', -border=>0 ); $html_table->setColWidth(1, '250px'); for my $i ( 0 .. $#data ) { for my $j ( 0 .. $#{ $data[$i] } ) { $html_table->setCell($i+1, $j+1, $data[$i][$j]); if( $j != 0 ) { $html_table->setCellAlign($i+1, $j+1, 'center'); } if( $j != 0 && $i != 0 ) { $html_table->setCellBGColor($i+1, $j+1, 'white'); } } } $html_table->setRowHead(1); $output .= $html_table->getTable(); return $output; }
nmonweb/nmonweb
nmon2db/2.0/bin/alerts_aix.pl
Perl
gpl-3.0
19,964
package pacman.entries.pacman.mcts; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import pacman.game.Constants.MOVE; import pacman.game.Game; public class Node { private static final double C = 100; private final Node parent; private final List<Node> children; private final MOVE move; private final Game state; private int visited; private double score; public int depth; public Node(Game state, Node parent, MOVE move) { this.state = state; this.parent = parent; this.move = move; this.depth = (parent == null) ? 0 : parent.getDepth() + 1; this.children = new ArrayList<>(); this.visited = 1; this.score = 0; } public double getUCTScore() { if (state.gameOver()) { return 0; } return (this.score / this.visited) + C * Math.sqrt(Math.log(this.parent.getVisited()) / this.visited); } public Node getBestUCTChild() { if (this.children.isEmpty()) { return null; } return this.children.stream().max(Comparator.comparingDouble(Node::getUCTScore)).get(); } public Node getBestChild() { if (this.children.isEmpty()) { return null; } return this.children.stream().max(Comparator.comparingDouble(Node::getScore)).get(); } public int getVisited() { return visited; } public void setVisited(int visited) { this.visited = visited; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } public int getDepth() { return depth; } public void setDepth(int depth) { this.depth = depth; } public Node getParent() { return parent; } public List<Node> getChildren() { return children; } public MOVE getMove() { return move; } public Game getState() { return state; } }
lrusnac/maig-2016
src/pacman/entries/pacman/mcts/Node.java
Java
gpl-3.0
2,040
package com.lody.virtual.client.stub; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import com.lody.virtual.client.core.PatchManager; import com.lody.virtual.client.env.VirtualRuntime; import com.lody.virtual.client.hook.patchs.am.HCallbackHook; import com.lody.virtual.client.local.VActivityManager; import com.lody.virtual.helper.proto.StubActivityRecord; import com.lody.virtual.os.VUserHandle; /** * @author Lody * */ public abstract class StubActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // Note: // ClassLoader of savedInstanceState is not exist now. super.onCreate(null); finish(); Intent stubIntent = getIntent(); StubActivityRecord r = new StubActivityRecord(stubIntent); if (r.intent != null) { if (TextUtils.equals(r.info.processName, VirtualRuntime.getProcessName()) && r.userId == VUserHandle.myUserId()) { PatchManager.getInstance().checkEnv(HCallbackHook.class); Intent intent = r.intent; startActivity(intent); } else { VActivityManager.get().startActivity(r.intent, r.userId); } } } public static class C0 extends StubActivity { } public static class C1 extends StubActivity { } public static class C2 extends StubActivity { } public static class C3 extends StubActivity { } public static class C4 extends StubActivity { } public static class C5 extends StubActivity { } public static class C6 extends StubActivity { } public static class C7 extends StubActivity { } public static class C8 extends StubActivity { } public static class C9 extends StubActivity { } public static class C10 extends StubActivity { } public static class C11 extends StubActivity { } public static class C12 extends StubActivity { } public static class C13 extends StubActivity { } public static class C14 extends StubActivity { } public static class C15 extends StubActivity { } public static class C16 extends StubActivity { } public static class C17 extends StubActivity { } public static class C18 extends StubActivity { } public static class C19 extends StubActivity { } public static class C20 extends StubActivity { } public static class C21 extends StubActivity { } public static class C22 extends StubActivity { } public static class C23 extends StubActivity { } public static class C24 extends StubActivity { } public static class C25 extends StubActivity { } public static class C26 extends StubActivity { } public static class C27 extends StubActivity { } public static class C28 extends StubActivity { } public static class C29 extends StubActivity { } public static class C30 extends StubActivity { } public static class C31 extends StubActivity { } public static class C32 extends StubActivity { } public static class C33 extends StubActivity { } public static class C34 extends StubActivity { } public static class C35 extends StubActivity { } public static class C36 extends StubActivity { } public static class C37 extends StubActivity { } public static class C38 extends StubActivity { } public static class C39 extends StubActivity { } public static class C40 extends StubActivity { } public static class C41 extends StubActivity { } public static class C42 extends StubActivity { } public static class C43 extends StubActivity { } public static class C44 extends StubActivity { } public static class C45 extends StubActivity { } public static class C46 extends StubActivity { } public static class C47 extends StubActivity { } public static class C48 extends StubActivity { } public static class C49 extends StubActivity { } public static class C50 extends StubActivity { } public static class C51 extends StubActivity { } public static class C52 extends StubActivity { } public static class C53 extends StubActivity { } public static class C54 extends StubActivity { } public static class C55 extends StubActivity { } public static class C56 extends StubActivity { } public static class C57 extends StubActivity { } public static class C58 extends StubActivity { } public static class C59 extends StubActivity { } public static class C60 extends StubActivity { } public static class C61 extends StubActivity { } public static class C62 extends StubActivity { } public static class C63 extends StubActivity { } public static class C64 extends StubActivity { } public static class C65 extends StubActivity { } public static class C66 extends StubActivity { } public static class C67 extends StubActivity { } public static class C68 extends StubActivity { } public static class C69 extends StubActivity { } public static class C70 extends StubActivity { } public static class C71 extends StubActivity { } public static class C72 extends StubActivity { } public static class C73 extends StubActivity { } public static class C74 extends StubActivity { } public static class C75 extends StubActivity { } public static class C76 extends StubActivity { } public static class C77 extends StubActivity { } public static class C78 extends StubActivity { } public static class C79 extends StubActivity { } public static class C80 extends StubActivity { } public static class C81 extends StubActivity { } public static class C82 extends StubActivity { } public static class C83 extends StubActivity { } public static class C84 extends StubActivity { } public static class C85 extends StubActivity { } public static class C86 extends StubActivity { } public static class C87 extends StubActivity { } public static class C88 extends StubActivity { } public static class C89 extends StubActivity { } public static class C90 extends StubActivity { } public static class C91 extends StubActivity { } public static class C92 extends StubActivity { } public static class C93 extends StubActivity { } public static class C94 extends StubActivity { } public static class C95 extends StubActivity { } public static class C96 extends StubActivity { } public static class C97 extends StubActivity { } public static class C98 extends StubActivity { } public static class C99 extends StubActivity { } }
prife/VirtualApp
VirtualApp/lib/src/main/java/com/lody/virtual/client/stub/StubActivity.java
Java
gpl-3.0
6,366
\hypertarget{_input_prompt_view_8java}{}\doxysection{src/ch/innovazion/arionide/ui/overlay/views/\+Input\+Prompt\+View.java File Reference} \label{_input_prompt_view_8java}\index{src/ch/innovazion/arionide/ui/overlay/views/InputPromptView.java@{src/ch/innovazion/arionide/ui/overlay/views/InputPromptView.java}} \doxysubsection*{Classes} \begin{DoxyCompactItemize} \item class \mbox{\hyperlink{classch_1_1innovazion_1_1arionide_1_1ui_1_1overlay_1_1views_1_1_input_prompt_view}{ch.\+innovazion.\+arionide.\+ui.\+overlay.\+views.\+Input\+Prompt\+View}} \end{DoxyCompactItemize} \doxysubsection*{Packages} \begin{DoxyCompactItemize} \item package \mbox{\hyperlink{namespacech_1_1innovazion_1_1arionide_1_1ui_1_1overlay_1_1views}{ch.\+innovazion.\+arionide.\+ui.\+overlay.\+views}} \end{DoxyCompactItemize}
thedreamer979/Arionide
doc/latex/_input_prompt_view_8java.tex
TeX
gpl-3.0
805
using System.Diagnostics.CodeAnalysis; using Castle.MicroKernel.Registration; using Selkie.Windsor; namespace Selkie.Services.Aco.Console { [ExcludeFromCodeCoverage] //ncrunch: no coverage start public class Installer : BasicConsoleInstaller, IWindsorInstaller { public override string GetPrefixOfDllsToInstall() { return "Selkie."; } } }
tschroedter/Selkie.Services.Monitor
Selkie.Services.Aco.Console/Installer.cs
C#
gpl-3.0
416
package com.lyrx.text import java.io.File import java.nio.charset.Charset import StringGenerator._ /** * Created by extawe on 11/4/16. */ class SimpleStringCollector() extends StringCollector{ var stringCollection:StringGenerator ="" override def stripSuffix(aSuffix:String)={ val oldSnippet:String = stringCollection.generate(); if(oldSnippet.trim().endsWith(aSuffix)){ stringCollection = oldSnippet.trim().stripSuffix(aSuffix) } } override def content(): StringGenerator = stringCollection override def collect(aString:GenBase[String]):GenBase[String]={ stringCollection = stringCollection << aString aString } }
lyrx/lyrxgenerator
src/main/scala/com/lyrx/text/SimpleStringCollector.scala
Scala
gpl-3.0
667
package com.lody.virtual.client; import android.os.Binder; import android.os.Build; import android.os.Process; import com.lody.virtual.client.core.VirtualCore; import com.lody.virtual.client.env.VirtualRuntime; import com.lody.virtual.client.ipc.VActivityManager; import com.lody.virtual.client.natives.NativeMethods; import com.lody.virtual.helper.compat.BuildCompat; import com.lody.virtual.helper.utils.DeviceUtil; import com.lody.virtual.helper.utils.VLog; import com.lody.virtual.os.VUserHandle; import com.lody.virtual.remote.InstalledAppInfo; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.List; import java.util.Map; /** * VirtualApp Native Project */ public class NativeEngine { private static final String TAG = NativeEngine.class.getSimpleName(); private static Map<String, InstalledAppInfo> sDexOverrideMap; private static boolean sFlag = false; static { try { System.loadLibrary("va++"); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } static { NativeMethods.init(); } public static void startDexOverride() { List<InstalledAppInfo> installedAppInfos = VirtualCore.get().getInstalledApps(0); sDexOverrideMap = new HashMap<>(installedAppInfos.size()); for (InstalledAppInfo info : installedAppInfos) { try { sDexOverrideMap.put(new File(info.apkPath).getCanonicalPath(), info); } catch (IOException e) { e.printStackTrace(); } } } public static String getRedirectedPath(String origPath) { try { return nativeGetRedirectedPath(origPath); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } return origPath; } public static String resverseRedirectedPath(String origPath) { try { return nativeReverseRedirectedPath(origPath); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } return origPath; } public static void redirectDirectory(String origPath, String newPath) { if (!origPath.endsWith("/")) { origPath = origPath + "/"; } if (!newPath.endsWith("/")) { newPath = newPath + "/"; } try { nativeIORedirect(origPath, newPath); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } public static void redirectFile(String origPath, String newPath) { if (origPath.endsWith("/")) { origPath = origPath.substring(0, origPath.length() - 1); } if (newPath.endsWith("/")) { newPath = newPath.substring(0, newPath.length() - 1); } try { nativeIORedirect(origPath, newPath); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } public static void whitelist(String path) { try { nativeIOWhitelist(path); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } public static void forbid(String path) { if (!path.endsWith("/")) { path = path + "/"; } try { nativeIOForbid(path); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } public static void enableIORedirect() { try { String soPath = String.format("/data/data/%s/lib/libva++.so", VirtualCore.get().getHostPkg()); if (!new File(soPath).exists()) { throw new RuntimeException("Unable to find the so."); } nativeEnableIORedirect(soPath, Build.VERSION.SDK_INT, BuildCompat.getPreviewSDKInt()); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } } static void launchEngine() { if (sFlag) { return; } Method[] methods = {NativeMethods.gOpenDexFileNative, NativeMethods.gCameraNativeSetup, NativeMethods.gAudioRecordNativeCheckPermission}; try { nativeLaunchEngine(methods, VirtualCore.get().getHostPkg(), VirtualRuntime.isArt(), Build.VERSION.SDK_INT, NativeMethods.gCameraMethodType); } catch (Throwable e) { VLog.e(TAG, VLog.getStackTraceString(e)); } sFlag = true; } public static void onKillProcess(int pid, int signal) { VLog.e(TAG, "killProcess: pid = %d, signal = %d.", pid, signal); if (pid == android.os.Process.myPid()) { VLog.e(TAG, VLog.getStackTraceString(new Throwable())); } } public static int onGetCallingUid(int originUid) { int callingPid = Binder.getCallingPid(); if (callingPid == Process.myPid()) { return VClientImpl.get().getBaseVUid(); } if (callingPid == VirtualCore.get().getSystemPid()) { return Process.SYSTEM_UID; } int vuid = VActivityManager.get().getUidByPid(callingPid); if (vuid != -1) { return VUserHandle.getAppId(vuid); } VLog.d(TAG, "Unknown uid: " + callingPid); return VClientImpl.get().getBaseVUid(); } public static void onOpenDexFileNative(String[] params) { String dexOrJarPath = params[0]; String outputPath = params[1]; VLog.d(TAG, "DexOrJarPath = %s, OutputPath = %s.", dexOrJarPath, outputPath); try { String canonical = new File(dexOrJarPath).getCanonicalPath(); InstalledAppInfo info = sDexOverrideMap.get(canonical); if (info != null && !info.dependSystem || info != null && DeviceUtil.isMeizuBelowN() && params[1] == null) { outputPath = info.getOdexFile().getPath(); params[1] = outputPath; } } catch (IOException e) { e.printStackTrace(); } } private static native void nativeLaunchEngine(Object[] method, String hostPackageName, boolean isArt, int apiLevel, int cameraMethodType); private static native void nativeMark(); private static native String nativeReverseRedirectedPath(String redirectedPath); private static native String nativeGetRedirectedPath(String orgPath); private static native void nativeIORedirect(String origPath, String newPath); private static native void nativeIOWhitelist(String path); private static native void nativeIOForbid(String path); private static native void nativeEnableIORedirect(String selfSoPath, int apiLevel, int previewApiLevel); public static int onGetUid(int uid) { return VClientImpl.get().getBaseVUid(); } }
dstmath/VirtualApp
VirtualApp/lib/src/main/java/com/lody/virtual/client/NativeEngine.java
Java
gpl-3.0
6,864
/* Chronic Disease Report Generator - Web based reports on quality of care standards Copyright (C) 2015 Brice Wong, Tom Sitter, Kevin Lin - Hamilton Family Health Team This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /* * Generates and displays chart and user controls * Handles user interaction */ var mdsViewer = (function() { //Member variables to store data and state var mCanvas = d3.select("#canvasContainer").select("#canvasSVG"); var mCanvasSnapshot = d3.select("#canvasContainer_snapshot").select("#canvasSVG");; var mMode = ""; //either "snapshot" or "tracking" var mDataLabels = true; //either true or false (not currently used) var mShowAverages = true; //LHIN Averages var mShowHFHTAverages = true; //HFHT Averages var mShowTargets = true; //HFHT Targets var mReportTitle = ""; //Main chart title - used when saving images or PDFs var mCalculatedData = null; // indicator result data set from mdsIndicators var mSelectedPhysicians = {}; // selected physicians object [{docnumber: true/false}, ...] var mArrayDates = null; //array of dates [date, date, ...] var mTotalPatients = null; //# of patient records in file var mCurrentIndSetIndex = 0; // current rule set index var mCurrentIndSetName = ""; // current rule set name var mCurrentIndicator = 0; // current indicator var mCurrentDateIndex = 0; //current selected date when in tracking mode var xScaleSnapshot, yScaleSnapshot, xAxisSnapshot, yAxisSnapshot; var xScaleTracking, yScaleTracking, xAxisTracking, yAxisTracking; //Static variables to handle graph dimensions and colors var DEFAULT_CANVAS_WIDTH = 940; var IMAGE_CANVAS_WIDTH = 752; var mCanvasScale = 1; var mCanvasWidth = DEFAULT_CANVAS_WIDTH * mCanvasScale; // pixels var DEFAULT_CANVAS_HEIGHT = 480; // pixels var mCanvasHeight = DEFAULT_CANVAS_HEIGHT; var DEFAULT_PADDING_LEFT_SNAPSHOT = 250; var mSnapshotPaddingLeft = DEFAULT_PADDING_LEFT_SNAPSHOT * mCanvasScale; var DEFAULT_PADDING_TOP_SNAPSHOT = 50; var DEFAULT_GRAPH_WIDTH_SNAPSHOT = DEFAULT_CANVAS_WIDTH - DEFAULT_PADDING_LEFT_SNAPSHOT - 25; var DEFAULT_BAR_WIDTH = 50; var mGraphWidthSnapshot = DEFAULT_GRAPH_WIDTH_SNAPSHOT * mCanvasScale; var DEFAULT_GRAPH_HEIGHT_SNAPSHOT = DEFAULT_CANVAS_HEIGHT - (2 * DEFAULT_PADDING_TOP_SNAPSHOT); var DEFAULT_PADDING_LEFT_TRACKING = 75; var mTrackingPaddingLeft = DEFAULT_PADDING_LEFT_TRACKING * mCanvasScale; var DEFAULT_PADDING_TOP_TRACKING = 50; var DEFAULT_GRAPH_WIDTH_TRACKING = DEFAULT_CANVAS_WIDTH - (2 * DEFAULT_PADDING_LEFT_TRACKING); var mGraphWidthTracking = DEFAULT_GRAPH_WIDTH_TRACKING * mCanvasScale; var DEFAULT_GRAPH_HEIGHT_TRACKING = DEFAULT_CANVAS_HEIGHT - (2 * DEFAULT_PADDING_TOP_TRACKING); var DEFAULT_YAXIS_CHAR_LENGTH = 25; var DEFAULT_XAXIS_CHAR_LENGTH = 8; var mYAxisCharLength = DEFAULT_YAXIS_CHAR_LENGTH * mCanvasScale; var mXAxisCharLength = DEFAULT_XAXIS_CHAR_LENGTH; var DEFAULT_COLOURS = ["firebrick", "steelblue", "yellowgreen", "mediumpurple", "cadetblue", "sandybrown", "forestgreen", "goldenrod", "darkslateblue", "firebrick", "palevioletred", "sienna", "bisque"]; var HIGHLIGHT_COLOURS = ["lightcoral", "#90B4D2", "#CCE698", "#DFD4F4", "#AFCED0", "#FAD2B0", "#90C590", "lightcoral","steelblue" , "lightcoral"]; var MONTH_NAMES = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var MONTH_NAMES_SHORT = [ "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec" ]; //Whether the file has a "Rostered" field, //used to check whether to make a "Rostered Patients Only" checkbox var hasRosteredField = false; var mRosteredOnly = true; var resizeTimer; //First time an extra canvas is generated, automatically scroll to it to show user the location //then disable the feature var mFirstScrollView = true; //Scroll until element is completely in view $.fn.scrollView = function () { return this.each(function () { $('html, body').animate({ scrollTop: $(this).offset().top }, 1000); }); }; //If element is less than 1/3 (approximately) in view then return true //(only works if element is below current viewing window) $.fn.inViewport = function () { return $(this).position().top + $(this).height()/3 < (window.innerHeight || document.documentElement.clientHeight) + $(window).scrollTop(); }; //Check if two objects have the same keys and values function isEquivalent(a, b) { // Create arrays of property names var aProps = Object.keys(a); var bProps = Object.keys(b); // If number of properties is different, // objects are not equivalent if (aProps.length != bProps.length) { return false; } for (var i = 0; i < aProps.length; i++) { var propName = aProps[i]; // If b does not have property // objects are not equivalent if (!b.hasOwnProperty(propName)) { return false; } if (!(b[propName] === a[propName])) { return false; } } // If we made it this far, objects // are considered equivalent return true; } /* * Called by mdsReader * Removes and reinitializes UI elements and chart * Calls appropriate graphing function based on mode */ function generateCharts(currentRuleSetIndex, calculatedData, selectedPhysicians, arrayDates, totalPatients) { //mMode = mMode || (arrayDates.length > 1 ? "tracking" : "snapshot"); mMode = (arrayDates.length > 1 ? "tracking" : "snapshot"); mCurrentIndSetIndex = currentRuleSetIndex; mCalculatedData = calculatedData; //If the selected phyisicians objects have different keys (i.e. docs) then this is //a new file and we have to update the physician list in the action bar var isNewFile = !isEquivalent(mSelectedPhysicians, selectedPhysicians); mSelectedPhysicians = selectedPhysicians; mArrayDates = arrayDates; mTotalPatients = totalPatients; mCurrentIndSetName = mdsIndicators.ruleList[currentRuleSetIndex].name; //mCurrentIndicator = 0; $("#canvasContainer_snapshot").empty(); $("#canvasContainer_histogram").empty(); if (mCalculatedData == undefined) { console.log("no calculated data!"); return; } if ($("#settings").children().length === 0) { //addUserInterface(); TPS } else if (isNewFile) { addPhysicianList(); mCurrentDateIndex = 0; } clearCanvas(); updateCanvasSize(); addUserInterface(); if ($('#indicatorEditor').is(':empty')) { addIndicatorEditor(); } if (mMode === "snapshot") { //calculatedData = calculatedData[0]; //$("#dropdownIndicators").hide(); generateSnapshot(0); histogram(); } else { var isEmpty = true; for (var i = 0; i < mCalculatedData.length; i++) { if (mCalculatedData[i].length>0) { isEmpty = false; } else { mCalculatedData.splice(i, 1); mArrayDates.splice(i, 1); } } if (!isEmpty) { //By default, select first item in dropdown addIndicatorEditor(); generateTracking(); } else { alert("No data found in these files for the " + $("#dropdownRules").val() + " rule set"); } } $("#dropdownRules").val(getCurrentIndSetName()); //Turn on canvas resizing window.onresize = function(){ if (resizeTimer){ clearTimeout(resizeTimer); } resizeTimer = setTimeout(function(){ updateCanvasSize(true); }, 250); }; }; /* * Remove graph and user interface elements * Called when chart needs to be refreshed or cleared */ function clearCanvas() { //Only applies to snapshot mode mCanvasHeight = Math.floor(DEFAULT_BAR_WIDTH * mCalculatedData[mCurrentDateIndex].length + (2*DEFAULT_PADDING_TOP_SNAPSHOT)) $("#canvasContainer").empty(); mCanvas = d3.select("#canvasContainer").append("svg") .attr("id", "canvasSVG") .attr("width", mCanvasWidth) .attr("height", mMode == 'snapshot' ? mCanvasHeight : DEFAULT_CANVAS_HEIGHT) .style("border", "1px solid lightgray") .append("g") .attr("class", "g_main") .attr("transform", function() { switch (mMode) { case "snapshot": return "translate(" + mSnapshotPaddingLeft + ", " + DEFAULT_PADDING_TOP_SNAPSHOT + ")"; break; case "tracking": return "translate(" + DEFAULT_PADDING_LEFT_TRACKING + ", " + DEFAULT_PADDING_TOP_TRACKING + ")"; break; } }); }; function allEqual(val, obj){ for (k in obj) { if (obj[k] != val) { return false; } } return true; } function getCurrentIndSetName(){ return mdsIndicators.ruleList[mCurrentIndSetIndex].name; } function getIndicator(){ if (arguments.length === 0) { return mdsIndicators.ruleList[mCurrentIndSetIndex].rules[getInternalRuleIndex()]; } else { return mdsIndicators.ruleList[mCurrentIndSetIndex].rules[arguments[0]]; } } function getIndicatorSet(){ if (arguments.length === 0) { return mdsIndicators.ruleList[mCurrentIndSetIndex].rules; } else { return mdsIndicators.ruleList[arguments[0]].rules; } } /* * Adds and initializes user interface elements, namely * Physician Selection * Indicator Set dropdown * Individual indicator dropdown (in tracking mode) * Download buttons */ function addUserInterface() { // If uploading new files, remove old side panels and recreate the panels with new filters based on the new imported data // physicianSection, measuresSection, settingsSection $("#settings").empty(); // Adding a panel section for selecting physicians $("#settings").append('<ul id="selectPhysicians"></ul>' + '<div id="dropdowns"></div>' + '<div id="actionButtons"></div>'); addPhysicianList(); // Save to PNG var btnSaveImage = '<button class="pure-button actionButton" id="btnSaveImage"><i class="fa fa-file-image-o"></i> Save as image</button>'; $("#actionButtons").append(btnSaveImage); $("#btnSaveImage").unbind(); $("#btnSaveImage").click(function() { saveFile('image'); }); var btnSavePDF = '<button class="pure-button actionButton" id="btnSavePDF"><i class="fa fa-file-pdf-o"></i> Save as PDF</button>'; $("#actionButtons").append(btnSavePDF); $("#btnSavePDF").unbind(); $("#btnSavePDF").click(function() { saveFile('pdf'); }); var btnDownloadPatients = '<button class="pure-button actionButton" id="btnDownloadPatients"><i class="fa fa-file-text"></i> Download Patient Info</button>' $("#actionButtons").append(btnDownloadPatients); $("#btnDownloadPatients").unbind(); $("#btnDownloadPatients").click(function() { var indicator = getIndicator(); var cols = indicator.col.slice(); //Remove current date from indicator columns var hasCurrentDate = $.inArray("Current Date", cols); if (hasCurrentDate >= 0) { cols.splice(hasCurrentDate, 1 ); } //get the data var data = mdsReader.getData()[mCurrentDateIndex]; //store it once in a variable var currentDate = data["Current Date"][0]; //Add patient ID to patient list var patientList = {} patientList['PatientID'] = data['Patient #']; for (var i in cols) { patientList[cols[i]] = data[cols[i]]; } var patientsIndex = mCalculatedData[mCurrentDateIndex][mCurrentIndicator].passedIndex; var csvPatientList = []; for (var r=0; r < patientsIndex.length; r++) { //Skip patients who are meeting criteria if (patientsIndex[r] === true) continue //Store information for patients not meeting criteria var row = []; row.push(patientList["PatientID"][r]); for (var i in cols) { // Remove any commas in text such as dates row.push(patientList[cols[i]][r].replace(",", "")); } csvPatientList.push([row.join(", ")]); } var message = []; message.push(indicator.desc()); message.push("Data Extracted On: " + currentDate); var header = ["Patient ID"]; for (var h in cols) { header.push(cols[h]); } message.push(header.join(", ")); for (var p in csvPatientList) { message.push(csvPatientList[p].toString()); } var text = new Blob([message.join("\n")], {type:'text/plain'}); saveAs(text, 'patientList.csv'); }); // Toggle data labels var btnToggleLabels = '<button class="pure-button actionButton" id="btnToggleLabels"><i class="fa fa-check-square-o"></i> Toggle data labels</button>'; $("#actionButtons").append(btnToggleLabels); $("#btnToggleLabels").unbind(); $("#btnToggleLabels").click(function() { toggleDataLabels(); $(this).find("i").toggleClass("fa-check-square-o fa-square-o"); return false; }); /* * Indicator set dropdown (e.g. diabetes, hypertension, immus, ...) */ var dropdownRules = ['<select id="dropdownRules" class="settingsDropdown">']; // Add dropdown to switch between rule sets for (var i=0; i<mdsIndicators.ruleList.length;i++) { dropdownRules.push('<option>' + mdsIndicators.ruleList[i].name + '</option>'); } dropdownRules.push('</select>'); $("#dropdowns").append(dropdownRules.join('\n')); $("#dropdownRules").change(function() { mCurrentIndSetIndex = this.selectedIndex; mCurrentIndSetName = this.value; mCurrentIndicator = 0; mdsReader.reCalculate(mCurrentIndSetIndex, mSelectedPhysicians); addIndicatorEditor(); }); $("#dropdownRules").val(getCurrentIndSetName()); /* * EMR choice dropdown (PSS or Oscar) */ var dropdownEMR = '<select id="dropdownEMR">' + '<option value="PSS">PSS</option>' + '<option value="Oscar">Oscar</option>' + '</select>'; $("#dropdowns").append(dropdownEMR); // Create change function $("#dropdownEMR").change(function() { mdsIndicators.setEMR(this.value); mdsReader.reCalculate(mCurrentIndSetIndex, mSelectedPhysicians); }); //Set the selected EMR in the dropdown based on which is selected $("#dropdownEMR").val(mdsIndicators.getEMR()); /* Rostered checkbox. Only visible if a Rostered field is in the report */ //Add a checkbox to allow user to filter only rostered patients if that column exists. //mdsReader has public variable that records whether this column exists //If checked, tell mdsIndicators that the user only wants rostered patients if (hasRosteredField) { var rostered = ' <input type="checkbox" id="rostered">' + 'Rostered Patients Only' + '</input>'; $("#dropdowns").append(rostered); $("#rostered").prop("checked", mRosteredOnly); $("#rostered").change(function() { mRosteredOnly = $(this).is(':checked'); mdsReader.reCalculate(mCurrentIndSetIndex, mSelectedPhysicians); }); } }; function addPhysicianList() { $("#selectPhysicians").empty(); var selected = allEqual(true, mSelectedPhysicians) ? "selected" : "notSelected"; $("#selectPhysicians").append('<li id="mainSelector" class="physicianListItem ' + selected + '"><span class="checkmark">\u2714</span>Select All</li>'); // Loop through 'arrayUniquePhysicians' and create a list item for each element. These will be the physician filters that will appear in the side // panel. There will also be a filter for "All Selected Physicians" //for (var i = 0; i < Object.keys(mSelectedPhysicians).length; i++) { for (doc in mSelectedPhysicians) { var selected = mSelectedPhysicians[doc] == true ? "selected" : "notSelected"; $("#selectPhysicians").append('<li class="physicianListItem ' + selected + '" data-docnumber="'+doc+'"><span class="checkmark">\u2714</span> Doctor Number ' + doc + '</li>'); } //} $(".physicianListItem").click( function(){ if (mCalculatedData == undefined) { console.log("Calculated data undefined"); return false; } var isSelected = $(this).hasClass("selected"); if (isSelected === true) { var className = 'notSelected'; } else { var className = 'selected'; } // If clicked on "Select All" if (this.id === "mainSelector") { // If class has 'selected', it currently is selected and must be unselected for (doc in mSelectedPhysicians) { if (mSelectedPhysicians.hasOwnProperty(doc)) { //negate the isSelected status to select/deselect the option mSelectedPhysicians[doc] = !isSelected; } } $(".physicianListItem").removeClass("selected notSelected").addClass(className); } // Otherwise, clicked on an individual doctor else { var doc = $(this).data('docnumber'); mSelectedPhysicians[doc] = !isSelected; $(this).toggleClass('selected notSelected'); if(allEqual(true, mSelectedPhysicians)) { $("#mainSelector").removeClass("selected notSelected").addClass("selected"); } else { $("#mainSelector").removeClass("selected notSelected").addClass("notSelected"); } } mdsReader.reCalculate(mCurrentIndSetIndex, mSelectedPhysicians); return false; }); } /** * Saves current chart to either PDF or PNG * @param {String} fileType Either 'pdf' or 'image' * @return {boolean} Always false - required for jQuery callback */ function saveFile(fileType) { //Second true means that we are forcing it to be "MEDIUM" sized updateCanvasSize(true, "MEDIUM"); // Append canvas to the document var canvasHeight = (mMode == 'snapshot' ? mCanvasHeight : DEFAULT_CANVAS_HEIGHT) var canvasString = '<canvas id="outputCanvas" width="' + IMAGE_CANVAS_WIDTH + '" height="' + canvasHeight + '" style="border: 1px solid black; display:none;"></canvas>'; $("#outputCanvas").remove(); $("body").append(canvasString); // Retrieve output canvas and copy the current visualization into the canvas var output = $("#outputCanvas")[0]; var svgXML = (new XMLSerializer()).serializeToString($("#canvasSVG")[0]); canvg(output, svgXML, { ignoreDimensions: true }); var ctx = output.getContext('2d'); ctx.save(); ctx.globalCompositeOperation = "destination-over"; ctx.fillStyle = 'white'; ctx.fillRect(0, 0, output.width, output.height); if (fileType === 'pdf') { // Retrieve data URL of the graph var outputURL = output.toDataURL('image/jpeg'); // Create portrait PDF object var doc = new jsPDF(); // Title doc.setFontSize(20); doc.setFont('times'); var splitTitle = doc.splitTextToSize(mReportTitle, 180); var titleSpacing; if (splitTitle[0].length >= 55) { titleSpacing = 10; } else { titleSpacing = 60-(splitTitle[0].length/2); } doc.text(titleSpacing, 20, splitTitle); //doc.addImage(outputURL, 'JPEG', 15, 60, 180, 100); doc.addImage(outputURL, 'JPEG', 15, 60, mCanvasWidth*0.2, canvasHeight*0.2); // save() to download automatically, output() to open in a new tab //doc.save(mReportTitle.concat('.pdf')); doc.output('save', mReportTitle.concat('.pdf')); } else { // Retrieve data string of the canvas and append to the hidden img element var outputURL = output.toDataURL(); $("#outputImg").src = outputURL; // Modify attributes of hidden elements and simulate file download $("#outputA").download = mReportTitle; $("#outputA").href = outputURL; $("#outputA").click(); output.toBlob(function(blob) { saveAs(blob, mReportTitle.concat('.png')); }); } ctx.restore(); //Restore canvas to previous size (if it changed) updateCanvasSize(true); //For jQuery callback return false; } function addIndicatorEditor() { function capitalize(s){ return s.toLowerCase().replace( /\b./g, function(a){ return a.toUpperCase(); } ); }; //Reset indicator editor bar removeIndicatorEditor(); currentIndicator = getIndicator(); if (!currentIndicator.hasOwnProperty("modifiable")) { return false; } var items = []; //items.push('<div id="indicatorEditor" class="pure-g">'); items.push('<div class="pure-u-1 indicatorTitle">Modify Indicator Targets</div>'); $.each(currentIndicator.modifiable, function(i, item) { var itemName = mdsIndicators.lookupVarNameTable[item]; if (typeof itemName === 'undefined') { itemName = capitalize(item); } items.push('<div class="pure-u-1"><label for="' + item + '">' + itemName + '</label>'); items.push('<br/><input id="' + item + '" class="indicatorValue" value="' + currentIndicator[item] + '"></div>'); }); items.push('<div style="padding-top:15px;" class="pure-u-1-2"><button id="applybtn" class="pure-button actionButton">Apply Changes</button></div>'); items.push('<div class="pure-u-1-2" style="padding-top:15px;"><button style="float:right" id="resetbtn" class="pure-button actionButton">Reset</button></div>'); items.push('<div class="pure-u-1"><button id="resetallbtn" class="pure-button actionButton">Reset All</button></div>'); $("#indicatorEditor").append(items.join('')); $("#indicatorEditor .indicatorValue").bind('keypress', function(e) { var code = e.keyCode || e.which; if(code == 13) { updateIndicator(); } }); $("#applybtn").unbind("click") .click( function() { updateIndicator();} ); $("#resetbtn").unbind("click") .click( function() { resetIndicator();} ); $("#resetallbtn").unbind("click") .click( function() { resetAllIndicators();} ); $("#indicatorEditor").css("display", "block"); updateDropdownIndicators(); } //Remove and re-add indicator dropdown using indicators in mCalculatedData function updateDropdownIndicators() { if ($("#indicatorEditor").length === 0) { return false; } $("#dropdownIndicators").remove(); var dropdownIndicators = ['<select id="dropdownIndicators">']; // Add the options for the different measures in the drop down menu // Created dynamically based on default values // To do: variables to store user input values for (var i = 0; i < mCalculatedData[0].length; i++) { if (getIndicator(getInternalRuleIndex(i)).hasOwnProperty('modifiable')) { dropdownIndicators.push('<option>' + mCalculatedData[0][i]["desc"] + '</option>'); } else { dropdownIndicators.push('<option disabled>' + mCalculatedData[0][i]["desc"] + '</option>'); } } dropdownIndicators.push('</select>'); $("#indicatorEditor").prepend(dropdownIndicators.join('\n')); $("#dropdownIndicators")[0].selectedIndex = mCurrentIndicator; $("#dropdownIndicators").change(function() { mCurrentIndicator = this.selectedIndex; updateCharts(); }); } // Update indicators with values from indicator editor function updateIndicator() { var params_updated = 0; var currentIndicator = getInternalRuleIndex(); $('.indicatorValue').each(function() { if (isNaN(Number(this.value))) { mdsIndicators.ruleList[mCurrentIndSetIndex].rules[currentIndicator][this.id] = 0; } else { mdsIndicators.ruleList[mCurrentIndSetIndex].rules[currentIndicator][this.id] = this.value; } params_updated++; }); if (params_updated === $('.indicatorValue').length) { recalculateIndicators(); } } //Call reset on the currently selected indicator function resetIndicator() { //var currentIndicator = getInternalRuleIndex(); mdsIndicators.resetToDefault(getIndicator()); recalculateIndicators(); } function resetAllIndicators() { var indicators = getIndicatorSet(); //Loop through all rules and Reset if they have a 'defaults' property for (var i = 0; i < indicators.length; i++){ if (indicators[i].hasOwnProperty('defaults')) { mdsIndicators.resetToDefault(indicators[i]); } } recalculateIndicators(); } //Re-add dropdown with indicators //Recalculate graph, preserving currently selected indicator //Re-add indicator editor function recalculateIndicators(){ var currentIndicator = mCurrentIndicator; mdsReader.reCalculate(mCurrentIndSetIndex, mSelectedPhysicians); mCurrentIndicator = currentIndicator; addIndicatorEditor(); } function removeIndicatorEditor() { $("#indicatorEditor").empty(); $("#indicatorEditor").css("display", "none"); } function updateCharts() { clearCanvas(); $("#canvasContainer_snapshot").empty(); $("#canvasContainer_histogram").empty(); if (mMode === "tracking") { generateTracking(); } else { generateSnapshot(0); histogram(); } addIndicatorEditor(); } function getInternalRuleIndex() { if (mCalculatedData[0].length > 0 && mCurrentIndicator < mCalculatedData[0].length) { return mCalculatedData[0][mCurrentIndicator].index; } else { return 0; } } /** * Updates dimensions of drawing canvas based on window size or * input parameters and redraws it * @param {boolean} redraw Clears and redraws canvas if true * @param {boolean} canvasSize One of ["SMALL", "MEDIUM", "LARGE"] to set canvas size manually * @return Nothing */ function updateCanvasSize(redraw, canvasSize) { var prevScale = mCanvasScale; var small = 0.6; var medium = 0.8; var large = 1; if (arguments.length === 2) { switch(canvasSize){ case "LARGE": mCanvasScale = large; break; case "MEDIUM": mCanvasScale = medium; break; case "SMALL": mCanvasScale = small; break; default: mCanvasScale = medium; } } else { if (window.innerWidth >= 960) { mCanvasScale = large; } else if (window.innerWidth < 960 && window.innerWidth >= 780) { mCanvasScale = medium; } else if (window.innerWidth < 780) { mCanvasScale = small; } } if (prevScale != mCanvasScale) { mCanvasWidth = Math.floor(DEFAULT_CANVAS_WIDTH*mCanvasScale); mGraphWidthSnapshot = Math.floor(DEFAULT_GRAPH_WIDTH_SNAPSHOT*mCanvasScale); mGraphWidthTracking = Math.floor(DEFAULT_GRAPH_WIDTH_TRACKING*mCanvasScale); mSnapshotPaddingLeft = Math.floor(DEFAULT_PADDING_LEFT_SNAPSHOT*mCanvasScale); mYAxisCharLength = Math.floor(DEFAULT_YAXIS_CHAR_LENGTH*mCanvasScale); if (redraw) { clearCanvas(); if (mMode === 'snapshot') { generateSnapshot(0); histogram(); } else { generateTracking(); } } } } function splitText(textElement, lineLength, title) { var isTitle = typeof title !== 'undefined' ? true : false; var text = textElement.text(); var splitRegex = new RegExp(".{" + lineLength + "}\\S*\\s+", "g"); var splitText= text.replace(splitRegex, "$&@").split(/\s+@/); var numLines = splitText.length; textElement.text('').attr('y', '0'); for (var i = 0; i < splitText.length; i++) { var tspan = textElement.append('tspan').text(splitText[i]); if (isTitle) { textElement.attr('y', -25); tspan.attr('y', '-8').attr('x',mCanvasWidth/2 - splitText[i].length).attr("style","text-anchor:middle"); } else { switch (splitText.length) { case 2: if (i==0) {tspan.attr('x', 0).attr('y', -6).attr('dx', '-10');} else {tspan.attr('x', 0).attr('y', 12).attr('dx', '-10');} break; case 3: if (i==0) {tspan.attr('x', 0).attr('y', -14).attr('dx', '-10');} else if (i==1) {tspan.attr('x', 0).attr('y', 4).attr('dx', '-10');} else {tspan.attr('x', 0).attr('y', 18).attr('dx', '-10');} break; default: tspan.attr('x', 0).attr('dx', '-10'); } } } } var insertLinebreaks = function (d) { var el = d3.select(this); var words = d3.select(this).text(); var splitRegex = new RegExp(".{" + mXAxisCharLength + "}\\S*\\s+", "g"); var words = words.replace(splitRegex, "$&@").split(/\s+@/); el.text(''); var length = 0; var line = ''; for (var i = 0; i < words.length; i++) { var tspan = el.append('tspan').text(words[i]); if (i > 0) tspan.attr('x', 0).attr('dy', '15'); } }; /** * Creates a bar chart for a report file * @param {numeric} selectedDate Index into array of file dates, used to select which file to create the barchart. 0 for one file. * @param {boolean} extraCanvas true if the bar chart should go in the secondary canvas, false or undefined to go into the main canvas */ function generateSnapshot(selectedDate, extraCanvas){ var selectedDate = selectedDate || 0; var canvas = (typeof extraCanvas === "undefined" ? mCanvas : mCanvasSnapshot); var data = mCalculatedData[selectedDate]; if (data.length === 0) { removeIndicatorEditor(); return; } var mGraphHeight = DEFAULT_BAR_WIDTH * data.length; // Add rectangles for percentage of patients within criteria var arrayData = []; var arrayDesc = []; var arrayTooltip = []; var arrayLabels = []; if (typeof(data) === undefined || data.length == 0) { return; } for (var i=0; i < data.length; i++) { if (data[i]["total"] == 0) { arrayLabels.push("0% (0/0)"); arrayData.push(0) } else { var percent = data[i]["passed"] / data[i]["total"] * 100; var label = Math.round(percent) + "% (" + data[i]["passed"] + "/" + data[i]["total"]+ ")"; arrayData.push(percent); arrayLabels.push(label); } //If the description is really long then insert a newline. var desc = data[i]["desc"]; var tooltip = data[i]["tooltip"] || ""; arrayDesc.push(desc); arrayTooltip.push(tooltip); } xScaleSnapshot = d3.scale.linear() .domain([0, 100]) .range([0, mGraphWidthSnapshot]); xAxisSnapshot = d3.svg.axis() .scale(xScaleSnapshot) .orient("bottom") .tickFormat(function(d) { return d + "%"; }); yScaleSnapshot = d3.scale.ordinal() .domain(arrayDesc) .rangeRoundBands([0, mGraphHeight], 0.1); yAxisSnapshot = d3.svg.axis() .scale(yScaleSnapshot) .orient("left"); canvas.selectAll(".tickline") .data(xScaleSnapshot.ticks(10)) .enter().append("line") .attr("x1", xScaleSnapshot) .attr("x2", xScaleSnapshot) .attr("y1", 0) .attr("y2", mGraphHeight) .style("stroke", "#ccc") .style("stroke-width", 1) .style("opacity", 0.7); // Add x axis label canvas.append("text") .attr("class", "xAxisLabel") .attr("x", mGraphWidthSnapshot / 2) .attr("y", mGraphHeight + 40) .attr("text-anchor", "middle") .style("font-weight", "bold") .style("font-size", "14px") .style("font-family", "Arial") .text("% of Patients"); // Graph title text canvas.append("text") .attr("class", "graphTitle") .attr("x", mGraphWidthSnapshot / 2) .attr("y", -DEFAULT_PADDING_TOP_SNAPSHOT / 2 + 10) .attr("text-anchor", "middle") .style("font-size", "14px") .style("font-weight", "bold") .text(function() { var arraySelectedOnly = []; for (var doc in mSelectedPhysicians) { if (mSelectedPhysicians[doc] == true) arraySelectedOnly.push(doc); } if (arraySelectedOnly.length == 0) { return "No Doctors Selected"; } var title = mCurrentIndSetName + " Report for Doctor"; if (arraySelectedOnly.length > 1) title += "s "; else title += " "; for (var i = 0; i < arraySelectedOnly.length; i++) { if (i == arraySelectedOnly.length - 2) title += arraySelectedOnly[i] + " and "; else if (i == arraySelectedOnly.length - 1) title += arraySelectedOnly[i]; else title += arraySelectedOnly[i] + ", "; } var date = mArrayDates[selectedDate]; title += " as of " + MONTH_NAMES_SHORT[date.getMonth()] + " " + date.getDate() + " " + date.getFullYear(); //title += " (n = " + mTotalPatients[selectedDate] + ")"; //store for when saving file mReportTitle = title; return title; }); //Translate graph into center of page canvas.append("g") .attr("transform", "translate(0, " + mGraphHeight + ")") .style("font-family", "Arial") .style("font-size", "14px") .call(xAxisSnapshot); //Y axis labels canvas.append("g") .attr("class", "indicatorLabel") .style("font-family", "Arial") .style("font-size", "14px") .attr("id", "yaxis") .call(yAxisSnapshot); canvas.selectAll('g#yaxis g text').each(function () { splitText(d3.select(this), mYAxisCharLength); }); // Add styling and attributes for major ticks in axes var majorTicks = document.getElementsByClassName("tick major"); for (var i = 0; i < majorTicks.length; i++) { majorTicks[i].childNodes[0].setAttribute("style", "fill:none; stroke:black"); majorTicks[i].childNodes[0].setAttribute("shape-rendering", "crispEdges"); } // Add styling and attributes for axes paths var paths = document.getElementsByClassName("domain"); for (var i = 0; i < paths.length; i++) { paths[i].setAttribute("style", "fill:none; stroke:black"); paths[i].setAttribute("shape-rendering", "crispEdges"); } if (arrayData.length == 0) { return; } // Add bars for patients within criteria canvas.selectAll("onTargetBar") .data(arrayData) .enter().append("rect") .attr("class", "onTargetBar") .attr("width", function(d) { return xScaleSnapshot(d); }) .attr("height", yScaleSnapshot.rangeBand()) .attr("y", function (d, i) { return yScaleSnapshot(arrayDesc[i]); }) .attr("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .attr("data-ruleindex", function (d, i) { return i.toString(); }) //used to select/modify current rule .on("click", function(d, i) { handleBarClick(i, this.getAttribute("y")); return false; }) .style("stroke", "black") .style("stroke-width", "1px") .attr("shape-rendering", "crispEdges") .append("svg:title") .text(function(d, i) { return arrayTooltip[i]; }); // Add bars for patients not within criteria canvas.selectAll("offTargetBar") .data(arrayData) .enter().append("rect") .attr("class", "offTargetBar") .attr("width", function(d) { return xScaleSnapshot(100 - d); }) .attr("height", yScaleSnapshot.rangeBand()) .attr("x", function(d) { return xScaleSnapshot(d); }) .attr("y", function(d, i) { return yScaleSnapshot(arrayDesc[i]); }) .attr("fill", "white") .style("stroke", "black") .style("stroke-width", "1px") .attr("shape-rendering", "crispEdges") .on("click", function(d, i) { handleBarClick(i, this.getAttribute("y")); return false; }) .append("svg:title") .text(function(d, i) { return arrayTooltip[i]; }); //Display HFHT Average for this indicator (if available) if (mShowHFHTAverages) { var yScaleAverages = d3.scale.linear() .domain([0, 100]) .range([0, mGraphHeight]); var indexes = []; for (var i in data){ indexes.push(data[i].index); } var indicatorSet = getIndicatorSet(); var hfhtaverages = []; for (var i in indexes) { if (indicatorSet[indexes[i]].hasOwnProperty("hfhtaverage")) { hfhtaverages.push({"index": +i, "hfhtavg": +indicatorSet[indexes[i]].hfhtaverage }); } } canvas.selectAll("HFHTaverageLine") .data(hfhtaverages) .enter().append("line") .attr("class", "HFHTaverageLine") .attr("x1", function(d) { return xScaleSnapshot(100*d.hfhtavg); }) .attr("x2", function(d) { return xScaleSnapshot(100*d.hfhtavg); }) .attr("y1", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("y2", function (d, i) { return yScaleSnapshot(arrayDesc[d.index])+yScaleSnapshot.rangeBand(); }) .attr("stroke-width", 2) .attr("stroke", "silver"); /* Continued after labels are inserted!! */ } //Display LHIN 4 Average for this indicator (if available) if (mShowAverages) { var yScaleAverages = d3.scale.linear() .domain([0, 100]) .range([0, mGraphHeight]); var indexes = []; for (var i in data){ indexes.push(data[i].index); } var indicatorSet = getIndicatorSet(); var averages = []; for (var i in indexes) { if (indicatorSet[indexes[i]].hasOwnProperty("average")) { averages.push({"index": +i, "avg": +indicatorSet[indexes[i]].average }); } } canvas.selectAll("averageLine") .data(averages) .enter().append("line") .attr("class", "averageLine") .attr("x1", function(d) { return xScaleSnapshot(100*d.avg); }) .attr("x2", function(d) { return xScaleSnapshot(100*d.avg); }) .attr("y1", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("y2", function (d, i) { return yScaleSnapshot(arrayDesc[d.index])+yScaleSnapshot.rangeBand(); }) .attr("stroke-width", 2) .attr("stroke", "gold"); /* Continued after labels are inserted!! */ } //Display HFHT Targets for this indicator (if available) if (mShowTargets) { var yScaleAverages = d3.scale.linear() .domain([0, 100]) .range([0, mGraphHeight]); var indexes = []; for (var i in data){ indexes.push(data[i].index); } var indicatorSet = getIndicatorSet(); var targets = []; for (var i in indexes) { if (indicatorSet[indexes[i]].hasOwnProperty("goal")) { targets.push({"index": indexes[i], "goal": +indicatorSet[indexes[i]].goal }); } } canvas.selectAll("targetLine") .data(targets) .enter().append("line") .attr("class", "targetLine") .attr("x1", function(d) { return xScaleSnapshot(100*d.goal); }) .attr("x2", function(d) { return xScaleSnapshot(100*d.goal); }) .attr("y1", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("y2", function (d, i) { return yScaleSnapshot(arrayDesc[d.index])+yScaleSnapshot.rangeBand(); }) .attr("stroke-width", 2) .attr("stroke", "#CD7F32"); /* Continued after labels are inserted!! */ } //Labels for each bar canvas.selectAll("onTargetLabel") .data(arrayData) .enter().append("text") .attr("class", "dataLabelSnapshot") .attr("x", function(d, i) { if (d<20) { return xScaleSnapshot(d+2); } else { return xScaleSnapshot(d/2); } }) .attr("y", function(d, i) { return yScaleSnapshot(arrayDesc[i]) + (yScaleSnapshot.rangeBand()/2); }) .attr("text-anchor", function(d) { if (d<20) { return "start"; } else { return "middle"; } }) .style("font-family", "Arial") .style("font-size", "13px") .attr("dy", ".35em") .style("fill", function(d, i) { if (d<20) { return "black"; } else { return "white"; } }) .text(function(d, i) { return arrayLabels[i]; }); //Rectangles are added here so that they lay on top of the labels if (mShowAverages) { //For tooltip canvas.selectAll("averageRect") .data(averages) .enter().append("rect") .attr("class", "averageRect") .attr("width", xScaleSnapshot(5)) .attr("height", yScaleSnapshot.rangeBand()) .attr("x", function (d, i) { return xScaleSnapshot(100*d.avg - 2.5); }) .attr("y", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("fill", "rgba(0, 0, 0, 0)") .append("svg:title") .text(function(d) { return "LHIN 4 Average (" + (d.avg*100).toFixed(1) + "%)" }); } //Rectangles are added here so that they lay on top of the labels if (mShowHFHTAverages) { //For tooltip canvas.selectAll("HFHTaverageRect") .data(hfhtaverages) .enter().append("rect") .attr("class", "HFHTaverageRect") .attr("width", xScaleSnapshot(5)) .attr("height", yScaleSnapshot.rangeBand()) .attr("x", function (d, i) { return xScaleSnapshot(100*d.hfhtavg - 2.5); }) .attr("y", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("fill", "rgba(0, 0, 0, 0)") .append("svg:title") .text(function(d) { return "HFHT Average (" + (d.hfhtavg*100).toFixed(1) + "%)" }); } //Rectangles are added here so that they lay on top of the labels if (mShowTargets) { //For tooltip canvas.selectAll("targetRect") .data(targets) .enter().append("rect") .attr("class", "targetRect") .attr("width", xScaleSnapshot(5)) .attr("height", yScaleSnapshot.rangeBand()) .attr("x", function (d, i) { return xScaleSnapshot(100*d.goal - 2.5); }) .attr("y", function (d, i) { return yScaleSnapshot(arrayDesc[d.index]); }) .attr("fill", "rgba(0, 0, 0, 0)") .append("svg:title") .text(function(d) { return "HFHT Target (" + (d.goal*100).toFixed(1) + "%)" }); } }; // End of generateSnapshot function handleBarClick(i, y) { var thisBar = $(".onTargetBar[y="+y+"]"); var isSelected = (thisBar.attr("data-selected") == "true") $(".onTargetBar") .attr("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .attr("data-selected", "false"); thisBar.attr("data-selected", "true"); if (isSelected) { thisBar.attr("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .attr("data-selected", "false"); } else { thisBar.attr("fill", HIGHLIGHT_COLOURS[mCurrentIndSetIndex]) .attr("data-selected", "true"); } mCurrentIndicator = i; histogram(); var currentIndicator = getIndicator(); if (currentIndicator.hasOwnProperty("modifiable")) { addIndicatorEditor(); } else { removeIndicatorEditor(); } } function generateTracking() { var arrayDates = mArrayDates; var arrayData = []; var arrayDesc = []; var arrayLabels = []; for (var i=0; i < mCalculatedData.length; i++) { arrayData.push([]); arrayDesc.push([]); arrayLabels.push([]); for (var j=0; j < mCalculatedData[i].length; j++) { if (mCalculatedData[i][j]["total"] == 0) { arrayLabels[i].push("0% (0/0)"); continue; } var percent = mCalculatedData[i][j]["passed"] / mCalculatedData[i][j]["total"] * 100; var label = Math.round(percent) + "% (" + mCalculatedData[i][j]["passed"] + "/" + mCalculatedData[i][j]["total"]+ ")"; arrayData[i].push(percent); arrayLabels[i].push(label); arrayDesc[i].push(mCalculatedData[i][j]["desc"]); } } if (arrayData.length == 0) { return; } // Create min and max dates for the time scale - 1 week before and after var minDate = new Date(arrayDates[0]); minDate.setDate(minDate.getDate()-30); var maxDate = new Date(arrayDates[arrayDates.length - 1]); maxDate.setDate(maxDate.getDate()+30); // Create the scale for the X axis xScaleTracking = d3.time.scale() .domain([minDate, maxDate]) .range([0, mGraphWidthTracking]); // To do: better date format xAxisTracking = d3.svg.axis() .scale(xScaleTracking) .orient("bottom") .tickFormat(d3.time.format("%b %Y")); // Create Y Axis scale yScaleTracking = d3.scale.linear() .domain([0, 100]) .range([DEFAULT_GRAPH_HEIGHT_TRACKING, 0]); yAxisTracking = d3.svg.axis() .scale(yScaleTracking) .orient("left"); // Create and append ticklines for the xAxis mCanvas.selectAll(".xTickLine") .data(arrayData) .enter().append("line") .attr("class", "tickLine xTickLine") .attr("x1", function (d, i) { return xScaleTracking(arrayDates[i]); }) .attr("x2", function (d, i) { return xScaleTracking(arrayDates[i]); }) .attr("y1", 0) .attr("y2", DEFAULT_GRAPH_HEIGHT_TRACKING) .style("opacity", 0.7) .style("stroke", "#cccccc") .style("stroke-width", "1px"); // Create and append ticklines for the yAxis mCanvas.selectAll(".yTickLine") .data(yScaleTracking.ticks(10)) .enter().append("line") .attr("class", "tickLine yTickLine") .attr("x1", 0) .attr("x2", mGraphWidthTracking) .attr("y1", yScaleTracking) .attr("y2", yScaleTracking) .style("opacity", 0.7) .style("stroke", "#cccccc") .style("stroke-width", "1px"); // Append xAxis to the mCanvas mCanvas.append("g") .attr("class", "xAxis") .attr("transform", "translate(0, " + DEFAULT_GRAPH_HEIGHT_TRACKING + ")") .style("font-size", "14px") .style("font-family", "Arial") .call(xAxisTracking); mCanvas.selectAll('g.xAxis g text').each(insertLinebreaks); // Append yAxis to the mCanvas mCanvas.append("g") .attr("class", "yAxis") .style("font-size", "14px") .style("font-family", "Arial") .call(yAxisTracking); // Add styling and attributes for major ticks var majorTicks = document.getElementsByClassName("tick major"); for (var i = 0; i < majorTicks.length; i++) { // Get 'line' child nodes majorTicks[i].childNodes[0].setAttribute("style", "fill:none; stroke:black"); majorTicks[i].childNodes[0].setAttribute("shape-rendering", "crispEdges"); } // // Add styling and attributes for axes paths var paths = document.getElementsByClassName("domain"); for (var i = 0; i < paths.length; i++) { // Get child nodes within group paths[i].setAttribute("style", "fill:none; stroke:black"); paths[i].setAttribute("shape-rendering", "crispEdges"); paths[i].setAttribute("vector-effect", "non-scaling-stroke"); } // Append lines between data points mCanvas.selectAll(".dataPointConnector") .data(new Array(arrayData.length - 1)) .enter().append("line") .attr("class", "dataPointConnector") .attr("x1", function (d, i) { return xScaleTracking(arrayDates[i]); }) .attr("x2", function (d, i) { return xScaleTracking(arrayDates[i + 1]); }) .attr("y1", function (d, i) { return yScaleTracking(arrayData[i][mCurrentIndicator]); }) .attr("y2", function (d, i) { return yScaleTracking(arrayData[i + 1][mCurrentIndicator]); }) .attr("stroke", DEFAULT_COLOURS[mCurrentIndSetIndex]) .attr("stroke-width", 2); // Append data points mCanvas.selectAll(".dataPoint") .data(arrayData) .enter().append("circle") .attr("class", "dataPoint") .attr("cx", function (d, i) { return xScaleTracking(arrayDates[i]); }) .attr("cy", function(d, i) { return yScaleTracking(arrayData[i][mCurrentIndicator]); }) .attr("r", 5) .attr("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .on("mouseover", function(d) { d3.select(this) .attr("r", 7) .style("fill", HIGHLIGHT_COLOURS[mCurrentIndSetIndex]); }) .on("mouseout", function(d) { d3.select(this) .attr("r", 5) .style("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]); }) .on("click", function(d, i) { d3.selectAll(".dataPoint") .attr("class", "dataPoint") .attr("r", 5) .style("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .on("mouseout", function(d) { d3.select(this) .attr("r", 5) .style("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]); }); d3.select(this).attr("class", "dataPoint selected") .attr("r", 7) .style("fill", HIGHLIGHT_COLOURS[mCurrentIndSetIndex]) .on("mouseout", function() {}); mCurrentDateIndex = i; var scroll = $(window).scrollTop(); generateExtraCanvas(); histogram(); $(window).scrollTop(scroll); }); // Add x axis label mCanvas.append("text") .attr("class", "xAxisLabel") .attr("x", mGraphWidthTracking / 2) .attr("y", DEFAULT_GRAPH_HEIGHT_TRACKING + 40) .attr("text-anchor", "middle") .style("font-weight", "bold") .style("font-size", "14px") .style("font-family", "Arial") .text("Date"); // Add y axis label mCanvas.append("text") .attr("class", "yAxisLabel") .attr("transform", "rotate(-90)") .attr("x", -DEFAULT_GRAPH_HEIGHT_TRACKING / 2) .attr("y", -DEFAULT_PADDING_LEFT_TRACKING / 2) .attr("text-anchor", "middle") .style("font-weight", "bold") .style("font-size", "14px") .style("font-family", "Arial") .text("% of patients"); // Add graph title mCanvas.append("text") .attr("class", "graphTitle") .attr("x", mGraphWidthTracking / 2) .attr("y", -DEFAULT_PADDING_TOP_TRACKING / 2) .attr("text-anchor", "middle") .style("font-size", "14px") .style("font-family", "sans-serif") .style("font-weight", "bold") .text(function() { var indicator = mCalculatedData[0][mCurrentIndicator].desc; var title = indicator + " for Doctor"; var arraySelectedOnly = []; for (var doc in mSelectedPhysicians) { if (mSelectedPhysicians[doc] == true) arraySelectedOnly.push(doc); } if (arraySelectedOnly.length > 1) title += "s "; else title += " "; for (var i = 0; i < arraySelectedOnly.length; i++) { if (i == arraySelectedOnly.length - 2) title += arraySelectedOnly[i] + " and "; else if (i == arraySelectedOnly.length - 1) title += arraySelectedOnly[i]; else title += arraySelectedOnly[i] + ", "; } mReportTitle = title; return title; }); mCanvas.selectAll('.graphTitle').each(function () { splitText(d3.select(this), 180, true); }); var m = mCurrentIndicator; // Add labels for data points mCanvas.selectAll(".dataLabelTracking") .data(arrayData) .enter().append("text") .attr("class", "dataLabelTracking") .attr("x", function(d, i) { return xScaleTracking(arrayDates[i]); }) .attr("y", function(d, i) { // If small value, place label above point if ((arrayData[i][m]) < 10) return yScaleTracking(arrayData[i][m]) - 15; // Else else { // For first data point if (i == 0) { // If adjacent point is above, place label below, vice versa if (arrayData[1][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; else return yScaleTracking(arrayData[i][m]) - 15; } // For last point, compare with second last point else if (i == arrayData.length - 1) { if (arrayData[arrayData.length - 2][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; else return yScaleTracking(arrayData[i][m]) - 15; } // Else all points in between, check both sides else { // If both adjacent points are above, place below if (arrayData[i - 1][m] >= arrayData[i][m] && arrayData[i + 1][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; // Else if both are below, place above else if (arrayData[i - 1][m] < arrayData[i][m] && arrayData[i + 1][m] < arrayData[i][m]) return yScaleTracking(arrayData[i][m]) - 15; // Else just place above else return yScaleTracking(arrayData[i][m]) - 15; } } }) .attr("text-anchor", "middle") .style("fill", "black") .style("font-size", "13px") .style("font-family", "Arial") .text(function(d, i) { return arrayLabels[i][m]; }); if (mCanvasSnapshot != null) { generateExtraCanvas(); } }; function generateExtraCanvas() { $("#canvasContainer_histogram").empty(); $("#canvasContainer_snapshot").empty(); //Recreate the extra canvas mCanvasSnapshot = d3.select("#canvasContainer_snapshot").append("svg") .attr("id", "canvasSVGExtra") .attr("width", mCanvasWidth) .attr("height", mCanvasHeight) .style("border", "1px solid lightgray") .append("g") .attr("class", "g_main") .attr("transform", "translate(" + mSnapshotPaddingLeft + ", " + DEFAULT_PADDING_TOP_SNAPSHOT + ")"); //Add the snapshot graph to the extra canvas if (mMode == "tracking") { generateSnapshot(mCurrentDateIndex, true); histogram(); } //Scroll to the new canvas if (!$("#canvasContainer_snapshot").inViewport() && mFirstScrollView) { $("#canvasContainer_snapshot").scrollView(); mFirstScrollView = false; } // $("#canvasContainer_extra").scrollView(); } function toggleDataLabels() { var arrayData = []; var arrayDesc = []; var arrayLabels = []; if (mMode === "snapshot") { if (d3.selectAll(".dataLabelSnapshot")[0].length > 0) { d3.selectAll(".dataLabelSnapshot").remove(); return; } else { var data = mCalculatedData[0]; for (var i=0; i < data.length; i++) { if (data[i]["total"] == 0) { arrayLabels.push("0% (0/0)"); arrayData.push(0); arrayDesc.push(data[i]["desc"]); continue; } var percent = data[i]["passed"] / data[i]["total"] * 100; arrayData.push(percent); var label = Math.round(percent) + "% (" + data[i]["passed"] + "/" + data[i]["total"]+ ")"; arrayLabels.push(label); arrayDesc.push(data[i]["desc"]); } if (arrayData.length == 0) { return; } mCanvas.selectAll("onTargetLabel") .data(arrayData) .enter().append("text") .attr("class", "dataLabelSnapshot") .attr("x", function(d, i) { if (d<20) { return xScaleSnapshot(d+2); } else { return xScaleSnapshot(d/2); } }) .attr("y", function(d, i) { return yScaleSnapshot(arrayDesc[i]) + (yScaleSnapshot.rangeBand()/2); }) .attr("text-anchor", function(d) { if (d<20) { return "start"; } else { return "middle"; } }) .style("font-family", "Arial") .style("font-size", "13px") .attr("dy", ".35em") .style("fill", function(d, i) { if (d<20) { return "black"; } else { return "white"; } }) .text(function(d, i) { return arrayLabels[i]; }); } } else { if (d3.selectAll(".dataLabelTracking")[0].length > 0) { d3.selectAll(".dataLabelTracking").remove(); return; } else { for (var i=0; i < mCalculatedData.length; i++) { arrayData.push([]); arrayDesc.push([]); arrayLabels.push([]); for (var j=0; j < mCalculatedData[i].length; j++) { if (mCalculatedData[i][j]["total"] == 0) { arrayLabels[i].push("0% (0/0)"); continue; } var percent = mCalculatedData[i][j]["passed"] / mCalculatedData[i][j]["total"] * 100; arrayData[i].push(percent); var label = Math.round(percent) + "% (" + mCalculatedData[i][j]["passed"] + "/" + mCalculatedData[i][j]["total"]+ ")"; arrayLabels[i].push(label); arrayDesc[i].push(mCalculatedData[i][j]["desc"]); } } if (arrayData.length == 0) { return; } var m = mCurrentIndicator; mCanvas.selectAll(".dataLabelTracking") .data(arrayData) .enter().append("text") .attr("class", "dataLabelTracking") .attr("x", function(d, i) { return xScaleTracking(mArrayDates[i]); }) .attr("y", function(d, i) { //Algorithm to decide whether to place the labels above or below the point //Essentially, if they point is less than the previous one, place the label below //Otherwise place it above (unless the point is very small -- ie not enough room below for label) // If small value, place label above point if ((arrayData[i][m]) < 10) return yScaleTracking(arrayData[i][m]) - 15; // Else else { // For first data point if (i == 0) { // If adjacent point is above, place label below, vice versa if (arrayData[1][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; else return yScaleTracking(arrayData[i][m]) - 15; } // For last point, compare with second last point else if (i == arrayData.length - 1) { if (arrayData[arrayData.length - 2][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; else return yScaleTracking(arrayData[i][m]) - 15; } // Else all points in between, check both sides else { // If both adjacent points are above, place below if (arrayData[i - 1][m] >= arrayData[i][m] && arrayData[i + 1][m] >= arrayData[i][m]) return yScaleTracking(arrayData[i][m]) + 25; // Else if both are below, place above else if (arrayData[i - 1][m] < arrayData[i][m] && arrayData[i + 1][m] < arrayData[i][m]) return yScaleTracking(arrayData[i][m]) - 15; // Else just place above else return yScaleTracking(arrayData[i][m]) - 15; } } }) .attr("text-anchor", "middle") .style("fill", "black") .style("font-size", "13px") .style("font-family", "Arial") .text(function(d, i) { return arrayLabels[i][m]; }); } } }; //end toggleDataLabels function histogram() { //data contains an array of values and axis label(s) //[ [values], label] //label can be an array of [x-label, y-label] or just a x-label for histograms //values can be 1d for histogram or 2d for a scatter plot [ [x-values], [y-values]] var data = mdsIndicators.getPlotData(getIndicator(), mCurrentDateIndex); if (data === null) { $("#canvasContainer_histogram").empty(); return; } var values = data[0]; var label = data[1]; var svg = $("#canvasContainer_histogram"); //Empty the extra canvas svg.empty(); //Recreate the extra canvas svg = d3.select("#canvasContainer_histogram").append("svg") .attr("id", "canvasSVGExtra") .attr("width", mCanvasWidth) .attr("height", DEFAULT_CANVAS_HEIGHT) .style("border", "1px solid lightgray") .append("g") .attr("class", "g_main") .attr("transform", "translate(" + DEFAULT_PADDING_LEFT_TRACKING + ", " + DEFAULT_PADDING_TOP_TRACKING + ")"); // A formatter for counts. var formatCount = d3.format(",.0f"); var xScale = d3.scale.linear() .domain(d3.extent(values)) .range([0, mGraphWidthTracking]) .nice(); var xAxis = d3.svg.axis() .scale(xScale) .orient("bottom"); // Generate a histogram using twenty uniformly-spaced bins. var histdata = d3.layout.histogram() .bins(xScale.ticks(20)) (values); var yScale = d3.scale.linear() .domain([0, d3.max(histdata, function(d) { return d.y; })]) .range([DEFAULT_GRAPH_HEIGHT_TRACKING, 0]); var yAxis = d3.svg.axis() .scale(yScale) .orient("left") .ticks(10) .tickFormat(d3.format("d")) .tickSubdivide(0); // Add x axis label svg.append("text") .attr("class", "xaxis xAxisLabel") .attr("x", mGraphWidthTracking / 2) .attr("y", DEFAULT_GRAPH_HEIGHT_TRACKING + 40) .attr("text-anchor", "middle") .style("font-weight", "bold") .style("font-size", "14px") .style("font-family", "Arial") .text(label); // Add y axis label svg.append("text") .attr("class", "yAxisLabel") .attr("transform", "rotate(-90)") .attr("x", -DEFAULT_GRAPH_HEIGHT_TRACKING / 2) .attr("y", -DEFAULT_PADDING_LEFT_TRACKING / 2) .attr("text-anchor", "middle") .style("font-weight", "bold") .style("font-size", "14px") .style("font-family", "Arial") .text("# of Patients"); var date = mArrayDates[mCurrentDateIndex]; formattedDate = MONTH_NAMES_SHORT[date.getMonth()] + " " + date.getDate() + " " + date.getFullYear(); // Add graph title svg.append("text") .attr("class", "graphTitle") .attr("x", mGraphWidthTracking / 2) .attr("y", -DEFAULT_PADDING_TOP_TRACKING / 2) .attr("text-anchor", "middle") .style("font-size", "14px") .style("font-family", "sans-serif") .style("font-weight", "bold") .text(getIndicator().desc() + " as of " + formattedDate); //Add xaxis svg.append("g") .attr("class", "xaxis") .attr("transform", "translate(0, " + DEFAULT_GRAPH_HEIGHT_TRACKING + ")") .call(xAxis); var barWidth = (mGraphWidthTracking / histdata.length) - 4 // Align xaxis labels with center of bar (opposed to lefthand side) // This is accomplished by moving them by 1/2 the bar width svg.selectAll(".xaxis text") .attr("dx", barWidth / 2); //Add yaxis svg.append("g") .attr("class", "yaxis") .call(yAxis); var bar = svg.selectAll(".bar") .data(histdata) .enter().append("g") .attr("class", "bar") .attr("transform", function(d) { return "translate(" + xScale(d.x) + "," + yScale(d.y) + ")"; }); bar.append("rect") .attr("x", 1) .attr("fill", DEFAULT_COLOURS[mCurrentIndSetIndex]) .attr("width", barWidth) //.attr("width", x(data[0].dx) - 1) .attr("height", function(d) { return DEFAULT_GRAPH_HEIGHT_TRACKING - yScale(d.y); }) .style("stroke", "black") .style("stroke-width", "1px") .attr("shape-rendering", "crispEdges"); // Add styling and attributes for axes paths var paths = document.getElementsByClassName("domain"); for (var i = 0; i < paths.length; i++) { paths[i].setAttribute("style", "fill:none; stroke:black"); paths[i].setAttribute("shape-rendering", "crispEdges"); } }; //end histogram return { generateCharts: generateCharts, clearCanvas: clearCanvas, mode: mMode, histogram: histogram, setHasRosteredField: function(x) { hasRosteredField = x; }, hasRosteredField: function() { return hasRosteredField; }, rosteredOnly: function() { return mRosteredOnly; } }; })();
HamiltonFHT/ChronicDiseaseReportGenerator
js/mdsViewer.js
JavaScript
gpl-3.0
61,276
<?php /* * Copyright 2014, Zunautica Initiatives Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ $col = collection_db_get_all($db); var_dump($col); ?>
carrotsrc/xebec-archive
management/collections/template_view.php
PHP
gpl-3.0
608
/* Copyright 2005-2011 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks 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. Threading Building Blocks is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #include "tbb/cache_aligned_allocator.h" #include "tbb/tbb_allocator.h" #include "tbb/tbb_exception.h" #include "tbb_misc.h" #include "dynamic_link.h" #include <cstdlib> #if _WIN32||_WIN64 #include "tbb/machine/windows_api.h" #else #include <dlfcn.h> #endif /* _WIN32||_WIN64 */ using namespace std; #if __TBB_WEAK_SYMBOLS #pragma weak scalable_malloc #pragma weak scalable_free #pragma weak scalable_aligned_malloc #pragma weak scalable_aligned_free extern "C" { void* scalable_malloc( size_t ); void scalable_free( void* ); void* scalable_aligned_malloc( size_t, size_t ); void scalable_aligned_free( void* ); } #endif /* __TBB_WEAK_SYMBOLS */ namespace tbb { namespace internal { //! Dummy routine used for first indirect call via MallocHandler. static void* DummyMalloc( size_t size ); //! Dummy routine used for first indirect call via FreeHandler. static void DummyFree( void * ptr ); //! Handler for memory allocation static void* (*MallocHandler)( size_t size ) = &DummyMalloc; //! Handler for memory deallocation static void (*FreeHandler)( void* pointer ) = &DummyFree; //! Dummy routine used for first indirect call via padded_allocate_handler. static void* dummy_padded_allocate( size_t bytes, size_t alignment ); //! Dummy routine used for first indirect call via padded_free_handler. static void dummy_padded_free( void * ptr ); // ! Allocates memory using standard malloc. It is used when scalable_allocator is not available static void* padded_allocate( size_t bytes, size_t alignment ); // ! Allocates memory using standard free. It is used when scalable_allocator is not available static void padded_free( void* p ); //! Handler for padded memory allocation static void* (*padded_allocate_handler)( size_t bytes, size_t alignment ) = &dummy_padded_allocate; //! Handler for padded memory deallocation static void (*padded_free_handler)( void* p ) = &dummy_padded_free; //! Table describing how to link the handlers. static const dynamic_link_descriptor MallocLinkTable[] = { DLD(scalable_malloc, MallocHandler), DLD(scalable_free, FreeHandler), DLD(scalable_aligned_malloc, padded_allocate_handler), DLD(scalable_aligned_free, padded_free_handler), }; #if TBB_USE_DEBUG #define DEBUG_SUFFIX "_debug" #else #define DEBUG_SUFFIX #endif /* TBB_USE_DEBUG */ // MALLOCLIB_NAME is the name of the TBB memory allocator library. #if _WIN32||_WIN64 #define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll" #elif __APPLE__ #define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".dylib" #elif __linux__ #define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX __TBB_STRING(.so.TBB_COMPATIBLE_INTERFACE_VERSION) #elif __FreeBSD__ || __NetBSD__ || __sun || _AIX #define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so" #else #error Unknown OS #endif //! Initialize the allocation/free handler pointers. /** Caller is responsible for ensuring this routine is called exactly once. The routine attempts to dynamically link with the TBB memory allocator. If that allocator is not found, it links to malloc and free. */ void initialize_cache_aligned_allocator() { __TBB_ASSERT( MallocHandler==&DummyMalloc, NULL ); bool success = dynamic_link( MALLOCLIB_NAME, MallocLinkTable, 4 ); if( !success ) { // If unsuccessful, set the handlers to the default routines. // This must be done now, and not before FillDynamicLinks runs, because if other // threads call the handlers, we want them to go through the DoOneTimeInitializations logic, // which forces them to wait. FreeHandler = &free; MallocHandler = &malloc; padded_allocate_handler = &padded_allocate; padded_free_handler = &padded_free; } #if !__TBB_RML_STATIC PrintExtraVersionInfo( "ALLOCATOR", success?"scalable_malloc":"malloc" ); #endif } //! Defined in tbb_main.cpp extern void DoOneTimeInitializations(); //! Executed on very first call through MallocHandler static void* DummyMalloc( size_t size ) { DoOneTimeInitializations(); __TBB_ASSERT( MallocHandler!=&DummyMalloc, NULL ); return (*MallocHandler)( size ); } //! Executed on very first call throught FreeHandler static void DummyFree( void * ptr ) { DoOneTimeInitializations(); __TBB_ASSERT( FreeHandler!=&DummyFree, NULL ); (*FreeHandler)( ptr ); } //! Executed on very first call through padded_allocate_handler static void* dummy_padded_allocate( size_t bytes, size_t alignment ) { DoOneTimeInitializations(); __TBB_ASSERT( padded_allocate_handler!=&dummy_padded_allocate, NULL ); return (*padded_allocate_handler)(bytes, alignment); } //! Executed on very first call throught padded_free_handler static void dummy_padded_free( void * ptr ) { DoOneTimeInitializations(); __TBB_ASSERT( padded_free_handler!=&dummy_padded_free, NULL ); (*padded_free_handler)( ptr ); } static size_t NFS_LineSize = 128; size_t NFS_GetLineSize() { return NFS_LineSize; } #if _MSC_VER && !defined(__INTEL_COMPILER) // unary minus operator applied to unsigned type, result still unsigned #pragma warning( disable: 4146 4706 ) #endif void* NFS_Allocate( size_t n, size_t element_size, void* /*hint*/ ) { size_t m = NFS_LineSize; __TBB_ASSERT( m<=NFS_MaxLineSize, "illegal value for NFS_LineSize" ); __TBB_ASSERT( (m & (m-1))==0, "must be power of two" ); size_t bytes = n*element_size; if (bytes<n || bytes+m<bytes) { // Overflow throw_exception(eid_bad_alloc); } // scalable_aligned_malloc considers zero size request an error, and returns NULL if (bytes==0) bytes = 1; void* result = (*padded_allocate_handler)( bytes, m ); if (!result) throw_exception(eid_bad_alloc); __TBB_ASSERT( ((size_t)result&(m-1)) == 0, "The address returned isn't aligned to cache line size" ); return result; } void NFS_Free( void* p ) { (*padded_free_handler)( p ); } static void* padded_allocate( size_t bytes, size_t alignment ) { unsigned char* result = NULL; unsigned char* base = (unsigned char*)malloc(alignment+bytes); if( base ) { // Round up to the next line result = (unsigned char*)((uintptr_t)(base+alignment)&-alignment); // Record where block actually starts. ((uintptr_t*)result)[-1] = uintptr_t(base); } return result; } static void padded_free( void* p ) { if( p ) { __TBB_ASSERT( (uintptr_t)p>=0x4096, "attempt to free block not obtained from cache_aligned_allocator" ); // Recover where block actually starts unsigned char* base = ((unsigned char**)p)[-1]; __TBB_ASSERT( (void*)((uintptr_t)(base+NFS_LineSize)&-NFS_LineSize)==p, "not allocated by NFS_Allocate?" ); free(base); } } void* __TBB_EXPORTED_FUNC allocate_via_handler_v3( size_t n ) { void* result = (*MallocHandler) (n); if (!result) { throw_exception(eid_bad_alloc); } return result; } void __TBB_EXPORTED_FUNC deallocate_via_handler_v3( void *p ) { if( p ) { (*FreeHandler)( p ); } } bool __TBB_EXPORTED_FUNC is_malloc_used_v3() { if (MallocHandler == &DummyMalloc) { void* void_ptr = (*MallocHandler)(1); (*FreeHandler)(void_ptr); } __TBB_ASSERT( MallocHandler!=&DummyMalloc && FreeHandler!=&DummyFree, NULL ); // Cast to void avoids type mismatch errors on some compilers (e.g. __IBMCPP__) __TBB_ASSERT( !(((void*)MallocHandler==(void*)&malloc) ^ ((void*)FreeHandler==(void*)&free)), "Both shim pointers must refer to routines from the same package (either TBB or CRT)" ); return (void*)MallocHandler == (void*)&malloc; } } // namespace internal } // namespace tbb #if __TBB_RML_STATIC namespace tbb { namespace internal { static tbb::atomic<do_once_state> module_state; void DoOneTimeInitializations() { atomic_do_once( &initialize_cache_aligned_allocator, module_state ); } }} //namespace tbb::internal #endif
jonarbo/GREASY
src/3rdparty/tbb40_20111130oss/src/tbb/cache_aligned_allocator.cpp
C++
gpl-3.0
9,391
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ActiveSupport::ProxyObject</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" /> <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script> <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="banner"> <span>Ruby on Rails 4.2.6</span><br /> <h1> <span class="type">Class</span> ActiveSupport::ProxyObject <span class="parent">&lt; BasicObject </span> </h1> <ul class="files"> <li><a href="../../files/__/__/_rbenv/versions/2_4_0/lib/ruby/gems/2_4_0/gems/activesupport-4_2_6/lib/active_support/proxy_object_rb.html">/home/user/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.6/lib/active_support/proxy_object.rb</a></li> </ul> </div> <div id="bodyContent"> <div id="content"> <div class="description"> <p>A class with no predefined methods that behaves similarly to Builder&#39;s BlankSlate. Used for proxy classes.</p> </div> <!-- Method ref --> <div class="sectiontitle">Methods</div> <dl class="methods"> <dt>R</dt> <dd> <ul> <li> <a href="#method-i-raise">raise</a> </li> </ul> </dd> </dl> <!-- Methods --> <div class="sectiontitle">Instance Public methods</div> <div class="method"> <div class="title method-title" id="method-i-raise"> <b>raise</b>(*args) <a href="../../classes/ActiveSupport/ProxyObject.html#method-i-raise" name="method-i-raise" class="permalink">Link</a> </div> <div class="description"> <p>Let <a href="ProxyObject.html">ActiveSupport::ProxyObject</a> at least raise exceptions.</p> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-raise_source')" id="l_method-i-raise_source">show</a> </p> <div id="method-i-raise_source" class="dyn-source"> <pre><span class="ruby-comment"># File ../../.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-4.2.6/lib/active_support/proxy_object.rb, line 9</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">raise</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:raise</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> </div> </div> </body> </html>
Dpasi314/DevConnect
project/doc/api/classes/ActiveSupport/ProxyObject.html
HTML
gpl-3.0
4,047
# android-calculator Simple calculator app
Selat/android-calculator
README.md
Markdown
gpl-3.0
43
package regexgolf2.services.persistence.saving; import regexgolf2.model.SolvableChallenge; import regexgolf2.model.containers.ChallengePool; import regexgolf2.model.containers.WordPool; import regexgolf2.services.persistence.PersistenceException; public interface SaveVisitor { void visit(ChallengePool challengePool) throws PersistenceException; void visit(SolvableChallenge solvableChallenge) throws PersistenceException; void visit(WordPool wordPool) throws PersistenceException; }
greenkeeper/RegexGolf2
RegexGolf2/src/regexgolf2/services/persistence/saving/SaveVisitor.java
Java
gpl-3.0
492
<p align="center"> <img src="https://i.imgur.com/F5GNK4X.png" width="150" /> </p> # Paperless Desktop [![Build Status](https://travis-ci.org/thomasbrueggemann/paperless-desktop.svg?branch=master)](https://travis-ci.org/thomasbrueggemann/paperless-desktop) Desktop app that uses the [paperless](https://github.com/danielquinn/paperless) API to manage your document scans. <p align="center"> <img src="http://i.imgur.com/FrgAptE.png" /> </p> ## Installation Needs a running [paperless](https://github.com/danielquinn/paperless) instance of at least [v0.4.1](https://github.com/danielquinn/paperless/releases/tag/0.4.1) ### Pre-built executables Please keep in mind, that these are pre-releases. There is still some work to do. <center> <p> <a href="https://github.com/thomasbrueggemann/paperless-desktop/releases" style="background-color:#48D560; color:white; border: 0px; padding:20px 30px; font-size: 1.4em; border-radius:15px">  Download now </a> </p> </center> ## Development Thanks to npm, it's easy: _(Disclaimer: I only ever test this on macOS, any other operation system might behave unexpectedly running this)_ ```bash $ npm install $ npm start ``` ## Deployment Whenever a new macOS executable should be packaged, just call: ```bash $ npm run package:mac ``` ## Credits - &copy; icon design by [@pdiegmann](https://github.com/pdiegmann) - [photon](https://github.com/connors/photon) - [react](https://facebook.github.io/react/) - [electron](http://electron.atom.io/)
thomasbrueggemann/paperless-desktop
README.md
Markdown
gpl-3.0
1,514
package cn.cadal.audio.entity; public class SearchResult { private String AutioNO; private String Title; private String Creator; private String Subject; private String Publisher; /** * get and set function */ public String getAutioNO() { return AutioNO; } public void setAutioNO(String autioNO) { AutioNO = autioNO; } public String getTitle() { return Title; } public void setTitle(String title) { Title = title; } public String getCreator() { return Creator; } public void setCreator(String creator) { Creator = creator; } public String getSubject() { return Subject; } public void setSubject(String subject) { Subject = subject; } public void setPublisher(String publisher) { Publisher = publisher; } public String getPublisher() { return Publisher; } }
YinYanfei/CadalWorkspace
AudioSearch/src/cn/cadal/audio/entity/SearchResult.java
Java
gpl-3.0
810
package com.weebly.OliPro007.minecraftRPG.renderers; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import com.weebly.OliPro007.minecraftRPG.entities.EntityBullet; public class RenderBullet extends Render{ private static final ResourceLocation texture = new ResourceLocation("minecraftrpg", "textures/entities/entity_bullet.png"); public void renderBullet(EntityBullet entityBullet, double par2, double par4, double par6, float par8, float par9){ this.bindEntityTexture(entityBullet); GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glRotatef(entityBullet.prevRotationYaw + (entityBullet.rotationYaw - entityBullet.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityBullet.prevRotationPitch + (entityBullet.rotationPitch - entityBullet.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.instance; byte b0 = 0; float f2 = 0.0F; float f3 = 0.5F; float f4 = (float)(0 + b0 * 10) / 32.0F; float f5 = (float)(5 + b0 * 10) / 32.0F; float f6 = 0.0F; float f7 = 0.15625F; float f8 = (float)(5 + b0 * 10) / 32.0F; float f9 = (float)(10 + b0 * 10) / 32.0F; float f10 = 0.05625F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4.0F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8); tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8); tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9); tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8); tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8); tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9); tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9); tessellator.draw(); for (int i = 0; i < 4; ++i) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4); tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4); tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5); tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5); tessellator.draw(); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { this.renderBullet((EntityBullet) entity, d0, d1, d2, f, f1); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return this.getBulletTexture((EntityBullet) entity); } protected ResourceLocation getBulletTexture(EntityBullet entityBullet){ return texture; } }
OliPro007/MinecraftRPG
src/main/java/com/weebly/OliPro007/minecraftRPG/renderers/RenderBullet.java
Java
gpl-3.0
3,584
#ifndef PICTUREVIEWITEM_H #define PICTUREVIEWITEM_H #include <QObject> #include <QGraphicsItem> #include <QDateTime> #include <QTimer> #include "animateditem.h" #include "abstractmetadata.h" class PictureViewItem : public AnimatedItem { public: // operator QGraphicsItem* () { return dynamic_cast<QGraphicsItem *> (this); } // operator QObject* () { return dynamic_cast<QObject *> (this); } virtual void load () = 0; virtual void refresh () { } virtual void resize () = 0; virtual QDateTime getDate () = 0; virtual AbstractMetadata *metadata () = 0; virtual void setShowTime (int time) = 0; virtual bool rotateLeft () = 0; virtual bool rotateRight () = 0; virtual qreal zoom () = 0; virtual void setZoom (qreal zoomPercent) = 0; signals: void itemLoaded (); void showTimeEnded (); void zoomChanged (qreal newZoom); public slots: virtual void beginRotateAnimation () {} virtual void endRotateAnimation () {} private: }; #endif // PICTUREVIEWITEM_H
cachirulop/PhotoViewer
pictureviewitem.h
C
gpl-3.0
1,076