code
stringlengths
4
991k
repo_name
stringlengths
6
116
path
stringlengths
4
249
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
4
991k
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/* * ALSA SoC TWL6040 codec driver * * Author: Misael Lopez Cruz <x0052729@ti.com> * * This program 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. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/pm.h> #include <linux/i2c.h> #include <linux/gpio.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/i2c/twl.h> #include <linux/mfd/twl6040-codec.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h> #include "twl6040.h" #define TWL6040_RATES SNDRV_PCM_RATE_8000_96000 #define TWL6040_FORMATS (SNDRV_PCM_FMTBIT_S32_LE) #define TWL6040_OUTHS_0dB 0x00 #define TWL6040_OUTHS_M30dB 0x0F #define TWL6040_OUTHF_0dB 0x03 #define TWL6040_OUTHF_M52dB 0x1D #define TWL6040_RAMP_NONE 0 #define TWL6040_RAMP_UP 1 #define TWL6040_RAMP_DOWN 2 #ifdef CONFIG_SOUND_CONTROL #define TWL6040_RAMP_ZERO 3 #endif #define TWL6040_HSL_VOL_MASK 0x0F #define TWL6040_HSL_VOL_SHIFT 0 #define TWL6040_HSR_VOL_MASK 0xF0 #define TWL6040_HSR_VOL_SHIFT 4 #define TWL6040_HF_VOL_MASK 0x1F #define TWL6040_HF_VOL_SHIFT 0 #define TWL6040_EP_VOL_MASK 0x1E #define TWL6040_EP_VOL_SHIFT 1 struct twl6040_output { u16 active; u16 left_vol; u16 right_vol; u16 left_step; u16 right_step; unsigned int step_delay; u16 ramp; u16 mute; struct completion ramp_done; }; struct twl6040_jack_data { struct snd_soc_jack *jack; int report; }; /* codec private data */ struct twl6040_data { int codec_powered; int pll; int power_mode_forced; int headset_mode; unsigned int clk_in; unsigned int sysclk; u16 hs_left_step; u16 hs_right_step; u16 hf_left_step; u16 hf_right_step; u16 ep_step; struct snd_pcm_hw_constraint_list *sysclk_constraints; struct twl6040_jack_data hs_jack; struct snd_soc_codec *codec; struct workqueue_struct *workqueue; struct delayed_work delayed_work; struct mutex mutex; struct twl6040_output headset; struct twl6040_output earphone; struct twl6040_output handsfree; struct workqueue_struct *hf_workqueue; struct workqueue_struct *hs_workqueue; struct workqueue_struct *ep_workqueue; struct delayed_work hs_delayed_work; struct delayed_work hf_delayed_work; struct delayed_work ep_delayed_work; }; /* * twl6040 register cache & default register settings */ static const u8 twl6040_reg[TWL6040_CACHEREGNUM] = { 0x00, /* not used 0x00 */ 0x4B, /* TWL6040_ASICID (ro) 0x01 */ 0x00, /* TWL6040_ASICREV (ro) 0x02 */ 0x00, /* TWL6040_INTID 0x03 */ 0x00, /* TWL6040_INTMR 0x04 */ 0x00, /* TWL6040_NCPCTRL 0x05 */ 0x00, /* TWL6040_LDOCTL 0x06 */ 0x60, /* TWL6040_HPPLLCTL 0x07 */ 0x00, /* TWL6040_LPPLLCTL 0x08 */ 0x4A, /* TWL6040_LPPLLDIV 0x09 */ 0x00, /* TWL6040_AMICBCTL 0x0A */ 0x00, /* TWL6040_DMICBCTL 0x0B */ 0x18, /* TWL6040_MICLCTL 0x0C - No input selected on Left Mic */ 0x18, /* TWL6040_MICRCTL 0x0D - No input selected on Right Mic */ 0x00, /* TWL6040_MICGAIN 0x0E */ 0x1B, /* TWL6040_LINEGAIN 0x0F */ 0x00, /* TWL6040_HSLCTL 0x10 */ 0x00, /* TWL6040_HSRCTL 0x11 */ 0xFF, /* TWL6040_HSGAIN 0x12 */ 0x1E, /* TWL6040_EARCTL 0x13 */ 0x00, /* TWL6040_HFLCTL 0x14 */ 0x1D, /* TWL6040_HFLGAIN 0x15 */ 0x00, /* TWL6040_HFRCTL 0x16 */ 0x1D, /* TWL6040_HFRGAIN 0x17 */ 0x00, /* TWL6040_VIBCTLL 0x18 */ 0x00, /* TWL6040_VIBDATL 0x19 */ 0x00, /* TWL6040_VIBCTLR 0x1A */ 0x00, /* TWL6040_VIBDATR 0x1B */ 0x00, /* TWL6040_HKCTL1 0x1C */ 0x00, /* TWL6040_HKCTL2 0x1D */ 0x00, /* TWL6040_GPOCTL 0x1E */ 0x00, /* TWL6040_ALB 0x1F */ 0x00, /* TWL6040_DLB 0x20 */ 0x00, /* not used 0x21 */ 0x00, /* not used 0x22 */ 0x00, /* not used 0x23 */ 0x00, /* not used 0x24 */ 0x00, /* not used 0x25 */ 0x00, /* not used 0x26 */ 0x00, /* not used 0x27 */ 0x00, /* TWL6040_TRIM1 0x28 */ 0x00, /* TWL6040_TRIM2 0x29 */ 0x00, /* TWL6040_TRIM3 0x2A */ 0x00, /* TWL6040_HSOTRIM 0x2B */ 0x00, /* TWL6040_HFOTRIM 0x2C */ 0x09, /* TWL6040_ACCCTL 0x2D */ 0x00, /* TWL6040_STATUS (ro) 0x2E */ }; /* twl6040 vio/gnd registers: registers under vio/gnd supply can be accessed * twl6040 vdd/vss registers: registers under vdd/vss supplies can only be * accessed after the power-up sequence */ static const u8 twl6040_reg_supply[TWL6040_CACHEREGNUM] = { TWL6040_NO_SUPPLY, /* not used */ TWL6040_VIO_SUPPLY, /* TWL6040_ASICID (ro) */ TWL6040_VIO_SUPPLY, /* TWL6040_ASICREV (ro) */ TWL6040_VIO_SUPPLY, /* TWL6040_INTID */ TWL6040_VIO_SUPPLY, /* TWL6040_INTMR */ TWL6040_VIO_SUPPLY, /* TWL6040_NCPCTRL */ TWL6040_VIO_SUPPLY, /* TWL6040_LDOCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HPPLLCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_LPPLLCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_LPPLLDIV */ TWL6040_VIO_SUPPLY, /* TWL6040_AMICBCTL */ TWL6040_VIO_SUPPLY, /* TWL6040_DMICBCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_MICLCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_MICRCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_MICGAIN */ TWL6040_VDD_SUPPLY, /* TWL6040_LINEGAIN */ TWL6040_VDD_SUPPLY, /* TWL6040_HSLCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HSRCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HSGAIN */ TWL6040_VDD_SUPPLY, /* TWL6040_EARCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HFLCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HFLGAIN */ TWL6040_VDD_SUPPLY, /* TWL6040_HFRCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_HFRGAIN */ TWL6040_VDD_SUPPLY, /* TWL6040_VIBCTLL */ TWL6040_VDD_SUPPLY, /* TWL6040_VIBDATL */ TWL6040_VDD_SUPPLY, /* TWL6040_VIBCTLR */ TWL6040_VDD_SUPPLY, /* TWL6040_VIBDATR */ TWL6040_VIO_SUPPLY, /* TWL6040_HKCTL1 */ TWL6040_VIO_SUPPLY, /* TWL6040_HKCTL2 */ TWL6040_VIO_SUPPLY, /* TWL6040_GPOCTL */ TWL6040_VDD_SUPPLY, /* TWL6040_ALB */ TWL6040_VDD_SUPPLY, /* TWL6040_DLB */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_NO_SUPPLY, /* not used */ TWL6040_VIO_SUPPLY, /* TWL6040_TRIM1 */ TWL6040_VIO_SUPPLY, /* TWL6040_TRIM2 */ TWL6040_VIO_SUPPLY, /* TWL6040_TRIM3 */ TWL6040_VIO_SUPPLY, /* TWL6040_HSOTRIM */ TWL6040_VIO_SUPPLY, /* TWL6040_HFOTRIM */ TWL6040_VIO_SUPPLY, /* TWL6040_ACCCTL */ TWL6040_VIO_SUPPLY, /* TWL6040_STATUS (ro) */ }; #ifdef CONFIG_SOUND_CONTROL struct twl6040_data * snd_data; struct snd_soc_codec * snd_codec; unsigned int volume_boost = 0; static bool headset_plugged = false; #endif /* * read twl6040 register cache */ static inline unsigned int twl6040_read_reg_cache(struct snd_soc_codec *codec, unsigned int reg) { u8 *cache = codec->reg_cache; if (reg >= TWL6040_CACHEREGNUM) return -EIO; return cache[reg]; } /* * write twl6040 register cache */ static inline void twl6040_write_reg_cache(struct snd_soc_codec *codec, u8 reg, u8 value) { u8 *cache = codec->reg_cache; if (reg >= TWL6040_CACHEREGNUM) return; cache[reg] = value; } /* * read from twl6040 hardware register */ static int twl6040_read_reg_volatile(struct snd_soc_codec *codec, unsigned int reg) { struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); u8 value = 0; if (reg >= TWL6040_CACHEREGNUM) return -EIO; /* read access not supported while in sleep state */ if ((twl6040_reg_supply[reg] == TWL6040_VDD_SUPPLY) && !priv->codec_powered) return -EINVAL; value = twl6040_reg_read(twl6040, reg); twl6040_write_reg_cache(codec, reg, value); return value; } /* * write to the twl6040 register space */ static int twl6040_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int ret = 0; if (reg >= TWL6040_CACHEREGNUM) return -EIO; twl6040_write_reg_cache(codec, reg, value); if ((twl6040_reg_supply[reg] == TWL6040_VIO_SUPPLY) || priv->codec_powered) ret = twl6040_reg_write(twl6040, reg, value); else dev_dbg(codec->dev, "deferring register 0x%02x write: %02x\n", reg, value); return ret; } static void twl6040_init_vio_regs(struct snd_soc_codec *codec) { u8 *cache = codec->reg_cache; int reg; for (reg = 0; reg < TWL6040_CACHEREGNUM; reg++) { if (twl6040_reg_supply[reg] != TWL6040_VIO_SUPPLY) continue; /* * skip read-only registers (ASICID, ASICREV, STATUS) * and registers shared among MFD children */ switch (reg) { case TWL6040_REG_ASICID: case TWL6040_REG_ASICREV: case TWL6040_REG_INTID: case TWL6040_REG_INTMR: case TWL6040_REG_NCPCTL: case TWL6040_REG_LDOCTL: case TWL6040_REG_GPOCTL: case TWL6040_REG_ACCCTL: case TWL6040_REG_STATUS: continue; case TWL6040_REG_HSOTRIM: case TWL6040_REG_HFOTRIM: twl6040_read_reg_volatile(codec, reg); continue; default: break; } twl6040_write(codec, reg, cache[reg]); } } static void twl6040_init_vdd_regs(struct snd_soc_codec *codec) { u8 *cache = codec->reg_cache; int reg; for (reg = 0; reg < TWL6040_CACHEREGNUM; reg++) { if (twl6040_reg_supply[reg] != TWL6040_VDD_SUPPLY) continue; /* skip vibra and pll registers */ switch (reg) { case TWL6040_REG_VIBCTLL: case TWL6040_REG_VIBDATL: case TWL6040_REG_VIBCTLR: case TWL6040_REG_VIBDATR: case TWL6040_REG_HPPLLCTL: case TWL6040_REG_LPPLLCTL: case TWL6040_REG_LPPLLDIV: continue; default: break; } twl6040_write(codec, reg, cache[reg]); } } /* * Ramp HS PGA volume to minimise pops at stream startup and shutdown. */ static inline int twl6040_hs_ramp_step(struct snd_soc_codec *codec, unsigned int left_step, unsigned int right_step) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *headset = &priv->headset; int left_complete = 0, right_complete = 0; u8 reg, val; /* left channel */ left_step = (left_step > 0xF) ? 0xF : left_step; reg = twl6040_read_reg_cache(codec, TWL6040_REG_HSGAIN); val = (~reg & TWL6040_HSL_VOL_MASK); if (headset->ramp == TWL6040_RAMP_UP) { /* ramp step up */ #ifdef CONFIG_SOUND_CONTROL int volume = headset->left_vol + volume_boost; if (val < volume) { if (val + left_step > volume) val = volume; #else if (val < headset->left_vol) { if (val + left_step > headset->left_vol) val = headset->left_vol; #endif else val += left_step; reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, (reg | (~val & TWL6040_HSL_VOL_MASK))); } else { left_complete = 1; } #ifdef CONFIG_SOUND_CONTROL } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down*/ int volume = headset->left_vol + volume_boost; if (val > volume) { if ((int)val - (int)left_step < volume) val = volume; else val -= left_step; reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val & TWL6040_HSL_VOL_MASK)); } else { left_complete = 1; } } else if (headset->ramp == TWL6040_RAMP_ZERO) { /* ramp step down to zero*/ if (val > 0x0) { if ((int)val - (int)left_step < 0) val = 0; else val -= left_step; reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val & TWL6040_HSL_VOL_MASK)); } else { left_complete = 1; } } #else } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0x0) { if ((int)val - (int)left_step < 0) val = 0; else val -= left_step; reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val & TWL6040_HSL_VOL_MASK)); } else { left_complete = 1; } } #endif /* right channel */ right_step = (right_step > 0xF) ? 0xF : right_step; reg = twl6040_read_reg_cache(codec, TWL6040_REG_HSGAIN); val = (~reg & TWL6040_HSR_VOL_MASK) >> TWL6040_HSR_VOL_SHIFT; if (headset->ramp == TWL6040_RAMP_UP) { /* ramp step up */ #ifdef CONFIG_SOUND_CONTROL int volume = headset->right_vol + volume_boost; if (val < volume) { if (val + right_step > volume) val = volume; #else if (val < headset->right_vol) { if (val + right_step > headset->right_vol) val = headset->right_vol; #endif else val += right_step; reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, (reg | (~val << TWL6040_HSR_VOL_SHIFT))); } else { right_complete = 1; } #ifdef CONFIG_SOUND_CONTROL } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down*/ int volume = headset->right_vol + volume_boost; if (val > volume) { if ((int)val - (int)right_step < volume) val = volume; else val -= right_step; reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val << TWL6040_HSR_VOL_SHIFT)); } else { right_complete = 1; } } else if (headset->ramp == TWL6040_RAMP_ZERO) { /* ramp step down to zero*/ if (val > 0x0) { if ((int)val - (int)right_step < 0) val = 0; else val -= right_step; reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val << TWL6040_HSR_VOL_SHIFT)); } else { right_complete = 1; } } #else } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0x0) { if ((int)val - (int)right_step < 0) val = 0; else val -= right_step; reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val << TWL6040_HSR_VOL_SHIFT)); } else { right_complete = 1; } } #endif return left_complete & right_complete; } /* * Ramp HF PGA volume to minimise pops at stream startup and shutdown. */ static inline int twl6040_hf_ramp_step(struct snd_soc_codec *codec, unsigned int left_step, unsigned int right_step) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *handsfree = &priv->handsfree; int left_complete = 0, right_complete = 0; u16 reg, val; /* left channel */ left_step = (left_step > 0x1D) ? 0x1D : left_step; reg = twl6040_read_reg_cache(codec, TWL6040_REG_HFLGAIN); reg = 0x1D - reg; val = (reg & TWL6040_HF_VOL_MASK); if (handsfree->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < handsfree->left_vol) { if (val + left_step > handsfree->left_vol) val = handsfree->left_vol; else val += left_step; reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFLGAIN, reg | (0x1D - val)); } else { left_complete = 1; } } else if (handsfree->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0) { if ((int)val - (int)left_step < 0) val = 0; else val -= left_step; reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFLGAIN, reg | (0x1D - val)); } else { left_complete = 1; } } /* right channel */ right_step = (right_step > 0x1D) ? 0x1D : right_step; reg = twl6040_read_reg_cache(codec, TWL6040_REG_HFRGAIN); reg = 0x1D - reg; val = (reg & TWL6040_HF_VOL_MASK); if (handsfree->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < handsfree->right_vol) { if (val + right_step > handsfree->right_vol) val = handsfree->right_vol; else val += right_step; reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFRGAIN, reg | (0x1D - val)); } else { right_complete = 1; } } else if (handsfree->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0) { if ((int)val - (int)right_step < 0) val = 0; else val -= right_step; reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFRGAIN, reg | (0x1D - val)); } else { right_complete = 1; } } return left_complete & right_complete; } /* * Ramp Earpiece PGA volume to minimise pops at stream startup and shutdown. */ static inline int twl6040_ep_ramp_step(struct snd_soc_codec *codec, unsigned int step) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *earphone = &priv->earphone; int complete = 0; u8 reg, val; step = (step > 0xF) ? 0xF : step; reg = twl6040_read_reg_cache(codec, TWL6040_REG_EARCTL); val = (~reg & TWL6040_EP_VOL_MASK) >> TWL6040_EP_VOL_SHIFT; if (earphone->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < earphone->left_vol) { if (val + step > earphone->left_vol) val = earphone->left_vol; else val += step; reg &= ~TWL6040_EP_VOL_MASK; val = ~val << TWL6040_EP_VOL_SHIFT; twl6040_write(codec, TWL6040_REG_EARCTL, reg | (val & TWL6040_EP_VOL_MASK)); } else { complete = 1; } } else if (earphone->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0x0) { if ((int)val - (int)step < 0) val = 0; else val -= step; reg &= ~TWL6040_EP_VOL_MASK; val = ~val << TWL6040_EP_VOL_SHIFT; twl6040_write(codec, TWL6040_REG_EARCTL, reg | (val & TWL6040_EP_VOL_MASK)); } else { complete = 1; } } return complete; } /* * This work ramps both output PGAs at stream start/stop time to * minimise pop associated with DAPM power switching. */ static void twl6040_pga_hs_work(struct work_struct *work) { struct twl6040_data *priv = container_of(work, struct twl6040_data, hs_delayed_work.work); struct snd_soc_codec *codec = priv->codec; struct twl6040_output *headset = &priv->headset; unsigned int delay = headset->step_delay; int i, headset_complete; /* do we need to ramp at all ? */ if (headset->ramp == TWL6040_RAMP_NONE) return; /* HS PGA volumes have 4 bits of resolution to ramp */ for (i = 0; i <= 16; i++) { headset_complete = twl6040_hs_ramp_step(codec, headset->left_step, headset->right_step); /* ramp finished ? */ if (headset_complete) break; /* * TODO: tune: delay is longer over 0dB * as increases are larger. */ if (i >= 8) schedule_timeout_interruptible(msecs_to_jiffies(delay + (delay >> 1))); else schedule_timeout_interruptible(msecs_to_jiffies(delay)); } #ifdef CONFIG_SOUND_CONTROL if (headset->ramp == TWL6040_RAMP_ZERO) { #else if (headset->ramp == TWL6040_RAMP_DOWN) { #endif headset->active = 0; complete(&headset->ramp_done); } else { headset->active = 1; } headset->ramp = TWL6040_RAMP_NONE; } static void twl6040_pga_hf_work(struct work_struct *work) { struct twl6040_data *priv = container_of(work, struct twl6040_data, hf_delayed_work.work); struct snd_soc_codec *codec = priv->codec; struct twl6040_output *handsfree = &priv->handsfree; unsigned int delay = handsfree->step_delay; int i, handsfree_complete; /* do we need to ramp at all ? */ if (handsfree->ramp == TWL6040_RAMP_NONE) return; /* HF PGA volumes have 5 bits of resolution to ramp */ for (i = 0; i <= 32; i++) { handsfree_complete = twl6040_hf_ramp_step(codec, handsfree->left_step, handsfree->right_step); /* ramp finished ? */ if (handsfree_complete) break; /* * TODO: tune: delay is longer over 0dB * as increases are larger. */ if (i >= 16) schedule_timeout_interruptible(msecs_to_jiffies(delay + (delay >> 1))); else schedule_timeout_interruptible(msecs_to_jiffies(delay)); } if (handsfree->ramp == TWL6040_RAMP_DOWN) { handsfree->active = 0; complete(&handsfree->ramp_done); } else handsfree->active = 1; handsfree->ramp = TWL6040_RAMP_NONE; } static void twl6040_pga_ep_work(struct work_struct *work) { struct twl6040_data *priv = container_of(work, struct twl6040_data, ep_delayed_work.work); struct snd_soc_codec *codec = priv->codec; struct twl6040_output *earphone = &priv->earphone; unsigned int delay = earphone->step_delay; int i, earphone_complete; /* do we need to ramp at all ? */ if (earphone->ramp == TWL6040_RAMP_NONE) return; /* Earpiece PGA volumes have 4 bits of resolution to ramp */ for (i = 0; i <= 16; i++) { earphone_complete = twl6040_ep_ramp_step(codec, earphone->left_step); /* ramp finished ? */ if (earphone_complete) break; /* * TODO: tune: delay is longer over 0dB * as increases are larger. */ if (i >= 8) schedule_timeout_interruptible(msecs_to_jiffies(delay + (delay >> 1))); else schedule_timeout_interruptible(msecs_to_jiffies(delay)); } if (earphone->ramp == TWL6040_RAMP_DOWN) { earphone->active = 0; complete(&earphone->ramp_done); } else { earphone->active = 1; } earphone->ramp = TWL6040_RAMP_NONE; } static int pga_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_codec *codec = w->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *out; struct delayed_work *work; struct workqueue_struct *queue; switch (w->shift) { case 0: out = &priv->earphone; work = &priv->ep_delayed_work; queue = priv->ep_workqueue; out->left_step = priv->ep_step; out->step_delay = 5; /* 5 ms between volume ramp steps */ break; case 2: case 3: out = &priv->headset; work = &priv->hs_delayed_work; queue = priv->hs_workqueue; out->left_step = priv->hs_left_step; out->right_step = priv->hs_right_step; out->step_delay = 5; /* 5 ms between volume ramp steps */ break; case 4: out = &priv->handsfree; work = &priv->hf_delayed_work; queue = priv->hf_workqueue; out->left_step = priv->hf_left_step; out->right_step = priv->hf_right_step; out->step_delay = 5; /* 5 ms between volume ramp steps */ break; default: return -1; } switch (event) { case SND_SOC_DAPM_POST_PMU: if (out->active) break; /* don't use volume ramp for power-up */ #ifdef CONFIG_SOUND_CONTROL if (w->shift == 2 || w->shift == 3) { out->left_step = out->left_vol + volume_boost; out->right_step = out->right_vol + volume_boost; } else { out->left_step = out->left_vol; out->right_step = out->right_vol; } #else out->left_step = out->left_vol; out->right_step = out->right_vol; #endif if (!delayed_work_pending(work)) { out->ramp = TWL6040_RAMP_UP; queue_delayed_work(queue, work, msecs_to_jiffies(1)); } break; case SND_SOC_DAPM_PRE_PMD: if (!out->active) break; if (!delayed_work_pending(work)) { /* use volume ramp for power-down */ #ifdef CONFIG_SOUND_CONTROL if (w->shift == 2 || w->shift == 3) out->ramp = TWL6040_RAMP_ZERO; else out->ramp = TWL6040_RAMP_DOWN; #else out->ramp = TWL6040_RAMP_DOWN; #endif INIT_COMPLETION(out->ramp_done); queue_delayed_work(queue, work, msecs_to_jiffies(1)); wait_for_completion_timeout(&out->ramp_done, msecs_to_jiffies(2000)); } break; } return 0; } /* set headset dac and driver power mode */ static int headset_power_mode(struct snd_soc_codec *codec, int high_perf) { int hslctl, hsrctl; int mask = TWL6040_HSDRVMODEL | TWL6040_HSDACMODEL; hslctl = twl6040_read_reg_cache(codec, TWL6040_REG_HSLCTL); hsrctl = twl6040_read_reg_cache(codec, TWL6040_REG_HSRCTL); if (high_perf) { hslctl &= ~mask; hsrctl &= ~mask; } else { hslctl |= mask; hsrctl |= mask; } twl6040_write(codec, TWL6040_REG_HSLCTL, hslctl); twl6040_write(codec, TWL6040_REG_HSRCTL, hsrctl); return 0; } #ifdef CONFIG_SOUND_CONTROL void soundcontrol_updatevolume(unsigned int volumeboost) { struct twl6040_output * out = &snd_data->headset; struct delayed_work * work = &snd_data->hs_delayed_work; if (out->active && !delayed_work_pending(work)) { if (volumeboost > volume_boost) out->ramp = TWL6040_RAMP_UP; else out->ramp = TWL6040_RAMP_DOWN; volume_boost = volumeboost; out->left_step = out->left_vol + volume_boost; out->right_step = out->right_vol + volume_boost; queue_delayed_work(snd_data->hs_workqueue, work, msecs_to_jiffies(1)); } return; } EXPORT_SYMBOL(soundcontrol_updatevolume); void soundcontrol_updateperf(bool highperf_enabled) { snd_data->headset_mode = highperf_enabled ? 1 : 0; if (headset_plugged) { headset_power_mode(snd_codec, snd_data->headset_mode); } return; } EXPORT_SYMBOL(soundcontrol_updateperf); void soundcontrol_reportjack(int jack_type) { if (jack_type == 0) { headset_plugged = false; if (snd_codec != NULL) headset_power_mode(snd_codec, 1); } else { headset_plugged = true; if (snd_codec != NULL && snd_data != NULL) headset_power_mode(snd_codec, snd_data->headset_mode); } return; } EXPORT_SYMBOL(soundcontrol_reportjack); #endif static int twl6040_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { msleep(1); return 0; } static int twl6040_ep_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_codec *codec = w->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int ret = 0; if (SND_SOC_DAPM_EVENT_ON(event)) { /* Earphone doesn't support low power mode */ priv->power_mode_forced = 1; ret = headset_power_mode(codec, 1); } else { priv->power_mode_forced = 0; #ifdef CONFIG_SOUND_CONTROL if (headset_plugged) { ret = headset_power_mode(codec, priv->headset_mode); } else { ret = headset_power_mode(codec, 1); } #else ret = headset_power_mode(codec, priv->headset_mode); #endif } msleep(1); return ret; } static void twl6040_hs_jack_report(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int report) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int status; mutex_lock(&priv->mutex); /* Sync status */ status = twl6040_read_reg_volatile(codec, TWL6040_REG_STATUS); if (status & TWL6040_PLUGCOMP) snd_soc_jack_report(jack, report, report); else snd_soc_jack_report(jack, 0, report); mutex_unlock(&priv->mutex); } void twl6040_hs_jack_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int report) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); struct twl6040_jack_data *hs_jack = &priv->hs_jack; hs_jack->jack = jack; hs_jack->report = report; twl6040_hs_jack_report(codec, hs_jack->jack, hs_jack->report); } EXPORT_SYMBOL_GPL(twl6040_hs_jack_detect); static void twl6040_accessory_work(struct work_struct *work) { struct twl6040_data *priv = container_of(work, struct twl6040_data, delayed_work.work); struct snd_soc_codec *codec = priv->codec; struct twl6040_jack_data *hs_jack = &priv->hs_jack; twl6040_hs_jack_report(codec, hs_jack->jack, hs_jack->report); } /* audio interrupt handler */ static irqreturn_t twl6040_audio_handler(int irq, void *data) { struct snd_soc_codec *codec = data; struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); u8 intid; intid = twl6040_reg_read(twl6040, TWL6040_REG_INTID); if ((intid & TWL6040_PLUGINT) || (intid & TWL6040_UNPLUGINT)) queue_delayed_work(priv->workqueue, &priv->delayed_work, msecs_to_jiffies(200)); return IRQ_HANDLED; } static int twl6040_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *twl6040_priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *out = NULL; struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; int ret; unsigned int reg = mc->reg; /* For HS and EP we shadow the values and only actually write * them out when active in order to ensure the amplifier comes on * as quietly as possible. */ switch (reg) { case TWL6040_REG_HSGAIN: out = &twl6040_priv->headset; break; case TWL6040_REG_EARCTL: out = &twl6040_priv->earphone; break; default: break; } if (out) { out->left_vol = ucontrol->value.integer.value[0]; out->right_vol = ucontrol->value.integer.value[1]; if (!out->active) return 1; } ret = snd_soc_put_volsw(kcontrol, ucontrol); if (ret < 0) return ret; return 1; } static int twl6040_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *twl6040_priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *out = &twl6040_priv->headset; struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; unsigned int reg = mc->reg; switch (reg) { case TWL6040_REG_HSGAIN: out = &twl6040_priv->headset; ucontrol->value.integer.value[0] = out->left_vol; ucontrol->value.integer.value[1] = out->right_vol; return 0; case TWL6040_REG_EARCTL: out = &twl6040_priv->earphone; ucontrol->value.integer.value[0] = out->left_vol; return 0; default: break; } return snd_soc_get_volsw(kcontrol, ucontrol); } static int twl6040_put_volsw_2r_vu(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *twl6040_priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *out = NULL; struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; int ret; unsigned int reg = mc->reg; /* For HS and HF we shadow the values and only actually write * them out when active in order to ensure the amplifier comes on * as quietly as possible. */ switch (reg) { case TWL6040_REG_HFLGAIN: case TWL6040_REG_HFRGAIN: out = &twl6040_priv->handsfree; break; default: break; } if (out) { out->left_vol = ucontrol->value.integer.value[0]; out->right_vol = ucontrol->value.integer.value[1]; if (!out->active) return 1; } ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); if (ret < 0) return ret; return 1; } static int twl6040_get_volsw_2r(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *twl6040_priv = snd_soc_codec_get_drvdata(codec); struct twl6040_output *out = &twl6040_priv->handsfree; struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; unsigned int reg = mc->reg; /* If these are cached registers use the cache */ switch (reg) { case TWL6040_REG_HFLGAIN: case TWL6040_REG_HFRGAIN: out = &twl6040_priv->handsfree; ucontrol->value.integer.value[0] = out->left_vol; ucontrol->value.integer.value[1] = out->right_vol; return 0; default: break; } return snd_soc_get_volsw_2r(kcontrol, ucontrol); } /* * MICATT volume control: * from -6 to 0 dB in 6 dB steps */ static DECLARE_TLV_DB_SCALE(mic_preamp_tlv, -600, 600, 0); /* * MICGAIN volume control: * from 6 to 30 dB in 6 dB steps */ static DECLARE_TLV_DB_SCALE(mic_amp_tlv, 600, 600, 0); /* * AFMGAIN volume control: * from -18 to 24 dB in 6 dB steps */ static DECLARE_TLV_DB_SCALE(afm_amp_tlv, -1800, 600, 0); /* * HSGAIN volume control: * from -30 to 0 dB in 2 dB steps */ static DECLARE_TLV_DB_SCALE(hs_tlv, -3000, 200, 0); /* * HFGAIN volume control: * from -52 to 6 dB in 2 dB steps */ static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0); /* * EPGAIN volume control: * from -24 to 6 dB in 2 dB steps */ static DECLARE_TLV_DB_SCALE(ep_tlv, -2400, 200, 0); /* Left analog microphone selection */ static const char *twl6040_amicl_texts[] = {"Headset Mic", "Main Mic", "Aux/FM Left", "Off"}; /* Right analog microphone selection */ static const char *twl6040_amicr_texts[] = {"Headset Mic", "Sub Mic", "Aux/FM Right", "Off"}; static const struct soc_enum twl6040_enum[] = { SOC_ENUM_SINGLE(TWL6040_REG_MICLCTL, 3, 4, twl6040_amicl_texts), SOC_ENUM_SINGLE(TWL6040_REG_MICRCTL, 3, 4, twl6040_amicr_texts), }; static const char *twl6040_hs_texts[] = { "Off", "HS DAC", "Line-In amp" }; static const struct soc_enum twl6040_hs_enum[] = { SOC_ENUM_SINGLE(TWL6040_REG_HSLCTL, 5, ARRAY_SIZE(twl6040_hs_texts), twl6040_hs_texts), SOC_ENUM_SINGLE(TWL6040_REG_HSRCTL, 5, ARRAY_SIZE(twl6040_hs_texts), twl6040_hs_texts), }; static const char *twl6040_hf_texts[] = { "Off", "HF DAC", "Line-In amp" }; static const struct soc_enum twl6040_hf_enum[] = { SOC_ENUM_SINGLE(TWL6040_REG_HFLCTL, 2, ARRAY_SIZE(twl6040_hf_texts), twl6040_hf_texts), SOC_ENUM_SINGLE(TWL6040_REG_HFRCTL, 2, ARRAY_SIZE(twl6040_hf_texts), twl6040_hf_texts), }; static const struct snd_kcontrol_new amicl_control = SOC_DAPM_ENUM("Route", twl6040_enum[0]); static const struct snd_kcontrol_new amicr_control = SOC_DAPM_ENUM("Route", twl6040_enum[1]); /* Headset DAC playback switches */ static const struct snd_kcontrol_new hsl_mux_controls = SOC_DAPM_ENUM("Route", twl6040_hs_enum[0]); static const struct snd_kcontrol_new hsr_mux_controls = SOC_DAPM_ENUM("Route", twl6040_hs_enum[1]); /* Handsfree DAC playback switches */ static const struct snd_kcontrol_new hfl_mux_controls = SOC_DAPM_ENUM("Route", twl6040_hf_enum[0]); static const struct snd_kcontrol_new hfr_mux_controls = SOC_DAPM_ENUM("Route", twl6040_hf_enum[1]); static const struct snd_kcontrol_new ep_driver_switch_controls = SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0); /* Headset power mode */ static const char *twl6040_headset_power_texts[] = { "Low-Power", "High-Performance", }; static const struct soc_enum twl6040_headset_power_enum = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl6040_headset_power_texts), twl6040_headset_power_texts); static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); ucontrol->value.enumerated.item[0] = priv->headset_mode; return 0; } static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); int high_perf = ucontrol->value.enumerated.item[0]; int ret; if (priv->power_mode_forced) return -EPERM; ret = headset_power_mode(codec, high_perf); if (!ret) priv->headset_mode = high_perf; return ret; } static const struct snd_kcontrol_new twl6040_snd_controls[] = { /* Capture gains */ SOC_DOUBLE_TLV("Capture Preamplifier Volume", TWL6040_REG_MICGAIN, 6, 7, 1, 1, mic_preamp_tlv), SOC_DOUBLE_TLV("Capture Volume", TWL6040_REG_MICGAIN, 0, 3, 4, 0, mic_amp_tlv), /* AFM gains */ SOC_DOUBLE_TLV("Aux FM Volume", TWL6040_REG_LINEGAIN, 0, 3, 7, 0, afm_amp_tlv), /* Playback gains */ SOC_DOUBLE_EXT_TLV("Headset Playback Volume", TWL6040_REG_HSGAIN, 0, 4, 0xF, 1, twl6040_get_volsw, twl6040_put_volsw, hs_tlv), SOC_DOUBLE_R_EXT_TLV("Handsfree Playback Volume", TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, twl6040_get_volsw_2r, twl6040_put_volsw_2r_vu, hf_tlv), SOC_SINGLE_EXT_TLV("Earphone Playback Volume", TWL6040_REG_EARCTL, 1, 0xF, 1, twl6040_get_volsw, twl6040_put_volsw, ep_tlv), SOC_ENUM_EXT("Headset Power Mode", twl6040_headset_power_enum, twl6040_headset_power_get_enum, twl6040_headset_power_put_enum), }; static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { /* Inputs */ SND_SOC_DAPM_INPUT("MAINMIC"), SND_SOC_DAPM_INPUT("HSMIC"), SND_SOC_DAPM_INPUT("SUBMIC"), SND_SOC_DAPM_INPUT("AFML"), SND_SOC_DAPM_INPUT("AFMR"), /* Outputs */ SND_SOC_DAPM_OUTPUT("HSOL"), SND_SOC_DAPM_OUTPUT("HSOR"), SND_SOC_DAPM_OUTPUT("HFL"), SND_SOC_DAPM_OUTPUT("HFR"), SND_SOC_DAPM_OUTPUT("EP"), /* Analog input muxes for the capture amplifiers */ SND_SOC_DAPM_MUX("Analog Left Capture Route", SND_SOC_NOPM, 0, 0, &amicl_control), SND_SOC_DAPM_MUX("Analog Right Capture Route", SND_SOC_NOPM, 0, 0, &amicr_control), /* Analog capture PGAs */ SND_SOC_DAPM_PGA("MicAmpL", TWL6040_REG_MICLCTL, 0, 0, NULL, 0), SND_SOC_DAPM_PGA("MicAmpR", TWL6040_REG_MICRCTL, 0, 0, NULL, 0), /* Auxiliary FM PGAs */ SND_SOC_DAPM_PGA("AFMAmpL", TWL6040_REG_MICLCTL, 1, 0, NULL, 0), SND_SOC_DAPM_PGA("AFMAmpR", TWL6040_REG_MICRCTL, 1, 0, NULL, 0), /* ADCs */ SND_SOC_DAPM_ADC("ADC Left", "Left Front Capture", TWL6040_REG_MICLCTL, 2, 0), SND_SOC_DAPM_ADC("ADC Right", "Right Front Capture", TWL6040_REG_MICRCTL, 2, 0), /* Microphone bias */ SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL6040_REG_AMICBCTL, 0, 0), SND_SOC_DAPM_MICBIAS("Main Mic Bias", TWL6040_REG_AMICBCTL, 4, 0), SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias", TWL6040_REG_DMICBCTL, 0, 0), SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias", TWL6040_REG_DMICBCTL, 4, 0), /* DACs */ SND_SOC_DAPM_DAC_E("HSDAC Left", "Headset Playback", TWL6040_REG_HSLCTL, 0, 0, twl6040_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_DAC_E("HSDAC Right", "Headset Playback", TWL6040_REG_HSRCTL, 0, 0, twl6040_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_DAC_E("HFDAC Left", "Handsfree Playback", TWL6040_REG_HFLCTL, 0, 0, twl6040_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_DAC_E("HFDAC Right", "Handsfree Playback", TWL6040_REG_HFRCTL, 0, 0, twl6040_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_MUX("HF Left Playback", SND_SOC_NOPM, 0, 0, &hfl_mux_controls), SND_SOC_DAPM_MUX("HF Right Playback", SND_SOC_NOPM, 0, 0, &hfr_mux_controls), /* Analog playback Muxes */ SND_SOC_DAPM_MUX("HS Left Playback", SND_SOC_NOPM, 0, 0, &hsl_mux_controls), SND_SOC_DAPM_MUX("HS Right Playback", SND_SOC_NOPM, 0, 0, &hsr_mux_controls), /* Analog playback drivers */ SND_SOC_DAPM_OUT_DRV_E("Handsfree Left Driver", TWL6040_REG_HFLCTL, 4, 0, NULL, 0, pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_OUT_DRV_E("Handsfree Right Driver", TWL6040_REG_HFRCTL, 4, 0, NULL, 0, pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_OUT_DRV_E("Headset Left Driver", TWL6040_REG_HSLCTL, 2, 0, NULL, 0, pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_OUT_DRV_E("Headset Right Driver", TWL6040_REG_HSRCTL, 2, 0, NULL, 0, pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_SWITCH_E("Earphone Enable", SND_SOC_NOPM, 0, 0, &ep_driver_switch_controls, twl6040_ep_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_OUT_DRV_E("Earphone Driver", SND_SOC_NOPM, 0, 0, NULL, 0, pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), /* Analog playback PGAs */ SND_SOC_DAPM_PGA("HFDAC Left PGA", TWL6040_REG_HFLCTL, 1, 0, NULL, 0), SND_SOC_DAPM_PGA("HFDAC Right PGA", TWL6040_REG_HFRCTL, 1, 0, NULL, 0), }; static const struct snd_soc_dapm_route intercon[] = { /* Capture path */ {"Analog Left Capture Route", "Headset Mic", "HSMIC"}, {"Analog Left Capture Route", "Main Mic", "MAINMIC"}, {"Analog Left Capture Route", "Aux/FM Left", "AFML"}, {"Analog Right Capture Route", "Headset Mic", "HSMIC"}, {"Analog Right Capture Route", "Sub Mic", "SUBMIC"}, {"Analog Right Capture Route", "Aux/FM Right", "AFMR"}, {"MicAmpL", NULL, "Analog Left Capture Route"}, {"MicAmpR", NULL, "Analog Right Capture Route"}, {"ADC Left", NULL, "MicAmpL"}, {"ADC Right", NULL, "MicAmpR"}, /* AFM path */ {"AFMAmpL", "NULL", "AFML"}, {"AFMAmpR", "NULL", "AFMR"}, {"HS Left Playback", "HS DAC", "HSDAC Left"}, {"HS Left Playback", "Line-In amp", "AFMAmpL"}, {"HS Right Playback", "HS DAC", "HSDAC Right"}, {"HS Right Playback", "Line-In amp", "AFMAmpR"}, {"Headset Left Driver", "NULL", "HS Left Playback"}, {"Headset Right Driver", "NULL", "HS Right Playback"}, {"HSOL", NULL, "Headset Left Driver"}, {"HSOR", NULL, "Headset Right Driver"}, /* Earphone playback path */ {"Earphone Enable", "Switch", "HSDAC Left"}, {"Earphone Driver", NULL, "Earphone Enable"}, {"EP", NULL, "Earphone Driver"}, {"HF Left Playback", "HF DAC", "HFDAC Left"}, {"HF Left Playback", "Line-In amp", "AFMAmpL"}, {"HF Right Playback", "HF DAC", "HFDAC Right"}, {"HF Right Playback", "Line-In amp", "AFMAmpR"}, {"HFDAC Left PGA", NULL, "HF Left Playback"}, {"HFDAC Right PGA", NULL, "HF Right Playback"}, {"Handsfree Left Driver", "Switch", "HFDAC Left PGA"}, {"Handsfree Right Driver", "Switch", "HFDAC Right PGA"}, {"HFL", NULL, "Handsfree Left Driver"}, {"HFR", NULL, "Handsfree Right Driver"}, }; static int twl6040_add_widgets(struct snd_soc_codec *codec) { struct snd_soc_dapm_context *dapm = &codec->dapm; snd_soc_dapm_new_controls(dapm, twl6040_dapm_widgets, ARRAY_SIZE(twl6040_dapm_widgets)); snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); snd_soc_dapm_new_widgets(dapm); return 0; } /* set of rates for each pll: low-power and high-performance */ static unsigned int lp_rates[] = { 8000, 11250, 16000, 22500, 32000, 44100, 48000, 88200, 96000, }; static struct snd_pcm_hw_constraint_list lp_constraints = { .count = ARRAY_SIZE(lp_rates), .list = lp_rates, }; static unsigned int hp_rates[] = { 8000, 16000, 32000, 48000, 96000, }; static struct snd_pcm_hw_constraint_list hp_constraints = { .count = ARRAY_SIZE(hp_rates), .list = hp_rates, }; static int twl6040_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); switch (level) { case SND_SOC_BIAS_ON: break; case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: if (priv->codec_powered) break; twl6040_enable(twl6040); priv->codec_powered = 1; priv->sysclk_constraints = &lp_constraints; /* initialize vdd/vss registers with reg_cache */ twl6040_init_vdd_regs(codec); break; case SND_SOC_BIAS_OFF: if (!priv->codec_powered) break; twl6040_disable(twl6040); priv->codec_powered = 0; break; } codec->dapm.bias_level = level; /* get pll and sysclk after power transition */ priv->pll = twl6040_get_pll(twl6040); priv->sysclk = twl6040_get_sysclk(twl6040); return 0; } static int twl6040_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_codec *codec = rtd->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, priv->sysclk_constraints); return 0; } static int twl6040_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_codec *codec = rtd->codec; struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); unsigned int sysclk; int rate; int ret; rate = params_rate(params); switch (rate) { case 11250: case 22500: case 44100: case 88200: sysclk = 17640000; break; case 8000: case 16000: case 32000: case 48000: case 96000: sysclk = 19200000; break; default: dev_err(codec->dev, "unsupported rate %d\n", rate); return -EINVAL; } ret = twl6040_set_pll(twl6040, priv->pll, priv->clk_in, sysclk); if (ret) { dev_err(codec->dev, "failed to configure PLL %d", ret); return ret; } priv->sysclk = sysclk; return 0; } static int twl6040_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_codec *codec = rtd->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); if (!priv->sysclk) { dev_err(codec->dev, "no mclk configured, call set_sysclk() on init\n"); return -EINVAL; } /* * In the capture, the Analog path should be turn on and stabilized * before McPDM prepare itself to avoid pop noises. * So the codec startup event is sending through dapm in prepare itself * to ensure that the codec analog path is up before McPDM Uplink FIFO * is going to be activated. */ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { snd_soc_dapm_codec_stream_event(dai->codec, dai->driver->capture.stream_name, SND_SOC_DAPM_STREAM_START); msleep(150); } return 0; } static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); switch (clk_id) { case TWL6040_LPPLL_ID: priv->sysclk_constraints = &lp_constraints; break; case TWL6040_HPPLL_ID: priv->sysclk_constraints = &hp_constraints; break; default: dev_err(codec->dev, "unknown clk_id %d\n", clk_id); return -EINVAL; } priv->pll = clk_id; priv->clk_in = freq; return 0; } static int twl6040_digital_mute(struct snd_soc_dai *dai, int mute) { /* * pop-noise reduction sequence requires to shutdown * analog side before CPU DAI */ if (mute) snd_soc_dapm_codec_stream_event(dai->codec, dai->driver->playback.stream_name, SND_SOC_DAPM_STREAM_STOP); return 0; } static struct snd_soc_dai_ops twl6040_dai_ops = { .startup = twl6040_startup, .hw_params = twl6040_hw_params, .prepare = twl6040_prepare, .set_sysclk = twl6040_set_dai_sysclk, .digital_mute = twl6040_digital_mute, }; static struct snd_soc_dai_driver twl6040_dai[] = { { .name = "twl6040-ul", .capture = { .stream_name = "Capture", .channels_min = 1, .channels_max = 2, .rates = TWL6040_RATES, .formats = TWL6040_FORMATS, }, .ops = &twl6040_dai_ops, }, { .name = "twl6040-dl1", .playback = { .stream_name = "Headset Playback", .channels_min = 1, .channels_max = 2, .rates = TWL6040_RATES, .formats = TWL6040_FORMATS, }, .ops = &twl6040_dai_ops, }, { .name = "twl6040-dl2", .playback = { .stream_name = "Handsfree Playback", .channels_min = 1, .channels_max = 2, .rates = TWL6040_RATES, .formats = TWL6040_FORMATS, }, .ops = &twl6040_dai_ops, }, { .name = "twl6040-vib", .playback = { .stream_name = "Vibra Playback", .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_CONTINUOUS, .formats = TWL6040_FORMATS, }, .ops = &twl6040_dai_ops, }, }; #ifdef CONFIG_PM static int twl6040_suspend(struct snd_soc_codec *codec, pm_message_t state) { twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; } static int twl6040_resume(struct snd_soc_codec *codec) { if (codec->dapm.bias_level != codec->dapm.suspend_bias_level) { twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); twl6040_set_bias_level(codec, codec->dapm.suspend_bias_level); } return 0; } #else #define twl6040_suspend NULL #define twl6040_resume NULL #endif static int twl6040_probe(struct snd_soc_codec *codec) { struct twl6040_data *priv; struct twl4030_codec_audio_data *pdata = dev_get_platdata(codec->dev); int ret = 0; priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); if (priv == NULL) return -ENOMEM; snd_soc_codec_set_drvdata(codec, priv); priv->codec = codec; codec->control_data = dev_get_drvdata(codec->dev->parent); codec->dapm.idle_bias_off = 1; if (pdata && pdata->hs_left_step && pdata->hs_right_step) { priv->hs_left_step = pdata->hs_left_step; priv->hs_right_step = pdata->hs_right_step; } else { priv->hs_left_step = 1; priv->hs_right_step = 1; } if (pdata && pdata->hf_left_step && pdata->hf_right_step) { priv->hf_left_step = pdata->hf_left_step; priv->hf_right_step = pdata->hf_right_step; } else { priv->hf_left_step = 1; priv->hf_right_step = 1; } if (pdata && pdata->ep_step) priv->ep_step = pdata->ep_step; else priv->ep_step = 1; /* default is low-power mode */ #ifdef CONFIG_SOUND_CONTROL priv->headset_mode = 0; #else priv->headset_mode = 1; #endif priv->sysclk_constraints = &lp_constraints; priv->workqueue = create_singlethread_workqueue("twl6040-codec"); if (!priv->workqueue) { ret = -ENOMEM; goto work_err; } INIT_DELAYED_WORK(&priv->delayed_work, twl6040_accessory_work); mutex_init(&priv->mutex); init_completion(&priv->headset.ramp_done); init_completion(&priv->handsfree.ramp_done); init_completion(&priv->earphone.ramp_done); priv->hf_workqueue = create_singlethread_workqueue("twl6040-hf"); if (priv->hf_workqueue == NULL) { ret = -ENOMEM; goto hfwork_err; } priv->hs_workqueue = create_singlethread_workqueue("twl6040-hs"); if (priv->hs_workqueue == NULL) { ret = -ENOMEM; goto hswork_err; } priv->ep_workqueue = create_singlethread_workqueue("twl6040-ep"); if (priv->ep_workqueue == NULL) { ret = -ENOMEM; goto epwork_err; } INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work); INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work); INIT_DELAYED_WORK(&priv->ep_delayed_work, twl6040_pga_ep_work); ret = twl6040_request_irq(codec->control_data, TWL6040_IRQ_PLUG, twl6040_audio_handler, "twl6040_irq_plug", codec); if (ret) { dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); goto irq_err; } /* init vio registers */ twl6040_init_vio_regs(codec); /* power on device */ ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); if (ret) goto bias_err; snd_soc_add_controls(codec, twl6040_snd_controls, ARRAY_SIZE(twl6040_snd_controls)); twl6040_add_widgets(codec); #ifdef CONFIG_SOUND_CONTROL snd_data = priv; snd_codec = codec; if (headset_plugged) { headset_power_mode(codec, priv->headset_mode); } #endif return 0; bias_err: twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); irq_err: destroy_workqueue(priv->ep_workqueue); epwork_err: destroy_workqueue(priv->hs_workqueue); hswork_err: destroy_workqueue(priv->hf_workqueue); hfwork_err: destroy_workqueue(priv->workqueue); work_err: kfree(priv); return ret; } static int twl6040_remove(struct snd_soc_codec *codec) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); destroy_workqueue(priv->workqueue); destroy_workqueue(priv->hf_workqueue); destroy_workqueue(priv->hs_workqueue); destroy_workqueue(priv->ep_workqueue); kfree(priv); return 0; } static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { .probe = twl6040_probe, .remove = twl6040_remove, .suspend = twl6040_suspend, .resume = twl6040_resume, .read = twl6040_read_reg_cache, .write = twl6040_write, .set_bias_level = twl6040_set_bias_level, .reg_cache_size = ARRAY_SIZE(twl6040_reg), .reg_word_size = sizeof(u8), .reg_cache_default = twl6040_reg, }; static int __devinit twl6040_codec_probe(struct platform_device *pdev) { return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_twl6040, twl6040_dai, ARRAY_SIZE(twl6040_dai)); } static int __devexit twl6040_codec_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev); return 0; } static struct platform_driver twl6040_codec_driver = { .driver = { .name = "twl6040-codec", .owner = THIS_MODULE, }, .probe = twl6040_codec_probe, .remove = __devexit_p(twl6040_codec_remove), }; static int __init twl6040_codec_init(void) { return platform_driver_register(&twl6040_codec_driver); } module_init(twl6040_codec_init); static void __exit twl6040_codec_exit(void) { platform_driver_unregister(&twl6040_codec_driver); } module_exit(twl6040_codec_exit); MODULE_DESCRIPTION("ASoC TWL6040 codec driver"); MODULE_AUTHOR("Misael Lopez Cruz"); MODULE_LICENSE("GPL");
ch33kybutt/kernel_cmplus_tuna
sound/soc/codecs/twl6040.c
C
gpl-2.0
51,951
[ 30522, 1013, 1008, 1008, 25520, 2050, 27084, 1056, 13668, 16086, 12740, 3642, 2278, 4062, 1008, 1008, 3166, 1024, 28616, 21147, 8685, 8096, 1026, 1060, 8889, 25746, 2581, 24594, 1030, 14841, 1012, 4012, 1028, 1008, 1008, 2023, 2565, 2003, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2014 Tatsuhiro Tsujikawa * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef NGHTTP2_BUF_H #define NGHTTP2_BUF_H #ifdef HAVE_CONFIG_H #include <config.h> #endif /* HAVE_CONFIG_H */ #include <nghttp2.h> #include "nghttp2_int.h" typedef struct { /* This points to the beginning of the buffer. The effective range of buffer is [begin, end). */ uint8_t *begin; /* This points to the memory one byte beyond the end of the buffer. */ uint8_t *end; /* The position indicator for effective start of the buffer. pos <= last must be hold. */ uint8_t *pos; /* The position indicator for effective one beyond of the end of the buffer. last <= end must be hold. */ uint8_t *last; /* Mark arbitrary position in buffer [begin, end) */ uint8_t *mark; } nghttp2_buf; #define nghttp2_buf_len(BUF) ((ssize_t)((BUF)->last - (BUF)->pos)) #define nghttp2_buf_avail(BUF) ((ssize_t)((BUF)->end - (BUF)->last)) #define nghttp2_buf_mark_avail(BUF) ((ssize_t)((BUF)->mark - (BUF)->last)) #define nghttp2_buf_cap(BUF) ((ssize_t)((BUF)->end - (BUF)->begin)) #define nghttp2_buf_pos_offset(BUF) ((ssize_t)((BUF)->pos - (BUF)->begin)) #define nghttp2_buf_last_offset(BUF) ((ssize_t)((BUF)->last - (BUF)->begin)) #define nghttp2_buf_shift_right(BUF, AMT) \ do { \ (BUF)->pos += AMT; \ (BUF)->last += AMT; \ } while (0) #define nghttp2_buf_shift_left(BUF, AMT) \ do { \ (BUF)->pos -= AMT; \ (BUF)->last -= AMT; \ } while (0) /* * Initializes the |buf|. No memory is allocated in this function. Use * nghttp2_buf_reserve() or nghttp2_buf_reserve2() to allocate memory. */ void nghttp2_buf_init(nghttp2_buf *buf); /* * Initializes the |buf| and allocates at least |initial| bytes of * memory. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory */ int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial); /* * Frees buffer in |buf|. */ void nghttp2_buf_free(nghttp2_buf *buf); /* * Extends buffer so that nghttp2_buf_cap() returns at least * |new_cap|. If extensions took place, buffer pointers in |buf| will * change. * * This function returns 0 if it succeeds, or one of the followings * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory */ int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap); /* * Resets pos, last, mark member of |buf| to buf->begin. */ void nghttp2_buf_reset(nghttp2_buf *buf); /* * Initializes |buf| using supplied buffer |begin| of length * |len|. Semantically, the application should not call *_reserve() or * nghttp2_free() functions for |buf|. */ void nghttp2_buf_wrap_init(nghttp2_buf *buf, uint8_t *begin, size_t len); struct nghttp2_buf_chain; typedef struct nghttp2_buf_chain nghttp2_buf_chain; /* Chains 2 buffers */ struct nghttp2_buf_chain { /* Points to the subsequent buffer. NULL if there is no such buffer. */ nghttp2_buf_chain *next; nghttp2_buf buf; }; typedef struct { /* Points to the first buffer */ nghttp2_buf_chain *head; /* Buffer pointer where write occurs. */ nghttp2_buf_chain *cur; /* The buffer capacity of each buf */ size_t chunk_length; /* The maximum number of nghttp2_buf_chain */ size_t max_chunk; /* The number of nghttp2_buf_chain allocated */ size_t chunk_used; /* The number of nghttp2_buf_chain to keep on reset */ size_t chunk_keep; /* pos offset from begin in each buffers. On initialization and reset, buf->pos and buf->last are positioned at buf->begin + offset. */ size_t offset; } nghttp2_bufs; /* * This is the same as calling nghttp2_bufs_init2 with the given * arguments and offset = 0. */ int nghttp2_bufs_init(nghttp2_bufs *bufs, size_t chunk_length, size_t max_chunk); /* * This is the same as calling nghttp2_bufs_init3 with the given * arguments and chunk_keep = max_chunk. */ int nghttp2_bufs_init2(nghttp2_bufs *bufs, size_t chunk_length, size_t max_chunk, size_t offset); /* * Initializes |bufs|. Each buffer size is given in the * |chunk_length|. The maximum number of buffers is given in the * |max_chunk|. On reset, first |chunk_keep| buffers are kept and * remaining buffers are deleted. Each buffer will have bufs->pos and * bufs->last shifted to left by |offset| bytes on creation and reset. * * This function allocates first buffer. bufs->head and bufs->cur * will point to the first buffer after this call. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. * NGHTTP2_ERR_INVALID_ARGUMENT * chunk_keep is 0; or max_chunk < chunk_keep; or offset is too * long. */ int nghttp2_bufs_init3(nghttp2_bufs *bufs, size_t chunk_length, size_t max_chunk, size_t chunk_keep, size_t offset); /* * Frees any related resources to the |bufs|. */ void nghttp2_bufs_free(nghttp2_bufs *bufs); /* * Initializes |bufs| using supplied buffer |begin| of length |len|. * The first buffer bufs->head uses buffer |begin|. The buffer size * is fixed and no allocate extra chunk buffer is allocated. In other * words, max_chunk = chunk_keep = 1. To free the resource allocated * for |bufs|, use nghttp2_bufs_wrap_free(). * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. */ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len); /* * Frees any related resource to the |bufs|. This function does not * free supplied buffer provided in nghttp2_bufs_wrap_init(). */ void nghttp2_bufs_wrap_free(nghttp2_bufs *bufs); /* * Reallocates internal buffer using |chunk_length|. The max_chunk, * chunk_keep and offset do not change. After successful allocation * of new buffer, previous buffers are deallocated without copying * anything into new buffers. chunk_used is reset to 1. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. * NGHTTP2_ERR_INVALID_ARGUMENT * chunk_length < offset */ int nghttp2_bufs_realloc(nghttp2_bufs *bufs, size_t chunk_length); /* * Appends the |data| of length |len| to the |bufs|. The write starts * at bufs->cur->buf.last. A new buffers will be allocated to store * all data. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. * NGHTTP2_ERR_BUFFER_ERROR * Out of buffer space. */ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len); /* * Appends a single byte |b| to the |bufs|. The write starts at * bufs->cur->buf.last. A new buffers will be allocated to store all * data. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. * NGHTTP2_ERR_BUFFER_ERROR * Out of buffer space. */ int nghttp2_bufs_addb(nghttp2_bufs *bufs, uint8_t b); /* * Behaves like nghttp2_bufs_addb(), but this does not update * buf->last pointer. */ int nghttp2_bufs_addb_hold(nghttp2_bufs *bufs, uint8_t b); #define nghttp2_bufs_fast_addb(BUFS, B) \ do { \ *(BUFS)->cur->buf.last++ = B; \ } while (0) #define nghttp2_bufs_fast_addb_hold(BUFS, B) \ do { \ *(BUFS)->cur->buf.last = B; \ } while (0) /* * Performs bitwise-OR of |b| at bufs->cur->buf.last. A new buffers * will be allocated if necessary. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory. * NGHTTP2_ERR_BUFFER_ERROR * Out of buffer space. */ int nghttp2_bufs_orb(nghttp2_bufs *bufs, uint8_t b); /* * Behaves like nghttp2_bufs_orb(), but does not update buf->last * pointer. */ int nghttp2_bufs_orb_hold(nghttp2_bufs *bufs, uint8_t b); #define nghttp2_bufs_fast_orb(BUFS, B) \ do { \ *(BUFS)->cur->buf.last++ |= B; \ } while (0) #define nghttp2_bufs_fast_orb_hold(BUFS, B) \ do { \ *(BUFS)->cur->buf.last |= B; \ } while (0) /* * Copies all data stored in |bufs| to the contagious buffer. This * function allocates the contagious memory to store all data in * |bufs| and assigns it to |*out|. * * On successful return, nghttp2_bufs_len(bufs) returns 0, just like * after calling nghttp2_bufs_reset(). * This function returns the length of copied data and assigns the * pointer to copied data to |*out| if it succeeds, or one of the * following negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory */ ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out); /* * Resets |bufs| and makes the buffers empty. */ void nghttp2_bufs_reset(nghttp2_bufs *bufs); /* * Moves bufs->cur to bufs->cur->next. If resulting bufs->cur is * NULL, this function allocates new buffers and bufs->cur points to * it. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM * Out of memory * NGHTTP2_ERR_BUFFER_ERROR * Out of buffer space. */ int nghttp2_bufs_advance(nghttp2_bufs *bufs); /* Sets bufs->cur to bufs->head */ #define nghttp2_bufs_rewind(BUFS) \ do { \ (BUFS)->cur = (BUFS)->head; \ } while (0) /* * Move bufs->cur, from the current position, using next member, to * the last buf which has nghttp2_buf_len(buf) > 0 without seeing buf * which satisfies nghttp2_buf_len(buf) == 0. If * nghttp2_buf_len(&bufs->cur->buf) == 0 or bufs->cur->next is NULL, * bufs->cur is unchanged. */ void nghttp2_bufs_seek_last_present(nghttp2_bufs *bufs); /* * Returns nonzero if bufs->cur->next is not emtpy. */ int nghttp2_bufs_next_present(nghttp2_bufs *bufs); #define nghttp2_bufs_cur_avail(BUFS) nghttp2_buf_avail(&(BUFS)->cur->buf) /* * Returns the buffer length of |bufs|. */ ssize_t nghttp2_bufs_len(nghttp2_bufs *bufs); #endif /* NGHTTP2_BUF_H */
zonque/wireshark
epan/nghttp2/nghttp2_buf.h
C
gpl-2.0
12,317
[ 30522, 1013, 1008, 1008, 12835, 11039, 25856, 2475, 1011, 8299, 1013, 1016, 1039, 3075, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 11937, 10422, 18334, 24529, 23049, 7556, 4213, 1008, 1008, 6656, 2003, 2182, 3762, 4379, 1010, 2489, 1997, 371...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Defines the resnet model. Adapted from https://github.com/tensorflow/models/tree/master/official/vision/image_classification/resnet. The following code is based on its v1 version. """ import tensorflow.compat.v1 as tf _BATCH_NORM_DECAY = 0.9 _BATCH_NORM_EPSILON = 1e-5 DEFAULT_VERSION = 2 DEFAULT_DTYPE = tf.float32 CASTABLE_TYPES = (tf.float16,) ALLOWED_TYPES = (DEFAULT_DTYPE,) + CASTABLE_TYPES NUM_CLASSES = 10 ################################################################################ # Convenience functions for building the ResNet model. ################################################################################ def batch_norm(inputs, training, data_format, name=''): """Performs a batch normalization using a standard set of parameters.""" # We set fused=True for a significant performance boost. See # https://www.tensorflow.org/performance/performance_guide#common_fused_ops return tf.compat.v1.layers.batch_normalization( inputs=inputs, axis=1 if data_format == 'channels_first' else 3, momentum=_BATCH_NORM_DECAY, epsilon=_BATCH_NORM_EPSILON, center=True, scale=True, training=training, fused=True, name=name) # add name later if necessary def fixed_padding(inputs, kernel_size, data_format): """Pads the input along the spatial dimensions independently of input size. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depending on data_format. kernel_size: The kernel to be used in the conv2d or max_pool2d operation. Should be a positive integer. data_format: The input format ('channels_last' or 'channels_first'). Returns: A tensor with the same format as the input with the data either intact (if kernel_size == 1) or padded (if kernel_size > 1). """ pad_total = kernel_size - 1 pad_beg = pad_total // 2 pad_end = pad_total - pad_beg if data_format == 'channels_first': padded_inputs = tf.pad( tensor=inputs, paddings=[[0, 0], [0, 0], [pad_beg, pad_end], [pad_beg, pad_end]]) else: padded_inputs = tf.pad( tensor=inputs, paddings=[[0, 0], [pad_beg, pad_end], [pad_beg, pad_end], [0, 0]]) return padded_inputs def conv2d_fixed_padding(inputs, filters, kernel_size, strides, data_format, name): """Strided 2-D convolution with explicit padding.""" # The padding is consistent and is based only on `kernel_size`, not on the # dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone). if strides > 1: inputs = fixed_padding(inputs, kernel_size, data_format) return tf.compat.v1.layers.conv2d( inputs=inputs, filters=filters, kernel_size=kernel_size, strides=strides, padding=('SAME' if strides == 1 else 'VALID'), use_bias=False, reuse=tf.AUTO_REUSE, kernel_initializer=tf.compat.v1.variance_scaling_initializer(), data_format=data_format, name=name) ################################################################################ # ResNet block definitions. ################################################################################ def _building_block_v2(inputs, filters, training, projection_shortcut, strides, data_format, name): """A single block for ResNet v2, without a bottleneck. Batch normalization then ReLu then convolution as described by: Identity Mappings in Deep Residual Networks https://arxiv.org/pdf/1603.05027.pdf by Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun, Jul 2016. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depending on data_format. filters: The number of filters for the convolutions. training: A Boolean for whether the model is in training or inference mode. Needed for batch normalization. projection_shortcut: The function to use for projection shortcuts (typically a 1x1 convolution when downsampling the input). strides: The block's stride. If greater than 1, this block will ultimately downsample the input. data_format: The input format ('channels_last' or 'channels_first'). name: Block name. Returns: The output tensor of the block; shape should match inputs. """ shortcut = inputs first_name = name + 'first' inputs = batch_norm( inputs, training, data_format, name=first_name + 'batch_norm') inputs = tf.nn.relu(inputs, name=first_name + 'relu') # The projection shortcut should come after the first batch norm and ReLU # since it performs a 1x1 convolution. if projection_shortcut is not None: shortcut = projection_shortcut(inputs, name=first_name + 'proj') second_name = name + 'second' inputs = conv2d_fixed_padding( inputs=inputs, filters=filters, kernel_size=3, strides=strides, data_format=data_format, name=second_name + 'input') inputs = batch_norm( inputs, training, data_format, name=second_name + 'batch_norm') inputs = tf.nn.relu(inputs, name=second_name + 'relu') third_name = name + 'third' inputs = conv2d_fixed_padding( inputs=inputs, filters=filters, kernel_size=3, strides=1, data_format=data_format, name=third_name + 'input') return inputs + shortcut def block_layer(inputs, filters, bottleneck, block_fn, blocks, strides, training, name, data_format, shortcut=True): """Creates one layer of blocks for the ResNet model. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depending on data_format. filters: The number of filters for the first convolution of the layer. bottleneck: Is the block created a bottleneck block. block_fn: The block to use within the model, either `building_block` or `bottleneck_block`. blocks: The number of blocks contained in the layer. strides: The stride to use for the first convolution of the layer. If greater than 1, this layer will ultimately downsample the input. training: Either True or False, whether we are currently training the model. Needed for batch norm. name: A string name for the tensor output of the block layer. data_format: The input format ('channels_last' or 'channels_first'). shortcut: Whether to use projection shortcut in the first block. Returns: The output tensor of the block layer. """ # Bottleneck blocks end with 4x the number of filters as they start with filters_out = filters * 4 if bottleneck else filters def projection_shortcut(inputs, name): return conv2d_fixed_padding( inputs=inputs, filters=filters_out, kernel_size=1, strides=strides, data_format=data_format, name=name) # Only the first block per block_layer uses projection_shortcut and strides. # Skip the projection shortcut in the first block layer. shortcut_fn = projection_shortcut if shortcut else None inputs = block_fn( inputs, filters, training, shortcut_fn, strides, data_format, name=name + 'input') for j in range(1, blocks): inputs = block_fn( inputs, filters, training, None, 1, data_format, name=name + 'block' + str(j)) return tf.identity(inputs, name) class Model(object): """Base class for building the Resnet Model.""" def __init__(self, resnet_size, bottleneck, num_classes, num_filters, kernel_size, conv_stride, first_pool_size, first_pool_stride, block_sizes, block_strides, resnet_version=DEFAULT_VERSION, data_format=None, dtype=DEFAULT_DTYPE): """Creates a model for classifying an image. Args: resnet_size: A single integer for the size of the ResNet model. bottleneck: Use regular blocks or bottleneck blocks. num_classes: The number of classes used as labels. num_filters: The number of filters to use for the first block layer of the model. This number is then doubled for each subsequent block layer. kernel_size: The kernel size to use for convolution. conv_stride: stride size for the initial convolutional layer first_pool_size: Pool size to be used for the first pooling layer. If none, the first pooling layer is skipped. first_pool_stride: stride size for the first pooling layer. Not used if first_pool_size is None. block_sizes: A list containing n values, where n is the number of sets of block layers desired. Each value should be the number of blocks in the i-th set. block_strides: List of integers representing the desired stride size for each of the sets of block layers. Should be same length as block_sizes. resnet_version: Integer representing which version of the ResNet network to use. See README for details. Valid values: [1, 2] data_format: Input format ('channels_last', 'channels_first', or None). If set to None, the format is dependent on whether a GPU is available. dtype: The TensorFlow dtype to use for calculations. If not specified tf.float32 is used. Raises: ValueError: if invalid version is selected. """ self.resnet_size = resnet_size if not data_format: data_format = ('channels_first' if tf.test.is_built_with_cuda() else 'channels_last') self.resnet_version = resnet_version if resnet_version not in (1, 2): raise ValueError( 'Resnet version should be 1 or 2. See README for citations.') self.bottleneck = bottleneck self.block_fn = _building_block_v2 if dtype not in ALLOWED_TYPES: raise ValueError('dtype must be one of: {}'.format(ALLOWED_TYPES)) self.data_format = data_format self.num_classes = num_classes self.num_filters = num_filters self.kernel_size = kernel_size self.conv_stride = conv_stride self.first_pool_size = first_pool_size self.first_pool_stride = first_pool_stride self.block_sizes = block_sizes self.block_strides = block_strides self.dtype = dtype self.pre_activation = resnet_version == 2 def _custom_dtype_getter(self, # pylint: disable=keyword-arg-before-vararg getter, name, shape=None, dtype=DEFAULT_DTYPE, *args, **kwargs): """Creates variables in fp32, then casts to fp16 if necessary. This function is a custom getter. A custom getter is a function with the same signature as tf.get_variable, except it has an additional getter parameter. Custom getters can be passed as the `custom_getter` parameter of tf.variable_scope. Then, tf.get_variable will call the custom getter, instead of directly getting a variable itself. This can be used to change the types of variables that are retrieved with tf.get_variable. The `getter` parameter is the underlying variable getter, that would have been called if no custom getter was used. Custom getters typically get a variable with `getter`, then modify it in some way. This custom getter will create an fp32 variable. If a low precision (e.g. float16) variable was requested it will then cast the variable to the requested dtype. The reason we do not directly create variables in low precision dtypes is that applying small gradients to such variables may cause the variable not to change. Args: getter: The underlying variable getter, that has the same signature as tf.get_variable and returns a variable. name: The name of the variable to get. shape: The shape of the variable to get. dtype: The dtype of the variable to get. Note that if this is a low precision dtype, the variable will be created as a tf.float32 variable, then cast to the appropriate dtype *args: Additional arguments to pass unmodified to getter. **kwargs: Additional keyword arguments to pass unmodified to getter. Returns: A variable which is cast to fp16 if necessary. """ if dtype in CASTABLE_TYPES: var = getter(name, shape, tf.float32, *args, **kwargs) return tf.cast(var, dtype=dtype, name=name + '_cast') else: return getter(name, shape, dtype, *args, **kwargs) def _model_variable_scope(self): """Returns a variable scope that the model should be created under. If self.dtype is a castable type, model variable will be created in fp32 then cast to self.dtype before being used. Returns: A variable scope for the model. """ return tf.compat.v1.variable_scope( 'resnet_model', custom_getter=self._custom_dtype_getter, reuse=tf.AUTO_REUSE) def __call__(self, inputs, training): """Add operations to classify a batch of input images. Args: inputs: A Tensor representing a batch of input images. training: A boolean. Set to True to add operations required only when training the classifier. Returns: A logits Tensor with shape [<batch_size>, self.num_classes]. """ with self._model_variable_scope(): if self.data_format == 'channels_first': # Convert the inputs from channels_last (NHWC) to channels_first (NCHW). # This provides a large performance boost on GPU. See # https://www.tensorflow.org/performance/performance_guide#data_formats inputs = tf.transpose(a=inputs, perm=[0, 3, 1, 2]) inputs = conv2d_fixed_padding( inputs=inputs, filters=self.num_filters, kernel_size=self.kernel_size, strides=self.conv_stride, data_format=self.data_format, name='initial_input') inputs = tf.identity(inputs, 'initial_conv') # We do not include batch normalization or activation functions in V2 # for the initial conv1 because the first ResNet unit will perform these # for both the shortcut and non-shortcut paths as part of the first # block's projection. Cf. Appendix of [2]. if self.resnet_version == 1: inputs = batch_norm(inputs, training, self.data_format) inputs = tf.nn.relu(inputs) if self.first_pool_size: inputs = tf.compat.v1.layers.max_pooling2d( inputs=inputs, pool_size=self.first_pool_size, strides=self.first_pool_stride, padding='SAME', data_format=self.data_format) inputs = tf.identity(inputs, 'initial_max_pool') for i, num_blocks in enumerate(self.block_sizes): # We now have 4 block layers, but the last does not # double the number of filters. # We also skip the projection shortcut in the first block layer. num_filters = self.num_filters * min((2**i), 4) shortcut = i != 0 inputs = block_layer( inputs=inputs, filters=num_filters, bottleneck=self.bottleneck, block_fn=self.block_fn, blocks=num_blocks, strides=self.block_strides[i], training=training, name='block_layer{}'.format(i + 1), data_format=self.data_format, shortcut=shortcut) # Skip the last BN+relu. # Only apply the BN and ReLU for model that does pre_activation in each # building/bottleneck block, eg resnet V2. # if self.pre_activation: # inputs = batch_norm(inputs, training, self.data_format, # name='pre_act'+'batch_norm') # inputs = tf.nn.relu(inputs,name='pre_act'+'relu') # The current top layer has shape # `batch_size x pool_size x pool_size x final_size`. # ResNet does an Average Pooling layer over pool_size, # but that is the same as doing a reduce_mean. We do a reduce_mean # here because it performs better than AveragePooling2D. # Also perform max-pooling, and concat results. axes = [2, 3] if self.data_format == 'channels_first' else [1, 2] avg_pooled = tf.reduce_mean(input_tensor=inputs, axis=axes, keepdims=True) avg_pooled = tf.squeeze(avg_pooled, axes) max_pooled = tf.reduce_max(input_tensor=inputs, axis=axes, keepdims=True) max_pooled = tf.squeeze(max_pooled, axes) inputs = tf.concat([avg_pooled, max_pooled], axis=1) inputs = tf.identity(inputs, 'final_pooling') inputs = tf.compat.v1.layers.dense( inputs=inputs, units=self.num_classes, reuse=tf.AUTO_REUSE) inputs = tf.identity(inputs, 'final_dense') return inputs ############################################################################### # Running the model ############################################################################### class FastCifar10Model(Model): """Model class with appropriate defaults for CIFAR-10 data.""" def __init__(self, resnet_size, data_format=None, num_classes=NUM_CLASSES, resnet_version=DEFAULT_VERSION, dtype=DEFAULT_DTYPE): """These are the parameters that work for CIFAR-10 data. Args: resnet_size: The number of convolutional layers needed in the model. data_format: Either 'channels_first' or 'channels_last', specifying which data format to use when setting up the model. num_classes: The number of output classes needed from the model. This enables users to extend the same model to their own datasets. resnet_version: Integer representing which version of the ResNet network to use. See README for details. Valid values: [1, 2] dtype: The TensorFlow dtype to use for calculations. Raises: ValueError: if invalid resnet_size is chosen """ # 4 block layers, so change to 8n+2. if resnet_size % 8 != 2: raise ValueError('resnet_size must be 8n + 2:', resnet_size) num_blocks = (resnet_size - 2) // 8 # Switch to 4 block layers. Use 64, 128, 256, 256 filters. super(FastCifar10Model, self).__init__( resnet_size=resnet_size, bottleneck=False, num_classes=num_classes, num_filters=64, kernel_size=3, conv_stride=1, first_pool_size=None, first_pool_stride=None, block_sizes=[num_blocks] * 4, block_strides=[1, 2, 2, 2], resnet_version=resnet_version, data_format=data_format, dtype=dtype)
google-research/google-research
adaptive_learning_rate_tuner/resnet_model_fast.py
Python
apache-2.0
19,574
[ 30522, 1001, 16861, 1027, 21183, 2546, 1011, 1022, 1001, 9385, 16798, 2475, 1996, 8224, 2470, 6048, 1012, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1001, 2017, 2089, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>AFL Match Statistics : Sydney defeated by Gold Coast at SCG Round 18 Saturday, 21st July 2018</TITLE> <meta NAME="description" CONTENT="Sydney defeated by Gold Coast at SCG Round 18 Saturday, 21st July 2018 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=9660&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=9660"><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"> Sydney defeated by Gold Coast </td></tr> <tr><td class="lnorm" height="15">Round 18, SCG, Attendance: 32565</td></tr> <tr><td class="lnorm" height="15"> Saturday, 21st July 2018, 2:10 PM AEST</td></tr> <tr><td class="lnorm" height="19" style="padding-top:4px;"> Sydney Betting Odds: Win 1.03, Line -63.5 @ 1.92 </td></tr> <tr><td class="lnorm" height="19" style="padding-bottom:4px;"> Gold Coast Betting Odds: Win 14.00, Line +63.5 @ 1.92 </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-sydney-swans">Sydney</a></td> <td align="center">6.4 <td align="center">6.7 <td align="center">6.10 <td align="center">8.16 <td align="center">64 </tr> <tr> <td class="leftbold" height="22"><a href="th-gold-coast-suns">Gold Coast</a></td> <td align="center">1.5 <td align="center">7.7 <td align="center">9.12 <td align="center">12.16 <td align="center">88 </tr> </table> </TD></TR> <TR><TD COLSPAN="3" HEIGHT="30" CLASS="norm"> <a href="#t1">Sydney Player Stats</a> | <a href="#t2">Gold Coast Player Stats</a> | <a href="#hd">Match Head to Head Stats</a> | <a href="#brk">Scoring Breakdown</a> | <a href="highlights?id=1905">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>Sydney Match Statistics (Sorted by Disposals)</b></td> <td class="innertbtitle" align="right">Coach: <a href="cp-john-longmire--81">John Longmire</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=9660&sby=23&advv=Y#t1" title="Contested Possessions">CP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=24&advv=Y#t1" title="Uncontested Possessions">UP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=25&advv=Y#t1" title="Effective Disposals">ED</a></td> <td width="34" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=34&advv=Y#t1" title="Disposal Efficiency %">DE%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=27&advv=Y#t1" title="Contested Marks">CM</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=21&advv=Y#t1" title="Goal Assists">GA</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=28&advv=Y#t1" title="Marks Inside 50">MI5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=31&advv=Y#t1" title="One Percenters">1%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=32&advv=Y#t1" title="Bounces">BO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=35&advv=Y#t1" title="Centre Clearances">CCL</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=36&advv=Y#t1" title="Stoppage Clearances">SCL</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=37&advv=Y#t1" title="Score Involvements">SI</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=38&advv=Y#t1" title="Metres Gained">MG</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=39&advv=Y#t1" title="Turnovers">TO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=40&advv=Y#t1" title="Intercepts">ITC</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=41&advv=Y#t1" title="Tackles Inside 50">T5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&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-sydney-swans--josh-p--kennedy" title="Josh Kennedy">J Kennedy</a></td> <td class="statdata">16</td> <td class="statdata">17</td> <td class="statdata">19</td> <td class="statdata">57.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">1</td> <td class="statdata">9</td> <td class="statdata">8</td> <td class="statdata">399</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">84</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-sydney-swans--luke-parker" title="Luke Parker">L Parker</a></td> <td class="statdata">14</td> <td class="statdata">13</td> <td class="statdata">17</td> <td class="statdata">58.6</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">5</td> <td class="statdata">6</td> <td class="statdata">424</td> <td class="statdata">5</td> <td class="statdata">5</td> <td class="statdata">0</td> <td class="statdata">89</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-sydney-swans--jake-lloyd" title="Jake Lloyd">J Lloyd</a></td> <td class="statdata">4</td> <td class="statdata">17</td> <td class="statdata">20</td> <td class="statdata">80</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">6</td> <td class="statdata">578</td> <td class="statdata">4</td> <td class="statdata">2</td> <td class="statdata">0</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-sydney-swans--harry-cunningham" title="Harry Cunningham">H Cunningham</a></td> <td class="statdata">7</td> <td class="statdata">17</td> <td class="statdata">20</td> <td class="statdata">83.3</td> <td class="statdata">0</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">5</td> <td class="statdata">5</td> <td class="statdata">352</td> <td class="statdata">2</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-sydney-swans--aliir-aliir" title="Aliir Aliir">A Aliir</a></td> <td class="statdata">14</td> <td class="statdata">13</td> <td class="statdata">20</td> <td class="statdata">83.3</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">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">315</td> <td class="statdata">3</td> <td class="statdata">17</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-sydney-swans--dane-rampe" title="Dane Rampe">D Rampe</a></td> <td class="statdata">8</td> <td class="statdata">14</td> <td class="statdata">16</td> <td class="statdata">72.7</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">9</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">236</td> <td class="statdata">3</td> <td class="statdata">7</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-sydney-swans--zak-jones" title="Zak Jones">Z Jones</a></td> <td class="statdata">2</td> <td class="statdata">19</td> <td class="statdata">15</td> <td class="statdata">75</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">291</td> <td class="statdata">4</td> <td class="statdata">2</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-sydney-swans--isaac-heeney" title="Isaac Heeney">I Heeney</a></td> <td class="statdata">10</td> <td class="statdata">10</td> <td class="statdata">13</td> <td class="statdata">65</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">3</td> <td class="statdata">6</td> <td class="statdata">295</td> <td class="statdata">1</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-sydney-swans--nic-newman" title="Nic Newman">N Newman</a></td> <td class="statdata">9</td> <td class="statdata">10</td> <td class="statdata">12</td> <td class="statdata">60</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">375</td> <td class="statdata">7</td> <td class="statdata">6</td> <td class="statdata">1</td> <td class="statdata">74</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-sydney-swans--colin-o-riordan" title="Colin O'Riordan">C O'Riordan</a></td> <td class="statdata">7</td> <td class="statdata">14</td> <td class="statdata">13</td> <td class="statdata">65</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">6</td> <td class="statdata">319</td> <td class="statdata">2</td> <td class="statdata">9</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-sydney-swans--george-hewett" title="George Hewett">G Hewett</a></td> <td class="statdata">11</td> <td class="statdata">9</td> <td class="statdata">13</td> <td class="statdata">68.4</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">1</td> <td class="statdata">3</td> <td class="statdata">3</td> <td class="statdata">128</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">2</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-sydney-swans--oliver-florent" title="Oliver Florent">O Florent</a></td> <td class="statdata">9</td> <td class="statdata">9</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">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">3</td> <td class="statdata">256</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">77</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-sydney-swans--lance-franklin" title="Lance Franklin">L Franklin</a></td> <td class="statdata">7</td> <td class="statdata">10</td> <td class="statdata">6</td> <td class="statdata">40</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">8</td> <td class="statdata">455</td> <td class="statdata">7</td> <td class="statdata">1</td> <td class="statdata">2</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-sydney-swans--harrison-marsh" title="Harrison Marsh">H Marsh</a></td> <td class="statdata">1</td> <td class="statdata">15</td> <td class="statdata">13</td> <td class="statdata">86.7</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">4</td> <td class="statdata">388</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">74</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-sydney-swans--tom-papley" title="Tom Papley">T Papley</a></td> <td class="statdata">10</td> <td class="statdata">4</td> <td class="statdata">7</td> <td class="statdata">58.3</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">4</td> <td class="statdata">210</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">1</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-sydney-swans--will-hayward" title="Will Hayward">W Hayward</a></td> <td class="statdata">7</td> <td class="statdata">6</td> <td class="statdata">9</td> <td class="statdata">75</td> <td class="statdata">1</td> <td class="statdata">0</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">4</td> <td class="statdata">225</td> <td class="statdata">3</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">82</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-sydney-swans--ben-ronke" title="Ben Ronke">B Ronke</a></td> <td class="statdata">4</td> <td class="statdata">7</td> <td class="statdata">3</td> <td class="statdata">25</td> <td class="statdata">0</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">1</td> <td class="statdata">3</td> <td class="statdata">175</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">82</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-sydney-swans--callum-sinclair" title="Callum Sinclair">C Sinclair</a></td> <td class="statdata">6</td> <td class="statdata">5</td> <td class="statdata">6</td> <td class="statdata">54.5</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">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">157</td> <td class="statdata">3</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-sydney-swans--tom-mccartin" title="Tom McCartin">T McCartin</a></td> <td class="statdata">8</td> <td class="statdata">4</td> <td class="statdata">7</td> <td class="statdata">63.6</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">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">72</td> <td class="statdata">5</td> <td class="statdata">1</td> <td class="statdata">1</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-sydney-swans--robbie-fox" title="Robbie Fox">R Fox</a></td> <td class="statdata">3</td> <td class="statdata">6</td> <td class="statdata">8</td> <td class="statdata">88.9</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">1</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">16</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">66</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-sydney-swans--nick-smith-1" title="Nick Smith">N Smith</a></td> <td class="statdata">3</td> <td class="statdata">4</td> <td class="statdata">4</td> <td class="statdata">66.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">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">20</td> <td class="statdata">1</td> <td class="statdata">4</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-sydney-swans--darcy-cameron" title="Darcy Cameron">D Cameron</a></td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">3</td> <td class="statdata">100</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">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">33</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">47</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>Gold Coast Match Statistics (Sorted by Disposals)</b></td> <td class="innertbtitle" align="right">Coach: <a href="cp-stuart-dew--360">Stuart Dew</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=9660&sby=23&advv=Y#t2" title="Contested Possessions">CP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=24&advv=Y#t2" title="Uncontested Possessions">UP</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=25&advv=Y#t2" title="Effective Disposals">ED</a></td> <td width="34" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=34&advv=Y#t2" title="Disposal Efficiency %">DE%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=27&advv=Y#t2" title="Contested Marks">CM</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=21&advv=Y#t2" title="Goal Assists">GA</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=28&advv=Y#t2" title="Marks Inside 50">MI5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=31&advv=Y#t2" title="One Percenters">1%</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=32&advv=Y#t2" title="Bounces">BO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=35&advv=Y#t2" title="Centre Clearances">CCL</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=36&advv=Y#t2" title="Stoppage Clearances">SCL</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=37&advv=Y#t2" title="Score Involvements">SI</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=38&advv=Y#t2" title="Metres Gained">MG</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=39&advv=Y#t2" title="Turnovers">TO</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=40&advv=Y#t2" title="Intercepts">ITC</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&sby=41&advv=Y#t2" title="Tackles Inside 50">T5</a></td> <td width="29" class="bnorm"><a href="fts_match_statistics?mid=9660&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-gold-coast-suns--will-brodie" title="Will Brodie">W Brodie</a></td> <td class="statdata">11</td> <td class="statdata">17</td> <td class="statdata">14</td> <td class="statdata">51.9</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">3</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">374</td> <td class="statdata">8</td> <td class="statdata">2</td> <td class="statdata">1</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-gold-coast-suns--touk-miller" title="Touk Miller">T Miller</a></td> <td class="statdata">13</td> <td class="statdata">14</td> <td class="statdata">15</td> <td class="statdata">60</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">0</td> <td class="statdata">6</td> <td class="statdata">5</td> <td class="statdata">535</td> <td class="statdata">3</td> <td class="statdata">3</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-gold-coast-suns--steven-may" title="Steven May">S May</a></td> <td class="statdata">9</td> <td class="statdata">13</td> <td class="statdata">14</td> <td class="statdata">60.9</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">9</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">443</td> <td class="statdata">8</td> <td class="statdata">15</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-gold-coast-suns--lachlan-weller" title="Lachlan Weller">L Weller</a></td> <td class="statdata">6</td> <td class="statdata">17</td> <td class="statdata">17</td> <td class="statdata">73.9</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">0</td> <td class="statdata">2</td> <td class="statdata">7</td> <td class="statdata">543</td> <td class="statdata">3</td> <td class="statdata">2</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">J Lyons</a></td> <td class="statdata">13</td> <td class="statdata">6</td> <td class="statdata">13</td> <td class="statdata">65</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">1</td> <td class="statdata">9</td> <td class="statdata">3</td> <td class="statdata">313</td> <td class="statdata">4</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">69</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-gold-coast-suns--kade-kolodjashnij" title="Kade Kolodjashnij">K Kolodjashnij</a></td> <td class="statdata">4</td> <td class="statdata">16</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">4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">3</td> <td class="statdata">311</td> <td class="statdata">3</td> <td class="statdata">7</td> <td class="statdata">0</td> <td class="statdata">90</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--peter-wright" title="Peter Wright">P Wright</a></td> <td class="statdata">13</td> <td class="statdata">8</td> <td class="statdata">13</td> <td class="statdata">65</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">4</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">5</td> <td class="statdata">186</td> <td class="statdata">6</td> <td class="statdata">2</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-gold-coast-suns--aaron-young" title="Aaron Young">A Young</a></td> <td class="statdata">9</td> <td class="statdata">7</td> <td class="statdata">11</td> <td class="statdata">64.7</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">9</td> <td class="statdata">307</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">3</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-gold-coast-suns--nicholas-holman" title="Nicholas Holman">N Holman</a></td> <td class="statdata">8</td> <td class="statdata">10</td> <td class="statdata">12</td> <td class="statdata">70.6</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">8</td> <td class="statdata">309</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">1</td> <td class="statdata">82</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-gold-coast-suns--alex-sexton" title="Alex Sexton">A Sexton</a></td> <td class="statdata">7</td> <td class="statdata">12</td> <td class="statdata">12</td> <td class="statdata">75</td> <td class="statdata">1</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">1</td> <td class="statdata">7</td> <td class="statdata">383</td> <td class="statdata">4</td> <td class="statdata">2</td> <td class="statdata">2</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-gold-coast-suns--sean-lemmens" title="Sean Lemmens">S Lemmens</a></td> <td class="statdata">8</td> <td class="statdata">9</td> <td class="statdata">10</td> <td class="statdata">62.5</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">2</td> <td class="statdata">1</td> <td class="statdata">7</td> <td class="statdata">165</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">71</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-gold-coast-suns--jesse-joyce" title="Jesse Joyce">J Joyce</a></td> <td class="statdata">6</td> <td class="statdata">10</td> <td class="statdata">10</td> <td class="statdata">62.5</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">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">215</td> <td class="statdata">5</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-gold-coast-suns--jarrod-witts" title="Jarrod Witts">J Witts</a></td> <td class="statdata">9</td> <td class="statdata">5</td> <td class="statdata">7</td> <td class="statdata">50</td> <td class="statdata">1</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">3</td> <td class="statdata">7</td> <td class="statdata">158</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">1</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-gold-coast-suns--jesse-lonergan" title="Jesse Lonergan">J Lonergan</a></td> <td class="statdata">7</td> <td class="statdata">7</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">2</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">4</td> <td class="statdata">246</td> <td class="statdata">3</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--jarrod-harbrow" title="Jarrod Harbrow">J Harbrow</a></td> <td class="statdata">4</td> <td class="statdata">9</td> <td class="statdata">10</td> <td class="statdata">76.9</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">0</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">244</td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">87</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-gold-coast-suns--charlie-ballard" title="Charlie Ballard">C Ballard</a></td> <td class="statdata">7</td> <td class="statdata">6</td> <td class="statdata">10</td> <td class="statdata">76.9</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">0</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">245</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">0</td> <td class="statdata">71</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--jacob-heron" title="Jacob Heron">J Heron</a></td> <td class="statdata">6</td> <td class="statdata">6</td> <td class="statdata">6</td> <td class="statdata">50</td> <td class="statdata">1</td> <td class="statdata">0</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">7</td> <td class="statdata">174</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-gold-coast-suns--callum-ah-chee" title="Callum Ah Chee">C Ah Chee</a></td> <td class="statdata">5</td> <td class="statdata">6</td> <td class="statdata">9</td> <td class="statdata">90</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">0</td> <td class="statdata">0</td> <td class="statdata">3</td> <td class="statdata">158</td> <td class="statdata">0</td> <td class="statdata">6</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--brayden-crossley" title="Brayden Crossley">B Crossley</a></td> <td class="statdata">8</td> <td class="statdata">2</td> <td class="statdata">6</td> <td class="statdata">60</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">1</td> <td class="statdata">0</td> <td class="statdata">2</td> <td class="statdata">106</td> <td class="statdata">2</td> <td class="statdata">2</td> <td class="statdata">2</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-gold-coast-suns--michael-rischitelli" title="Michael Rischitelli">M Rischitelli</a></td> <td class="statdata">4</td> <td class="statdata">4</td> <td class="statdata">7</td> <td class="statdata">87.5</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">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">249</td> <td class="statdata">2</td> <td class="statdata">5</td> <td class="statdata">0</td> <td class="statdata">80</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td align="left" height="18"><a href="pp-gold-coast-suns--wil-powell" title="Wil Powell">W Powell</a></td> <td class="statdata">5</td> <td class="statdata">2</td> <td class="statdata">5</td> <td class="statdata">71.4</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">0</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">106</td> <td class="statdata">0</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">71</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td align="left" height="18"><a href="pp-gold-coast-suns--rory-thompson" title="Rory Thompson">R Thompson</a></td> <td class="statdata">1</td> <td class="statdata">2</td> <td class="statdata">3</td> <td class="statdata">75</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">0</td> <td class="statdata">0</td> <td class="statdata">0</td> <td class="statdata">21</td> <td class="statdata">1</td> <td class="statdata">1</td> <td class="statdata">0</td> <td class="statdata">93</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">Sydney</td> <td width="125" class="bnorm">Statistic</td> <td width="124" class="bnorm">Gold Coast</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">161</td> <td class="statdata">Contested Possessions</td> <td class="statdata">163</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">225</td> <td class="statdata">Uncontested Possessions</td> <td class="statdata">188</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">255</td> <td class="statdata">Effective Disposals</td> <td class="statdata">227</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">67.1%</td> <td class="statdata">Disposal Efficiency %</td> <td class="statdata">65.8%</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">59</td> <td class="statdata">Clangers</td> <td class="statdata">60</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">17</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">9</td> <td class="statdata">Marks Inside 50</td> <td class="statdata">10</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">44</td> <td class="statdata">Clearances</td> <td class="statdata">43</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">47</td> <td class="statdata">Rebound 50s</td> <td class="statdata">38</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">45</td> <td class="statdata">One Percenters</td> <td class="statdata">55</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">10</td> <td class="statdata">Bounces</td> <td class="statdata">5</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">4</td> <td class="statdata">Goal Assists</td> <td class="statdata">5</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">50.0%</td> <td class="statdata">% Goals Assisted</td> <td class="statdata">41.7%</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">10</td> <td class="statdata">Centre Clearances</td> <td class="statdata">11</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">34</td> <td class="statdata">Stoppage Clearances</td> <td class="statdata">32</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">85</td> <td class="statdata">Score Involvements</td> <td class="statdata">88</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">5719</td> <td class="statdata">Metres Gained</td> <td class="statdata">5791</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">67</td> <td class="statdata">Turnovers</td> <td class="statdata">63</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="25" class="statdata">63</td> <td class="statdata">Intercepts</td> <td class="statdata">67</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="25" class="statdata">10</td> <td class="statdata">Tackles Inside 50</td> <td class="statdata">13</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">Sydney</td> <td width="124" class="bnorm">Attribute</td> <td width="124" class="bnorm">Gold Coast</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">187.5cm</td> <td class="statdata">Height</td> <td class="statdata">188.7cm</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">85.6kg</td> <td class="statdata">Weight</td> <td class="statdata">85.3kg</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">24yr 5mth</td> <td class="statdata">Age</td> <td class="statdata">23yr 5mth</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">78.6</td> <td class="statdata">Games</td> <td class="statdata">70.4</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">Sydney</td> <td width="124" class="bnorm">Games</td> <td width="124" class="bnorm">Gold Coast</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">10</td> <td class="statdata">Less than 50</td> <td class="statdata">9</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">6</td> <td class="statdata">50 to 99</td> <td class="statdata">9</td> </tr> <tr bgcolor="#f2f4f7" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#f2f4f7';"> <td height="18" class="statdata">2</td> <td class="statdata">100 to 149</td> <td class="statdata">2</td> </tr> <tr bgcolor="#ffffff" onMouseOver="this.bgColor='#cbcdd0';" onMouseOut="this.bgColor='#ffffff';"> <td height="18" class="statdata">4</td> <td class="statdata">150 or more</td> <td class="statdata">2</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>First Quarter</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">6.4 40</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">1.5 11</td> </tr> <tr> <td class="ylwbgmid">10</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">16.7%</td> </tr> <tr> <td class="ylwbgmid">Won quarter by 29</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Lost quarter by 29</td> </tr> <tr> <td class="ylwbgmid">Leading by 29</td> <td class="ylwbgmid">End of Quarter</td> <td class="ylwbgmid">Trailing by 29</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>Second Quarter</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">0.3 3</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">6.2 38</td> </tr> <tr> <td class="ylwbgmid">3</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">8</td> </tr> <tr> <td class="ylwbgmid">0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">75.0%</td> </tr> <tr> <td class="ylwbgmid">Lost quarter by 35</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won quarter by 35</td> </tr> <tr> <td class="ylwbgmid">Trailing by 6</td> <td class="ylwbgmid">Halftime</td> <td class="ylwbgmid">Leading by 6</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>Third Quarter</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">0.3 3</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">2.5 17</td> </tr> <tr> <td class="ylwbgmid">3</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">7</td> </tr> <tr> <td class="ylwbgmid">0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">28.6%</td> </tr> <tr> <td class="ylwbgmid">Lost quarter by 14</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won quarter by 14</td> </tr> <tr> <td class="ylwbgmid">Trailing by 20</td> <td class="ylwbgmid">End of Quarter</td> <td class="ylwbgmid">Leading by 20</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>Final Quarter</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">2.6 18</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">3.4 22</td> </tr> <tr> <td class="ylwbgmid">8</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">7</td> </tr> <tr> <td class="ylwbgmid">25.0%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">42.9%</td> </tr> <tr> <td class="ylwbgmid">Lost quarter by 4</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won quarter by 4</td> </tr> <tr> <td class="ylwbgmid">Lost game by 24</td> <td class="ylwbgmid">End of Game</td> <td class="ylwbgmid">Won game by 24</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>First Half</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">6.7 43</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">7.7 49</td> </tr> <tr> <td class="ylwbgmid">13</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">14</td> </tr> <tr> <td class="ylwbgmid">46.2%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">50.0%</td> </tr> <tr> <td class="ylwbgmid">Lost half by 6</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won half by 6</td> </tr> <tr> <td class="ylwbgmid">Trailing by 6</td> <td class="ylwbgmid">Halftime</td> <td class="ylwbgmid">Leading by 6</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>Sydney</b></td> <td class="ylwbgmid" width="125"><b>Second Half</b></td> <td class="ylwbgmid" width="124"><b>Gold Coast</b></td> </tr> <tr><td colspan="3" class="ylwbdr" style="height:1px"></td></tr> <tr> <td class="ylwbgmid">2.9 21</td> <td class="ylwbgmid">Score</td> <td class="ylwbgmid">5.9 39</td> </tr> <tr> <td class="ylwbgmid">11</td> <td class="ylwbgmid">Scoring Shots</td> <td class="ylwbgmid">14</td> </tr> <tr> <td class="ylwbgmid">18.2%</td> <td class="ylwbgmid">Conversion</td> <td class="ylwbgmid">35.7%</td> </tr> <tr> <td class="ylwbgmid">Lost half by 18</td> <td class="ylwbgmid">Result</td> <td class="ylwbgmid">Won half by 18</td> </tr> <tr> <td class="ylwbgmid">Lost game by 24</td> <td class="ylwbgmid">End of Game</td> <td class="ylwbgmid">Won game by 24</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_adv9660.html
HTML
gpl-3.0
147,714
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 30524, 8040, 2290, 2461, 2324, 5095, 1010, 7398, 2251, 2760, 1026, 1013, 2516, 1028, 1026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // PayPalFuturePaymentViewController.h // // Version 2.6.1 // // Copyright (c) 2014, PayPal // All rights reserved. // #import <UIKit/UIKit.h> #import "PayPalConfiguration.h" @class PayPalFuturePaymentViewController; typedef void (^PayPalFuturePaymentDelegateCompletionBlock)(void); #pragma mark - PayPalFuturePaymentDelegate /// Exactly one of these two required delegate methods will get called when the UI completes. /// You MUST dismiss the modal view controller from these required delegate methods. @protocol PayPalFuturePaymentDelegate <NSObject> @required /// User canceled the future payment process. /// Your code MUST dismiss the PayPalFuturePaymentViewController. /// @param futurePaymentViewController The PayPalFuturePaymentViewController that the user canceled without agreement. - (void)payPalFuturePaymentDidCancel:(PayPalFuturePaymentViewController *)futurePaymentViewController; /// User successfully completed the future payment authorization. /// The PayPalFuturePaymentViewController's activity indicator has been dismissed. /// Your code MAY deal with the futurePaymentAuthorization, if it did not already do so within your optional /// payPalFuturePaymentViewController:willAuthorizeFuturePayment:completionBlock: method. /// Your code MUST dismiss the PayPalFuturePaymentViewController. /// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized. /// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment. - (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization; @optional /// User successfully completed the future payment authorization. /// The PayPalFuturePaymentViewController's activity indicator is still visible. /// Your code MAY deal with the futurePaymentAuthorization; e.g., send it to your server and await confirmation. /// Your code MUST finish by calling the completionBlock. /// Your code must NOT dismiss the PayPalFuturePaymentViewController. /// @param futurePaymentViewController The PayPalFuturePaymentViewController where the user successfullly authorized. /// @param futurePaymentAuthorization A dictionary containing information that your server will need to process the payment. /// @param completionBlock Block to execute when your processing is done. - (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController willAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization completionBlock:(PayPalFuturePaymentDelegateCompletionBlock)completionBlock; @end #pragma mark - PayPalFuturePaymentViewController @interface PayPalFuturePaymentViewController : UINavigationController /// The designated initalizer. A new view controller MUST be initialized for each use. /// @param configuration The configuration to be used for the lifetime of the controller. /// The configuration properties merchantName, merchantPrivacyPolicyURL, and merchantUserAgreementURL must be provided. /// @param delegate The delegate you want to receive updates about the future payment authorization. - (instancetype)initWithConfiguration:(PayPalConfiguration *)configuration delegate:(id<PayPalFuturePaymentDelegate>)delegate; /// Delegate access @property (nonatomic, weak, readonly) id<PayPalFuturePaymentDelegate> futurePaymentDelegate; @end
amani-mohammad/appcessorize
Appcessorize.framework/Versions/A/Headers/PayPalFuturePaymentViewController.h
C
mit
3,583
[ 30522, 1013, 1013, 1013, 1013, 3477, 12952, 11263, 11244, 4502, 25219, 3372, 8584, 8663, 13181, 10820, 1012, 1044, 1013, 1013, 1013, 1013, 2544, 1016, 1012, 1020, 1012, 1015, 1013, 1013, 1013, 1013, 9385, 1006, 1039, 1007, 2297, 1010, 3477,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import {Component, OnInit} from '@angular/core'; import {EvaluationService} from '../service/evaluation.service'; @Component({ selector: 'app-evaluation', templateUrl: './evaluation.component.html', styleUrls: ['./evaluation.component.css'] }) export class EvaluationComponent implements OnInit { public result: number[]; private quadrantWith = 200; constructor(public evaluationService: EvaluationService) { } ngOnInit() { this.result = this.evaluationService.evaluate(); } calc(points: number): number { const value = 1 / 30 * (points - 10) * this.quadrantWith return (value < 0) ? 0 : value; } }
david-0/disg
src/app/evaluation/evaluation.component.ts
TypeScript
gpl-3.0
638
[ 30522, 12324, 1063, 6922, 1010, 2006, 5498, 2102, 1065, 2013, 1005, 1030, 16108, 1013, 4563, 1005, 1025, 12324, 1063, 9312, 8043, 7903, 2063, 1065, 2013, 1005, 1012, 1012, 1013, 2326, 1013, 9312, 1012, 2326, 1005, 1025, 1030, 6922, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python # ====================================================================== import pangloss import sys,getopt,cPickle,numpy import scipy.stats as stats # ====================================================================== def Calibrate(argv): """ NAME Calibrate.py PURPOSE Transform the results of the lightcone reconstruction process, Pr(kappah|D), into our target PDF, Pr(kappa|D). COMMENTS All PDF input is provided as a list of samples. There are two modes of operation: 1) The Pr(kappah|C) for an ensemble of calibration lightcones are compressed into a single number (currently the median), and then combined with the true kappa values to make Pr(kappa,kappah|C). This is written out as a 2D sample list. 2) The Pr(kappah|D) for a single observed lightcone is compressed into a single number (currently the median). This is then used to take a slice from Pr(kappa,kappah|C) to make Pr(kappa|D,C). Both 1 and 2 can be carried out in series if desired (Mode=3). FLAGS -h Print this message [0] INPUTS configfile Plain text file containing Pangloss configuration OPTIONAL INPUTS --mode Operating mode 1,2 or 3. See COMMENTS above. OUTPUTS stdout Useful information samples From 1) Pr(kappa,kappah|C) or 2) Pr(kappa|D,C) EXAMPLE Calibrate.py example.config BUGS AUTHORS This file is part of the Pangloss project, distributed under the GPL v2, by Tom Collett (IoA) and Phil Marshall (Oxford). Please cite: Collett et al 2013, http://arxiv.org/abs/1303.6564 HISTORY 2013-03-21 started Collett & Marshall (Oxford) """ # -------------------------------------------------------------------- try: opts, args = getopt.getopt(argv,"hm:",["help","mode"]) except getopt.GetoptError, err: print str(err) # will print something like "option -a not recognized" print Calibrate.__doc__ # will print the big comment above. return Mode=3 for o,a in opts: if o in ("-h", "--help"): print Calibrate.__doc__ return elif o in ("-m", "--mode"): Mode = int(a) assert Mode < 4 and Mode >0, "unhandled Mode" else: assert False, "unhandled option" # Check for setup file in array args: if len(args) == 1: configfile = args[0] print pangloss.doubledashedline print pangloss.hello print pangloss.doubledashedline print "Calibrate: transforming Pr(kappah|D) to Pr(kappa|D)" print "Calibrate: taking instructions from",configfile else: print Calibrate.__doc__ return # -------------------------------------------------------------------- # Read in configuration, and extract the ones we need: experiment = pangloss.Configuration(configfile) EXP_NAME = experiment.parameters['ExperimentName'] Nc = experiment.parameters['NCalibrationLightcones'] comparator=experiment.parameters['Comparator'] comparatorType=experiment.parameters['ComparatorType'] comparatorWidth=experiment.parameters['ComparatorWidth'] # Figure out which mode is required: ModeName = experiment.parameters['CalibrateMode'] if ModeName=='Joint': Mode = 1 if ModeName=='Slice': Mode = 2 if ModeName=='JointAndSlice': Mode = 3 CALIB_DIR = experiment.parameters['CalibrationFolder'][0] jointdistfile= CALIB_DIR+'/'+comparator+'_'+comparatorType+'.pickle' jointdistasPDFfile= CALIB_DIR+'/'+comparator+'_'+comparatorType+'_asPDF.pickle' # Final result is PDF for kappa: x = experiment.parameters['ObservedCatalog'][0] resultfile = x.split('.')[0]+"_"+EXP_NAME+"_PofKappa.pickle" # -------------------------------------------------------------------- # Mode 1: generate a joint distribution, eg Pr(kappah,kappa) # from the calibration dataset: if Mode==1 or Mode==3: print pangloss.dashedline # First find the calibration pdfs for kappa_h: calpickles = [] for i in range(Nc): calpickles.append(experiment.getLightconePickleName('simulated',pointing=i)) calresultpickles=[] if comparator=="Kappah" and comparatorType=="median": for i in range(Nc): x = calpickles[i] pfile = x.split('.')[0].split("_lightcone")[0]+"_"+EXP_NAME+"_KappaHilbert_Kappah_median.pickle" calresultpickles.append(pfile) elif comparator=="Kappah" and comparatorType!="median": for i in range(Nc): x = calpickles[i] pfile = x.split('.')[0].split("_lightcone")[0]+"_"+EXP_NAME+"_KappaHilbert_Kappah_"+comparatorType+".pickle" calresultpickles.append(pfile) else: print "Calibrate: Unrecognised comparator "+Comparator print "Calibrate: If you want to use a comparator other than kappa_h, " print "Calibrate: you'll need to code it up!" print "Calibrate: (This should be easy, but you can ask tcollett@ast.cam.uk for help)." exit() # Now calculate comparators: callist=numpy.empty((Nc,2)) jd=pangloss.PDF(["kappa_ext",comparator+'_'+comparatorType]) for i in range(Nc): C = calresultpickles[i] pdf = pangloss.readPickle(C) if comparator=="Kappah": if comparatorType=="median": # Recall that we created a special file for this # choice of comparator and comparator type, in # Reconstruct. You could also use the # comparatortype=="mean" code, swapping mean for median. callist[i,0]=pdf[0] callist[i,1]=pdf[1][0] elif comparatorType=="mean": callist[i,0] = pdf.truth[0] callist[i,1] = numpy.mean(pdf.samples) else: print "Calibrate: Unrecognised comparatorType "+comparatorType print "Calibrate: If you want to use a comparatorType other than median " print "Calibrate: or mean, you'll need to code it up!" print "Calibrate: (This should be easy, but you can ask tcollett@ast.cam.uk for help)." exit() jd.append(callist[i]) pangloss.writePickle(callist,jointdistfile) # Also store the joint dist as a pangloss pdf: pangloss.writePickle(jd,jointdistasPDFfile) # Plot: plotfile = jointdistasPDFfile.split('.')[0]+'.png' jd.plot("Kappah_median","kappa_ext",weight=None,output=plotfile,title="The joint distribution of $\kappa_{\mathrm{ext}}$ and calibrator \n\n (more correlated means a better calibrator!)") print "Calibrate: calibration joint PDF saved in:" print "Calibrate: "+jointdistfile print "Calibrate: and "+jointdistasPDFfile print "Calibrate: you can view this PDF in "+plotfile # -------------------------------------------------------------------- # Mode 2: calibrate a real line of sight's Pr(kappah|D) using the # joint distribution Pr(kappa,<kappah>|D) if Mode==2 or Mode==3: print pangloss.dashedline callibguide = pangloss.readPickle(jointdistfile) obspickle = experiment.getLightconePickleName('real') pfile = obspickle.split('.')[0].split("_lightcone")[0]+'_'+EXP_NAME+"_PofKappah.pickle" pdf=pangloss.readPickle(pfile) if comparator=="Kappah": if comparatorType=="median":# note we created a special file for this choice of comparator and comparator type. You could also use the comparatortype=="mean" code swapping mean for median. RealComparator=numpy.median(pdf.samples) elif comparatorType=="mean": RealComparator=numpy.mean(pdf.samples) else: print "I don't know that comparatorType. exiting" exit() pdf = pangloss.PDF(["kappa_ext","weight"]) #print RealComparator #print numpy.median(callibguide[:,1]),numpy.std(callibguide[:,1]) dif=(callibguide[:,1]-RealComparator) weights=dif*0.0 weights[numpy.abs(dif)<comparatorWidth]=1. weights/=numpy.sum(weights) samples=callibguide[:,0] samplesandweights=callibguide.copy() samplesandweights[:,1]=weights pdf.samples=(samplesandweights) plotfile = resultfile.split('.')[0]+".png" pdf.plot('kappa_ext',weight='weight',output=plotfile) average = numpy.average(samples, weights=weights) variance = numpy.dot(weights, (samples-average)**2)/weights.sum() average,std=average, variance**.5 #if step function weights can calculate 68%CL easily: included=samples[weights>0] onesigconfidence=numpy.abs(\ stats.scoreatpercentile(included,84)- stats.scoreatpercentile(included,16)\ )/2. pangloss.writePickle(pdf,resultfile) print "Calibrate: your reconstructed lightcone has been calibrated," print "Calibrate: suggesting it has a kappa_ext of",\ "%.3f +\- %.3f"%(average,onesigconfidence) print "Calibrate: the PDF for kappa_ext has been output to "+resultfile print "Calibrate: in the form of sample kappa_ext values, and their weights." print "Calibrate: you can view this PDF in "+plotfile print print "Calibrate: To read and process this file, try:" print print " import pangloss" print " pdf = pangloss.readPickle(\"%s\")"%resultfile print " kappa_samples = pdf.getParameter(\"kappa_ext\")" print " kappa_weights = pdf.getParameter(\"weight\")" # -------------------------------------------------------------------- print print pangloss.doubledashedline return resultfile,jointdistasPDFfile # ====================================================================== if __name__ == '__main__': Calibrate(sys.argv[1:]) # ======================================================================
enoordeh/Pangloss
Calibrate.py
Python
gpl-2.0
10,551
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1001, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 30524, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package app.model; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Entity @Table(name= "countries") @Data @AllArgsConstructor @NoArgsConstructor public class Country { public Country(String countryName, String countryCode) { this.countryName = countryName; this.countryCode = countryCode; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "country_id", unique = true, nullable = false) private Integer countryId; @Column(name = "country_name", nullable = false, length = 45) private String countryName; @Column(name = "country_code", nullable = false, length = 6) private String countryCode; }
pawel-nn/proj_app_bd_sem7
ProjAppBD/src/main/java/app/model/Country.java
Java
apache-2.0
894
[ 30522, 7427, 10439, 1012, 2944, 1025, 12324, 10763, 9262, 2595, 1012, 28297, 1012, 4245, 13874, 1012, 4767, 1025, 12324, 9262, 2595, 1012, 28297, 1012, 5930, 1025, 12324, 9262, 2595, 1012, 28297, 1012, 9178, 1025, 12324, 9262, 2595, 1012, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (C) 2014-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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. // // 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 General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. // // { dg-options "-std=gnu++11" } // { dg-do run { xfail *-*-* } } #include <debug/forward_list> #include <testsuite_allocator.h> void test01() { bool test __attribute__((unused)) = true; typedef __gnu_test::uneq_allocator<int> alloc_type; typedef __gnu_debug::forward_list<int, alloc_type> test_type; test_type v1(alloc_type(1)); v1.push_front(0); auto it = v1.begin(); test_type v2(std::move(v1), alloc_type(2)); VERIFY( it == v2.begin() ); // Error, it is singular } int main() { test01(); return 0; }
zjh171/gcc
libstdc++-v3/testsuite/23_containers/forward_list/debug/construct4_neg.cc
C++
gpl-2.0
1,301
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2297, 1011, 2325, 2489, 4007, 3192, 1010, 4297, 1012, 1013, 1013, 1013, 1013, 2023, 5371, 2003, 2112, 1997, 1996, 27004, 11163, 1039, 1009, 1009, 3075, 1012, 2023, 3075, 2003, 2489, 1013, 1013, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module Travis::Addons::GithubCheckStatus::Output TEMPLATES = { name: 'Travis CI - {{build_info.name}}', summary: { queued: '{{build_link(state,details_url, "The build")}} is currently waiting in the build queue for a VM to be ready.', running: '{{build_link(state,details_url, "The build")}} is currently running.', changed: '{{build_link(state,details_url, "The build")}} **{{state}}**. This is a change from the previous build, which **{{previous_state}}**.', unchanged: '{{build_link(state,details_url, "The build")}} **{{state}}**, just like the previous build.', no_previous: '{{build_link(state,details_url, "The build")}} **{{state}}**.' }, matrix_description: { without_stages: 'This build has **{{number jobs.size}} jobs**, running in parallel.', with_stages: 'This build has **{{number jobs.size}} jobs**, running in **{{number stages.size}} sequential stages**.' }, allow_failure: "This job is <a href='https://docs.travis-ci.com/user/customizing-the-build#Rows-that-are-Allowed-to-Fail'>allowed to fail</a>.", stage_description: <<-MARKDOWN, ### Stage {{stage[:number]}}: {{escape stage[:name]}} This stage **{{state stage[:state]}}**. MARKDOWN text: <<-MARKDOWN, {{build_info.description}} ## Jobs and Stages {{job_info_text}} ## Build Configuration Build Option | Setting -----------------|-------------- Language | {{language}} Operating System | {{os_description}} {{language_info}} <details> <summary>Build Configuration</summary> {{code :yaml, config_display_text}} </details> MARKDOWN jobs_table: <<-HTML, <table> <thead> {{ table_head.rstrip }} </thead> <tbody> {{ table_body.rstrip }} </tbody> </table> HTML } end
travis-ci/travis-tasks
lib/travis/addons/github_check_status/output/templates.rb
Ruby
mit
1,923
[ 30522, 11336, 10001, 1024, 1024, 5587, 5644, 1024, 1024, 21025, 2705, 12083, 5403, 10603, 29336, 2271, 1024, 1024, 6434, 23561, 2015, 1027, 1063, 2171, 1024, 1005, 10001, 25022, 1011, 1063, 1063, 3857, 1035, 18558, 1012, 2171, 1065, 1065, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (c) 2010-2021 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ package org.openhab.binding.nibeheatpump.internal.message; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; import org.openhab.binding.nibeheatpump.internal.message.NibeHeatPumpBaseMessage.MessageType; import org.openhab.binding.nibeheatpump.internal.protocol.NibeHeatPumpProtocol; /** * The {@link MessageFactory} implements factory class to create Nibe protocol messages. * * * @author Pauli Anttila - Initial contribution */ public class MessageFactory { public static NibeHeatPumpMessage getMessage(byte[] message) throws NibeHeatPumpException { if (message != null) { byte messageTypeByte = NibeHeatPumpProtocol.getMessageType(message); MessageType messageType = NibeHeatPumpBaseMessage.getMessageType(messageTypeByte); switch (messageType) { case MODBUS_DATA_READ_OUT_MSG: return new ModbusDataReadOutMessage(message); case MODBUS_READ_REQUEST_MSG: return new ModbusReadRequestMessage(message); case MODBUS_READ_RESPONSE_MSG: return new ModbusReadResponseMessage(message); case MODBUS_WRITE_REQUEST_MSG: return new ModbusWriteRequestMessage(message); case MODBUS_WRITE_RESPONSE_MSG: return new ModbusWriteResponseMessage(message); default: return null; } } throw new NibeHeatPumpException("Illegal message (null)"); } }
paulianttila/openhab2
bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/MessageFactory.java
Java
epl-1.0
1,936
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1011, 25682, 16884, 2000, 1996, 2330, 25459, 2622, 1008, 1008, 2156, 1996, 5060, 5371, 1006, 1055, 1007, 5500, 2007, 2023, 2147, 2005, 3176, 1008, 2592, 1012, 1008, 1008, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Tempest\Database; use Exception; use ReflectionClass; use JsonSerializable; use Tempest\App; use Symfony\Component\EventDispatcher\EventDispatcher; use Doctrine\Common\Inflector\Inflector; use Tempest\Events\ModelEvent; /** * A database model, derived from a {@link Row}. * * @author Marty Wallace */ abstract class Model extends EventDispatcher implements JsonSerializable { /** @var SealedField[] */ private static $_fields = []; /** @var Index[] */ private static $_indexes = []; /** * Get the table name associated with this model. * * @return string */ public static function getTable() { return static::table(); } /** * Gets a generated CREATE TABLE query for this model. * * @return string */ public static function getCreateTableQuery() { $content = []; foreach (static::getFields() as $field) { $content[] = trim(implode(' ', [ '`' . $field->getName() . '`', $field->getColumnType(), $field->getNullable() ? 'DEFAULT NULL' : 'NOT NULL', $field->getAutoIncrements() ? 'AUTO_INCREMENT' : '' ])); } foreach (static::getIndexes() as $index) { $fieldNames = array_map(function(SealedField $field) { return '`' . $field->getName() . '`'; }, $index->getFields()); if ($index->getType() === Index::PRIMARY) $key = 'PRIMARY KEY'; else if ($index->getType() === Index::UNIQUE) $key = 'UNIQUE KEY'; else $key = 'KEY'; $content[] = trim(implode(' ', [ $key . ($index->getName() ? '`' . $index->getName() . '`' : ''), '(' . implode(', ', $fieldNames) . ')' ])); } return 'CREATE TABLE `' . static::getTable() . '` (' . PHP_EOL . ' ' . implode(',' . PHP_EOL . ' ', $content) . PHP_EOL . ');'; } /** * Retrieve all declared fields for this model. * * @return SealedField[] */ public static function getFields() { if (!array_key_exists(static::class, self::$_fields)) { $sealed = []; foreach (static::fields() as $name => $field) { $sealed[$name] = $field->seal($name); } self::$_fields[static::class] = $sealed; } return self::$_fields[static::class]; } /** * Determine whether this model has declared a field. * * @param string $field The field name. * * @return bool */ public static function hasField($field) { return array_key_exists($field, static::getFields()); } /** * Retrieve a single field declared by this model. * * @param string $field The field name. * * @return SealedField */ public static function getField($field) { return static::hasField($field) ? static::getFields()[$field] : null; } /** * Get all indexes attached to this model, as declared by its {@link fields}. This does not return a flat tree of * indexes as defined by each field, but will merge indexes with matching names and a list of all the associated * fields. * * @return Index[] * * @throws Exception If the index tree could not be properly merged. */ public static function getIndexes() { if (!array_key_exists(static::class, self::$_indexes)) { /** @var Index[] $indexes */ $indexes = []; foreach (static::getFields() as $field) { foreach ($field->getIndexes() as $index) { if (!empty($index->getName()) || $index->getType() === Index::PRIMARY) { foreach ($indexes as $known) { // Merge keys that are both PRIMARY or whose names match. $shouldMerge = $known->getName() === $index->getName() || ($known->getType() === Index::PRIMARY && $index->getType() === Index::PRIMARY); if ($shouldMerge) { if ($known->getType() !== $index->getType()) { throw new Exception('Indexes for "' . static::class . '" sharing a name must also share their type.'); } $known->merge($index); continue 2; } } $indexes[] = $index->copy(); } else { $indexes[] = $index->copy(); } } } self::$_indexes[static::class] = $indexes; } return self::$_indexes[static::class]; } /** * Retrieve an index using its name. * * @param string $name The index name as declared by this model. * * @return Index */ public static function getIndexByName($name) { foreach (static::getIndexes() as $index) { if ($index->getName() === $name) { return $index; } } return null; } /** * Gets the PRIMARY index if this model declares one. * * @return Index */ public static function getPrimaryIndex() { foreach (static::getIndexes() as $index) { if ($index->getType() === Index::PRIMARY) { return $index; } } return null; } /** * Gets all PRIMARY or UNIQUE indexes declared by this model. * * @return Index[] */ public static function getUniqueIndexes() { return array_filter(static::getIndexes(), function(Index $index) { return $index->getType() === Index::PRIMARY || $index->getType() === INDEX::UNIQUE; }); } /** * Get all INDEX (non PRIMARY or UNIQUE) indexes declared by this model. * * @return Index[] */ public static function getNonUniqueIndexes() { return array_filter(static::getIndexes(), function(Index $index) { return $index->getType() === Index::INDEX; }); } /** * Get all non PRIMARY indexes declared by this model. * * @return Index[] */ public static function getNonPrimaryIndexes() { return array_filter(static::getIndexes(), function(Index $index) { return $index->getType() !== Index::PRIMARY; }); } /** * Retrieve all fields that are PRIMARY keyed. * * @return SealedField[] */ public static function getPrimaryFields() { return static::getPrimaryIndex()->getFields(); } /** * Retrieve all fields that are either PRIMARY or UNIQUE keyed. * * @return SealedField[] */ public static function getUniqueFields() { return array_filter(static::getFields(), function(SealedField $field) { return $field->hasUniqueIndex(); }); } /** * Retrieve all fields that are not PRIMARY or UNIQUE keyed. * * @return SealedField[] */ public static function getNonUniqueFields() { return array_filter(static::getFields(), function(SealedField $field) { return !$field->hasUniqueIndex(); }); } /** * Retrieve all fields that are not PRIMARY keyed. * * @return SealedField[] */ public static function getNonPrimaryFields() { return array_filter(static::getFields(), function(SealedField $field) { return !$field->hasPrimaryIndex(); }); } /** * Retrieve all fields with no index associated with it. * * @return SealedField[] */ public static function getNonIndexedFields() { return array_filter(static::getFields(), function(SealedField $field) { return count($field->getIndexes()) === 0; }); } /** * Retrieve the auto-incrementing field, if this model declared one. * * @return SealedField */ public static function getIncrementingField() { foreach (static::getFields() as $field) { if ($field->getAutoIncrements()) return $field; } return null; } /** * Create one or more models from one or more rows. * * @param Row|Row[] $rows One or more rows. If a single row is provided, a single model is returned. If an array of * rows is provided, an array of models is returned, even if that array only contains a single item. If the provided * array is empty, an empty array is returned. If the provided value is not an array and empty, null is returned. * * @return static|static[] */ public static function from($rows) { if (is_array($rows)) { return array_values(array_map(function(Row $row) { return new static($row->getValues()); }, $rows)); } return empty($rows) ? null : new static($rows->getValues()); } /** * Returns a SELECT query that resolves to one or more instances of this model. * * @param string[] $fields The fields to select. * * @return Query */ public static function select(array $fields = ['*']) { return Query::select(static::getTable(), $fields)->produces(static::class); } /** * Returns a DELETE query for the table associated with this model. * * @return Query */ public static function delete() { return Query::delete(static::getTable()); } /** * Returns an INSERT INTO query for the table associated with this model. * * @param array $data The data to insert. * * @return Query */ public static function insert(array $data = []) { return Query::insert(static::getTable(), $data); } /** * Find an instance of this model using its primary key, assuming it declares a single primary key. * * @param mixed $primary The primary key value. * * @return static * * @throws Exception If there is not exactly one primary key declared by this model. */ public static function find($primary) { $fields = static::getPrimaryFields(); if (count($fields) === 0) throw new Exception('There are no primary keys declared by "' . static::reflect()->getShortName() . '".'); if (count($fields) > 1) throw new Exception('"' . static::reflect()->getShortName() . '" defines multiple primary keys.'); return static::select()->where(array_pop($fields)->getName(), $primary)->first(); } /** * Attempt to find a record with the specfied primary key, else creates a new one. The record is not automatically * saved to the database. * * @param mixed $primary The primary key value. * @param array $data Data to fill the existing or newly created model with. * * @return static */ public static function findOrCreate($primary, array $data = []) { $model = static::find($primary); if (empty($model)) { $model = static::create(); } $model->fill($data); return $model; } /** * Retrieve all rows within the table associated with this model and map them to this model. * * @return static[] */ public static function all() { return static::from(Query::select(static::getTable())->all()); } /** * Provide reflection information about this model. * * @return ReflectionClass */ public static function reflect() { return new ReflectionClass(static::class); } /** * Create a new model and optionally {@link fill} it with data. * * @param array $data Optional data to {@link fill} the newly created model with. * * @return static */ public static function create(array $data = []) { return new static($data); } /** * Declares fields for this model. * * @return Field[] */ protected abstract static function fields(); /** * The table that stores this model type. * * @return string */ protected static function table() { return Inflector::pluralize(Inflector::tableize(static::reflect()->getShortName())); } /** @var mixed[] */ private $_data = []; /** @var mixed[] */ private $_undeclared = []; /** * Model constructor. * * @param array $data */ private function __construct(array $data = []) { $this->reset()->fill($data); } public function __get($prop) { if (static::hasField($prop)) return $this->getRefined($prop); if (array_key_exists($prop, $this->_undeclared)) return $this->_undeclared[$prop]; return null; } public function __set($prop, $value) { if (static::hasField($prop)) $this->setFieldValue($prop, $value); else $this->_undeclared[$prop] = $value; } public function __isset($prop) { return static::hasField($prop) || array_key_exists($prop, $this->_undeclared); } /** * Fill this model with data. * * @param array $data The data to fill the model with. * * @return $this */ public function fill(array $data) { foreach ($data as $field => $value) { if (static::hasField($field)) $this->setFieldValue($field, $value); else $this->_undeclared[$field] = $value; } return $this; } /** * Reset this model's data - all undeclared data will be deleted and all field values will be set to their defaults. * * @return $this */ public function reset() { $this->_undeclared = []; /** @var Field $field */ foreach (static::getFields() as $name => $field) { $this->setFieldValue($name, $field->getDefault()); } $this->dispatch(ModelEvent::RESET, new ModelEvent($this)); return $this; } /** * Get the raw value attached to a specified field. * * @param string $field The field name. * * @return mixed * * @throws Exception I this model does not declare the provided field. */ public function getRaw($field) { if (!static::hasField($field)) { throw new Exception('Model "' . static::reflect()->getShortName() . '" does not declare a field "' . $field . '".'); } return static::getField($field)->toRaw($this->_data[$field]); } /** * Get the refined value attached to a specified field. * * @param string $field The field name. * * @return mixed * * @throws Exception I this model does not declare the provided field. */ public function getRefined($field) { if (!static::hasField($field)) { throw new Exception('Model "' . static::reflect()->getShortName() . '" does not declare a field "' . $field . '".'); } return static::getField($field)->toRefined($this->_data[$field]); } /** * Sets the value of a field declared by this model. * * @param string $field The field to set. * @param mixed $value The value to assign. * * @return $this * * @throws Exception If this model does not declare the provided field. */ public function setFieldValue($field, $value) { if (!static::hasField($field)) { throw new Exception('Model "' . static::reflect()->getShortName() . '" does not declare a field "' . $field . '".'); } $this->_data[$field] = static::getField($field)->toRaw($value); return $this; } /** * Get all raw values. * * @return array */ public function getAllRaw() { $result = []; foreach ($this->_data as $field => $value) { $result[$field] = static::getField($field)->toRaw($value); } return $result; } /** * Get all refined values. * * @return array */ public function getAllRefined() { $result = []; foreach ($this->_data as $field => $value) { $result[$field] = static::getField($field)->toRefined($value); } return $result; } /** * Get all raw values from non-unique fields. * * @return array */ public function getNonUniqueRaw() { $result = []; foreach (static::getNonUniqueFields() as $field) { $result[$field->getName()] = $this->getRaw($field->getName()); } return $result; } /** * Get all raw values from non-primary fields. * * @return array */ public function getNonPrimaryRaw() { $result = []; foreach (static::getNonPrimaryFields() as $field) { $result[$field->getName()] = $this->getRaw($field->getName()); } return $result; } /** * Gets the primary key value in the case where this model has a single primary key. * * @return mixed * * @throws Exception If there is not exactly one primary key. */ public function getPrimaryKey() { $primary = static::getPrimaryFields(); if (count($primary) === 0) throw new Exception('There are no primary keys declared by "' . static::reflect()->getShortName() . '".'); if (count($primary) > 1) throw new Exception('"' . static::reflect()->getShortName() . '" defines multiple primary keys.'); return $this->getRefined(array_pop($primary)->getName()); } /** * Saves this model into the database. * * @param bool $updateOnDuplicate Whether or not to update a matching duplicate record if one was found. */ public function save($updateOnDuplicate = true) { $this->dispatch(ModelEvent::BEFORE_SAVE, new ModelEvent($this)); $query = static::insert($this->_data); if ($updateOnDuplicate) { $query = $query->onDuplicateKeyUpdate($this->getNonPrimaryRaw()); } $query->execute(); $incrementing = static::getIncrementingField(); if (!empty($incrementing)) { // This model has a field that should auto-increment. if (empty($this->getRaw($incrementing->getName()))) { // There is no existing value for this field, set it to the last insert ID. $this->setFieldValue($incrementing->getName(), App::get()->db->getLastInsertId()); } } $this->dispatch(ModelEvent::AFTER_SAVE, new ModelEvent($this)); } public function jsonSerialize() { return $this->getAllRefined(); } }
MartyWallace/Tempest
src/Tempest/Database/Model.php
PHP
mit
16,235
[ 30522, 1026, 1029, 25718, 3415, 15327, 22553, 1032, 7809, 1025, 2224, 6453, 1025, 2224, 9185, 26266, 1025, 2224, 1046, 23345, 11610, 3669, 4143, 3468, 1025, 2224, 22553, 1032, 10439, 1025, 2224, 25353, 2213, 14876, 4890, 1032, 6922, 1032, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Noylecorp\DoctrineExtrasBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class NoylecorpDoctrineExtrasBundle extends Bundle { }
noylecorp/doctrine-extras-bundle
NoylecorpDoctrineExtrasBundle.php
PHP
mit
154
[ 30522, 1026, 1029, 25718, 3415, 15327, 2053, 12844, 24586, 1032, 8998, 10288, 6494, 19022, 8630, 2571, 1025, 2224, 25353, 2213, 14876, 4890, 1032, 6922, 1032, 8299, 5484, 11877, 1032, 14012, 1032, 14012, 1025, 2465, 2053, 12844, 24586, 3527, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Chapter1.Group1 { public class OneMoreThan : Num { Num predecessor; public OneMoreThan(Num _predecessor) { predecessor = _predecessor; } } }
Ju2ender/CSharp-Exercise
ALitterCSharp/src/Chapter1/Group1/OneMoreThan.cs
C#
mit
318
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 3793, 1025, 2478, 2291, 1012, 11689, 2075, 1012, 8518, 1025, 3415, 15327, 3127, 2487, 1012, 2177, 2487, 1063, 2270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (C) 2009-2011, Stefan Hacker All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Mumble Developers nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef BONJOURCLIENT_H_ #define BONJOURCLIENT_H_ #include <QtCore/QObject> class BonjourServiceBrowser; class BonjourServiceResolver; class BonjourClient : public QObject { private: Q_OBJECT Q_DISABLE_COPY(BonjourClient) public: BonjourClient(); ~BonjourClient(); BonjourServiceBrowser *bsbBrowser; BonjourServiceResolver *bsrResolver; }; #endif
mkrautz/mumble-sbcelt
src/mumble/BonjourClient.h
C
bsd-3-clause
1,935
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2268, 1011, 2249, 1010, 8852, 23307, 2035, 2916, 9235, 1012, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, 2030, 2302, 14080, 1010, 2024, 7936, 3024, 2008, 1996, 2206, 3785, 2024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Buffers; using System.Runtime.InteropServices; namespace System.Net.Libuv { internal class UVBuffer { public readonly static UVBuffer Default = new UVBuffer(); public static UVInterop.alloc_callback_unix AllocateUnixBuffer { get; set; } public static UVInterop.alloc_callback_win AllocWindowsBuffer { get; set; } private UVBuffer() { } static UVBuffer() { AllocateUnixBuffer = OnAllocateUnixBuffer; AllocWindowsBuffer = OnAllocateWindowsBuffer; } static void OnAllocateUnixBuffer(IntPtr memoryBuffer, uint length, out Unix buffer) { var memory = Marshal.AllocHGlobal((int)length); buffer = new Unix(memory, length); } static void OnAllocateWindowsBuffer(IntPtr memoryBuffer, uint length, out Windows buffer) { var memory = Marshal.AllocHGlobal((int)length); buffer = new Windows(memory, length); } [StructLayout(LayoutKind.Sequential)] internal struct Windows { internal uint Length; internal IntPtr Buffer; internal Windows(IntPtr buffer, uint length) { Buffer = buffer; Length = length; } internal void Dispose() { Marshal.FreeHGlobal(Buffer); Length = 0; Buffer = IntPtr.Zero; } } [StructLayout(LayoutKind.Sequential)] internal struct Unix { internal IntPtr Buffer; internal IntPtr Length; internal Unix(IntPtr buffer, uint length) { Buffer = buffer; Length = (IntPtr)length; } internal void Dispose() { Marshal.FreeHGlobal(Buffer); Length = IntPtr.Zero; Buffer = IntPtr.Zero; } } } }
weshaggard/corefxlab
src/System.Net.Libuv/System/Net/Libuv/Buffer.cs
C#
mit
2,051
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 17698, 2015, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 6970, 11923, 2121, 7903, 2229, 1025, 3415, 15327, 2291, 1012, 5658, 1012, 5622, 8569, 2615, 1063, 4722, 2465, 23068, 8569, 12494, 1063, 2270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef _S3C2410_ADC_H_ #define _S3C2410_ADC_H_ #define ADC_WRITE(ch, prescale) ((ch)<<16|(prescale)) #define ADC_WRITE_GETCH(data) (((data)>>16)&0x7) #define ADC_WRITE_GETPRE(data) ((data)&0xff) #endif
tanxjian/gec2440-linux
drivers/char/s3c24xx-adc.h
C
gpl-2.0
217
[ 30522, 1001, 2065, 13629, 2546, 1035, 1055, 2509, 2278, 18827, 10790, 1035, 4748, 2278, 1035, 1044, 1035, 1001, 9375, 1035, 1055, 2509, 2278, 18827, 10790, 1035, 4748, 2278, 1035, 1044, 1035, 1001, 9375, 4748, 2278, 1035, 4339, 1006, 10381,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require "spec_helper" describe Time do describe ".beginning_of_timehop_day" do subject { time.beginning_of_timehop_day } context "after 5am" do let(:time) { Time.parse("2011-11-07 15:15:33") } let(:beginning_of_timehop_day) { Time.parse("2011-11-07 5:00:00") } it { should be_within(1.second).of(beginning_of_timehop_day) } end context "before 5am" do let(:time) { Time.parse("2011-11-07 3:15:33") } let(:beginning_of_timehop_day) { Time.parse("2011-11-06 5:00:00") } it { should be_within(1.second).of(beginning_of_timehop_day) } end end describe ".end_of_timehop_day" do subject { time.end_of_timehop_day } context "after 5am" do let(:time) { Time.parse("2011-11-07 15:15:33") } let(:end_of_timehop_day) { Time.parse("2011-11-08 4:59:59") } it { should be_within(1.second).of(end_of_timehop_day) } end context "before 5am" do let(:time) { Time.parse("2011-11-07 3:15:33") } let(:end_of_timehop_day) { Time.parse("2011-11-07 4:59:59") } it { should be_within(1.second).of(end_of_timehop_day) } end end end
timehop/timehop_time
spec/timehop_time/time_spec.rb
Ruby
mit
1,128
[ 30522, 5478, 1000, 28699, 1035, 2393, 2121, 1000, 6235, 2051, 2079, 6235, 1000, 1012, 2927, 1035, 1997, 1035, 2051, 18471, 1035, 2154, 1000, 2079, 3395, 1063, 2051, 1012, 2927, 1035, 1997, 1035, 2051, 18471, 1035, 2154, 1065, 6123, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.diecode.killermoney.events; import net.diecode.killermoney.objects.CCommand; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class KMCCommandExecutionEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); private CCommand cCommand; private Player killer; private LivingEntity victim; private boolean cancelled; public KMCCommandExecutionEvent(CCommand cCommand, Player killer, LivingEntity victim) { this.cCommand = cCommand; this.killer = killer; this.victim = victim; } public HandlerList getHandlers() { return handlers; } public static HandlerList getHandlerList() { return handlers; } public CCommand getCCommand() { return cCommand; } public Player getKiller() { return killer; } public LivingEntity getVictim() { return victim; } @Override public boolean isCancelled() { return cancelled; } @Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } }
diecode/KillerMoney
src/net/diecode/killermoney/events/KMCCommandExecutionEvent.java
Java
gpl-3.0
1,271
[ 30522, 7427, 5658, 1012, 3280, 16044, 1012, 6359, 8202, 3240, 1012, 2824, 1025, 12324, 5658, 1012, 3280, 16044, 1012, 6359, 8202, 3240, 1012, 5200, 1012, 10507, 5358, 2386, 2094, 1025, 12324, 8917, 1012, 20934, 24103, 2102, 1012, 9178, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jsonp({"cep":"49038733","logradouro":"Rua Odilon Gon\u00e7alves da Silveira","bairro":"Zona de Expans\u00e3o (Aruana)","cidade":"Aracaju","uf":"SE","estado":"Sergipe"});
lfreneda/cepdb
api/v1/49038733.jsonp.js
JavaScript
cc0-1.0
170
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 22288, 22025, 2581, 22394, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 21766, 2050, 21045, 7811, 2175, 2078, 1032, 1057, 8889, 2063, 2581, 2389, 6961,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace RaceDay.Models.DTO { public class CustomerBet { public int RaceId { get; set; } public string RaceName { get; set; } public int HorseId { get; set; } public string HorseName { get; set; } public double Stake { get; set; } } }
techchallenge-droy/techchallenge_debojitroy
BackendWebAPI/WilliamHillTechChallenge/RaceDay.Models/DTO/CustomerBet.cs
C#
mit
291
[ 30522, 3415, 15327, 8255, 4710, 1012, 4275, 1012, 26718, 2080, 1063, 2270, 2465, 8013, 20915, 1063, 2270, 20014, 2679, 3593, 1063, 2131, 1025, 2275, 1025, 1065, 2270, 5164, 2679, 18442, 1063, 2131, 1025, 2275, 1025, 1065, 2270, 20014, 3586,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * @flow * @module ProductPropertyInput * @extends React.PureComponent * * @author Oleg Nosov <olegnosov1@gmail.com> * @license MIT * * @description * React form for product property(options select only). * */ import React, { PureComponent } from "react"; import { isObject } from "../../../helpers"; import type { GetLocalization, InputEvent, ProductPropertyOption, Prices, } from "../../../types"; /** * @typedef {Object.<string, number>} OptionIndex */ export type OptionIndex = { [propertyName: string]: number, }; /** * @typedef {Object} OptionObject */ export type OptionObject = {| onSelect?: (option: OptionObject) => void, additionalCost?: Prices, value: ProductPropertyOption, |}; /** @ */ export type PropertyOption = ProductPropertyOption | OptionObject; /** @ */ export type PropertyOptions = Array<PropertyOption>; /** @ */ export type OnChange = (obj: { value: OptionIndex }) => void; export type Props = {| name: string, options: PropertyOptions, selectedOptionIndex: number, currency: string, onChange: OnChange, getLocalization: GetLocalization, |}; const defaultProps = { selectedOptionIndex: 0, }; export default class ProductPropertyInput extends PureComponent<Props, void> { props: Props; static defaultProps = defaultProps; static displayName = "ProductPropertyInput"; /* * If option value is an object, we need to extract primitive value */ static getOptionValue = (value: PropertyOption): ProductPropertyOption => isObject(value) ? ProductPropertyInput.getOptionValue(value.value) : value; /* * Generate select input options based on options values */ static generateOptionsSelectionList = ( options: PropertyOptions, getLocalization: GetLocalization, currency: string, localizationScope: Object = {}, ): Array<React$Element<*>> => options .map(ProductPropertyInput.getOptionValue) .map((optionValue, index) => ( <option key={optionValue} value={optionValue}> {typeof optionValue === "string" ? getLocalization(optionValue, { ...localizationScope, ...(isObject(options[index]) ? { cost: (isObject(options[index].additionalCost) && options[index].additionalCost[currency]) || 0, } : {}), }) : optionValue} </option> )); handleSelectInputValueChange = ({ currentTarget }: InputEvent) => { const { value: optionValue } = currentTarget; const { name, options, onChange } = this.props; const { getOptionValue } = ProductPropertyInput; const selectedOptionIndex = options .map(getOptionValue) .indexOf(optionValue); const selectedOption = options[selectedOptionIndex]; if ( isObject(selectedOption) && typeof selectedOption.onSelect === "function" ) selectedOption.onSelect(selectedOption); onChange({ value: { [name]: selectedOptionIndex }, }); }; render() { const { name, options, selectedOptionIndex, currency, getLocalization, } = this.props; const { handleSelectInputValueChange } = this; const { generateOptionsSelectionList, getOptionValue, } = ProductPropertyInput; const localizationScope = { name, currency, get localizedName() { return getLocalization(name, localizationScope); }, get localizedCurrency() { return getLocalization(currency, localizationScope); }, }; return ( <div className="form-group row"> <label htmlFor={name} className="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-form-label" > {getLocalization("propertyLabel", localizationScope)} </label> <div className="col-xs-9 col-sm-9 col-md-9 col-lg-9"> <select onChange={handleSelectInputValueChange} className="form-control" value={getOptionValue(options[selectedOptionIndex | 0])} > {generateOptionsSelectionList( options, getLocalization, currency, localizationScope, )} </select> </div> </div> ); } }
olegnn/react-shopping-cart
src/components/Product/ProductPropertyInput/ProductPropertyInput.js
JavaScript
mit
4,423
[ 30522, 1013, 1008, 1008, 1008, 1030, 4834, 1008, 1030, 11336, 4031, 21572, 4842, 3723, 2378, 18780, 1008, 1030, 8908, 10509, 1012, 5760, 9006, 29513, 3372, 1008, 1008, 1030, 3166, 25841, 16839, 4492, 1026, 25841, 15460, 4492, 2487, 1030, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("14.PrintTheASCIITable")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("14.PrintTheASCIITable")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("16c3f7f3-7b92-487a-87c7-c9d75336426e")] // 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")]
SHAMMY1/Telerik-Academy-2016
CSharp-Fundamentals/Homeworks/02.Data-Types-and-Variables/DataTypesAndVariablesHW/14.PrintTheASCIITable/Properties/AssemblyInfo.cs
C#
mit
1,418
[ 30522, 2478, 2291, 1012, 9185, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 21624, 8043, 7903, 2229, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 6970, 11923, 2121, 7903, 2229, 1025, 1013, 1013, 2236, 2592, 2055, 2019, 3320, 2003, 4758, 2083, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * 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. * */ #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/regulator/machine.h> #include <linux/regulator/consumer.h> #include <linux/ion.h> #include <mach/irqs.h> #include <mach/dma.h> #include <asm/mach/mmc.h> #include <asm/clkdev.h> #include <linux/msm_kgsl.h> #include <linux/msm_rotator.h> #include <mach/msm_hsusb.h> #include "footswitch.h" #include "clock.h" #include "clock-rpm.h" #include "clock-voter.h" #include "devices.h" #include "devices-msm8x60.h" #include <linux/dma-mapping.h> #include <linux/irq.h> #include <linux/clk.h> #include <asm/hardware/gic.h> #include <asm/mach-types.h> #include <asm/clkdev.h> #include <mach/msm_serial_hs_lite.h> #include <mach/msm_bus.h> #include <mach/msm_bus_board.h> #include <mach/socinfo.h> #include <mach/msm_memtypes.h> #include <mach/msm_tsif.h> #include <mach/scm-io.h> #ifdef CONFIG_MSM_DSPS #include <mach/msm_dsps.h> #endif #include <linux/android_pmem.h> #include <linux/gpio.h> #include <linux/delay.h> #include <mach/mdm.h> #include <mach/rpm.h> #include <mach/board.h> #include <sound/apr_audio.h> #include "rpm_stats.h" #include "mpm.h" #include "msm_watchdog.h" /* Address of GSBI blocks */ #define MSM_GSBI1_PHYS 0x16000000 #define MSM_GSBI2_PHYS 0x16100000 #define MSM_GSBI3_PHYS 0x16200000 #define MSM_GSBI4_PHYS 0x16300000 #define MSM_GSBI5_PHYS 0x16400000 #define MSM_GSBI6_PHYS 0x16500000 #define MSM_GSBI7_PHYS 0x16600000 #define MSM_GSBI8_PHYS 0x19800000 #define MSM_GSBI9_PHYS 0x19900000 #define MSM_GSBI10_PHYS 0x19A00000 #define MSM_GSBI11_PHYS 0x19B00000 #define MSM_GSBI12_PHYS 0x19C00000 /* GSBI QUPe devices */ #define MSM_GSBI1_QUP_PHYS 0x16080000 #define MSM_GSBI2_QUP_PHYS 0x16180000 #define MSM_GSBI3_QUP_PHYS 0x16280000 #define MSM_GSBI4_QUP_PHYS 0x16380000 #define MSM_GSBI5_QUP_PHYS 0x16480000 #define MSM_GSBI6_QUP_PHYS 0x16580000 #define MSM_GSBI7_QUP_PHYS 0x16680000 #define MSM_GSBI8_QUP_PHYS 0x19880000 #define MSM_GSBI9_QUP_PHYS 0x19980000 #define MSM_GSBI10_QUP_PHYS 0x19A80000 #define MSM_GSBI11_QUP_PHYS 0x19B80000 #define MSM_GSBI12_QUP_PHYS 0x19C80000 /* GSBI UART devices */ #define MSM_UART1DM_PHYS (MSM_GSBI6_PHYS + 0x40000) #define INT_UART1DM_IRQ GSBI6_UARTDM_IRQ #define INT_UART2DM_IRQ GSBI12_UARTDM_IRQ #define MSM_UART2DM_PHYS 0x19C40000 #define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000) #define INT_UART3DM_IRQ GSBI3_UARTDM_IRQ #define TCSR_BASE_PHYS 0x16b00000 /* PRNG device */ #define MSM_PRNG_PHYS 0x16C00000 #define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000) #define INT_UART9DM_IRQ GSBI9_UARTDM_IRQ static void charm_ap2mdm_kpdpwr_on(void) { gpio_direction_output(AP2MDM_PMIC_RESET_N, 0); gpio_direction_output(AP2MDM_KPDPWR_N, 1); } static void charm_ap2mdm_kpdpwr_off(void) { int i; gpio_direction_output(AP2MDM_ERRFATAL, 1); for (i = 20; i > 0; i--) { if (gpio_get_value(MDM2AP_STATUS) == 0) break; msleep(100); } gpio_direction_output(AP2MDM_ERRFATAL, 0); if (i == 0) { pr_err("%s: MDM2AP_STATUS never went low. Doing a hard reset \ of the charm modem.\n", __func__); gpio_direction_output(AP2MDM_PMIC_RESET_N, 1); /* * Currently, there is a debounce timer on the charm PMIC. It is * necessary to hold the AP2MDM_PMIC_RESET low for ~3.5 seconds * for the reset to fully take place. Sleep here to ensure the * reset has occured before the function exits. */ msleep(4000); gpio_direction_output(AP2MDM_PMIC_RESET_N, 0); } } static struct resource charm_resources[] = { /* MDM2AP_ERRFATAL */ { .start = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL), .end = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL), .flags = IORESOURCE_IRQ, }, /* MDM2AP_STATUS */ { .start = MSM_GPIO_TO_INT(MDM2AP_STATUS), .end = MSM_GPIO_TO_INT(MDM2AP_STATUS), .flags = IORESOURCE_IRQ, } }; static struct charm_platform_data mdm_platform_data = { .charm_modem_on = charm_ap2mdm_kpdpwr_on, .charm_modem_off = charm_ap2mdm_kpdpwr_off, }; struct platform_device msm_charm_modem = { .name = "charm_modem", .id = -1, .num_resources = ARRAY_SIZE(charm_resources), .resource = charm_resources, .dev = { .platform_data = &mdm_platform_data, }, }; #ifdef CONFIG_MSM_DSPS #define GSBI12_DEV (&msm_dsps_device.dev) #else #define GSBI12_DEV (&msm_gsbi12_qup_i2c_device.dev) #endif void __init msm8x60_init_irq(void) { msm_mpm_irq_extn_init(); gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, (void *)MSM_QGIC_CPU_BASE); } #define MSM_LPASS_QDSP6SS_PHYS 0x28800000 static struct resource msm_8660_q6_resources[] = { { .start = MSM_LPASS_QDSP6SS_PHYS, .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_pil_q6v3 = { .name = "pil_qdsp6v3", .id = -1, .num_resources = ARRAY_SIZE(msm_8660_q6_resources), .resource = msm_8660_q6_resources, }; #define MSM_MSS_REGS_PHYS 0x10200000 static struct resource msm_8660_modem_resources[] = { { .start = MSM_MSS_REGS_PHYS, .end = MSM_MSS_REGS_PHYS + SZ_256 - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_pil_modem = { .name = "pil_modem", .id = -1, .num_resources = ARRAY_SIZE(msm_8660_modem_resources), .resource = msm_8660_modem_resources, }; struct platform_device msm_pil_tzapps = { .name = "pil_tzapps", .id = -1, }; static struct resource msm_uart1_dm_resources[] = { { .start = MSM_UART1DM_PHYS, .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1, .flags = IORESOURCE_MEM, }, { .start = INT_UART1DM_IRQ, .end = INT_UART1DM_IRQ, .flags = IORESOURCE_IRQ, }, { /* GSBI6 is UARTDM1 */ .start = MSM_GSBI6_PHYS, .end = MSM_GSBI6_PHYS + 4 - 1, .name = "gsbi_resource", .flags = IORESOURCE_MEM, }, { .start = DMOV_HSUART1_TX_CHAN, .end = DMOV_HSUART1_RX_CHAN, .name = "uartdm_channels", .flags = IORESOURCE_DMA, }, { .start = DMOV_HSUART1_TX_CRCI, .end = DMOV_HSUART1_RX_CRCI, .name = "uartdm_crci", .flags = IORESOURCE_DMA, }, }; static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32); struct platform_device msm_device_uart_dm1 = { .name = "msm_serial_hs", .id = 0, .num_resources = ARRAY_SIZE(msm_uart1_dm_resources), .resource = msm_uart1_dm_resources, .dev = { .dma_mask = &msm_uart_dm1_dma_mask, .coherent_dma_mask = DMA_BIT_MASK(32), }, }; static struct resource msm_uart3_dm_resources[] = { { .start = MSM_UART3DM_PHYS, .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1, .name = "uartdm_resource", .flags = IORESOURCE_MEM, }, { .start = INT_UART3DM_IRQ, .end = INT_UART3DM_IRQ, .flags = IORESOURCE_IRQ, }, { .start = MSM_GSBI3_PHYS, .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1, .name = "gsbi_resource", .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_uart_dm3 = { .name = "msm_serial_hsl", .id = 2, .num_resources = ARRAY_SIZE(msm_uart3_dm_resources), .resource = msm_uart3_dm_resources, }; static struct resource msm_uart12_dm_resources[] = { { .start = MSM_UART2DM_PHYS, .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, .name = "uartdm_resource", .flags = IORESOURCE_MEM, }, { .start = INT_UART2DM_IRQ, .end = INT_UART2DM_IRQ, .flags = IORESOURCE_IRQ, }, { /* GSBI 12 is UARTDM2 */ .start = MSM_GSBI12_PHYS, .end = MSM_GSBI12_PHYS + PAGE_SIZE - 1, .name = "gsbi_resource", .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_uart_dm12 = { .name = "msm_serial_hsl", .id = 0, .num_resources = ARRAY_SIZE(msm_uart12_dm_resources), .resource = msm_uart12_dm_resources, }; #ifdef CONFIG_MSM_GSBI9_UART static struct msm_serial_hslite_platform_data uart_gsbi9_pdata = { .config_gpio = 1, .uart_tx_gpio = 67, .uart_rx_gpio = 66, }; static struct resource msm_uart_gsbi9_resources[] = { { .start = MSM_UART9DM_PHYS, .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1, .name = "uartdm_resource", .flags = IORESOURCE_MEM, }, { .start = INT_UART9DM_IRQ, .end = INT_UART9DM_IRQ, .flags = IORESOURCE_IRQ, }, { /* GSBI 9 is UART_GSBI9 */ .start = MSM_GSBI9_PHYS, .end = MSM_GSBI9_PHYS + PAGE_SIZE - 1, .name = "gsbi_resource", .flags = IORESOURCE_MEM, }, }; struct platform_device *msm_device_uart_gsbi9; struct platform_device *msm_add_gsbi9_uart(void) { return platform_device_register_resndata(NULL, "msm_serial_hsl", 1, msm_uart_gsbi9_resources, ARRAY_SIZE(msm_uart_gsbi9_resources), &uart_gsbi9_pdata, sizeof(uart_gsbi9_pdata)); } #endif static struct resource gsbi3_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI3_QUP_PHYS, .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI3_PHYS, .end = MSM_GSBI3_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI3_QUP_IRQ, .end = GSBI3_QUP_IRQ, .flags = IORESOURCE_IRQ, }, { .name = "i2c_clk", .start = 44, .end = 44, .flags = IORESOURCE_IO, }, { .name = "i2c_sda", .start = 43, .end = 43, .flags = IORESOURCE_IO, }, }; static struct resource gsbi4_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI4_QUP_PHYS, .end = MSM_GSBI4_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI4_PHYS, .end = MSM_GSBI4_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI4_QUP_IRQ, .end = GSBI4_QUP_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct resource gsbi7_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI7_QUP_PHYS, .end = MSM_GSBI7_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI7_PHYS, .end = MSM_GSBI7_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI7_QUP_IRQ, .end = GSBI7_QUP_IRQ, .flags = IORESOURCE_IRQ, }, { .name = "i2c_clk", .start = 60, .end = 60, .flags = IORESOURCE_IO, }, { .name = "i2c_sda", .start = 59, .end = 59, .flags = IORESOURCE_IO, }, }; static struct resource gsbi8_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI8_QUP_PHYS, .end = MSM_GSBI8_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI8_PHYS, .end = MSM_GSBI8_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI8_QUP_IRQ, .end = GSBI8_QUP_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct resource gsbi9_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI9_QUP_PHYS, .end = MSM_GSBI9_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI9_PHYS, .end = MSM_GSBI9_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI9_QUP_IRQ, .end = GSBI9_QUP_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct resource gsbi12_qup_i2c_resources[] = { { .name = "qup_phys_addr", .start = MSM_GSBI12_QUP_PHYS, .end = MSM_GSBI12_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_qup_i2c_addr", .start = MSM_GSBI12_PHYS, .end = MSM_GSBI12_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "qup_err_intr", .start = GSBI12_QUP_IRQ, .end = GSBI12_QUP_IRQ, .flags = IORESOURCE_IRQ, }, }; #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors grp3d_init_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors grp3d_low_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(990), }, }; static struct msm_bus_vectors grp3d_nominal_low_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(1300), }, }; static struct msm_bus_vectors grp3d_nominal_high_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2008), }, }; static struct msm_bus_vectors grp3d_max_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_3D, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(2484), }, }; static struct msm_bus_paths grp3d_bus_scale_usecases[] = { { ARRAY_SIZE(grp3d_init_vectors), grp3d_init_vectors, }, { ARRAY_SIZE(grp3d_low_vectors), grp3d_low_vectors, }, { ARRAY_SIZE(grp3d_nominal_low_vectors), grp3d_nominal_low_vectors, }, { ARRAY_SIZE(grp3d_nominal_high_vectors), grp3d_nominal_high_vectors, }, { ARRAY_SIZE(grp3d_max_vectors), grp3d_max_vectors, }, }; static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = { grp3d_bus_scale_usecases, ARRAY_SIZE(grp3d_bus_scale_usecases), .name = "grp3d", }; static struct msm_bus_vectors grp2d0_init_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors grp2d0_max_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(990), }, }; static struct msm_bus_paths grp2d0_bus_scale_usecases[] = { { ARRAY_SIZE(grp2d0_init_vectors), grp2d0_init_vectors, }, { ARRAY_SIZE(grp2d0_max_vectors), grp2d0_max_vectors, }, }; static struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = { grp2d0_bus_scale_usecases, ARRAY_SIZE(grp2d0_bus_scale_usecases), .name = "grp2d0", }; static struct msm_bus_vectors grp2d1_init_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors grp2d1_max_vectors[] = { { .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = KGSL_CONVERT_TO_MBPS(990), }, }; static struct msm_bus_paths grp2d1_bus_scale_usecases[] = { { ARRAY_SIZE(grp2d1_init_vectors), grp2d1_init_vectors, }, { ARRAY_SIZE(grp2d1_max_vectors), grp2d1_max_vectors, }, }; static struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = { grp2d1_bus_scale_usecases, ARRAY_SIZE(grp2d1_bus_scale_usecases), .name = "grp2d1", }; #endif #ifdef CONFIG_HW_RANDOM_MSM static struct resource rng_resources = { .flags = IORESOURCE_MEM, .start = MSM_PRNG_PHYS, .end = MSM_PRNG_PHYS + SZ_512 - 1, }; struct platform_device msm_device_rng = { .name = "msm_rng", .id = 0, .num_resources = 1, .resource = &rng_resources, }; #endif static struct resource kgsl_3d0_resources[] = { { .name = KGSL_3D0_REG_MEMORY, .start = 0x04300000, /* GFX3D address */ .end = 0x0431ffff, .flags = IORESOURCE_MEM, }, { .name = KGSL_3D0_IRQ, .start = GFX3D_IRQ, .end = GFX3D_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct kgsl_device_platform_data kgsl_3d0_pdata = { .pwrlevel = { { .gpu_freq = 266667000, .bus_freq = 4, .io_fraction = 0, }, { .gpu_freq = 228571000, .bus_freq = 3, .io_fraction = 33, }, { .gpu_freq = 200000000, .bus_freq = 2, .io_fraction = 100, }, { .gpu_freq = 177778000, .bus_freq = 1, .io_fraction = 100, }, { .gpu_freq = 27000000, .bus_freq = 0, }, }, .init_level = 0, .num_levels = 5, .set_grp_async = NULL, .idle_timeout = HZ/5, .nap_allowed = true, .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE, #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &grp3d_bus_scale_pdata, #endif }; struct platform_device msm_kgsl_3d0 = { .name = "kgsl-3d0", .id = 0, .num_resources = ARRAY_SIZE(kgsl_3d0_resources), .resource = kgsl_3d0_resources, .dev = { .platform_data = &kgsl_3d0_pdata, }, }; static struct resource kgsl_2d0_resources[] = { { .name = KGSL_2D0_REG_MEMORY, .start = 0x04100000, /* Z180 base address */ .end = 0x04100FFF, .flags = IORESOURCE_MEM, }, { .name = KGSL_2D0_IRQ, .start = GFX2D0_IRQ, .end = GFX2D0_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct kgsl_device_platform_data kgsl_2d0_pdata = { .pwrlevel = { { .gpu_freq = 200000000, .bus_freq = 1, }, { .gpu_freq = 200000000, .bus_freq = 0, }, }, .init_level = 0, .num_levels = 2, .set_grp_async = NULL, .idle_timeout = HZ/10, .nap_allowed = true, .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE, #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &grp2d0_bus_scale_pdata, #endif }; struct platform_device msm_kgsl_2d0 = { .name = "kgsl-2d0", .id = 0, .num_resources = ARRAY_SIZE(kgsl_2d0_resources), .resource = kgsl_2d0_resources, .dev = { .platform_data = &kgsl_2d0_pdata, }, }; static struct resource kgsl_2d1_resources[] = { { .name = KGSL_2D1_REG_MEMORY, .start = 0x04200000, /* Z180 device 1 base address */ .end = 0x04200FFF, .flags = IORESOURCE_MEM, }, { .name = KGSL_2D1_IRQ, .start = GFX2D1_IRQ, .end = GFX2D1_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct kgsl_device_platform_data kgsl_2d1_pdata = { .pwrlevel = { { .gpu_freq = 200000000, .bus_freq = 1, }, { .gpu_freq = 200000000, .bus_freq = 0, }, }, .init_level = 0, .num_levels = 2, .set_grp_async = NULL, .idle_timeout = HZ/10, .nap_allowed = true, .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE, #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &grp2d1_bus_scale_pdata, #endif }; struct platform_device msm_kgsl_2d1 = { .name = "kgsl-2d1", .id = 1, .num_resources = ARRAY_SIZE(kgsl_2d1_resources), .resource = kgsl_2d1_resources, .dev = { .platform_data = &kgsl_2d1_pdata, }, }; /* * this a software workaround for not having two distinct board * files for 8660v1 and 8660v2. 8660v1 has a faulty 2d clock, and * this workaround detects the cpu version to tell if the kernel is on a * 8660v1, and should disable the 2d core. it is called from the board file */ void __init msm8x60_check_2d_hardware(void) { if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) && (SOCINFO_VERSION_MINOR(socinfo_get_version()) == 0)) { printk(KERN_WARNING "kgsl: 2D cores disabled on 8660v1\n"); kgsl_2d0_pdata.clk_map = 0; } } /* Use GSBI3 QUP for /dev/i2c-0 */ struct platform_device msm_gsbi3_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI3_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi3_qup_i2c_resources), .resource = gsbi3_qup_i2c_resources, }; /* Use GSBI4 QUP for /dev/i2c-1 */ struct platform_device msm_gsbi4_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI4_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi4_qup_i2c_resources), .resource = gsbi4_qup_i2c_resources, }; /* Use GSBI8 QUP for /dev/i2c-3 */ struct platform_device msm_gsbi8_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI8_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi8_qup_i2c_resources), .resource = gsbi8_qup_i2c_resources, }; /* Use GSBI9 QUP for /dev/i2c-2 */ struct platform_device msm_gsbi9_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI9_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi9_qup_i2c_resources), .resource = gsbi9_qup_i2c_resources, }; /* Use GSBI7 QUP for /dev/i2c-4 (Marimba) */ struct platform_device msm_gsbi7_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI7_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi7_qup_i2c_resources), .resource = gsbi7_qup_i2c_resources, }; /* Use GSBI12 QUP for /dev/i2c-5 (Sensors) */ struct platform_device msm_gsbi12_qup_i2c_device = { .name = "qup_i2c", .id = MSM_GSBI12_QUP_I2C_BUS_ID, .num_resources = ARRAY_SIZE(gsbi12_qup_i2c_resources), .resource = gsbi12_qup_i2c_resources, }; #ifdef CONFIG_MSM_SSBI #define MSM_SSBI_PMIC1_PHYS 0x00500000 static struct resource resources_ssbi_pmic1_resource[] = { { .start = MSM_SSBI_PMIC1_PHYS, .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_ssbi_pmic1 = { .name = "msm_ssbi", .id = 0, .resource = resources_ssbi_pmic1_resource, .num_resources = ARRAY_SIZE(resources_ssbi_pmic1_resource), }; #define MSM_SSBI2_PMIC2B_PHYS 0x00C00000 static struct resource resources_ssbi_pmic2_resource[] = { { .start = MSM_SSBI2_PMIC2B_PHYS, .end = MSM_SSBI2_PMIC2B_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_ssbi_pmic2 = { .name = "msm_ssbi", .id = 1, .resource = resources_ssbi_pmic2_resource, .num_resources = ARRAY_SIZE(resources_ssbi_pmic2_resource), }; #endif #ifdef CONFIG_I2C_SSBI /* CODEC SSBI on /dev/i2c-8 */ #define MSM_SSBI3_PHYS 0x18700000 static struct resource msm_ssbi3_resources[] = { { .name = "ssbi_base", .start = MSM_SSBI3_PHYS, .end = MSM_SSBI3_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_ssbi3 = { .name = "i2c_ssbi", .id = MSM_SSBI3_I2C_BUS_ID, .num_resources = ARRAY_SIZE(msm_ssbi3_resources), .resource = msm_ssbi3_resources, }; #endif /* CONFIG_I2C_SSBI */ static struct resource gsbi1_qup_spi_resources[] = { { .name = "spi_base", .start = MSM_GSBI1_QUP_PHYS, .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_base", .start = MSM_GSBI1_PHYS, .end = MSM_GSBI1_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "spi_irq_in", .start = GSBI1_QUP_IRQ, .end = GSBI1_QUP_IRQ, .flags = IORESOURCE_IRQ, }, { .name = "spidm_channels", .start = 5, .end = 6, .flags = IORESOURCE_DMA, }, { .name = "spidm_crci", .start = 8, .end = 7, .flags = IORESOURCE_DMA, }, { .name = "spi_clk", .start = 36, .end = 36, .flags = IORESOURCE_IO, }, { .name = "spi_miso", .start = 34, .end = 34, .flags = IORESOURCE_IO, }, { .name = "spi_mosi", .start = 33, .end = 33, .flags = IORESOURCE_IO, }, { .name = "spi_cs", .start = 35, .end = 35, .flags = IORESOURCE_IO, }, }; /* Use GSBI1 QUP for SPI-0 */ struct platform_device msm_gsbi1_qup_spi_device = { .name = "spi_qsd", .id = 0, .num_resources = ARRAY_SIZE(gsbi1_qup_spi_resources), .resource = gsbi1_qup_spi_resources, }; static struct resource gsbi10_qup_spi_resources[] = { { .name = "spi_base", .start = MSM_GSBI10_QUP_PHYS, .end = MSM_GSBI10_QUP_PHYS + SZ_4K - 1, .flags = IORESOURCE_MEM, }, { .name = "gsbi_base", .start = MSM_GSBI10_PHYS, .end = MSM_GSBI10_PHYS + 4 - 1, .flags = IORESOURCE_MEM, }, { .name = "spi_irq_in", .start = GSBI10_QUP_IRQ, .end = GSBI10_QUP_IRQ, .flags = IORESOURCE_IRQ, }, { .name = "spi_clk", .start = 73, .end = 73, .flags = IORESOURCE_IO, }, { .name = "spi_cs", .start = 72, .end = 72, .flags = IORESOURCE_IO, }, { .name = "spi_mosi", .start = 70, .end = 70, .flags = IORESOURCE_IO, }, }; /* Use GSBI10 QUP for SPI-1 */ struct platform_device msm_gsbi10_qup_spi_device = { .name = "spi_qsd", .id = 1, .num_resources = ARRAY_SIZE(gsbi10_qup_spi_resources), .resource = gsbi10_qup_spi_resources, }; #define MSM_SDC1_BASE 0x12400000 #define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800) #define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000) #define MSM_SDC2_BASE 0x12140000 #define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800) #define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000) #define MSM_SDC3_BASE 0x12180000 #define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800) #define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000) #define MSM_SDC4_BASE 0x121C0000 #define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800) #define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000) #define MSM_SDC5_BASE 0x12200000 #define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800) #define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000) static struct resource resources_sdc1[] = { { .start = MSM_SDC1_BASE, .end = MSM_SDC1_DML_BASE - 1, .flags = IORESOURCE_MEM, }, { .start = SDC1_IRQ_0, .end = SDC1_IRQ_0, .flags = IORESOURCE_IRQ, }, #ifdef CONFIG_MMC_MSM_SPS_SUPPORT { .name = "sdcc_dml_addr", .start = MSM_SDC1_DML_BASE, .end = MSM_SDC1_BAM_BASE - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_addr", .start = MSM_SDC1_BAM_BASE, .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_irq", .start = SDC1_BAM_IRQ, .end = SDC1_BAM_IRQ, .flags = IORESOURCE_IRQ, }, #else { .name = "sdcc_dma_chnl", .start = DMOV_SDC1_CHAN, .end = DMOV_SDC1_CHAN, .flags = IORESOURCE_DMA, }, { .name = "sdcc_dma_crci", .start = DMOV_SDC1_CRCI, .end = DMOV_SDC1_CRCI, .flags = IORESOURCE_DMA, } #endif /* CONFIG_MMC_MSM_SPS_SUPPORT */ }; static struct resource resources_sdc2[] = { { .start = MSM_SDC2_BASE, .end = MSM_SDC2_DML_BASE - 1, .flags = IORESOURCE_MEM, }, { .start = SDC2_IRQ_0, .end = SDC2_IRQ_0, .flags = IORESOURCE_IRQ, }, #ifdef CONFIG_MMC_MSM_SPS_SUPPORT { .name = "sdcc_dml_addr", .start = MSM_SDC2_DML_BASE, .end = MSM_SDC2_BAM_BASE - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_addr", .start = MSM_SDC2_BAM_BASE, .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_irq", .start = SDC2_BAM_IRQ, .end = SDC2_BAM_IRQ, .flags = IORESOURCE_IRQ, }, #else { .name = "sdcc_dma_chnl", .start = DMOV_SDC2_CHAN, .end = DMOV_SDC2_CHAN, .flags = IORESOURCE_DMA, }, { .name = "sdcc_dma_crci", .start = DMOV_SDC2_CRCI, .end = DMOV_SDC2_CRCI, .flags = IORESOURCE_DMA, } #endif /* CONFIG_MMC_MSM_SPS_SUPPORT */ }; static struct resource resources_sdc3[] = { { .start = MSM_SDC3_BASE, .end = MSM_SDC3_DML_BASE - 1, .flags = IORESOURCE_MEM, }, { .start = SDC3_IRQ_0, .end = SDC3_IRQ_0, .flags = IORESOURCE_IRQ, }, #ifdef CONFIG_MMC_MSM_SPS_SUPPORT { .name = "sdcc_dml_addr", .start = MSM_SDC3_DML_BASE, .end = MSM_SDC3_BAM_BASE - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_addr", .start = MSM_SDC3_BAM_BASE, .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_irq", .start = SDC3_BAM_IRQ, .end = SDC3_BAM_IRQ, .flags = IORESOURCE_IRQ, }, #else { .name = "sdcc_dma_chnl", .start = DMOV_SDC3_CHAN, .end = DMOV_SDC3_CHAN, .flags = IORESOURCE_DMA, }, { .name = "sdcc_dma_crci", .start = DMOV_SDC3_CRCI, .end = DMOV_SDC3_CRCI, .flags = IORESOURCE_DMA, }, #endif /* CONFIG_MMC_MSM_SPS_SUPPORT */ }; static struct resource resources_sdc4[] = { { .start = MSM_SDC4_BASE, .end = MSM_SDC4_DML_BASE - 1, .flags = IORESOURCE_MEM, }, { .start = SDC4_IRQ_0, .end = SDC4_IRQ_0, .flags = IORESOURCE_IRQ, }, #ifdef CONFIG_MMC_MSM_SPS_SUPPORT { .name = "sdcc_dml_addr", .start = MSM_SDC4_DML_BASE, .end = MSM_SDC4_BAM_BASE - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_addr", .start = MSM_SDC4_BAM_BASE, .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_irq", .start = SDC4_BAM_IRQ, .end = SDC4_BAM_IRQ, .flags = IORESOURCE_IRQ, }, #else { .name = "sdcc_dma_chnl", .start = DMOV_SDC4_CHAN, .end = DMOV_SDC4_CHAN, .flags = IORESOURCE_DMA, }, { .name = "sdcc_dma_crci", .start = DMOV_SDC4_CRCI, .end = DMOV_SDC4_CRCI, .flags = IORESOURCE_DMA, }, #endif /* CONFIG_MMC_MSM_SPS_SUPPORT */ }; static struct resource resources_sdc5[] = { { .start = MSM_SDC5_BASE, .end = MSM_SDC5_DML_BASE - 1, .flags = IORESOURCE_MEM, }, { .start = SDC5_IRQ_0, .end = SDC5_IRQ_0, .flags = IORESOURCE_IRQ, }, #ifdef CONFIG_MMC_MSM_SPS_SUPPORT { .name = "sdcc_dml_addr", .start = MSM_SDC5_DML_BASE, .end = MSM_SDC5_BAM_BASE - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_addr", .start = MSM_SDC5_BAM_BASE, .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1, .flags = IORESOURCE_MEM, }, { .name = "sdcc_bam_irq", .start = SDC5_BAM_IRQ, .end = SDC5_BAM_IRQ, .flags = IORESOURCE_IRQ, }, #else { .name = "sdcc_dma_chnl", .start = DMOV_SDC5_CHAN, .end = DMOV_SDC5_CHAN, .flags = IORESOURCE_DMA, }, { .name = "sdcc_dma_crci", .start = DMOV_SDC5_CRCI, .end = DMOV_SDC5_CRCI, .flags = IORESOURCE_DMA, }, #endif /* CONFIG_MMC_MSM_SPS_SUPPORT */ }; struct platform_device msm_device_sdc1 = { .name = "msm_sdcc", .id = 1, .num_resources = ARRAY_SIZE(resources_sdc1), .resource = resources_sdc1, .dev = { .coherent_dma_mask = 0xffffffff, }, }; struct platform_device msm_device_sdc2 = { .name = "msm_sdcc", .id = 2, .num_resources = ARRAY_SIZE(resources_sdc2), .resource = resources_sdc2, .dev = { .coherent_dma_mask = 0xffffffff, }, }; struct platform_device msm_device_sdc3 = { .name = "msm_sdcc", .id = 3, .num_resources = ARRAY_SIZE(resources_sdc3), .resource = resources_sdc3, .dev = { .coherent_dma_mask = 0xffffffff, }, }; struct platform_device msm_device_sdc4 = { .name = "msm_sdcc", .id = 4, .num_resources = ARRAY_SIZE(resources_sdc4), .resource = resources_sdc4, .dev = { .coherent_dma_mask = 0xffffffff, }, }; struct platform_device msm_device_sdc5 = { .name = "msm_sdcc", .id = 5, .num_resources = ARRAY_SIZE(resources_sdc5), .resource = resources_sdc5, .dev = { .coherent_dma_mask = 0xffffffff, }, }; static struct platform_device *msm_sdcc_devices[] __initdata = { &msm_device_sdc1, &msm_device_sdc2, &msm_device_sdc3, &msm_device_sdc4, &msm_device_sdc5, }; int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) { struct platform_device *pdev; if (controller < 1 || controller > 5) return -EINVAL; pdev = msm_sdcc_devices[controller-1]; pdev->dev.platform_data = plat; return platform_device_register(pdev); } #ifdef CONFIG_MSM_CAMERA_V4L2 static struct resource msm_csic0_resources[] = { { .name = "csic", .start = 0x04800000, .end = 0x04800000 + 0x00000400 - 1, .flags = IORESOURCE_MEM, }, { .name = "csic", .start = CSI_0_IRQ, .end = CSI_0_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct resource msm_csic1_resources[] = { { .name = "csic", .start = 0x04900000, .end = 0x04900000 + 0x00000400 - 1, .flags = IORESOURCE_MEM, }, { .name = "csic", .start = CSI_1_IRQ, .end = CSI_1_IRQ, .flags = IORESOURCE_IRQ, }, }; struct resource msm_vfe_resources[] = { { .name = "msm_vfe", .start = 0x04500000, .end = 0x04500000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, { .name = "msm_vfe", .start = VFE_IRQ, .end = VFE_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct resource msm_vpe_resources[] = { { .name = "vpe", .start = 0x05300000, .end = 0x05300000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, { .name = "vpe", .start = INT_VPE, .end = INT_VPE, .flags = IORESOURCE_IRQ, }, }; struct platform_device msm_device_csic0 = { .name = "msm_csic", .id = 0, .resource = msm_csic0_resources, .num_resources = ARRAY_SIZE(msm_csic0_resources), }; struct platform_device msm_device_csic1 = { .name = "msm_csic", .id = 1, .resource = msm_csic1_resources, .num_resources = ARRAY_SIZE(msm_csic1_resources), }; struct platform_device msm_device_vfe = { .name = "msm_vfe", .id = 0, .resource = msm_vfe_resources, .num_resources = ARRAY_SIZE(msm_vfe_resources), }; struct platform_device msm_device_vpe = { .name = "msm_vpe", .id = 0, .resource = msm_vpe_resources, .num_resources = ARRAY_SIZE(msm_vpe_resources), }; #endif #define MIPI_DSI_HW_BASE 0x04700000 #define ROTATOR_HW_BASE 0x04E00000 #define TVENC_HW_BASE 0x04F00000 #define MDP_HW_BASE 0x05100000 static struct resource msm_mipi_dsi_resources[] = { { .name = "mipi_dsi", .start = MIPI_DSI_HW_BASE, .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1, .flags = IORESOURCE_MEM, }, { .start = DSI_IRQ, .end = DSI_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct platform_device msm_mipi_dsi_device = { .name = "mipi_dsi", .id = 1, .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources), .resource = msm_mipi_dsi_resources, }; static struct resource msm_mdp_resources[] = { { .name = "mdp", .start = MDP_HW_BASE, .end = MDP_HW_BASE + 0x000F0000 - 1, .flags = IORESOURCE_MEM, }, { .start = INT_MDP, .end = INT_MDP, .flags = IORESOURCE_IRQ, }, }; static struct platform_device msm_mdp_device = { .name = "mdp", .id = 0, .num_resources = ARRAY_SIZE(msm_mdp_resources), .resource = msm_mdp_resources, }; #ifdef CONFIG_MSM_ROTATOR static struct resource resources_msm_rotator[] = { { .start = 0x04E00000, .end = 0x04F00000 - 1, .flags = IORESOURCE_MEM, }, { .start = ROT_IRQ, .end = ROT_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct msm_rot_clocks rotator_clocks[] = { { .clk_name = "core_clk", .clk_type = ROTATOR_CORE_CLK, .clk_rate = 160 * 1000 * 1000, }, { .clk_name = "iface_clk", .clk_type = ROTATOR_PCLK, .clk_rate = 0, }, }; static struct msm_rotator_platform_data rotator_pdata = { .number_of_clocks = ARRAY_SIZE(rotator_clocks), .hardware_version_number = 0x01010307, .rotator_clks = rotator_clocks, .regulator_name = "fs_rot", #ifdef CONFIG_MSM_BUS_SCALING .bus_scale_table = &rotator_bus_scale_pdata, #endif }; struct platform_device msm_rotator_device = { .name = "msm_rotator", .id = 0, .num_resources = ARRAY_SIZE(resources_msm_rotator), .resource = resources_msm_rotator, .dev = { .platform_data = &rotator_pdata, }, }; #endif /* Sensors DSPS platform data */ #ifdef CONFIG_MSM_DSPS #define PPSS_REG_PHYS_BASE 0x12080000 #define PPSS_PAUSE_REG 0x1804 #define MHZ (1000*1000) #define TCSR_GSBI_IRQ_MUX_SEL 0x0044 #define GSBI_IRQ_MUX_SEL_MASK 0xF #define GSBI_IRQ_MUX_SEL_DSPS 0xB static void dsps_init1(struct msm_dsps_platform_data *data) { int val; /* route GSBI12 interrutps to DSPS */ val = secure_readl(MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL); val &= ~GSBI_IRQ_MUX_SEL_MASK; val |= GSBI_IRQ_MUX_SEL_DSPS; secure_writel(val, MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL); } static struct dsps_clk_info dsps_clks[] = { { .name = "ppss_pclk", .rate = 0, /* no rate just on/off */ }, { .name = "mem_clk", .rate = 0, /* no rate just on/off */ }, { .name = "gsbi_qup_clk", .rate = 24 * MHZ, /* See clk_tbl_gsbi_qup[] */ }, { .name = "dfab_dsps_clk", .rate = 64 * MHZ, /* Same rate as USB. */ } }; static struct dsps_regulator_info dsps_regs[] = { { .name = "8058_l5", .volt = 2850000, /* in uV */ }, { .name = "8058_s3", .volt = 1800000, /* in uV */ } }; /* * Note: GPIOs field is intialized in run-time at the function * msm8x60_init_dsps(). */ struct msm_dsps_platform_data msm_dsps_pdata = { .clks = dsps_clks, .clks_num = ARRAY_SIZE(dsps_clks), .gpios = NULL, .gpios_num = 0, .regs = dsps_regs, .regs_num = ARRAY_SIZE(dsps_regs), .init = dsps_init1, .ppss_pause_reg = PPSS_PAUSE_REG, .signature = DSPS_SIGNATURE, }; static struct resource msm_dsps_resources[] = { { .start = PPSS_REG_PHYS_BASE, .end = PPSS_REG_PHYS_BASE + SZ_8K - 1, .name = "ppss_reg", .flags = IORESOURCE_MEM, }, }; struct platform_device msm_dsps_device = { .name = "msm_dsps", .id = 0, .num_resources = ARRAY_SIZE(msm_dsps_resources), .resource = msm_dsps_resources, .dev.platform_data = &msm_dsps_pdata, }; #endif /* CONFIG_MSM_DSPS */ #ifdef CONFIG_FB_MSM_TVOUT static struct resource msm_tvenc_resources[] = { { .name = "tvenc", .start = TVENC_HW_BASE, .end = TVENC_HW_BASE + PAGE_SIZE - 1, .flags = IORESOURCE_MEM, } }; static struct resource tvout_device_resources[] = { { .name = "tvout_device_irq", .start = TV_ENC_IRQ, .end = TV_ENC_IRQ, .flags = IORESOURCE_IRQ, }, }; #endif static void __init msm_register_device(struct platform_device *pdev, void *data) { int ret; pdev->dev.platform_data = data; ret = platform_device_register(pdev); if (ret) dev_err(&pdev->dev, "%s: platform_device_register() failed = %d\n", __func__, ret); } static struct platform_device msm_lcdc_device = { .name = "lcdc", .id = 0, }; #ifdef CONFIG_FB_MSM_TVOUT static struct platform_device msm_tvenc_device = { .name = "tvenc", .id = 0, .num_resources = ARRAY_SIZE(msm_tvenc_resources), .resource = msm_tvenc_resources, }; static struct platform_device msm_tvout_device = { .name = "tvout_device", .id = 0, .num_resources = ARRAY_SIZE(tvout_device_resources), .resource = tvout_device_resources, }; #endif #ifdef CONFIG_MSM_BUS_SCALING static struct platform_device msm_dtv_device = { .name = "dtv", .id = 0, }; #endif void __init msm_fb_register_device(char *name, void *data) { if (!strncmp(name, "mdp", 3)) msm_register_device(&msm_mdp_device, data); else if (!strncmp(name, "lcdc", 4)) msm_register_device(&msm_lcdc_device, data); else if (!strncmp(name, "mipi_dsi", 8)) msm_register_device(&msm_mipi_dsi_device, data); #ifdef CONFIG_FB_MSM_TVOUT else if (!strncmp(name, "tvenc", 5)) msm_register_device(&msm_tvenc_device, data); else if (!strncmp(name, "tvout_device", 12)) msm_register_device(&msm_tvout_device, data); #endif #ifdef CONFIG_MSM_BUS_SCALING else if (!strncmp(name, "dtv", 3)) msm_register_device(&msm_dtv_device, data); #endif else printk(KERN_ERR "%s: unknown device! %s\n", __func__, name); } static struct resource resources_otg[] = { { .start = 0x12500000, .end = 0x12500000 + SZ_1K - 1, .flags = IORESOURCE_MEM, }, { .start = USB1_HS_IRQ, .end = USB1_HS_IRQ, .flags = IORESOURCE_IRQ, }, }; struct platform_device msm_device_otg = { .name = "msm_otg", .id = -1, .num_resources = ARRAY_SIZE(resources_otg), .resource = resources_otg, }; static u64 dma_mask = 0xffffffffULL; struct platform_device msm_device_gadget_peripheral = { .name = "msm_hsusb", .id = -1, .dev = { .dma_mask = &dma_mask, .coherent_dma_mask = 0xffffffffULL, }, }; #ifdef CONFIG_USB_EHCI_MSM_72K static struct resource resources_hsusb_host[] = { { .start = 0x12500000, .end = 0x12500000 + SZ_1K - 1, .flags = IORESOURCE_MEM, }, { .start = USB1_HS_IRQ, .end = USB1_HS_IRQ, .flags = IORESOURCE_IRQ, }, }; struct platform_device msm_device_hsusb_host = { .name = "msm_hsusb_host", .id = 0, .num_resources = ARRAY_SIZE(resources_hsusb_host), .resource = resources_hsusb_host, .dev = { .dma_mask = &dma_mask, .coherent_dma_mask = 0xffffffffULL, }, }; static struct platform_device *msm_host_devices[] = { &msm_device_hsusb_host, }; int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat) { struct platform_device *pdev; pdev = msm_host_devices[host]; if (!pdev) return -ENODEV; pdev->dev.platform_data = plat; return platform_device_register(pdev); } #endif #define MSM_TSIF0_PHYS (0x18200000) #define MSM_TSIF1_PHYS (0x18201000) #define MSM_TSIF_SIZE (0x200) #define TCSR_ADM_0_A_CRCI_MUX_SEL 0x0070 #define TSIF_0_CLK GPIO_CFG(93, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_0_EN GPIO_CFG(94, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_0_DATA GPIO_CFG(95, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_0_SYNC GPIO_CFG(96, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_1_CLK GPIO_CFG(97, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_1_EN GPIO_CFG(98, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_1_DATA GPIO_CFG(99, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) #define TSIF_1_SYNC GPIO_CFG(100, 1, GPIO_CFG_INPUT, \ GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) static const struct msm_gpio tsif0_gpios[] = { { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", }, { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", }, { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", }, { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", }, }; static const struct msm_gpio tsif1_gpios[] = { { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", }, { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", }, { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", }, { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", }, }; static void tsif_release(struct device *dev) { } static void tsif_init1(struct msm_tsif_platform_data *data) { int val; /* configure mux to use correct tsif instance */ val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL); val |= 0x80000000; secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL); } struct msm_tsif_platform_data tsif1_platform_data = { .num_gpios = ARRAY_SIZE(tsif1_gpios), .gpios = tsif1_gpios, .tsif_pclk = "iface_clk", .tsif_ref_clk = "ref_clk", .init = tsif_init1 }; struct resource tsif1_resources[] = { [0] = { .flags = IORESOURCE_IRQ, .start = TSIF2_IRQ, .end = TSIF2_IRQ, }, [1] = { .flags = IORESOURCE_MEM, .start = MSM_TSIF1_PHYS, .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1, }, [2] = { .flags = IORESOURCE_DMA, .start = DMOV_TSIF_CHAN, .end = DMOV_TSIF_CRCI, }, }; static void tsif_init0(struct msm_tsif_platform_data *data) { int val; /* configure mux to use correct tsif instance */ val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL); val &= 0x7FFFFFFF; secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL); } struct msm_tsif_platform_data tsif0_platform_data = { .num_gpios = ARRAY_SIZE(tsif0_gpios), .gpios = tsif0_gpios, .tsif_pclk = "iface_clk", .tsif_ref_clk = "ref_clk", .init = tsif_init0 }; struct resource tsif0_resources[] = { [0] = { .flags = IORESOURCE_IRQ, .start = TSIF1_IRQ, .end = TSIF1_IRQ, }, [1] = { .flags = IORESOURCE_MEM, .start = MSM_TSIF0_PHYS, .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1, }, [2] = { .flags = IORESOURCE_DMA, .start = DMOV_TSIF_CHAN, .end = DMOV_TSIF_CRCI, }, }; struct platform_device msm_device_tsif[2] = { { .name = "msm_tsif", .id = 0, .num_resources = ARRAY_SIZE(tsif0_resources), .resource = tsif0_resources, .dev = { .release = tsif_release, .platform_data = &tsif0_platform_data }, }, { .name = "msm_tsif", .id = 1, .num_resources = ARRAY_SIZE(tsif1_resources), .resource = tsif1_resources, .dev = { .release = tsif_release, .platform_data = &tsif1_platform_data }, } }; struct platform_device msm_device_smd = { .name = "msm_smd", .id = -1, }; static struct msm_watchdog_pdata msm_watchdog_pdata = { .pet_time = 10000, .bark_time = 11000, .has_secure = true, }; struct platform_device msm8660_device_watchdog = { .name = "msm_watchdog", .id = -1, .dev = { .platform_data = &msm_watchdog_pdata, }, }; static struct resource msm_dmov_resource_adm0[] = { { .start = INT_ADM0_AARM, .flags = IORESOURCE_IRQ, }, { .start = 0x18320000, .end = 0x18320000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, }; static struct resource msm_dmov_resource_adm1[] = { { .start = INT_ADM1_AARM, .flags = IORESOURCE_IRQ, }, { .start = 0x18420000, .end = 0x18420000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, }; static struct msm_dmov_pdata msm_dmov_pdata_adm0 = { .sd = 1, .sd_size = 0x800, }; static struct msm_dmov_pdata msm_dmov_pdata_adm1 = { .sd = 1, .sd_size = 0x800, }; struct platform_device msm_device_dmov_adm0 = { .name = "msm_dmov", .id = 0, .resource = msm_dmov_resource_adm0, .num_resources = ARRAY_SIZE(msm_dmov_resource_adm0), .dev = { .platform_data = &msm_dmov_pdata_adm0, }, }; struct platform_device msm_device_dmov_adm1 = { .name = "msm_dmov", .id = 1, .resource = msm_dmov_resource_adm1, .num_resources = ARRAY_SIZE(msm_dmov_resource_adm1), .dev = { .platform_data = &msm_dmov_pdata_adm1, }, }; /* MSM Video core device */ #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors vidc_init_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors vidc_venc_vga_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 54525952, .ib = 436207616, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 72351744, .ib = 289406976, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 500000, .ib = 1000000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 500000, .ib = 1000000, }, }; static struct msm_bus_vectors vidc_vdec_vga_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 40894464, .ib = 327155712, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 48234496, .ib = 192937984, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 500000, .ib = 2000000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 500000, .ib = 2000000, }, }; static struct msm_bus_vectors vidc_venc_720p_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 163577856, .ib = 1308622848, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 219152384, .ib = 876609536, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 1750000, .ib = 3500000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 1750000, .ib = 3500000, }, }; static struct msm_bus_vectors vidc_vdec_720p_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 121634816, .ib = 973078528, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 155189248, .ib = 620756992, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 1750000, .ib = 7000000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 1750000, .ib = 7000000, }, }; static struct msm_bus_vectors vidc_venc_1080p_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 372244480, .ib = 1861222400, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 501219328, .ib = 2004877312, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 2500000, .ib = 5000000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 2500000, .ib = 5000000, }, }; static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = { { .src = MSM_BUS_MASTER_HD_CODEC_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 222298112, .ib = 1778384896, }, { .src = MSM_BUS_MASTER_HD_CODEC_PORT1, .dst = MSM_BUS_SLAVE_SMI, .ab = 330301440, .ib = 1321205760, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 2500000, .ib = 700000000, }, { .src = MSM_BUS_MASTER_AMPSS_M0, .dst = MSM_BUS_SLAVE_SMI, .ab = 2500000, .ib = 10000000, }, }; static struct msm_bus_paths vidc_bus_client_config[] = { { ARRAY_SIZE(vidc_init_vectors), vidc_init_vectors, }, { ARRAY_SIZE(vidc_venc_vga_vectors), vidc_venc_vga_vectors, }, { ARRAY_SIZE(vidc_vdec_vga_vectors), vidc_vdec_vga_vectors, }, { ARRAY_SIZE(vidc_venc_720p_vectors), vidc_venc_720p_vectors, }, { ARRAY_SIZE(vidc_vdec_720p_vectors), vidc_vdec_720p_vectors, }, { ARRAY_SIZE(vidc_venc_1080p_vectors), vidc_venc_1080p_vectors, }, { ARRAY_SIZE(vidc_vdec_1080p_vectors), vidc_vdec_1080p_vectors, }, }; static struct msm_bus_scale_pdata vidc_bus_client_data = { vidc_bus_client_config, ARRAY_SIZE(vidc_bus_client_config), .name = "vidc", }; #endif #define MSM_VIDC_BASE_PHYS 0x04400000 #define MSM_VIDC_BASE_SIZE 0x00100000 static struct resource msm_device_vidc_resources[] = { { .start = MSM_VIDC_BASE_PHYS, .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1, .flags = IORESOURCE_MEM, }, { .start = VCODEC_IRQ, .end = VCODEC_IRQ, .flags = IORESOURCE_IRQ, }, }; struct msm_vidc_platform_data vidc_platform_data = { #ifdef CONFIG_MSM_BUS_SCALING .vidc_bus_client_pdata = &vidc_bus_client_data, #endif #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION .memtype = ION_CP_MM_HEAP_ID, .enable_ion = 1, .cp_enabled = 0, #else .memtype = MEMTYPE_SMI_KERNEL, .enable_ion = 0, #endif .disable_dmx = 0, .disable_fullhd = 0, .disable_turbo = 1 }; struct platform_device msm_device_vidc = { .name = "msm_vidc", .id = 0, .num_resources = ARRAY_SIZE(msm_device_vidc_resources), .resource = msm_device_vidc_resources, .dev = { .platform_data = &vidc_platform_data, }, }; #if defined(CONFIG_MSM_RPM_STATS_LOG) static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = { .phys_addr_base = 0x00107E04, .phys_size = SZ_8K, }; struct platform_device msm_rpm_stat_device = { .name = "msm_rpm_stat", .id = -1, .dev = { .platform_data = &msm_rpm_stat_pdata, }, }; #endif #ifdef CONFIG_MSM_MPM static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = { [1] = MSM_GPIO_TO_INT(61), [4] = MSM_GPIO_TO_INT(87), [5] = MSM_GPIO_TO_INT(88), [6] = MSM_GPIO_TO_INT(89), [7] = MSM_GPIO_TO_INT(90), [8] = MSM_GPIO_TO_INT(91), [9] = MSM_GPIO_TO_INT(34), [10] = MSM_GPIO_TO_INT(38), [11] = MSM_GPIO_TO_INT(42), [12] = MSM_GPIO_TO_INT(46), [13] = MSM_GPIO_TO_INT(50), [14] = MSM_GPIO_TO_INT(54), [15] = MSM_GPIO_TO_INT(58), [16] = MSM_GPIO_TO_INT(63), [17] = MSM_GPIO_TO_INT(160), [18] = MSM_GPIO_TO_INT(162), [19] = MSM_GPIO_TO_INT(144), [20] = MSM_GPIO_TO_INT(146), [25] = USB1_HS_IRQ, [26] = TV_ENC_IRQ, [27] = HDMI_IRQ, [29] = MSM_GPIO_TO_INT(123), [30] = MSM_GPIO_TO_INT(172), [31] = MSM_GPIO_TO_INT(99), [32] = MSM_GPIO_TO_INT(96), [33] = MSM_GPIO_TO_INT(67), [34] = MSM_GPIO_TO_INT(71), [35] = MSM_GPIO_TO_INT(105), [36] = MSM_GPIO_TO_INT(117), [37] = MSM_GPIO_TO_INT(29), [38] = MSM_GPIO_TO_INT(30), [39] = MSM_GPIO_TO_INT(31), [40] = MSM_GPIO_TO_INT(37), [41] = MSM_GPIO_TO_INT(40), [42] = MSM_GPIO_TO_INT(41), [43] = MSM_GPIO_TO_INT(45), [44] = MSM_GPIO_TO_INT(51), [45] = MSM_GPIO_TO_INT(52), [46] = MSM_GPIO_TO_INT(57), [47] = MSM_GPIO_TO_INT(73), [48] = MSM_GPIO_TO_INT(93), [49] = MSM_GPIO_TO_INT(94), [50] = MSM_GPIO_TO_INT(103), [51] = MSM_GPIO_TO_INT(104), [52] = MSM_GPIO_TO_INT(106), [53] = MSM_GPIO_TO_INT(115), [54] = MSM_GPIO_TO_INT(124), [55] = MSM_GPIO_TO_INT(125), [56] = MSM_GPIO_TO_INT(126), [57] = MSM_GPIO_TO_INT(127), [58] = MSM_GPIO_TO_INT(128), [59] = MSM_GPIO_TO_INT(129), }; static uint16_t msm_mpm_bypassed_apps_irqs[] = { TLMM_MSM_SUMMARY_IRQ, RPM_SCSS_CPU0_GP_HIGH_IRQ, RPM_SCSS_CPU0_GP_MEDIUM_IRQ, RPM_SCSS_CPU0_GP_LOW_IRQ, RPM_SCSS_CPU0_WAKE_UP_IRQ, RPM_SCSS_CPU1_GP_HIGH_IRQ, RPM_SCSS_CPU1_GP_MEDIUM_IRQ, RPM_SCSS_CPU1_GP_LOW_IRQ, RPM_SCSS_CPU1_WAKE_UP_IRQ, MARM_SCSS_GP_IRQ_0, MARM_SCSS_GP_IRQ_1, MARM_SCSS_GP_IRQ_2, MARM_SCSS_GP_IRQ_3, MARM_SCSS_GP_IRQ_4, MARM_SCSS_GP_IRQ_5, MARM_SCSS_GP_IRQ_6, MARM_SCSS_GP_IRQ_7, MARM_SCSS_GP_IRQ_8, MARM_SCSS_GP_IRQ_9, LPASS_SCSS_GP_LOW_IRQ, LPASS_SCSS_GP_MEDIUM_IRQ, LPASS_SCSS_GP_HIGH_IRQ, SDC4_IRQ_0, SPS_MTI_31, }; struct msm_mpm_device_data msm_mpm_dev_data = { .irqs_m2a = msm_mpm_irqs_m2a, .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a), .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs, .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs), .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8, .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8, .mpm_apps_ipc_reg = MSM_GCC_BASE + 0x008, .mpm_apps_ipc_val = BIT(1), .mpm_ipc_irq = RPM_SCSS_CPU0_GP_MEDIUM_IRQ, }; #endif #ifdef CONFIG_MSM_BUS_SCALING struct platform_device msm_bus_sys_fabric = { .name = "msm_bus_fabric", .id = MSM_BUS_FAB_SYSTEM, }; struct platform_device msm_bus_apps_fabric = { .name = "msm_bus_fabric", .id = MSM_BUS_FAB_APPSS, }; struct platform_device msm_bus_mm_fabric = { .name = "msm_bus_fabric", .id = MSM_BUS_FAB_MMSS, }; struct platform_device msm_bus_sys_fpb = { .name = "msm_bus_fabric", .id = MSM_BUS_FAB_SYSTEM_FPB, }; struct platform_device msm_bus_cpss_fpb = { .name = "msm_bus_fabric", .id = MSM_BUS_FAB_CPSS_FPB, }; #endif #ifdef CONFIG_SND_SOC_MSM8660_APQ struct platform_device msm_pcm = { .name = "msm-pcm-dsp", .id = -1, }; struct platform_device msm_pcm_routing = { .name = "msm-pcm-routing", .id = -1, }; struct platform_device msm_cpudai0 = { .name = "msm-dai-q6", .id = PRIMARY_I2S_RX, }; struct platform_device msm_cpudai1 = { .name = "msm-dai-q6", .id = PRIMARY_I2S_TX, }; struct platform_device msm_cpudai_hdmi_rx = { .name = "msm-dai-q6", .id = HDMI_RX, }; struct platform_device msm_cpudai_bt_rx = { .name = "msm-dai-q6", .id = INT_BT_SCO_RX, }; struct platform_device msm_cpudai_bt_tx = { .name = "msm-dai-q6", .id = INT_BT_SCO_TX, }; struct platform_device msm_cpudai_fm_rx = { .name = "msm-dai-q6", .id = INT_FM_RX, }; struct platform_device msm_cpudai_fm_tx = { .name = "msm-dai-q6", .id = INT_FM_TX, }; struct platform_device msm_cpu_fe = { .name = "msm-dai-fe", .id = -1, }; struct platform_device msm_stub_codec = { .name = "msm-stub-codec", .id = 1, }; struct platform_device msm_voice = { .name = "msm-pcm-voice", .id = -1, }; struct platform_device msm_voip = { .name = "msm-voip-dsp", .id = -1, }; struct platform_device msm_lpa_pcm = { .name = "msm-pcm-lpa", .id = -1, }; struct platform_device msm_pcm_hostless = { .name = "msm-pcm-hostless", .id = -1, }; #endif struct platform_device asoc_msm_pcm = { .name = "msm-dsp-audio", .id = 0, }; struct platform_device asoc_msm_dai0 = { .name = "msm-codec-dai", .id = 0, }; struct platform_device asoc_msm_dai1 = { .name = "msm-cpu-dai", .id = 0, }; #if defined (CONFIG_MSM_8x60_VOIP) struct platform_device asoc_msm_mvs = { .name = "msm-mvs-audio", .id = 0, }; struct platform_device asoc_mvs_dai0 = { .name = "mvs-codec-dai", .id = 0, }; struct platform_device asoc_mvs_dai1 = { .name = "mvs-cpu-dai", .id = 0, }; #endif struct platform_device *msm_footswitch_devices[] = { FS_8X60(FS_IJPEG, "fs_ijpeg"), FS_8X60(FS_MDP, "fs_mdp"), FS_8X60(FS_ROT, "fs_rot"), FS_8X60(FS_VED, "fs_ved"), FS_8X60(FS_VFE, "fs_vfe"), FS_8X60(FS_VPE, "fs_vpe"), FS_8X60(FS_GFX3D, "fs_gfx3d"), FS_8X60(FS_GFX2D0, "fs_gfx2d0"), FS_8X60(FS_GFX2D1, "fs_gfx2d1"), }; unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices); #ifdef CONFIG_MSM_RPM struct msm_rpm_map_data rpm_map_data[] __initdata = { MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1), MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1), MSM_RPM_MAP(TRIGGER_SET_FROM, TRIGGER_SET, 1), MSM_RPM_MAP(TRIGGER_SET_TO, TRIGGER_SET, 1), MSM_RPM_MAP(TRIGGER_SET_TRIGGER, TRIGGER_SET, 1), MSM_RPM_MAP(TRIGGER_CLEAR_FROM, TRIGGER_CLEAR, 1), MSM_RPM_MAP(TRIGGER_CLEAR_TO, TRIGGER_CLEAR, 1), MSM_RPM_MAP(TRIGGER_CLEAR_TRIGGER, TRIGGER_CLEAR, 1), MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1), MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1), MSM_RPM_MAP(PLL_4, PLL_4, 1), MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1), MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1), MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1), MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1), MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1), MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1), MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1), MSM_RPM_MAP(SMI_CLK, SMI_CLK, 1), MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1), MSM_RPM_MAP(APPS_L2_CACHE_CTL, APPS_L2_CACHE_CTL, 1), MSM_RPM_MAP(APPS_FABRIC_HALT_0, APPS_FABRIC_HALT, 2), MSM_RPM_MAP(APPS_FABRIC_CLOCK_MODE_0, APPS_FABRIC_CLOCK_MODE, 3), MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6), MSM_RPM_MAP(SYSTEM_FABRIC_HALT_0, SYSTEM_FABRIC_HALT, 2), MSM_RPM_MAP(SYSTEM_FABRIC_CLOCK_MODE_0, SYSTEM_FABRIC_CLOCK_MODE, 3), MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 22), MSM_RPM_MAP(MM_FABRIC_HALT_0, MM_FABRIC_HALT, 2), MSM_RPM_MAP(MM_FABRIC_CLOCK_MODE_0, MM_FABRIC_CLOCK_MODE, 3), MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23), MSM_RPM_MAP(SMPS0B_0, SMPS0B, 2), MSM_RPM_MAP(SMPS1B_0, SMPS1B, 2), MSM_RPM_MAP(SMPS2B_0, SMPS2B, 2), MSM_RPM_MAP(SMPS3B_0, SMPS3B, 2), MSM_RPM_MAP(SMPS4B_0, SMPS4B, 2), MSM_RPM_MAP(LDO0B_0, LDO0B, 2), MSM_RPM_MAP(LDO1B_0, LDO1B, 2), MSM_RPM_MAP(LDO2B_0, LDO2B, 2), MSM_RPM_MAP(LDO3B_0, LDO3B, 2), MSM_RPM_MAP(LDO4B_0, LDO4B, 2), MSM_RPM_MAP(LDO5B_0, LDO5B, 2), MSM_RPM_MAP(LDO6B_0, LDO6B, 2), MSM_RPM_MAP(LVS0B, LVS0B, 1), MSM_RPM_MAP(LVS1B, LVS1B, 1), MSM_RPM_MAP(LVS2B, LVS2B, 1), MSM_RPM_MAP(LVS3B, LVS3B, 1), MSM_RPM_MAP(MVS, MVS, 1), MSM_RPM_MAP(SMPS0_0, SMPS0, 2), MSM_RPM_MAP(SMPS1_0, SMPS1, 2), MSM_RPM_MAP(SMPS2_0, SMPS2, 2), MSM_RPM_MAP(SMPS3_0, SMPS3, 2), MSM_RPM_MAP(SMPS4_0, SMPS4, 2), MSM_RPM_MAP(LDO0_0, LDO0, 2), MSM_RPM_MAP(LDO1_0, LDO1, 2), MSM_RPM_MAP(LDO2_0, LDO2, 2), MSM_RPM_MAP(LDO3_0, LDO3, 2), MSM_RPM_MAP(LDO4_0, LDO4, 2), MSM_RPM_MAP(LDO5_0, LDO5, 2), MSM_RPM_MAP(LDO6_0, LDO6, 2), MSM_RPM_MAP(LDO7_0, LDO7, 2), MSM_RPM_MAP(LDO8_0, LDO8, 2), MSM_RPM_MAP(LDO9_0, LDO9, 2), MSM_RPM_MAP(LDO10_0, LDO10, 2), MSM_RPM_MAP(LDO11_0, LDO11, 2), MSM_RPM_MAP(LDO12_0, LDO12, 2), MSM_RPM_MAP(LDO13_0, LDO13, 2), MSM_RPM_MAP(LDO14_0, LDO14, 2), MSM_RPM_MAP(LDO15_0, LDO15, 2), MSM_RPM_MAP(LDO16_0, LDO16, 2), MSM_RPM_MAP(LDO17_0, LDO17, 2), MSM_RPM_MAP(LDO18_0, LDO18, 2), MSM_RPM_MAP(LDO19_0, LDO19, 2), MSM_RPM_MAP(LDO20_0, LDO20, 2), MSM_RPM_MAP(LDO21_0, LDO21, 2), MSM_RPM_MAP(LDO22_0, LDO22, 2), MSM_RPM_MAP(LDO23_0, LDO23, 2), MSM_RPM_MAP(LDO24_0, LDO24, 2), MSM_RPM_MAP(LDO25_0, LDO25, 2), MSM_RPM_MAP(LVS0, LVS0, 1), MSM_RPM_MAP(LVS1, LVS1, 1), MSM_RPM_MAP(NCP_0, NCP, 2), MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1), }; unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data); struct platform_device msm_rpm_device = { .name = "msm_rpm", .id = -1, }; #endif
dekadev/Deka-kernel-CM10.1-3.0
arch/arm/mach-msm/devices-msm8x60.c
C
gpl-2.0
58,880
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2230, 1011, 2262, 1010, 3642, 13158, 7057, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "qemu-common.h" #include "qemu-option.h" #include "qemu-config.h" #include "sysemu.h" QemuOptsList qemu_drive_opts = { .name = "drive", .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), .desc = { { .name = "bus", .type = QEMU_OPT_NUMBER, .help = "bus number", },{ .name = "unit", .type = QEMU_OPT_NUMBER, .help = "unit number (i.e. lun for scsi)", },{ .name = "if", .type = QEMU_OPT_STRING, .help = "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", },{ .name = "index", .type = QEMU_OPT_NUMBER, },{ .name = "cyls", .type = QEMU_OPT_NUMBER, .help = "number of cylinders (ide disk geometry)", },{ .name = "heads", .type = QEMU_OPT_NUMBER, .help = "number of heads (ide disk geometry)", },{ .name = "secs", .type = QEMU_OPT_NUMBER, .help = "number of sectors (ide disk geometry)", },{ .name = "trans", .type = QEMU_OPT_STRING, .help = "chs translation (auto, lba. none)", },{ .name = "media", .type = QEMU_OPT_STRING, .help = "media type (disk, cdrom)", },{ .name = "snapshot", .type = QEMU_OPT_BOOL, },{ .name = "file", .type = QEMU_OPT_STRING, .help = "disk image", },{ .name = "cache", .type = QEMU_OPT_STRING, .help = "host cache usage (none, writeback, writethrough)", },{ .name = "aio", .type = QEMU_OPT_STRING, .help = "host AIO implementation (threads, native)", },{ .name = "format", .type = QEMU_OPT_STRING, .help = "disk format (raw, qcow2, ...)", },{ .name = "serial", .type = QEMU_OPT_STRING, },{ .name = "werror", .type = QEMU_OPT_STRING, },{ .name = "addr", .type = QEMU_OPT_STRING, .help = "pci address (virtio only)", },{ .name = "boot", .type = QEMU_OPT_BOOL, .help = "make this a boot drive", }, { /* end if list */ } }, }; QemuOptsList qemu_chardev_opts = { .name = "chardev", .head = QTAILQ_HEAD_INITIALIZER(qemu_chardev_opts.head), .desc = { { .name = "backend", .type = QEMU_OPT_STRING, },{ .name = "path", .type = QEMU_OPT_STRING, },{ .name = "host", .type = QEMU_OPT_STRING, },{ .name = "port", .type = QEMU_OPT_STRING, },{ .name = "localaddr", .type = QEMU_OPT_STRING, },{ .name = "localport", .type = QEMU_OPT_STRING, },{ .name = "to", .type = QEMU_OPT_NUMBER, },{ .name = "ipv4", .type = QEMU_OPT_BOOL, },{ .name = "ipv6", .type = QEMU_OPT_BOOL, },{ .name = "wait", .type = QEMU_OPT_BOOL, },{ .name = "server", .type = QEMU_OPT_BOOL, },{ .name = "delay", .type = QEMU_OPT_BOOL, },{ .name = "telnet", .type = QEMU_OPT_BOOL, },{ .name = "width", .type = QEMU_OPT_NUMBER, },{ .name = "height", .type = QEMU_OPT_NUMBER, },{ .name = "cols", .type = QEMU_OPT_NUMBER, },{ .name = "rows", .type = QEMU_OPT_NUMBER, },{ .name = "mux", .type = QEMU_OPT_BOOL, }, { /* end if list */ } }, }; QemuOptsList qemu_device_opts = { .name = "device", .head = QTAILQ_HEAD_INITIALIZER(qemu_device_opts.head), .desc = { /* * no elements => accept any * sanity checking will happen later * when setting device properties */ { /* end if list */ } }, }; QemuOptsList qemu_net_opts = { .name = "net", .head = QTAILQ_HEAD_INITIALIZER(qemu_net_opts.head), .desc = { /* * no elements => accept any params * validation will happen later */ { /* end of list */ } }, }; QemuOptsList qemu_rtc_opts = { .name = "rtc", .head = QTAILQ_HEAD_INITIALIZER(qemu_rtc_opts.head), .desc = { { .name = "base", .type = QEMU_OPT_STRING, },{ .name = "clock", .type = QEMU_OPT_STRING, #ifdef TARGET_I386 },{ .name = "driftfix", .type = QEMU_OPT_STRING, #endif }, { /* end if list */ } }, }; static QemuOptsList *lists[] = { &qemu_drive_opts, &qemu_chardev_opts, &qemu_device_opts, &qemu_net_opts, &qemu_rtc_opts, NULL, }; int qemu_set_option(const char *str) { char group[64], id[64], arg[64]; QemuOpts *opts; int i, rc, offset; rc = sscanf(str, "%63[^.].%63[^.].%63[^=]%n", group, id, arg, &offset); if (rc < 3 || str[offset] != '=') { qemu_error("can't parse: \"%s\"\n", str); return -1; } for (i = 0; lists[i] != NULL; i++) { if (strcmp(lists[i]->name, group) == 0) break; } if (lists[i] == NULL) { qemu_error("there is no option group \"%s\"\n", group); return -1; } opts = qemu_opts_find(lists[i], id); if (!opts) { qemu_error("there is no %s \"%s\" defined\n", lists[i]->name, id); return -1; } if (qemu_opt_set(opts, arg, str+offset+1) == -1) { return -1; } return 0; }
aidanshribman/qemu-kvm
qemu-config.c
C
gpl-2.0
6,005
[ 30522, 1001, 2421, 1000, 1053, 6633, 2226, 1011, 2691, 1012, 1044, 1000, 1001, 2421, 1000, 1053, 6633, 2226, 1011, 5724, 1012, 1044, 1000, 1001, 2421, 1000, 1053, 6633, 2226, 1011, 9530, 8873, 2290, 1012, 1044, 1000, 1001, 2421, 1000, 253...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YuGiOh.Bot.Extensions { public static class StringJoinExtensions { public static string Join(this string[] strArray, char separator) => string.Join(separator, strArray); public static string Join(this string[] strArray, string separator) => string.Join(separator, strArray); public static string Join(this IEnumerable<string> strEnumerable, char separator) => string.Join(separator, strEnumerable); public static string Join(this IEnumerable<string> strEnumerable, string separator) => string.Join(separator, strEnumerable); public static string Join(this char[] strArray, char separator) => string.Join(separator, strArray); public static string Join(this char[] strArray, string separator) => string.Join(separator, strArray); public static string Join(this IEnumerable<char> strEnumerable, char separator) => string.Join(separator, strEnumerable); public static string Join(this IEnumerable<char> strEnumerable, string separator) => string.Join(separator, strEnumerable); } }
MeLikeChoco/YuGiOhBot
YuGiOh.Bot/Extensions/StringJoinExtensions.cs
C#
mit
1,290
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 3793, 1025, 2478, 2291, 1012, 11689, 2075, 1012, 8518, 1025, 3415, 15327, 9805, 11411, 2232, 1012, 28516, 1012, 14305...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post-haha title: Learn Python and Contribute to the DiPP Website! comments: true permalink: 2014-07-28-learn-python-and-contribute-to-the-dipp-website.md category: haha --- Hello lovelies, (1) This week's HaHa* is one not to be missed. If Jonathan's and my presence isn't enough of a draw, we'll also be teaching you intro data exploration in Python! We'll grab a few exercises from this book: <http://greenteapress.com/thinkstats/thinkstats.pdf>. To sum: Learn Python at HaHa, Wed. @ 6pm, Argo Tea at 16 W. Randolph (2) DiPP has a website! [Check us out](http://uc-dipp.github.io/) — aren't we looking pretty? +1,000 to last week's HaHa attendees for getting it off the ground. Jonathan and I may write your snarky weekly HaHa updates, but all of YOU are DiPP. So show your DiPP love and devotion by helping to build the website. It's built with Jekyll and Poole on GitHub: <https://github.com/uc-dipp/uc-dipp.github.io> If that means nothing to you, fear not. Just sign up for a free GitHub account, shoot me or Jonathan your username, and we'll add you to the project and give you some pointers on how to get started. If you can Google "how to change font colors in HTML," you can contribute. (3) DiPP has a Twitter: <http://twitter.com/uchicagodipp> Recently this thing called "my paying job" has gotten in the way of maintaining it as well I'd like, so please send me links! (4) If you've read this far, thanks so much. As your reward, here's a cute animal curated personally for you by the greatest cute-animals-on-the-Internet curator of all, Adriana Ciccone: <http://i.imgur.com/mC2nvAH.jpg> Thanks and see you Wednesday, Jonathan and Lara \* For those who don't read all their emails super closely, HaHa is the accepted alternative name for Hack Harris. All thanks go to Sarah Sajewski for the coining.
uc-dipp/uc-dipp.github.io
_posts/2014-07-28-learn-python-and-contribute-to-the-dipp-website.md
Markdown
mit
1,841
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 1011, 5292, 3270, 2516, 1024, 4553, 18750, 1998, 9002, 2000, 1996, 16510, 2361, 4037, 999, 7928, 1024, 2995, 2566, 9067, 19839, 1024, 2297, 1011, 5718, 1011, 2654, 1011, 4553, 1011, 18750, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using Hyak.Common; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.Rest; using Microsoft.Rest.Azure.Authentication; using System; using System.Linq; using System.Security; using Microsoft.Azure.Commands.Common.Authentication.Properties; namespace Microsoft.Azure.Commands.Common.Authentication.Factories { public class AuthenticationFactory : IAuthenticationFactory { public const string CommonAdTenant = "Common"; public AuthenticationFactory() { TokenProvider = new AdalTokenProvider(); } public ITokenProvider TokenProvider { get; set; } public IAccessToken Authenticate( IAzureAccount account, IAzureEnvironment environment, string tenant, SecureString password, string promptBehavior, Action<string> promptAction, IAzureTokenCache tokenCache, string resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId) { IAccessToken token; var cache = tokenCache as TokenCache; if (cache == null) { cache = TokenCache.DefaultShared; } var configuration = GetAdalConfiguration(environment, tenant, resourceId, cache); TracingAdapter.Information( Resources.AdalAuthConfigurationTrace, configuration.AdDomain, configuration.AdEndpoint, configuration.ClientId, configuration.ClientRedirectUri, configuration.ResourceClientUri, configuration.ValidateAuthority); if (account.IsPropertySet(AzureAccount.Property.CertificateThumbprint)) { var thumbprint = account.GetProperty(AzureAccount.Property.CertificateThumbprint); #if !NETSTANDARD token = TokenProvider.GetAccessTokenWithCertificate(configuration, account.Id, thumbprint, account.Type); #else throw new NotSupportedException("Certificate based authentication is not supported in netcore version."); #endif } else { token = TokenProvider.GetAccessToken(configuration, promptBehavior, promptAction, account.Id, password, account.Type); } account.Id = token.UserId; return token; } public IAccessToken Authenticate( IAzureAccount account, IAzureEnvironment environment, string tenant, SecureString password, string promptBehavior, Action<string> promptAction, string resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId) { return Authenticate( account, environment, tenant, password, promptBehavior, promptAction, AzureSession.Instance.TokenCache, resourceId); } public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(IAzureContext context) { return GetSubscriptionCloudCredentials(context, AzureEnvironment.Endpoint.ServiceManagement); } public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(IAzureContext context, string targetEndpoint) { if (context.Subscription == null) { var exceptionMessage = targetEndpoint == AzureEnvironment.Endpoint.ServiceManagement ? Resources.InvalidDefaultSubscription : Resources.NoSubscriptionInContext; throw new ApplicationException(exceptionMessage); } if (context.Account == null) { var exceptionMessage = targetEndpoint == AzureEnvironment.Endpoint.ServiceManagement ? Resources.AccountNotFound : Resources.ArmAccountNotFound; throw new ArgumentException(exceptionMessage); } if (context.Account.Type == AzureAccount.AccountType.Certificate) { var certificate = AzureSession.Instance.DataStore.GetCertificate(context.Account.Id); return new CertificateCloudCredentials(context.Subscription.Id.ToString(), certificate); } if (context.Account.Type == AzureAccount.AccountType.AccessToken) { return new TokenCloudCredentials(context.Subscription.Id.ToString(), context.Account.GetProperty(AzureAccount.Property.AccessToken)); } string tenant = null; if (context.Subscription != null && context.Account != null) { tenant = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants) .Intersect(context.Account.GetPropertyAsArray(AzureAccount.Property.Tenants)) .FirstOrDefault(); } if (tenant == null && context.Tenant != null && new Guid(context.Tenant.Id) != Guid.Empty) { tenant = context.Tenant.Id.ToString(); } if (tenant == null) { var exceptionMessage = targetEndpoint == AzureEnvironment.Endpoint.ServiceManagement ? Resources.TenantNotFound : Resources.NoTenantInContext; throw new ArgumentException(exceptionMessage); } try { var tokenCache = AzureSession.Instance.TokenCache; TracingAdapter.Information( Resources.UPNAuthenticationTrace, context.Account.Id, context.Environment.Name, tenant); if (context.TokenCache != null) { tokenCache = context.TokenCache; } var token = Authenticate( context.Account, context.Environment, tenant, null, ShowDialog.Never, null, tokenCache, context.Environment.GetTokenAudience(targetEndpoint)); TracingAdapter.Information( Resources.UPNAuthenticationTokenTrace, token.LoginType, token.TenantId, token.UserId); return new AccessTokenCredential(context.Subscription.GetId(), token); } catch (Exception ex) { TracingAdapter.Information(Resources.AdalAuthException, ex.Message); var exceptionMessage = targetEndpoint == AzureEnvironment.Endpoint.ServiceManagement ? Resources.InvalidSubscriptionState : Resources.InvalidArmContext; throw new ArgumentException(exceptionMessage, ex); } } public ServiceClientCredentials GetServiceClientCredentials(IAzureContext context) { return GetServiceClientCredentials(context, AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId); } public ServiceClientCredentials GetServiceClientCredentials(IAzureContext context, string targetEndpoint) { if (context.Account == null) { throw new ArgumentException(Resources.ArmAccountNotFound); } if (context.Account.Type == AzureAccount.AccountType.Certificate) { throw new NotSupportedException(AzureAccount.AccountType.Certificate.ToString()); } if (context.Account.Type == AzureAccount.AccountType.AccessToken) { return new TokenCredentials(context.Account.GetProperty(AzureAccount.Property.AccessToken)); } string tenant = null; if (context.Subscription != null && context.Account != null) { tenant = context.Subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants) .Intersect(context.Account.GetPropertyAsArray(AzureAccount.Property.Tenants)) .FirstOrDefault(); } if (tenant == null && context.Tenant != null && new Guid(context.Tenant.Id) != Guid.Empty) { tenant = context.Tenant.Id.ToString(); } if (tenant == null) { throw new ArgumentException(Resources.NoTenantInContext); } try { TracingAdapter.Information(Resources.UPNAuthenticationTrace, context.Account.Id, context.Environment.Name, tenant); // TODO: When we will refactor the code, need to add tracing /*TracingAdapter.Information(Resources.UPNAuthenticationTokenTrace, token.LoginType, token.TenantId, token.UserId);*/ var env = new ActiveDirectoryServiceSettings { AuthenticationEndpoint = context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ActiveDirectory), TokenAudience = context.Environment.GetEndpointAsUri(context.Environment.GetTokenAudience(targetEndpoint)), ValidateAuthority = !context.Environment.OnPremise }; var tokenCache = AzureSession.Instance.TokenCache; if (context.TokenCache != null) { tokenCache = context.TokenCache; } ServiceClientCredentials result = null; if (context.Account.Type == AzureAccount.AccountType.User) { result = Rest.Azure.Authentication.UserTokenProvider.CreateCredentialsFromCache( AdalConfiguration.PowerShellClientId, tenant, context.Account.Id, env, tokenCache as TokenCache).ConfigureAwait(false).GetAwaiter().GetResult(); } else if (context.Account.Type == AzureAccount.AccountType.ServicePrincipal) { if (context.Account.IsPropertySet(AzureAccount.Property.CertificateThumbprint)) { result = ApplicationTokenProvider.LoginSilentAsync( tenant, context.Account.Id, new CertificateApplicationCredentialProvider( context.Account.GetThumbprint()), env, tokenCache as TokenCache).ConfigureAwait(false).GetAwaiter().GetResult(); } else { result = ApplicationTokenProvider.LoginSilentAsync( tenant, context.Account.Id, new KeyStoreApplicationCredentialProvider(tenant), env, tokenCache as TokenCache).ConfigureAwait(false).GetAwaiter().GetResult(); } } else { throw new NotSupportedException(context.Account.Type.ToString()); } return result; } catch (Exception ex) { TracingAdapter.Information(Resources.AdalAuthException, ex.Message); throw new ArgumentException(Resources.InvalidArmContext, ex); } } private AdalConfiguration GetAdalConfiguration(IAzureEnvironment environment, string tenantId, string resourceId, TokenCache tokenCache) { if (environment == null) { throw new ArgumentNullException("environment"); } var adEndpoint = environment.ActiveDirectoryAuthority; if (null == adEndpoint) { throw new ArgumentOutOfRangeException( "environment", string.Format("No Active Directory endpoint specified for environment '{0}'", environment.Name)); } var audience = environment.GetEndpoint(resourceId); if (string.IsNullOrWhiteSpace(audience)) { string message = Resources.InvalidManagementTokenAudience; if (resourceId == AzureEnvironment.Endpoint.GraphEndpointResourceId) { message = Resources.InvalidGraphTokenAudience; } throw new ArgumentOutOfRangeException("environment", string.Format(message, environment.Name)); } return new AdalConfiguration { AdEndpoint = adEndpoint.ToString(), ResourceClientUri = environment.GetEndpoint(resourceId), AdDomain = tenantId, ValidateAuthority = !environment.OnPremise, TokenCache = tokenCache }; } } }
atpham256/azure-powershell
src/Common/Commands.Common.Authentication/Factories/AuthenticationFactory.cs
C#
apache-2.0
14,356
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.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/>. * */ /** * \file htdocs/product/stock/index.php * \ingroup stock * \brief Home page of stock area */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $langs->load("stocks"); // Security check $result=restrictedArea($user,'stock'); /* * View */ $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks'; llxHeader("",$langs->trans("Stocks"),$help_url); print_fiche_titre($langs->trans("StocksArea")); //print '<table border="0" width="100%" class="notopnoleftnoright">'; //print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<div class="fichecenter"><div class="fichethirdleft">'; /* * Zone recherche entrepot */ print '<form method="post" action="'.DOL_URL_ROOT.'/product/stock/liste.php">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<table class="noborder nohover" width="100%">'; print "<tr class=\"liste_titre\">"; print '<td colspan="3">'.$langs->trans("Search").'</td></tr>'; print "<tr ".$bc[false]."><td>"; print $langs->trans("Ref").':</td><td><input class="flat" type="text" size="18" name="sref"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; print "<tr ".$bc[false]."><td>".$langs->trans("Other").':</td><td><input type="text" name="sall" class="flat" size="18"></td>'; print "</table></form><br>"; $sql = "SELECT e.label, e.rowid, e.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity = ".$conf->entity; $sql.= $db->order('e.statut','DESC'); $sql.= $db->plimit(15, 0); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Warehouses").'</td></tr>'; if ($num) { $entrepot=new Entrepot($db); $var=True; while ($i < $num) { $objp = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; print "<td><a href=\"fiche.php?id=$objp->rowid\">".img_object($langs->trans("ShowStock"),"stock")." ".$objp->label."</a></td>\n"; print '<td align="right">'.$entrepot->LibStatut($objp->statut,5).'</td>'; print "</tr>\n"; $i++; } $db->free($result); } print "</table>"; } else { dol_print_error($db); } //print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; // Last movements $max=10; $sql = "SELECT p.rowid, p.label as produit,"; $sql.= " e.label as stock, e.rowid as entrepot_id,"; $sql.= " m.value, m.datem"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = e.rowid"; $sql.= " AND e.entity = ".$conf->entity; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; $sql.= $db->order("datem","DESC"); $sql.= $db->plimit($max,0); dol_syslog("Index:list stock movements sql=".$sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); print '<table class="noborder" width="100%">'; print "<tr class=\"liste_titre\">"; print '<td>'.$langs->trans("LastMovements",min($num,$max)).'</td>'; print '<td>'.$langs->trans("Product").'</td>'; print '<td>'.$langs->trans("Warehouse").'</td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php">'.$langs->trans("FullList").'</a></td>'; print "</tr>\n"; $var=True; $i=0; while ($i < min($num,$max)) { $objp = $db->fetch_object($resql); $var=!$var; print "<tr $bc[$var]>"; print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>'; print "<td><a href=\"../fiche.php?id=$objp->rowid\">"; print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit; print "</a></td>\n"; print '<td><a href="fiche.php?id='.$objp->entrepot_id.'">'; print img_object($langs->trans("ShowWarehouse"),"stock").' '.$objp->stock; print "</a></td>\n"; print '<td align="right">'; if ($objp->value > 0) print '+'; print $objp->value.'</td>'; print "</tr>\n"; $i++; } $db->free($resql); print "</table>"; } //print '</td></tr></table>'; print '</div></div></div>'; llxFooter(); $db->close(); ?>
jcntux/Dolibarr
htdocs/product/stock/index.php
PHP
gpl-3.0
5,429
[ 30522, 1026, 1029, 25718, 1013, 1008, 9385, 1006, 1039, 1007, 2494, 1011, 2294, 8473, 4747, 8458, 2063, 21864, 14728, 3077, 1026, 8473, 4747, 8458, 2063, 1030, 21864, 14728, 3077, 1012, 8917, 1028, 1008, 9385, 1006, 1039, 1007, 2432, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML> <html lang="en"> <head> <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400' rel='stylesheet' type='text/css'/> <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'/> <link href="css/pages_stylesheet.css" rel="stylesheet"/> <link href="css/lightbox.css" rel="stylesheet" /> <meta charset="UTF-8"> <title>User Personas</title> </head> <body> <div id="wrapper"> <div id="sidenav"> <a href="index.html"> <h2 class="inline" id="logo">a&amp;d&amp;h</h2> </a> <ul> <li><a href="usecase.html">Use Case</a></li> <li><a href="userpersonas.html">User Personas</a></li> <li><a href="companalysis.html">Competitive Analysis</a></li> <li><a href="decisions.html">Hardest Decisions</a></li> <li class="current-page"><a href="redesignconcept.html">Redesign Concept</a></li> <li><a href="home.html">Redesign</a></li> </ul> </div> <div id="main"> <h3 id="title">Redesign Concept</h3> <h2 id="description">REDESIGN. BRANDING. MINIMALISM.</h2> <p>We redesigned the University of Leicester's website using this new architecture/page structure. The fully fleshed out pages include the Home page, secondary level pages, and also the Facts page to show what a third level page looks like.</p> <p>The layout is consistent for secondary level pages, and we plan on having it be consistent within the third level pages as well.</p> <p>The brand that we are having the site convey is that Leicester is "elite without being elitist." We show that through the minimal design, while also highlighting the many awards the university has received.</p> <ul id="redesign-structure"> <li> <a href="home.html"><b>Home</b></a> <ul> <li> <a href="students.html"><p><b>Student - Guest</b></p></a> </li> <li> <a href="jeremy.html"><p><b>Students - Jeremy</b></p></a> </li> <li> <a href="login.html"><p><b>Students - login </b></p></a> </li> <li><p>Faculty/Staff</p></li> <li><p>Parents</p></li> <li><p>Alumni</p></li> </ul> </li> <li> <a href="about.html"><b>About</b></a> <ul> <li><a href="facts.html"><b>Facts</b></a></li> <li><p>History</p></li> <li><p>Principles</p></li> <li><p>Administration</p></li> <li><p>Visitor</p></li> </ul> </li> <li><a href="academics.html"><b>Academics</b></a> <ul> <li><p>Schools &amp; Colleges</p></li> <li><p>Graduate/Professional Programs</p></li> <li><p>International Programs</p></li> <li><p>Distance Learning</p></li> </ul> </li> <li><a href="research.html"><b>Research</b></a> <ul> <li><p>Research Institutes</p></li> <li><p>Office of Research</p></li> <li><p>Research Archive</p></li> </ul> </li> <li><a href="admissions.html"><b>Admissions</b></a> <ul> <li><p>Undergraduate</p></li> <li><p>Graduate</p></li> <li><p>Professional</p></li> <li><p>International Programs</p></li> <li><p>Distance Learning</p></li> </ul> </li> <li><a href="campuslife.html"><b>Campus Life</b></a> <ul> <li><p>Culture</p></li> <li><p>Recreation</p></li> <li><p>Health &amp; Safety</p></li> </ul> </li> </ul> <br><br> <br><br> </div> </div> <!-- jQuery + lightbox --> <script src="js/jquery-1.11.0.min.js"></script> <script src="js/lightbox.min.js"></script> <footer> <p>&copy; Andriana Romero, Dominic Fong, Helena Qin | 2014</p> </footer> </body> </html>
andrianabeltran/myportfolio
app/uofleicester/redesignconcept.html
HTML
unlicense
3,784
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 4957, 17850, 12879, 1027, 1005, 8299, 1024, 1013, 1013, 15489, 2015, 1012, 8224, 9331, 2483, 1012, 4012, 1013, 20116, 2015...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
export class Timer { /** * diff 2 `Date` in Millisecond * @param {Date} since * @param {Date} until */ static diff(since, until) { return (until.getTime() - since.getTime()); } constructor() { /** time elapsed in millisecond */ this.sum = 0; this.running = false; this.begin = new Date(0); } set(millisecond) { this.sum = Math.trunc(millisecond); if (this.running) { this.begin = new Date(); } } offset(offset) { const target = this.get() + Math.trunc(offset); this.set(target); } get() { if (!this.running) return this.sum; return this.sum + Timer.diff(this.begin, new Date()); } start() { if (!this.running) { this.running = true; this.begin = new Date(); } } stop() { if (this.running) { this.running = false; this.sum += Timer.diff(this.begin, new Date()); } } /** clear elapsed time, then start */ clear() { this.sum = 0; this.running = true; this.begin = new Date(); } /** clear elapsed time, but do __NOT__ start */ reset() { this.sum = 0; this.running = false; this.begin = new Date(0); } }
Rocket1184/electron-netease-cloud-music
src/main/mpris/timer.js
JavaScript
gpl-3.0
1,347
[ 30522, 9167, 2465, 25309, 1063, 1013, 1008, 1008, 1008, 4487, 4246, 1016, 1036, 3058, 1036, 1999, 4971, 5562, 8663, 2094, 1008, 1030, 11498, 2213, 1063, 3058, 1065, 2144, 1008, 1030, 11498, 2213, 1063, 3058, 1065, 2127, 1008, 1013, 10763, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//----------------------------------------------------------------------- // // mod parser::atom TEST // //----------------------------------------------------------------------- use super::Status; use super::{parse_dot, parse_eof, parse_literal, parse_match, MatchRules}; #[test] fn test_parse_literal_ok() { let rules = rules!{}; let status_init = Status::init("aaaaaaaaaaaaaaaa", &rules); let (status_end, _) = parse_literal(status_init, "aaa").ok().unwrap(); assert!(status_end.pos.col == 3); assert!(status_end.pos.n == 3); assert!(status_end.pos.row == 0); } #[test] fn test_parse_literal_ok2() { let rules = rules!{}; let status_init = Status::init("abcdefghij", &rules); let (status_end, _) = parse_literal(status_init, "abc").ok().unwrap(); assert_eq!(status_end.pos.col, 3); assert_eq!(status_end.pos.n, 3); assert_eq!(status_end.pos.row, 0); } #[test] fn test_parse_literal_fail() { let rules = rules!{}; let status_init = Status::init("abcdefghij", &rules); assert!(parse_literal(status_init, "bbb").is_err()); } #[test] fn test_parse_literal_fail2() { let rules = rules!{}; let status_init = Status::init("abcdefghij", &rules); assert!(parse_literal(status_init, "abd").is_err()); } #[test] fn test_parse_literal_fail_short_text2parse() { let rules = rules!{}; let status_init = Status::init("abcd", &rules); assert!(parse_literal(status_init, "abcdefghij").is_err()); } #[test] fn test_parse_literal_with_new_line() { let rules = rules!{}; let status_init = Status::init( "aa aaaaaaaaaaaaaa", &rules, ); let (status_end, _) = parse_literal( status_init, "aa a", ).ok() .unwrap(); assert!(status_end.pos.col == 1); assert!(status_end.pos.row == 1); } #[test] fn test_parse_dot() { let rules = rules!{}; let status = Status::init("ab", &rules); let (status, _) = parse_dot(status).ok().unwrap(); assert!(status.pos.col == 1); assert!(status.pos.n == 1); assert!(status.pos.row == 0); let (status, _) = parse_dot(status).ok().unwrap(); assert!(status.pos.col == 2); assert!(status.pos.n == 2); assert!(status.pos.row == 0); assert!(parse_dot(status).is_err()); } #[test] fn test_parse_match_ok() { let rules = rules!{}; let status = Status::init("a f0ghi", &rules); let match_rules = MatchRules::new().with_chars("54321ed_cba"); let (status, _) = parse_match(status, &match_rules).ok().unwrap(); assert_eq!(status.pos.col, 1); assert_eq!(status.pos.n, 1); assert_eq!(status.pos.row, 0); let (status, _) = parse_dot(status).ok().unwrap(); let match_rules = MatchRules::new().with_bound_chars(vec![('f', 'g'), ('h', 'j')]); let (status, _) = parse_match(status, &match_rules).ok().unwrap(); assert_eq!(status.pos.col, 3); assert_eq!(status.pos.n, 3); assert_eq!(status.pos.row, 0); assert!(parse_match(status, &match_rules).is_err()); } #[test] fn test_parse_match_err() { let rules = rules!{}; let status = Status::init("a9", &rules); let match_rules = MatchRules::new().with_chars("ed_cba"); let (status, _) = parse_match(status, &match_rules).ok().unwrap(); assert_eq!(status.pos.col, 1); assert_eq!(status.pos.n, 1); assert_eq!(status.pos.row, 0); let match_rules = MatchRules::new().with_bound_chars(vec![('a', 'z'), ('0', '8')]); assert!(parse_match(status, &match_rules).is_err()); } #[test] fn test_parse_match_eof_ok() { let rules = rules!{}; let status = Status::init("a", &rules); let match_rules = MatchRules::new().with_bound_chars(vec![('a', 'z'), ('0', '9')]); let (status, _) = parse_match(status, &match_rules).ok().unwrap(); assert!(parse_eof(status).is_ok()); } #[test] fn test_parse_match_eof_error() { let rules = rules!{}; let status = Status::init("ab", &rules); let match_rules = MatchRules::new().with_bound_chars(vec![('a', 'z'), ('0', '9')]); let (status, _) = parse_match(status, &match_rules).ok().unwrap(); assert!(parse_eof(status).is_err()); }
jleahred/dynparser
src/parser/atom/test.rs
Rust
gpl-3.0
4,142
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Rails.application.routes.draw do resources :tags root 'literatures#index' resources :poems resources :short_stories resources :authors end
brianvanburken/publisher-rails
config/routes.rb
Ruby
mit
149
[ 30522, 15168, 1012, 4646, 1012, 5847, 1012, 4009, 2079, 4219, 1024, 22073, 7117, 1005, 3906, 2015, 1001, 5950, 1005, 4219, 1024, 5878, 4219, 1024, 2460, 1035, 3441, 4219, 1024, 6048, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jsonp({"cep":"20775100","logradouro":"Rua Rio Grande do Sul","bairro":"M\u00e9ier","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
lfreneda/cepdb
api/v1/20775100.jsonp.js
JavaScript
cc0-1.0
148
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 19843, 23352, 18613, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 21766, 2050, 5673, 9026, 2079, 21396, 1000, 1010, 1000, 21790, 18933, 1000, 1024, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>goedel: 3 m 42 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+1 / goedel - 8.12.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> goedel <small> 8.12.0 <span class="label label-success">3 m 42 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-02-19 04:09:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-19 04:09:34 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;palmskog@gmail.com&quot; homepage: &quot;https://github.com/coq-community/goedel&quot; dev-repo: &quot;git+https://github.com/coq-community/goedel.git&quot; bug-reports: &quot;https://github.com/coq-community/goedel/issues&quot; license: &quot;MIT&quot; synopsis: &quot;Coq proof of the Gödel-Rosser 1st incompleteness theorem&quot; description: &quot;&quot;&quot; A proof in Coq of the Gödel-Rosser 1st incompleteness theorem, which says that any first order theory extending NN (which is PA without induction) that is complete is inconsistent.&quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.14~&quot;} &quot;coq-pocklington&quot; {&gt;= &quot;8.12&quot; &amp; &lt; &quot;8.13~&quot;} ] tags: [ &quot;category:Mathematics/Logic/Foundations&quot; &quot;keyword:Goedel&quot; &quot;keyword:Rosser&quot; &quot;keyword:incompleteness&quot; &quot;keyword:logic&quot; &quot;keyword:Hilbert&quot; &quot;logpath:Goedel&quot; &quot;date:2021-01-01&quot; ] authors: [ &quot;Russell O&#39;Connor&quot; ] url { src: &quot;https://github.com/coq-community/goedel/archive/v8.12.0.tar.gz&quot; checksum: &quot;sha512=778b7eacbb13574428cd6f1349d724c27b2859159a32316b19f3460d5a5495216fd24fe1ce2b6159b2d6322396cae6c27d8f3447e43bde1877e4cd2e1f523282&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-goedel.8.12.0 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-goedel.8.12.0 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>35 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-goedel.8.12.0 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>3 m 42 s</dd> </dl> <h2>Installation size</h2> <p>Total: 12 M</p> <ul> <li>1 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubFormula.glob</code></li> <li>1 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PRrepresentable.glob</code></li> <li>645 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/checkPrf.glob</code></li> <li>409 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subProp.glob</code></li> <li>373 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubFormula.vo</code></li> <li>363 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSysPrf.glob</code></li> <li>331 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PRrepresentable.vo</code></li> <li>258 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/checkPrf.vo</code></li> <li>238 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subProp.vo</code></li> <li>222 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosserPA.glob</code></li> <li>222 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subAll.glob</code></li> <li>201 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubFormula.v</code></li> <li>191 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/primRec.glob</code></li> <li>189 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProp.glob</code></li> <li>188 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PRrepresentable.v</code></li> <li>183 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wellFormed.glob</code></li> <li>164 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSysPrf.vo</code></li> <li>149 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/primRec.vo</code></li> <li>142 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/chRem.glob</code></li> <li>140 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeFreeVar.glob</code></li> <li>129 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codePA.glob</code></li> <li>126 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosserPA.vo</code></li> <li>118 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subAll.vo</code></li> <li>115 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/checkPrf.v</code></li> <li>112 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic3.glob</code></li> <li>108 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic3.vo</code></li> <li>107 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/cPair.glob</code></li> <li>107 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fol.glob</code></li> <li>106 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN2LNT.vo</code></li> <li>106 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProp.vo</code></li> <li>103 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosser.glob</code></li> <li>100 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/chRem.vo</code></li> <li>98 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fixPoint.glob</code></li> <li>96 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/model.vo</code></li> <li>96 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/model.glob</code></li> <li>94 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/code.vo</code></li> <li>92 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeList.glob</code></li> <li>92 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fol.vo</code></li> <li>89 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosser.vo</code></li> <li>88 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN2LNT.glob</code></li> <li>81 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAtheory.glob</code></li> <li>81 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codePA.vo</code></li> <li>79 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wellFormed.vo</code></li> <li>74 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subProp.v</code></li> <li>74 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/cPair.vo</code></li> <li>73 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubTerm.glob</code></li> <li>73 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PA.vo</code></li> <li>65 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fixPoint.vo</code></li> <li>64 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSysPrf.v</code></li> <li>64 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN.vo</code></li> <li>63 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNT.vo</code></li> <li>62 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAtheory.vo</code></li> <li>60 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic.glob</code></li> <li>60 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeFreeVar.vo</code></li> <li>56 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/code.glob</code></li> <li>54 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic.vo</code></li> <li>53 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel1.vo</code></li> <li>50 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel2.vo</code></li> <li>50 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeList.vo</code></li> <li>49 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/primRec.v</code></li> <li>48 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN.glob</code></li> <li>48 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosserPA.v</code></li> <li>46 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic2.glob</code></li> <li>46 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubTerm.vo</code></li> <li>44 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNT.glob</code></li> <li>44 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN.vo</code></li> <li>44 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/expressible.vo</code></li> <li>44 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/subAll.v</code></li> <li>43 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Languages.vo</code></li> <li>43 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProof.vo</code></li> <li>43 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic2.vo</code></li> <li>41 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Deduction.vo</code></li> <li>40 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folReplace.glob</code></li> <li>39 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NNtheory.vo</code></li> <li>38 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAconsistent.vo</code></li> <li>36 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folReplace.vo</code></li> <li>36 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PA.glob</code></li> <li>35 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel1.glob</code></li> <li>34 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN2PA.vo</code></li> <li>33 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wConsistent.vo</code></li> <li>32 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeNatToTerm.vo</code></li> <li>30 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wellFormed.v</code></li> <li>29 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/prLogic.vo</code></li> <li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/chRem.v</code></li> <li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProp.v</code></li> <li>27 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/extEqualNat.vo</code></li> <li>26 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codePA.v</code></li> <li>26 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NNtheory.glob</code></li> <li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN.glob</code></li> <li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/expressible.glob</code></li> <li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel2.glob</code></li> <li>23 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/rosser.v</code></li> <li>23 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeFreeVar.v</code></li> <li>22 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN2LNT.v</code></li> <li>22 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/cPair.v</code></li> <li>21 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fol.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/fixPoint.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic3.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/model.v</code></li> <li>18 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/ListExt.vo</code></li> <li>17 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeList.v</code></li> <li>17 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Deduction.glob</code></li> <li>16 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Languages.glob</code></li> <li>15 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAtheory.v</code></li> <li>15 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProof.glob</code></li> <li>13 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic.v</code></li> <li>12 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeSubTerm.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNN.v</code></li> <li>10 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/code.v</code></li> <li>10 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/LNT.v</code></li> <li>10 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PA.v</code></li> <li>9 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAconsistent.glob</code></li> <li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN2PA.glob</code></li> <li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel1.v</code></li> <li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/ListExt.glob</code></li> <li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN.v</code></li> <li>7 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/goedel2.v</code></li> <li>7 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folLogic2.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/expressible.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wConsistent.glob</code></li> <li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folReplace.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NNtheory.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeNatToTerm.glob</code></li> <li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Languages.v</code></li> <li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/Deduction.v</code></li> <li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/extEqualNat.glob</code></li> <li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/misc.glob</code></li> <li>3 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/misc.vo</code></li> <li>3 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/folProof.v</code></li> <li>3 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/PAconsistent.v</code></li> <li>3 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/NN2PA.v</code></li> <li>2 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/prLogic.glob</code></li> <li>2 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/ListExt.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/codeNatToTerm.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/extEqualNat.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/wConsistent.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/misc.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Goedel/prLogic.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-goedel.8.12.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.05.0-2.0.1/released/8.7.1+1/goedel/8.12.0.html
HTML
mit
22,338
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php class Article extends CActiveRecord { public static function model($className = __CLASS__) { return parent::model($className); } public function tableName() { return 'article'; } public function rules() { return array( array('article_title,article_type,article_content,status,article_author','required'), ); } } ?>
lz1988/yiiblog
web/protected/adminweb/models/Article.php
PHP
apache-2.0
363
[ 30522, 1026, 1029, 25718, 2465, 3720, 8908, 6187, 15277, 2890, 27108, 2094, 1063, 2270, 10763, 3853, 2944, 1006, 1002, 2465, 18442, 1027, 1035, 1035, 2465, 1035, 1035, 1007, 1063, 2709, 6687, 1024, 1024, 2944, 1006, 1002, 2465, 18442, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * CompraingredienteFixture * */ class CompraingredienteFixture extends CakeTestFixture { /** * Fields * * @var array */ public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), 'resto_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false), 'restosurcusale_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false), 'proveedore_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false), 'compratipopago_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false), 'fecha_compra' => array('type' => 'date', 'null' => false, 'default' => null), 'fecha_vencimiento' => array('type' => 'date', 'null' => false, 'default' => null), 'num_factura' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'latin1_swedish_ci', 'charset' => 'latin1'), 'observaciones' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'latin1_swedish_ci', 'charset' => 'latin1'), 'created' => array('type' => 'datetime', 'null' => false, 'default' => null), 'modified' => array('type' => 'datetime', 'null' => false, 'default' => null), 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1) ), 'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'InnoDB') ); /** * Records * * @var array */ public $records = array( array( 'id' => 1, 'resto_id' => 1, 'restosurcusale_id' => 1, 'proveedore_id' => 1, 'compratipopago_id' => 1, 'fecha_compra' => '2017-01-20', 'fecha_vencimiento' => '2017-01-20', 'num_factura' => 'Lorem ipsum dolor sit amet', 'observaciones' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'created' => '2017-01-20 15:51:45', 'modified' => '2017-01-20 15:51:45' ), ); }
kster007/CUBETECH-SOLTERA
app/Test/Fixture/CompraingredienteFixture.php
PHP
mit
2,307
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 4012, 18098, 8113, 17603, 10265, 10111, 8873, 18413, 5397, 1008, 1008, 1013, 2465, 4012, 18098, 8113, 17603, 10265, 10111, 8873, 18413, 5397, 8908, 9850, 22199, 8873, 18413, 5397, 1063, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class block3{ static{ main(null); } public static void main(String []args){ System.out.println("main method"); } }
yugandar/javatask
30jun/block3.java
Java
mit
131
[ 30522, 2465, 3796, 2509, 1063, 10763, 1063, 2364, 1006, 19701, 1007, 1025, 1065, 2270, 10763, 11675, 2364, 1006, 5164, 1031, 1033, 12098, 5620, 1007, 1063, 2291, 1012, 2041, 1012, 6140, 19666, 1006, 1000, 2364, 4118, 1000, 1007, 1025, 1065,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import AddLearningToStoryDescription from '../../../../src/content_scripts/pivotal_tracker/use_cases/add_learning_to_story_description' import WWLTWRepository from '../../../../src/content_scripts/repositories/wwltw_repository'; import StoryTitleProvider from '../../../../src/content_scripts/utilities/story_title_provider'; import ProjectIdProvider from '../../../../src/content_scripts/utilities/project_id_provider'; describe('AddLearningToStoryDescription', function () { let wwltwRepositorySpy; let foundStory; let execute; const projectId = 'some project id'; const storyTitle = 'some story title'; beforeEach(function () { wwltwRepositorySpy = new WWLTWRepository(); foundStory = {id: '1234'}; spyOn(chrome.runtime, 'sendMessage'); spyOn(wwltwRepositorySpy, 'findByTitle').and.returnValue(Promise.resolve([foundStory])); spyOn(wwltwRepositorySpy, 'update').and.returnValue(Promise.resolve()); spyOn(StoryTitleProvider, 'currentStoryTitle').and.returnValue(storyTitle); spyOn(ProjectIdProvider, 'getProjectId').and.returnValue(projectId); const useCase = new AddLearningToStoryDescription(wwltwRepositorySpy); execute = useCase.execute; }); describe('execute', function () { describe('when called outside of AddLearningToStoryDescription instance', function () { it('finds the story', function () { execute('some tag, some other tag', 'some body'); expect(wwltwRepositorySpy.findByTitle).toHaveBeenCalledWith( projectId, storyTitle ); }); it('sends analytics data', function () { execute(); expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ eventType: 'submit' }); }); it('updates the found story', function (done) { const body = 'some body'; const tags = 'some tag, some other tag'; execute(tags, body).then(function () { expect(wwltwRepositorySpy.update).toHaveBeenCalledWith( projectId, foundStory, tags, body ); done(); }); }); }); }); });
oliverswitzer/wwltw-for-pivotal-tracker
test/content_scripts/pivotal_tracker/use_cases/add_learning_to_story_description_spec.js
JavaScript
isc
2,332
[ 30522, 12324, 5587, 19738, 6826, 2075, 13122, 7062, 6155, 23235, 3258, 2013, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 5034, 2278, 1013, 4180, 1035, 14546, 1013, 20369, 1035, 27080, 1013, 2224, 1035, 3572...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * tegra210_peq_alt.c - Tegra210 PEQ driver * * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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 <linux/clk.h> #include <linux/device.h> #include <linux/io.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <linux/pinctrl/consumer.h> #include <linux/of_device.h> #include "tegra210_xbar_alt.h" #include "tegra210_ope_alt.h" #include "tegra210_peq_alt.h" static const struct reg_default tegra210_peq_reg_defaults[] = { { TEGRA210_PEQ_CONFIG, 0x00000013}, { TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL, 0x00004000}, { TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL, 0x00004000}, }; /* Default PEQ filter parameters for a 5-stage biquad*/ static const int biquad_init_stage = 5; static const u32 biquad_init_gains[TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH] = { 1495012349, /* pre-gain */ /* Gains : b0, b1, a0, a1, a2 */ 536870912, -1073741824, 536870912, 2143508246, -1069773768, /* band-0 */ 134217728, -265414508, 131766272, 2140402222, -1071252997, /* band-1 */ 268435456, -233515765, -33935948, 1839817267, -773826124, /* band-2 */ 536870912, -672537913, 139851540, 1886437554, -824433167, /* band-3 */ 268435456, -114439279, 173723964, 205743566, 278809729, /* band-4 */ 1, 0, 0, 0, 0, /* band-5 */ 1, 0, 0, 0, 0, /* band-6 */ 1, 0, 0, 0, 0, /* band-7 */ 1, 0, 0, 0, 0, /* band-8 */ 1, 0, 0, 0, 0, /* band-9 */ 1, 0, 0, 0, 0, /* band-10 */ 1, 0, 0, 0, 0, /* band-11 */ 963423114, /* post-gain */ }; static const u32 biquad_init_shifts[TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH] = { 23, /* pre-shift */ 30, 30, 30, 30, 30, 0, 0, 0, 0, 0, 0, 0, /* shift for bands */ 28, /* post-shift */ }; static int tegra210_peq_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct tegra210_ope *ope = snd_soc_codec_get_drvdata(codec); unsigned int mask = (1 << fls(mc->max)) - 1; unsigned int val; regmap_read(ope->peq_regmap, mc->reg, &val); ucontrol->value.integer.value[0] = (val >> mc->shift) & mask; if (mc->invert) ucontrol->value.integer.value[0] = mc->max - ucontrol->value.integer.value[0]; return 0; } static int tegra210_peq_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct tegra210_ope *ope = snd_soc_codec_get_drvdata(codec); unsigned int mask = (1 << fls(mc->max)) - 1; unsigned int val; val = (ucontrol->value.integer.value[0] & mask); if (mc->invert) val = mc->max - val; val = val << mc->shift; return regmap_update_bits(ope->peq_regmap, mc->reg, (mask << mc->shift), val); } static int tegra210_peq_ahub_ram_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct tegra_soc_bytes *params = (void *)kcontrol->private_value; struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); u32 *data = (u32 *)ucontrol->value.bytes.data; memset(data, 0, params->soc.num_regs * codec->val_bytes); return 0; } static int tegra210_peq_ahub_ram_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct tegra_soc_bytes *params = (void *)kcontrol->private_value; struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct tegra210_ope *ope = snd_soc_codec_get_drvdata(codec); u32 reg_ctrl = params->soc.base; u32 reg_data = reg_ctrl + codec->val_bytes; u32 *data = (u32 *)ucontrol->value.bytes.data; tegra210_xbar_write_ahubram(ope->peq_regmap, reg_ctrl, reg_data, params->shift, data, params->soc.num_regs); return 0; } #define TEGRA210_PEQ_GAIN_PARAMS_CTRL(chan) \ TEGRA_SOC_BYTES_EXT("peq channel" #chan " biquad gain params", \ TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL, \ TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH, \ (TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH * chan), 0xffffffff, \ tegra210_peq_ahub_ram_get, tegra210_peq_ahub_ram_put) #define TEGRA210_PEQ_SHIFT_PARAMS_CTRL(chan) \ TEGRA_SOC_BYTES_EXT("peq channel" #chan " biquad shift params", \ TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL, \ TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH, \ (TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH * chan), 0x1f, \ tegra210_peq_ahub_ram_get, tegra210_peq_ahub_ram_put) static const struct snd_kcontrol_new tegra210_peq_controls[] = { SOC_SINGLE_EXT("peq active", TEGRA210_PEQ_CONFIG, TEGRA210_PEQ_CONFIG_MODE_SHIFT, 1, 0, tegra210_peq_get, tegra210_peq_put), SOC_SINGLE_EXT("peq biquad stages", TEGRA210_PEQ_CONFIG, TEGRA210_PEQ_CONFIG_BIQUAD_STAGES_SHIFT, TEGRA210_PEQ_MAX_BIQUAD_STAGES - 1, 0, tegra210_peq_get, tegra210_peq_put), TEGRA210_PEQ_GAIN_PARAMS_CTRL(0), TEGRA210_PEQ_GAIN_PARAMS_CTRL(1), TEGRA210_PEQ_SHIFT_PARAMS_CTRL(0), TEGRA210_PEQ_SHIFT_PARAMS_CTRL(1), }; static bool tegra210_peq_wr_reg(struct device *dev, unsigned int reg) { switch (reg) { case TEGRA210_PEQ_SOFT_RESET: case TEGRA210_PEQ_CG: case TEGRA210_PEQ_CONFIG: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_DATA: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA: return true; default: return false; }; } static bool tegra210_peq_rd_reg(struct device *dev, unsigned int reg) { switch (reg) { case TEGRA210_PEQ_SOFT_RESET: case TEGRA210_PEQ_CG: case TEGRA210_PEQ_STATUS: case TEGRA210_PEQ_CONFIG: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_DATA: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA: return true; default: return false; }; } static bool tegra210_peq_volatile_reg(struct device *dev, unsigned int reg) { switch (reg) { case TEGRA210_PEQ_SOFT_RESET: case TEGRA210_PEQ_STATUS: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_DATA: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA: return true; default: return false; }; } static bool tegra210_peq_precious_reg(struct device *dev, unsigned int reg) { switch (reg) { case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_DATA: case TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA: return true; default: return false; }; } static const struct regmap_config tegra210_peq_regmap_config = { .name = "peq", .reg_bits = 32, .reg_stride = 4, .val_bits = 32, .max_register = TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA, .writeable_reg = tegra210_peq_wr_reg, .readable_reg = tegra210_peq_rd_reg, .volatile_reg = tegra210_peq_volatile_reg, .precious_reg = tegra210_peq_precious_reg, .reg_defaults = tegra210_peq_reg_defaults, .num_reg_defaults = ARRAY_SIZE(tegra210_peq_reg_defaults), .cache_type = REGCACHE_FLAT, }; int tegra210_peq_codec_init(struct snd_soc_codec *codec) { struct tegra210_ope *ope = snd_soc_codec_get_drvdata(codec); int i = 0; pm_runtime_get_sync(codec->dev); regmap_update_bits(ope->peq_regmap, TEGRA210_PEQ_CONFIG, TEGRA210_PEQ_CONFIG_MODE_MASK, 0 << TEGRA210_PEQ_CONFIG_MODE_SHIFT); regmap_update_bits(ope->peq_regmap, TEGRA210_PEQ_CONFIG, TEGRA210_PEQ_CONfIG_BIQUAD_STAGES_MASK, (biquad_init_stage - 1) << TEGRA210_PEQ_CONFIG_BIQUAD_STAGES_SHIFT); /* Initialize PEQ AHUB RAM with default params */ for (i = 0; i < TEGRA210_PEQ_MAX_CHANNELS; i++) { /* Set default gain params */ tegra210_xbar_write_ahubram(ope->peq_regmap, TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_CTRL, TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_DATA, (i * TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH), (u32 *)&biquad_init_gains, TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH); /* Set default shift params */ tegra210_xbar_write_ahubram(ope->peq_regmap, TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_CTRL, TEGRA210_PEQ_AHUBRAMCTL_CONFIG_RAM_SHIFT_DATA, (i * TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH), (u32 *)&biquad_init_shifts, TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH); } pm_runtime_put_sync(codec->dev); snd_soc_add_codec_controls(codec, tegra210_peq_controls, ARRAY_SIZE(tegra210_peq_controls)); return 0; } EXPORT_SYMBOL_GPL(tegra210_peq_codec_init); int tegra210_peq_init(struct platform_device *pdev, int id) { struct tegra210_ope *ope = dev_get_drvdata(&pdev->dev); struct resource *mem, *memregion; void __iomem *regs; int ret = 0; mem = platform_get_resource(pdev, IORESOURCE_MEM, id); if (!mem) { dev_err(&pdev->dev, "No memory resource\n"); ret = -ENODEV; goto err; } memregion = devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem), pdev->name); if (!memregion) { dev_err(&pdev->dev, "Memory region already claimed\n"); ret = -EBUSY; goto err; } regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); if (!regs) { dev_err(&pdev->dev, "ioremap failed\n"); ret = -ENOMEM; goto err; } ope->peq_regmap = devm_regmap_init_mmio(&pdev->dev, regs, &tegra210_peq_regmap_config); if (IS_ERR(ope->peq_regmap)) { dev_err(&pdev->dev, "regmap init failed\n"); ret = PTR_ERR(ope->peq_regmap); goto err; } return 0; err: return ret; } EXPORT_SYMBOL_GPL(tegra210_peq_init); MODULE_AUTHOR("Sumit Bhattacharya <sumitb@nvidia.com>"); MODULE_DESCRIPTION("Tegra210 PEQ module"); MODULE_LICENSE("GPL");
zombi-x/android_kernel_nvidia_shieldtablet
sound/soc/tegra-alt/tegra210_peq_alt.c
C
gpl-2.0
10,187
[ 30522, 1013, 1008, 1008, 8915, 17643, 17465, 2692, 1035, 21877, 4160, 1035, 12456, 1012, 1039, 1011, 8915, 17643, 17465, 2692, 21877, 4160, 4062, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 1050, 17258, 2401, 3840, 1012, 2035, 2916, 9235, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'katello_test_helper' module Katello class MessageHandlerTestBase < ActiveSupport::TestCase def load_handler(event_name) json = File.read("#{Katello::Engine.root}/test/fixtures/candlepin_messages/#{event_name}.json") event = OpenStruct.new(subject: event_name, content: json) ::Katello::Candlepin::MessageHandler.new(event) end def setup @pool = katello_pools(:pool_one) #from json files @consumer_uuid = 'e930c61b-8dcb-4bca-8282-a8248185f9af' @pool_id = '4028f95162acf5c20162b043b1c606ca' @pool = katello_pools(:pool_one) @pool.update!(:cp_id => @pool_id) @facet = katello_subscription_facets(:one) @facet.update!(:uuid => @consumer_uuid) end end class SystemPurposeComplianceCreatedTest < MessageHandlerTestBase def setup super @handler = load_handler('system_purpose_compliance.created') end def test_system_purpose assert_equal @handler.system_purpose.overall_status, :mismatched assert_equal @handler.system_purpose.sla_status, :mismatched assert_equal @handler.system_purpose.role_status, :not_specified assert_equal @handler.system_purpose.usage_status, :not_specified assert_equal @handler.system_purpose.addons_status, :not_specified end end class ComplianceCreatedTest < MessageHandlerTestBase def setup super @handler = load_handler('compliance.created') end def test_consumer_uuid assert_equal @consumer_uuid, @handler.consumer_uuid end def test_reasons assert_equal 1, @handler.reasons.count assert_equal 'Red Hat Enterprise Linux Server', @handler.reasons[0]['productName'] end def test_status assert_equal 'invalid', @handler.status end def test_subscription_facet assert_equal @facet, @handler.subscription_facet end end class EntitlementCreated < MessageHandlerTestBase def setup super @handler = load_handler('entitlement.created') end def test_pool_id assert_equal @pool_id, @handler.pool_id end def test_consumer_uuid assert_equal @consumer_uuid, @handler.consumer_uuid end def test_create_pool_on_host @facet.pools = [] @handler.create_pool_on_host refute_empty @facet.pools.where(:cp_id => @pool_id) end end class EntitlementDeleted < MessageHandlerTestBase def setup super @handler = load_handler('entitlement.deleted') end def test_consumer_uuid assert_equal @consumer_uuid, @handler.consumer_uuid end def test_pool_id assert_equal @pool_id, @handler.pool_id end def test_remove_pool_from_host @facet.pools = [@pool] @handler.remove_pool_from_host assert_empty @facet.pools.where(:cp_id => @pool_id) end end class PoolCreated < MessageHandlerTestBase def setup super @handler = load_handler('pool.created') end def test_pool_id assert_equal @pool_id, @handler.pool_id end def test_import_pool Katello::EventQueue.expects(:push_event).with('import_pool', @pool.id) @handler.import_pool end end class PoolDeleted < MessageHandlerTestBase def setup super @handler = load_handler('pool.deleted') end def test_pool_id assert_equal @pool_id, @handler.pool_id end def test_delete_pool @handler.delete_pool assert_empty Katello::Pool.find_by(:cp_id => @pool_id) end end end
johnpmitsch/katello
test/services/candlepin/message_handler_test.rb
Ruby
gpl-2.0
3,532
[ 30522, 5478, 1005, 5736, 7174, 1035, 3231, 1035, 2393, 2121, 1005, 11336, 5736, 7174, 2465, 4471, 11774, 3917, 22199, 15058, 1026, 3161, 6342, 9397, 11589, 1024, 1024, 3231, 18382, 13366, 7170, 1035, 28213, 1006, 2724, 1035, 2171, 1007, 104...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<pre><code class="css">h1(class='s-simple-title u-fs-h5x') Thumbnail Object h2.s-simple-title--sub Default .s-simple-objects.thumbnail .o-thumb img(class="o-thumb__item" src= "http://placehold.it/200") .s-simple-code include ../code/highlight/highlight-code-javascript.html h2.s-simple-title--sub Thumbnail Rounded .s-simple-objects.thumbnail .o-thumb img(class="o-thumb__item u-r-all" src= "http://placehold.it/200") .s-simple-code include ../code/highlight/highlight-code-javascript.html h2.s-simple-title--sub Thumbnail Circle .s-simple-objects.thumbnail .o-thumb img(class="o-thumb__item u-r-circle" src= "http://placehold.it/200") .s-simple-code include ../code/highlight/highlight-code-javascript.html</code></pre>
simoneramo/simple
app/_partials/simple-partials/code/objects/thumbnail.html
HTML
mit
747
[ 30522, 1026, 3653, 1028, 1026, 3642, 2465, 1027, 1000, 20116, 2015, 1000, 1028, 1044, 2487, 1006, 2465, 1027, 1005, 1055, 1011, 3722, 1011, 2516, 1057, 1011, 1042, 2015, 1011, 1044, 2629, 2595, 1005, 1007, 7639, 25464, 4874, 1044, 2475, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.nutz.resource; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.util.Collections; import java.util.Comparator; import java.util.List; import javax.servlet.Servlet; import junit.extensions.ActiveTestSuite; import junit.extensions.RepeatedTest; import junit.extensions.TestSetup; import junit.framework.Assert; import org.junit.Test; import org.nutz.lang.Files; import org.nutz.lang.Strings; public class ScansTest { @Test public void test_loadResource() throws IOException { String RNAME = "junit/runner/Version.class"; List<NutResource> nrs = Scans.me().loadResource(".*.class", RNAME); assertEquals(1, nrs.size()); NutResource nr = nrs.get(0); assertTrue(nr.getName().indexOf(RNAME) >= 0); InputStream ins = nr.getInputStream(); int len = 0; while (-1 != ins.read()) { len++; } ins.close(); assertTrue(len > 600); } @Test public void test_in_normal_file() throws IOException { String testPath = "~/nutz/unit/rs/test"; File testDir = Files.createDirIfNoExists(testPath); Files.clearDir(testDir); List<NutResource> list = Scans.me().scan(testPath, ".*"); assertEquals(0, list.size()); Files.createDirIfNoExists(testPath + "/a/b/c"); list = Scans.me().scan(testPath, ".*"); assertEquals(0, list.size()); Files.createFileIfNoExists(testPath + "/a/b/c/l.txt"); Files.createFileIfNoExists(testPath + "/a/b/c/m.doc"); Files.createFileIfNoExists(testPath + "/a/b/c/n.jpg"); Files.createFileIfNoExists(testPath + "/a/b/c/o.jpg"); list = Scans.me().scan(testPath, ".*"); assertEquals(4, list.size()); list = Scans.me().scan(testPath, null); assertEquals(4, list.size()); list = Scans.me().scan(testPath, ".+[.]jpg"); assertEquals(2, list.size()); list = Scans.me().scan(testPath, ".*[.]txt"); assertEquals(1, list.size()); Files.deleteDir(testDir); } @Test public void test_in_classpath() { String testPath = Scans.class.getName().replace('.', '/') + ".class"; String testFilter = "^" + Scans.class.getSimpleName() + ".class$"; List<NutResource> list = Scans.me().scan(testPath, testFilter); assertEquals(1, list.size()); } // @Ignore @Test public void test_in_jar() { String testPath = Assert.class.getPackage().getName().replace('.', '/'); String testFilter = "^.*(Assert|Test)\\.class$"; List<NutResource> list = Scans.me().scan(testPath, testFilter); //Collections.sort(list); assertEquals(2, list.size()); assertTrue(list.get(0).getName().endsWith("Test.class")); assertTrue(list.get(1).getName().endsWith("Assert.class")); } // @Ignore @Test public void test_classes_in_jar() { List<Class<?>> list = Scans.me() .scanPackage( ActiveTestSuite.class, ".*(ActiveTestSuite|RepeatedTest|TestSetup)\\.class$"); assertEquals(3, list.size()); Collections.sort(list, new Comparator<Class<?>>() { public int compare(Class<?> o1, Class<?> o2) { return o1.getSimpleName().compareTo(o2.getSimpleName()); } }); assertTrue(ActiveTestSuite.class == list.get(0)); assertTrue(RepeatedTest.class == list.get(1)); assertTrue(TestSetup.class == list.get(2)); } @Test public void test_classes_in_package_path() { List<Class<?>> list = Scans.me().scanPackage("org.nutz", "Strings.class"); assertEquals(1, list.size()); assertTrue(Strings.class == list.get(0)); } @Test public void test_scan_with_unexists_file() { List<NutResource> list = Scans.me().scan("org/nutz/lang/notExist.class", null); assertEquals(0, list.size()); } @Test public void test_class_in_jar() { String testPath = Test.class.getName().replace('.', '/') + ".class"; String testFilter = "^Test.class$"; List<NutResource> list = Scans.me().scan(testPath, testFilter); assertEquals(1, list.size()); } @Test public void test_path_in_jar() { String testPath = Test.class.getPackage().getName().replace('.', '/'); List<NutResource> list = Scans.me().scan(testPath, null); assertTrue(list.size() > 10); } @Test public void test_scan_root() { Scans.me().scan("", ".+\\.xml"); } @Test public void test_resource_jar() throws MalformedURLException { Scans.me().registerLocation(Servlet.class); Scans.me().registerLocation(getClass().getClassLoader().getResource("javax/servlet/Servlet.class")); } }
007slm/nutz
test/org/nutz/resource/ScansTest.java
Java
apache-2.0
5,137
[ 30522, 7427, 8917, 1012, 17490, 2480, 1012, 7692, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 1008, 1025, 12324, 9262, 1012, 22834, 1012, 5371, 1025, 12324, 9262, 1012, 22834, 1012, 22834, 10288, 24422, 1025, 12324, 9262, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* sbt -- Simple Build Tool * Copyright 2009, 2010 Mark Harrah */ package sbt package compiler import scala.util import java.io.File import CompilerArguments.{abs, absString, BootClasspathOption} /** Forms the list of options that is passed to the compiler from the required inputs and other options. * The directory containing scala-library.jar and scala-compiler.jar (scalaLibDirectory) is required in * order to add these jars to the boot classpath. The 'scala.home' property must be unset because Scala * puts jars in that directory on the bootclasspath. Because we use multiple Scala versions, * this would lead to compiling against the wrong library jar.*/ final class CompilerArguments(scalaInstance: ScalaInstance, cp: ClasspathOptions) { def apply(sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String]): Seq[String] = { checkScalaHomeUnset() val cpWithCompiler = finishClasspath(classpath) // Scala compiler's treatment of empty classpath is troublesome (as of 2.9.1). // We append a random dummy element as workaround. val dummy = "dummy_" + Integer.toHexString(util.Random.nextInt) val classpathOption = Seq("-classpath", if(cpWithCompiler.isEmpty) dummy else absString(cpWithCompiler)) val outputOption = Seq("-d", outputDirectory.getAbsolutePath) options ++ outputOption ++ bootClasspathOption ++ classpathOption ++ abs(sources) } def finishClasspath(classpath: Seq[File]): Seq[File] = filterLibrary(classpath) ++ include(cp.compiler, scalaInstance.compilerJar) ++ include(cp.extra, scalaInstance.extraJars : _*) private def include(flag: Boolean, jars: File*) = if(flag) jars else Nil protected def abs(files: Seq[File]) = files.map(_.getAbsolutePath).sortWith(_ < _) protected def checkScalaHomeUnset() { val scalaHome = System.getProperty("scala.home") assert((scalaHome eq null) || scalaHome.isEmpty, "'scala.home' should not be set (was " + scalaHome + ")") } /** Add the correct Scala library jar to the boot classpath.*/ def createBootClasspath = { val originalBoot = System.getProperty("sun.boot.class.path", "") if(cp.bootLibrary) { val newBootPrefix = if(originalBoot.isEmpty) "" else originalBoot + File.pathSeparator newBootPrefix + scalaInstance.libraryJar.getAbsolutePath } else originalBoot } def filterLibrary(classpath: Seq[File]) = if(cp.filterLibrary) classpath.filterNot(_.getName contains ScalaArtifacts.LibraryID) else classpath def bootClasspathOption = if(cp.autoBoot) Seq(BootClasspathOption, createBootClasspath) else Nil def bootClasspath = if(cp.autoBoot) IO.parseClasspath(createBootClasspath) else Nil } object CompilerArguments { val BootClasspathOption = "-bootclasspath" def abs(files: Seq[File]): Seq[String] = files.map(_.getAbsolutePath) def abs(files: Set[File]): Seq[String] = abs(files.toSeq) def absString(files: Seq[File]): String = abs(files).mkString(File.pathSeparator) def absString(files: Set[File]): String = absString(files.toSeq) }
kuochaoyi/xsbt
compile/CompilerArguments.scala
Scala
bsd-3-clause
2,999
[ 30522, 1013, 1008, 24829, 2102, 1011, 1011, 3722, 3857, 6994, 1008, 9385, 2268, 1010, 2230, 2928, 5292, 11335, 2232, 1008, 1013, 7427, 24829, 2102, 7427, 21624, 12324, 26743, 1012, 21183, 4014, 12324, 9262, 1012, 22834, 1012, 5371, 12324, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#! /usr/bin/env python """Unit tests for SCardConnect/SCardStatus/SCardDisconnect This test case can be executed individually, or with all other test cases thru testsuite_scard.py. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. pyscard 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 pyscard; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ import unittest from smartcard.scard import * # import local_config for reader/card configuration # configcheck.py is generating local_config.py in # the test suite. import sys sys.path += ['..'] try: from local_config import expectedATRs, expectedReaders from local_config import expectedReaderGroups, expectedATRinReader except: print 'execute test suite first to generate the local_config.py file' sys.exit() class testcase_getATR(unittest.TestCase): """Test scard API for ATR retrieval""" def setUp(self): hresult, self.hcontext = SCardEstablishContext(SCARD_SCOPE_USER) self.assertEquals(hresult, 0) hresult, self.readers = SCardListReaders(self.hcontext, []) self.assertEquals(hresult, 0) def tearDown(self): hresult = SCardReleaseContext(self.hcontext) self.assertEquals(hresult, 0) def _getATR(self, r): if r < len(expectedATRs) and [] != expectedATRs[r]: hresult, hcard, dwActiveProtocol = SCardConnect( self.hcontext, self.readers[r], SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) self.assertEquals(hresult, 0) try: hresult, reader, state, protocol, atr = SCardStatus(hcard) self.assertEquals(hresult, 0) self.assertEquals(reader, expectedReaders[r]) self.assertEquals(atr, expectedATRs[r]) finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) self.assertEquals(hresult, 0) def test_getATR0(self): testcase_getATR._getATR(self, 0) def test_getATR1(self): testcase_getATR._getATR(self, 1) def test_getATR2(self): testcase_getATR._getATR(self, 2) def test_getATR3(self): testcase_getATR._getATR(self, 3) def suite(): suite1 = unittest.makeSuite(testcase_getATR) return unittest.TestSuite((suite1)) if __name__ == '__main__': unittest.main()
mixja/eap-sim-lab
lib/pyscard-1.6.16/smartcard/test/scard/testcase_getatr.py
Python
mit
3,083
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1000, 1000, 1000, 3131, 5852, 2005, 11228, 16409, 18256, 6593, 1013, 11228, 5104, 29336, 2271, 1013, 11228, 14141, 2483, 8663, 2638, 6593, 2023, 3231, 2553, 2064, 2022...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# # Multivariable indicator cosimulation # data(i200): 'zinc.eas', x=1, y=2, v=3, max=20, radius=1000, I=200, sk_mean = 0.28; data(i400): 'zinc.eas', x=1, y=2, v=3, max=20, radius=1000, I=400, sk_mean = 0.56; data(i800): 'zinc.eas', x=1, y=2, v=3, max=20, radius=1000, I=800, sk_mean = 0.85; # define an LMC: variogram(i200): 0.0490637 Nug(0) + 0.182814 Exp(300); variogram(i400): 0.0608225 Nug(0) + 0.21216 Exp(300); variogram(i200, i400): 0 Nug() + 0.14806 Exp(300); variogram(i800): 0.0550284 Nug(0) + 0.0842966 Exp(300); variogram(i200, i800): 0 Nug() + 0.0525584 Exp(300); variogram(i400, i800): 0 Nug() + 0.102852 Exp(300); method: is; mask: 'mask_map'; # apply order corrections for cumulative indicators: set order = 4; predictions(i200): 'i200pr'; predictions(i400): 'i400pr'; predictions(i800): 'i800pr'; # uncomment next line to get 5 simulations: # set nsim = 5;
fcecinati/QUICS_UOB
mGstat/examples/gstat_examples/ex16.cmd
Batchfile
bsd-2-clause
879
[ 30522, 1001, 1001, 4800, 10755, 19210, 17245, 2522, 5332, 12274, 13490, 1001, 2951, 1006, 1045, 28332, 1007, 1024, 1005, 15813, 1012, 19413, 2015, 1005, 1010, 1060, 1027, 1015, 1010, 1061, 1027, 1016, 1010, 1058, 1027, 1017, 1010, 4098, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# -*- coding: utf-8 -*- # compute the times of action(rec|click|msg) for each user from math import sqrt def getActionScore(action): if action == "rec": return 0 elif action == "click" : return 1 else: return 2 def compute_interaction(data): interaction = {} for line in data: (userA,userB,times,action) = line.split(' ') action = action[:-1] key = userB + " " + action interaction.setdefault(key, 0) interaction[key] += 1 return interaction def compute_user_history_interaction(trainFile): records = [] lineList = [] lineNum = 1 result = [] lineList = [line for line in file(trainFile)] for line in lineList: if lineNum == 1: #ignore the title in first line lineNum += 1 continue records.append(line) lineNum += 1 interaction = compute_interaction(records) out = file('user_interaction.txt', 'w') for (key, times) in interaction.items(): out.write('%s %d' % (key, times)) out.write('\n') for (key, times) in interaction.items(): user, action = key.split(' '); result.append((user, action, times)) return result #get the weight for each type of action def get_action_weight(action): pop = 0; if action == "rec": pop = 1 elif action == "click": pop = 10 elif action == "msg": pop = 100 return pop; #trainFile line like: [userA, userB, action_times, action_type(rec|click|msg)] def compute_user_popularity(trainFile, user_popularity_file): popDict = {} rankedscores = [] result = [] print "-----compute_user_history_interaction ... " interaction = compute_user_history_interaction(trainFile) print "-----compute_user_popularity ... " for (user, action, times) in interaction[0:len(interaction)]: popDict.setdefault(user, 0) popDict[user] += get_action_weight(action) * times ranked_popularity = [(popularity, user) for (user, popularity) in popDict.items()] ranked_popularity.sort() ranked_popularity.reverse() print "-----ranking_user_popularity ... " result = [(user, popularity) for (popularity, user) in ranked_popularity[0:len(ranked_popularity)]] print "-----output user_popularity ... " out = file(user_popularity_file, 'w') for (user, popularity) in result[0:len(result)]: out.write('%s %d\n' % (user, popularity)) print "-----Ending ... " return result
bingtianbaihua/MachineLearning
世纪佳缘会员推荐之投票加权/compute_user_popularity.py
Python
apache-2.0
2,399
[ 30522, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1001, 24134, 1996, 2335, 1997, 2895, 1006, 28667, 1064, 11562, 1064, 5796, 2290, 1007, 2005, 2169, 5310, 2013, 8785, 12324, 5490, 5339, 13366, 2131, 1890...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background-color: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('../fonts/glyphicons-halflings-regular.eot'); src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\002a"; } .glyphicon-plus:before { content: "\002b"; } .glyphicon-euro:before, .glyphicon-eur:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-cd:before { content: "\e201"; } .glyphicon-save-file:before { content: "\e202"; } .glyphicon-open-file:before { content: "\e203"; } .glyphicon-level-up:before { content: "\e204"; } .glyphicon-copy:before { content: "\e205"; } .glyphicon-paste:before { content: "\e206"; } .glyphicon-alert:before { content: "\e209"; } .glyphicon-equalizer:before { content: "\e210"; } .glyphicon-king:before { content: "\e211"; } .glyphicon-queen:before { content: "\e212"; } .glyphicon-pawn:before { content: "\e213"; } .glyphicon-bishop:before { content: "\e214"; } .glyphicon-knight:before { content: "\e215"; } .glyphicon-baby-formula:before { content: "\e216"; } .glyphicon-tent:before { content: "\26fa"; } .glyphicon-blackboard:before { content: "\e218"; } .glyphicon-bed:before { content: "\e219"; } .glyphicon-apple:before { content: "\f8ff"; } .glyphicon-erase:before { content: "\e221"; } .glyphicon-hourglass:before { content: "\231b"; } .glyphicon-lamp:before { content: "\e223"; } .glyphicon-duplicate:before { content: "\e224"; } .glyphicon-piggy-bank:before { content: "\e225"; } .glyphicon-scissors:before { content: "\e226"; } .glyphicon-bitcoin:before { content: "\e227"; } .glyphicon-btc:before { content: "\e227"; } .glyphicon-xbt:before { content: "\e227"; } .glyphicon-yen:before { content: "\00a5"; } .glyphicon-jpy:before { content: "\00a5"; } .glyphicon-ruble:before { content: "\20bd"; } .glyphicon-rub:before { content: "\20bd"; } .glyphicon-scale:before { content: "\e230"; } .glyphicon-ice-lolly:before { content: "\e231"; } .glyphicon-ice-lolly-tasted:before { content: "\e232"; } .glyphicon-education:before { content: "\e233"; } .glyphicon-option-horizontal:before { content: "\e234"; } .glyphicon-option-vertical:before { content: "\e235"; } .glyphicon-menu-hamburger:before { content: "\e236"; } .glyphicon-modal-window:before { content: "\e237"; } .glyphicon-oil:before { content: "\e238"; } .glyphicon-grain:before { content: "\e239"; } .glyphicon-sunglasses:before { content: "\e240"; } .glyphicon-text-size:before { content: "\e241"; } .glyphicon-text-color:before { content: "\e242"; } .glyphicon-text-background:before { content: "\e243"; } .glyphicon-object-align-top:before { content: "\e244"; } .glyphicon-object-align-bottom:before { content: "\e245"; } .glyphicon-object-align-horizontal:before { content: "\e246"; } .glyphicon-object-align-left:before { content: "\e247"; } .glyphicon-object-align-vertical:before { content: "\e248"; } .glyphicon-object-align-right:before { content: "\e249"; } .glyphicon-triangle-right:before { content: "\e250"; } .glyphicon-triangle-left:before { content: "\e251"; } .glyphicon-triangle-bottom:before { content: "\e252"; } .glyphicon-triangle-top:before { content: "\e253"; } .glyphicon-console:before { content: "\e254"; } .glyphicon-superscript:before { content: "\e255"; } .glyphicon-subscript:before { content: "\e256"; } .glyphicon-menu-left:before { content: "\e257"; } .glyphicon-menu-right:before { content: "\e258"; } .glyphicon-menu-down:before { content: "\e259"; } .glyphicon-menu-up:before { content: "\e260"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333333; background-color: #ffffff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #337ab7; text-decoration: none; } a:hover, a:focus { color: #23527c; text-decoration: underline; } a:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { padding: 4px; line-height: 1.42857143; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } [role="button"] { cursor: pointer; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #777777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } mark, .mark { background-color: #fcf8e3; padding: .2em; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777777; } .text-primary { color: #337ab7; } a.text-primary:hover, a.text-primary:focus { color: #286090; } .text-success { color: #3c763d; } a.text-success:hover, a.text-success:focus { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover, a.text-info:focus { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover, a.text-warning:focus { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover, a.text-danger:focus { color: #843534; } .bg-primary { color: #fff; background-color: #337ab7; } a.bg-primary:hover, a.bg-primary:focus { background-color: #286090; } .bg-success { background-color: #dff0d8; } a.bg-success:hover, a.bg-success:focus { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover, a.bg-info:focus { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover, a.bg-warning:focus { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover, a.bg-danger:focus { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.42857143; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eeeeee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; color: #777777; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; text-align: right; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857143; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #ffffff; background-color: #333333; border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; color: #333333; background-color: #f5f5f5; border: 1px solid #cccccc; border-radius: 4px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .row { margin-left: -15px; margin-right: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0%; } } table { background-color: transparent; } caption { padding-top: 8px; padding-bottom: 8px; color: #777777; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #dddddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #dddddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #dddddd; } .table .table { background-color: #ffffff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } .table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { position: static; float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { position: static; float: none; display: table-cell; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } .table-responsive { overflow-x: auto; min-height: 0.01%; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #dddddd; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; min-width: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857143; color: #555555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555555; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #999999; opacity: 1; } .form-control:-ms-input-placeholder { color: #999999; } .form-control::-webkit-input-placeholder { color: #999999; } .form-control::-ms-expand { border: 0; background-color: transparent; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #eeeeee; opacity: 1; } .form-control[disabled], fieldset[disabled] .form-control { cursor: not-allowed; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control { line-height: 34px; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm, .input-group-sm input[type="date"], .input-group-sm input[type="time"], .input-group-sm input[type="datetime-local"], .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg, .input-group-lg input[type="date"], .input-group-lg input[type="time"], .input-group-lg input[type="datetime-local"], .input-group-lg input[type="month"] { line-height: 46px; } } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { min-height: 20px; padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-left: -20px; margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; min-height: 34px; } .form-control-static.input-lg, .form-control-static.input-sm { padding-left: 0; padding-right: 0; } .input-sm { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .form-group-sm select.form-control { height: 30px; line-height: 30px; } .form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control { height: auto; } .form-group-sm .form-control-static { height: 30px; min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 1.5; } .input-lg { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-lg { height: 46px; line-height: 46px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .form-group-lg select.form-control { height: 46px; line-height: 46px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 46px; min-height: 38px; padding: 11px 16px; font-size: 18px; line-height: 1.3333333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .form-control-feedback, .input-group-sm + .form-control-feedback, .form-group-sm .form-control + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-success .form-control:focus { border-color: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; border-color: #3c763d; background-color: #dff0d8; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-warning .form-control:focus { border-color: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; border-color: #8a6d3b; background-color: #fcf8e3; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #a94442; } .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-error .form-control:focus { border-color: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; border-color: #a94442; background-color: #f2dede; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label ~ .form-control-feedback { top: 25px; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-static { display: inline-block; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { margin-top: 0; margin-bottom: 0; padding-top: 7px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 11px; font-size: 18px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn.active.focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus, .btn.focus { color: #333333; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #333333; background-color: #ffffff; border-color: #cccccc; } .btn-default:focus, .btn-default.focus { color: #333333; background-color: #e6e6e6; border-color: #8c8c8c; } .btn-default:hover { color: #333333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #333333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { color: #333333; background-color: #d4d4d4; border-color: #8c8c8c; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus { background-color: #ffffff; border-color: #cccccc; } .btn-default .badge { color: #ffffff; background-color: #333333; } .btn-primary { color: #ffffff; background-color: #337ab7; border-color: #2e6da4; } .btn-primary:focus, .btn-primary.focus { color: #ffffff; background-color: #286090; border-color: #122b40; } .btn-primary:hover { color: #ffffff; background-color: #286090; border-color: #204d74; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #ffffff; background-color: #286090; border-color: #204d74; } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { color: #ffffff; background-color: #204d74; border-color: #122b40; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus { background-color: #337ab7; border-color: #2e6da4; } .btn-primary .badge { color: #337ab7; background-color: #ffffff; } .btn-success { color: #ffffff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:focus, .btn-success.focus { color: #ffffff; background-color: #449d44; border-color: #255625; } .btn-success:hover { color: #ffffff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #ffffff; background-color: #449d44; border-color: #398439; } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { color: #ffffff; background-color: #398439; border-color: #255625; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #ffffff; } .btn-info { color: #ffffff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:focus, .btn-info.focus { color: #ffffff; background-color: #31b0d5; border-color: #1b6d85; } .btn-info:hover { color: #ffffff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #ffffff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { color: #ffffff; background-color: #269abc; border-color: #1b6d85; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #ffffff; } .btn-warning { color: #ffffff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:focus, .btn-warning.focus { color: #ffffff; background-color: #ec971f; border-color: #985f0d; } .btn-warning:hover { color: #ffffff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #ffffff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { color: #ffffff; background-color: #d58512; border-color: #985f0d; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #ffffff; } .btn-danger { color: #ffffff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:focus, .btn-danger.focus { color: #ffffff; background-color: #c9302c; border-color: #761c19; } .btn-danger:hover { color: #ffffff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #ffffff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { color: #ffffff; background-color: #ac2925; border-color: #761c19; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #ffffff; } .btn-link { color: #337ab7; font-weight: normal; border-radius: 0; } .btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #23527c; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #777777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-property: height, visibility; transition-property: height, visibility; -webkit-transition-duration: 0.35s; transition-duration: 0.35s; -webkit-transition-timing-function: ease; transition-timing-function: ease; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-top: 4px solid \9; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropup, .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; font-size: 14px; text-align: left; background-color: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857143; color: #333333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #262626; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #337ab7; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { left: auto; right: 0; } .dropdown-menu-left { left: 0; right: auto; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.42857143; color: #777777; white-space: nowrap; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { left: auto; right: 0; } .navbar-right .dropdown-menu-left { left: 0; right: auto; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn, .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-right-radius: 0; border-top-left-radius: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { float: none; display: table-cell; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-left: 0; padding-right: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group .form-control:focus { z-index: 3; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 46px; line-height: 46px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555555; text-align: center; background-color: #eeeeee; border: 1px solid #cccccc; border-radius: 4px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-top-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-bottom-left-radius: 0; border-top-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #777777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777777; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #337ab7; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #dddddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555555; background-color: #ffffff; border: 1px solid #dddddd; border-bottom-color: transparent; cursor: default; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #ffffff; } } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 4px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #ffffff; background-color: #337ab7; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #ffffff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-left: 0; padding-right: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-device-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; padding: 15px 15px; font-size: 18px; line-height: 20px; height: 50px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 8px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 8px; margin-bottom: 8px; } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .form-control-static { display: inline-block; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } .navbar-form .form-group:last-child { margin-bottom: 0; } } @media (min-width: 768px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777777; } .navbar-default .navbar-nav > li > a { color: #777777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #cccccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #dddddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #dddddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #e7e7e7; color: #555555; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #cccccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777777; } .navbar-default .navbar-link:hover { color: #333333; } .navbar-default .btn-link { color: #777777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333333; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #cccccc; } .navbar-inverse { background-color: #222222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #9d9d9d; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-text { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #ffffff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { background-color: #080808; color: #ffffff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #9d9d9d; } .navbar-inverse .navbar-link:hover { color: #ffffff; } .navbar-inverse .btn-link { color: #9d9d9d; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #ffffff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/\00a0"; padding: 0 5px; color: #cccccc; } .breadcrumb > .active { color: #777777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857143; text-decoration: none; color: #337ab7; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { z-index: 2; color: #23527c; background-color: #eeeeee; border-color: #dddddd; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 3; color: #ffffff; background-color: #337ab7; border-color: #337ab7; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 6px; border-top-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 6px; border-top-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; text-align: center; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #777777; background-color: #ffffff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #777777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #337ab7; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #286090; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #ffffff; line-height: 1; vertical-align: middle; white-space: nowrap; text-align: center; background-color: #777777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #337ab7; background-color: #ffffff; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #eeeeee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 6px; padding-left: 15px; padding-right: 15px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.42857143; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: border 0.2s ease-in-out; -o-transition: border 0.2s ease-in-out; transition: border 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { margin-left: auto; margin-right: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #337ab7; } .thumbnail .caption { padding: 9px; color: #333333; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #3c763d; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #31708f; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { background-color: #fcf8e3; border-color: #faebcc; color: #8a6d3b; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { background-color: #f2dede; border-color: #ebccd1; color: #a94442; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f5f5f5; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; line-height: 20px; color: #ffffff; text-align: center; background-color: #337ab7; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { zoom: 1; overflow: hidden; } .media-body { width: 10000px; } .media-object { display: block; } .media-object.img-thumbnail { max-width: none; } .media-right, .media > .pull-right { padding-left: 10px; } .media-left, .media > .pull-left { padding-right: 10px; } .media-left, .media-right, .media-body { display: table-cell; vertical-align: top; } .media-middle { vertical-align: middle; } .media-bottom { vertical-align: bottom; } .media-heading { margin-top: 0; margin-bottom: 5px; } .media-list { padding-left: 0; list-style: none; } .list-group { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #ffffff; border: 1px solid #dddddd; } .list-group-item:first-child { border-top-right-radius: 4px; border-top-left-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } a.list-group-item, button.list-group-item { color: #555555; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #333333; } a.list-group-item:hover, button.list-group-item:hover, a.list-group-item:focus, button.list-group-item:focus { text-decoration: none; color: #555555; background-color: #f5f5f5; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #eeeeee; color: #777777; cursor: not-allowed; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #777777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #ffffff; background-color: #337ab7; border-color: #337ab7; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #c7ddef; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success, button.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, button.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, button.list-group-item-success.active, a.list-group-item-success.active:hover, button.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info, button.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, button.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, button.list-group-item-info.active, a.list-group-item-info.active:hover, button.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning, button.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, button.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, button.list-group-item-warning.active, a.list-group-item-warning.active:hover, button.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger, button.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, button.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, button.list-group-item-danger.active, a.list-group-item-danger.active:hover, button.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #ffffff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #dddddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group, .panel > .panel-collapse > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption { padding-left: 15px; padding-right: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #dddddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 0; } .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #dddddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #dddddd; } .panel-default { border-color: #dddddd; } .panel-default > .panel-heading { color: #333333; background-color: #f5f5f5; border-color: #dddddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #dddddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #dddddd; } .panel-primary { border-color: #337ab7; } .panel-primary > .panel-heading { color: #ffffff; background-color: #337ab7; border-color: #337ab7; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #337ab7; } .panel-primary > .panel-heading .badge { color: #337ab7; background-color: #ffffff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #337ab7; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; border: 0; } .embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { display: none; overflow: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #ffffff; border: 1px solid #999999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid #e5e5e5; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857143; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 12px; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; background-color: #000000; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-left .tooltip-arrow { bottom: 0; right: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-right .tooltip-arrow { bottom: 0; left: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-left .tooltip-arrow { top: 0; right: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-right .tooltip-arrow { top: 0; left: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 14px; background-color: #ffffff; background-clip: padding-box; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #ffffff; bottom: -10px; } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform 0.6s ease-in-out; -moz-transition: -moz-transform 0.6s ease-in-out; -o-transition: -o-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; -moz-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); left: 0; } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); left: 0; } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); left: 0; } } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); background-color: rgba(0, 0, 0, 0); } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { outline: 0; color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; margin-top: -10px; z-index: 5; display: inline-block; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; line-height: 1; font-family: serif; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #ffffff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #ffffff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -10px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -10px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -10px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-header:before, .modal-header:after, .modal-footer:before, .modal-footer:after { content: " "; display: table; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-header:after, .modal-footer:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; } .affix { position: fixed; } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } /** * Additional styles for BraincraftedBootstrapBundle * (c) 2013 Florian Eckerstorfer (http://braincrafted.com) * http://bootstrap.braincrafted.com */ .bootstrap-time { width: 100%; } .bootstrap-time select { display: inline-block; width: auto; } .bootstrap-date { width: 100%; } .bootstrap-date select { display: inline-block; width: auto; margin-right: 5px; } .bootstrap-datetime .bootstrap-time, .bootstrap-datetime .bootstrap-date { display: inline-block; width: auto; } .form-group .bc-collection { margin-bottom: 0; } .form-group .bc-collection li + li { margin-top: 10px; } .form-group .bc-collection li:nth-last-child(1) { margin-bottom: 10px; } .form-inline .form-group { margin-left: 0; margin-right: 0; } .form-horizontal .col-lg-1 .col-1, .form-horizontal .col-lg-2 .col-1, .form-horizontal .col-lg-3 .col-1, .form-horizontal .col-lg-4 .col-1, .form-horizontal .col-lg-5 .col-1, .form-horizontal .col-lg-6 .col-1, .form-horizontal .col-lg-7 .col-1, .form-horizontal .col-lg-8 .col-1, .form-horizontal .col-lg-9 .col-1, .form-horizontal .col-lg-10 .col-1, .form-horizontal .col-lg-11 .col-1, .form-horizontal .col-lg12 .col-1, .form-horizontal .col-lg-1 .col-2, .form-horizontal .col-lg-2 .col-2, .form-horizontal .col-lg-3 .col-2, .form-horizontal .col-lg-4 .col-2, .form-horizontal .col-lg-5 .col-2, .form-horizontal .col-lg-6 .col-2, .form-horizontal .col-lg-7 .col-2, .form-horizontal .col-lg-8 .col-2, .form-horizontal .col-lg-9 .col-2, .form-horizontal .col-lg-10 .col-2, .form-horizontal .col-lg-11 .col-2, .form-horizontal .col-lg12 .col-2, .form-horizontal .col-lg-1 .col-3, .form-horizontal .col-lg-2 .col-3, .form-horizontal .col-lg-3 .col-3, .form-horizontal .col-lg-4 .col-3, .form-horizontal .col-lg-5 .col-3, .form-horizontal .col-lg-6 .col-3, .form-horizontal .col-lg-7 .col-3, .form-horizontal .col-lg-8 .col-3, .form-horizontal .col-lg-9 .col-3, .form-horizontal .col-lg-10 .col-3, .form-horizontal .col-lg-11 .col-3, .form-horizontal .col-lg12 .col-3, .form-horizontal .col-lg-1 .col-4, .form-horizontal .col-lg-2 .col-4, .form-horizontal .col-lg-3 .col-4, .form-horizontal .col-lg-4 .col-4, .form-horizontal .col-lg-5 .col-4, .form-horizontal .col-lg-6 .col-4, .form-horizontal .col-lg-7 .col-4, .form-horizontal .col-lg-8 .col-4, .form-horizontal .col-lg-9 .col-4, .form-horizontal .col-lg-10 .col-4, .form-horizontal .col-lg-11 .col-4, .form-horizontal .col-lg12 .col-4, .form-horizontal .col-lg-1 .col-5, .form-horizontal .col-lg-2 .col-5, .form-horizontal .col-lg-3 .col-5, .form-horizontal .col-lg-4 .col-5, .form-horizontal .col-lg-5 .col-5, .form-horizontal .col-lg-6 .col-5, .form-horizontal .col-lg-7 .col-5, .form-horizontal .col-lg-8 .col-5, .form-horizontal .col-lg-9 .col-5, .form-horizontal .col-lg-10 .col-5, .form-horizontal .col-lg-11 .col-5, .form-horizontal .col-lg12 .col-5, .form-horizontal .col-lg-1 .col-6, .form-horizontal .col-lg-2 .col-6, .form-horizontal .col-lg-3 .col-6, .form-horizontal .col-lg-4 .col-6, .form-horizontal .col-lg-5 .col-6, .form-horizontal .col-lg-6 .col-6, .form-horizontal .col-lg-7 .col-6, .form-horizontal .col-lg-8 .col-6, .form-horizontal .col-lg-9 .col-6, .form-horizontal .col-lg-10 .col-6, .form-horizontal .col-lg-11 .col-6, .form-horizontal .col-lg12 .col-6, .form-horizontal .col-lg-1 .col-7, .form-horizontal .col-lg-2 .col-7, .form-horizontal .col-lg-3 .col-7, .form-horizontal .col-lg-4 .col-7, .form-horizontal .col-lg-5 .col-7, .form-horizontal .col-lg-6 .col-7, .form-horizontal .col-lg-7 .col-7, .form-horizontal .col-lg-8 .col-7, .form-horizontal .col-lg-9 .col-7, .form-horizontal .col-lg-10 .col-7, .form-horizontal .col-lg-11 .col-7, .form-horizontal .col-lg12 .col-7, .form-horizontal .col-lg-1 .col-8, .form-horizontal .col-lg-2 .col-8, .form-horizontal .col-lg-3 .col-8, .form-horizontal .col-lg-4 .col-8, .form-horizontal .col-lg-5 .col-8, .form-horizontal .col-lg-6 .col-8, .form-horizontal .col-lg-7 .col-8, .form-horizontal .col-lg-8 .col-8, .form-horizontal .col-lg-9 .col-8, .form-horizontal .col-lg-10 .col-8, .form-horizontal .col-lg-11 .col-8, .form-horizontal .col-lg12 .col-8, .form-horizontal .col-lg-1 .col-9, .form-horizontal .col-lg-2 .col-9, .form-horizontal .col-lg-3 .col-9, .form-horizontal .col-lg-4 .col-9, .form-horizontal .col-lg-5 .col-9, .form-horizontal .col-lg-6 .col-9, .form-horizontal .col-lg-7 .col-9, .form-horizontal .col-lg-8 .col-9, .form-horizontal .col-lg-9 .col-9, .form-horizontal .col-lg-10 .col-9, .form-horizontal .col-lg-11 .col-9, .form-horizontal .col-lg12 .col-9, .form-horizontal .col-lg-1 .col-10, .form-horizontal .col-lg-2 .col-10, .form-horizontal .col-lg-3 .col-10, .form-horizontal .col-lg-4 .col-10, .form-horizontal .col-lg-5 .col-10, .form-horizontal .col-lg-6 .col-10, .form-horizontal .col-lg-7 .col-10, .form-horizontal .col-lg-8 .col-10, .form-horizontal .col-lg-9 .col-10, .form-horizontal .col-lg-10 .col-10, .form-horizontal .col-lg-11 .col-10, .form-horizontal .col-lg12 .col-10, .form-horizontal .col-lg-1 .col-11, .form-horizontal .col-lg-2 .col-11, .form-horizontal .col-lg-3 .col-11, .form-horizontal .col-lg-4 .col-11, .form-horizontal .col-lg-5 .col-11, .form-horizontal .col-lg-6 .col-11, .form-horizontal .col-lg-7 .col-11, .form-horizontal .col-lg-8 .col-11, .form-horizontal .col-lg-9 .col-11, .form-horizontal .col-lg-10 .col-11, .form-horizontal .col-lg-11 .col-11, .form-horizontal .col-lg12 .col-11, .form-horizontal .col-lg-1 .col-12, .form-horizontal .col-lg-2 .col-12, .form-horizontal .col-lg-3 .col-12, .form-horizontal .col-lg-4 .col-12, .form-horizontal .col-lg-5 .col-12, .form-horizontal .col-lg-6 .col-12, .form-horizontal .col-lg-7 .col-12, .form-horizontal .col-lg-8 .col-12, .form-horizontal .col-lg-9 .col-12, .form-horizontal .col-lg-10 .col-12, .form-horizontal .col-lg-11 .col-12, .form-horizontal .col-lg12 .col-12, .form-horizontal .col-lg-1 .col-sm-1, .form-horizontal .col-lg-2 .col-sm-1, .form-horizontal .col-lg-3 .col-sm-1, .form-horizontal .col-lg-4 .col-sm-1, .form-horizontal .col-lg-5 .col-sm-1, .form-horizontal .col-lg-6 .col-sm-1, .form-horizontal .col-lg-7 .col-sm-1, .form-horizontal .col-lg-8 .col-sm-1, .form-horizontal .col-lg-9 .col-sm-1, .form-horizontal .col-lg-10 .col-sm-1, .form-horizontal .col-lg-11 .col-sm-1, .form-horizontal .col-lg12 .col-sm-1, .form-horizontal .col-lg-1 .col-sm-2, .form-horizontal .col-lg-2 .col-sm-2, .form-horizontal .col-lg-3 .col-sm-2, .form-horizontal .col-lg-4 .col-sm-2, .form-horizontal .col-lg-5 .col-sm-2, .form-horizontal .col-lg-6 .col-sm-2, .form-horizontal .col-lg-7 .col-sm-2, .form-horizontal .col-lg-8 .col-sm-2, .form-horizontal .col-lg-9 .col-sm-2, .form-horizontal .col-lg-10 .col-sm-2, .form-horizontal .col-lg-11 .col-sm-2, .form-horizontal .col-lg12 .col-sm-2, .form-horizontal .col-lg-1 .col-sm-3, .form-horizontal .col-lg-2 .col-sm-3, .form-horizontal .col-lg-3 .col-sm-3, .form-horizontal .col-lg-4 .col-sm-3, .form-horizontal .col-lg-5 .col-sm-3, .form-horizontal .col-lg-6 .col-sm-3, .form-horizontal .col-lg-7 .col-sm-3, .form-horizontal .col-lg-8 .col-sm-3, .form-horizontal .col-lg-9 .col-sm-3, .form-horizontal .col-lg-10 .col-sm-3, .form-horizontal .col-lg-11 .col-sm-3, .form-horizontal .col-lg12 .col-sm-3, .form-horizontal .col-lg-1 .col-sm-4, .form-horizontal .col-lg-2 .col-sm-4, .form-horizontal .col-lg-3 .col-sm-4, .form-horizontal .col-lg-4 .col-sm-4, .form-horizontal .col-lg-5 .col-sm-4, .form-horizontal .col-lg-6 .col-sm-4, .form-horizontal .col-lg-7 .col-sm-4, .form-horizontal .col-lg-8 .col-sm-4, .form-horizontal .col-lg-9 .col-sm-4, .form-horizontal .col-lg-10 .col-sm-4, .form-horizontal .col-lg-11 .col-sm-4, .form-horizontal .col-lg12 .col-sm-4, .form-horizontal .col-lg-1 .col-sm-5, .form-horizontal .col-lg-2 .col-sm-5, .form-horizontal .col-lg-3 .col-sm-5, .form-horizontal .col-lg-4 .col-sm-5, .form-horizontal .col-lg-5 .col-sm-5, .form-horizontal .col-lg-6 .col-sm-5, .form-horizontal .col-lg-7 .col-sm-5, .form-horizontal .col-lg-8 .col-sm-5, .form-horizontal .col-lg-9 .col-sm-5, .form-horizontal .col-lg-10 .col-sm-5, .form-horizontal .col-lg-11 .col-sm-5, .form-horizontal .col-lg12 .col-sm-5, .form-horizontal .col-lg-1 .col-sm-6, .form-horizontal .col-lg-2 .col-sm-6, .form-horizontal .col-lg-3 .col-sm-6, .form-horizontal .col-lg-4 .col-sm-6, .form-horizontal .col-lg-5 .col-sm-6, .form-horizontal .col-lg-6 .col-sm-6, .form-horizontal .col-lg-7 .col-sm-6, .form-horizontal .col-lg-8 .col-sm-6, .form-horizontal .col-lg-9 .col-sm-6, .form-horizontal .col-lg-10 .col-sm-6, .form-horizontal .col-lg-11 .col-sm-6, .form-horizontal .col-lg12 .col-sm-6, .form-horizontal .col-lg-1 .col-sm-7, .form-horizontal .col-lg-2 .col-sm-7, .form-horizontal .col-lg-3 .col-sm-7, .form-horizontal .col-lg-4 .col-sm-7, .form-horizontal .col-lg-5 .col-sm-7, .form-horizontal .col-lg-6 .col-sm-7, .form-horizontal .col-lg-7 .col-sm-7, .form-horizontal .col-lg-8 .col-sm-7, .form-horizontal .col-lg-9 .col-sm-7, .form-horizontal .col-lg-10 .col-sm-7, .form-horizontal .col-lg-11 .col-sm-7, .form-horizontal .col-lg12 .col-sm-7, .form-horizontal .col-lg-1 .col-sm-8, .form-horizontal .col-lg-2 .col-sm-8, .form-horizontal .col-lg-3 .col-sm-8, .form-horizontal .col-lg-4 .col-sm-8, .form-horizontal .col-lg-5 .col-sm-8, .form-horizontal .col-lg-6 .col-sm-8, .form-horizontal .col-lg-7 .col-sm-8, .form-horizontal .col-lg-8 .col-sm-8, .form-horizontal .col-lg-9 .col-sm-8, .form-horizontal .col-lg-10 .col-sm-8, .form-horizontal .col-lg-11 .col-sm-8, .form-horizontal .col-lg12 .col-sm-8, .form-horizontal .col-lg-1 .col-sm-9, .form-horizontal .col-lg-2 .col-sm-9, .form-horizontal .col-lg-3 .col-sm-9, .form-horizontal .col-lg-4 .col-sm-9, .form-horizontal .col-lg-5 .col-sm-9, .form-horizontal .col-lg-6 .col-sm-9, .form-horizontal .col-lg-7 .col-sm-9, .form-horizontal .col-lg-8 .col-sm-9, .form-horizontal .col-lg-9 .col-sm-9, .form-horizontal .col-lg-10 .col-sm-9, .form-horizontal .col-lg-11 .col-sm-9, .form-horizontal .col-lg12 .col-sm-9, .form-horizontal .col-lg-1 .col-sm-10, .form-horizontal .col-lg-2 .col-sm-10, .form-horizontal .col-lg-3 .col-sm-10, .form-horizontal .col-lg-4 .col-sm-10, .form-horizontal .col-lg-5 .col-sm-10, .form-horizontal .col-lg-6 .col-sm-10, .form-horizontal .col-lg-7 .col-sm-10, .form-horizontal .col-lg-8 .col-sm-10, .form-horizontal .col-lg-9 .col-sm-10, .form-horizontal .col-lg-10 .col-sm-10, .form-horizontal .col-lg-11 .col-sm-10, .form-horizontal .col-lg12 .col-sm-10, .form-horizontal .col-lg-1 .col-sm-11, .form-horizontal .col-lg-2 .col-sm-11, .form-horizontal .col-lg-3 .col-sm-11, .form-horizontal .col-lg-4 .col-sm-11, .form-horizontal .col-lg-5 .col-sm-11, .form-horizontal .col-lg-6 .col-sm-11, .form-horizontal .col-lg-7 .col-sm-11, .form-horizontal .col-lg-8 .col-sm-11, .form-horizontal .col-lg-9 .col-sm-11, .form-horizontal .col-lg-10 .col-sm-11, .form-horizontal .col-lg-11 .col-sm-11, .form-horizontal .col-lg12 .col-sm-11, .form-horizontal .col-lg-1 .col-sm-12, .form-horizontal .col-lg-2 .col-sm-12, .form-horizontal .col-lg-3 .col-sm-12, .form-horizontal .col-lg-4 .col-sm-12, .form-horizontal .col-lg-5 .col-sm-12, .form-horizontal .col-lg-6 .col-sm-12, .form-horizontal .col-lg-7 .col-sm-12, .form-horizontal .col-lg-8 .col-sm-12, .form-horizontal .col-lg-9 .col-sm-12, .form-horizontal .col-lg-10 .col-sm-12, .form-horizontal .col-lg-11 .col-sm-12, .form-horizontal .col-lg12 .col-sm-12 { padding-left: 0; } form .has-error ul.help-block { list-style: none; padding-left: 0; } form .alert ul { list-style: none; padding-left: 0; }
AnimeNeko/atarashii-mal-api
web/css/bootstrap.css
CSS
apache-2.0
156,645
[ 30522, 1013, 1008, 999, 1008, 6879, 6494, 2361, 1058, 2509, 1012, 1017, 1012, 1021, 1006, 8299, 1024, 1013, 1013, 2131, 27927, 20528, 2361, 1012, 4012, 1007, 1008, 9385, 2249, 1011, 2355, 10474, 1010, 4297, 1012, 1008, 7000, 2104, 10210, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * TimeLineWidget.cpp - class timeLine, representing a time-line with position marker * * Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net> * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program (see COPYING); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * */ #include <QDomElement> #include <QTimer> #include <QApplication> #include <QLayout> #include <QMouseEvent> #include <QPainter> #include <QToolBar> #include "TimeLineWidget.h" #include "embed.h" #include "NStateButton.h" #include "GuiApplication.h" #include "TextFloat.h" #include "SongEditor.h" QPixmap * TimeLineWidget::s_posMarkerPixmap = nullptr; TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppb, Song::PlayPos & pos, const TimePos & begin, Song::PlayModes mode, QWidget * parent ) : QWidget( parent ), m_inactiveLoopColor( 52, 63, 53, 64 ), m_inactiveLoopBrush( QColor( 255, 255, 255, 32 ) ), m_inactiveLoopInnerColor( 255, 255, 255, 32 ), m_activeLoopColor( 52, 63, 53, 255 ), m_activeLoopBrush( QColor( 55, 141, 89 ) ), m_activeLoopInnerColor( 74, 155, 100, 255 ), m_loopRectangleVerticalPadding( 1 ), m_barLineColor( 192, 192, 192 ), m_barNumberColor( m_barLineColor.darker( 120 ) ), m_autoScroll( AutoScrollEnabled ), m_loopPoints( LoopPointsDisabled ), m_behaviourAtStop( BackToZero ), m_changedPosition( true ), m_xOffset( xoff ), m_posMarkerX( 0 ), m_ppb( ppb ), m_pos( pos ), m_begin( begin ), m_mode( mode ), m_savedPos( -1 ), m_hint( nullptr ), m_action( NoAction ), m_moveXOff( 0 ) { m_loopPos[0] = 0; m_loopPos[1] = DefaultTicksPerBar; if( s_posMarkerPixmap == nullptr ) { s_posMarkerPixmap = new QPixmap( embed::getIconPixmap( "playpos_marker" ) ); } setAttribute( Qt::WA_OpaquePaintEvent, true ); move( 0, yoff ); m_xOffset -= s_posMarkerPixmap->width() / 2; setMouseTracking(true); m_pos.m_timeLine = this; QTimer * updateTimer = new QTimer( this ); connect( updateTimer, SIGNAL( timeout() ), this, SLOT( updatePosition() ) ); updateTimer->start( 1000 / 60 ); // 60 fps connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ), this, SLOT( update() ) ); } TimeLineWidget::~TimeLineWidget() { if( getGUI()->songEditor() ) { m_pos.m_timeLine = nullptr; } delete m_hint; } void TimeLineWidget::setXOffset(const int x) { m_xOffset = x; if (s_posMarkerPixmap != nullptr) { m_xOffset -= s_posMarkerPixmap->width() / 2; } } void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { NStateButton * autoScroll = new NStateButton( _tool_bar ); autoScroll->setGeneralToolTip( tr( "Auto scrolling" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); connect( autoScroll, SIGNAL( changedState( int ) ), this, SLOT( toggleAutoScroll( int ) ) ); NStateButton * loopPoints = new NStateButton( _tool_bar ); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_off" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_on" ) ); connect( loopPoints, SIGNAL( changedState( int ) ), this, SLOT( toggleLoopPoints( int ) ) ); connect( this, SIGNAL( loopPointStateLoaded( int ) ), loopPoints, SLOT( changeState( int ) ) ); NStateButton * behaviourAtStop = new NStateButton( _tool_bar ); behaviourAtStop->addState( embed::getIconPixmap( "back_to_zero" ), tr( "After stopping go back to beginning" ) ); behaviourAtStop->addState( embed::getIconPixmap( "back_to_start" ), tr( "After stopping go back to " "position at which playing was " "started" ) ); behaviourAtStop->addState( embed::getIconPixmap( "keep_stop_position" ), tr( "After stopping keep position" ) ); connect( behaviourAtStop, SIGNAL( changedState( int ) ), this, SLOT( toggleBehaviourAtStop( int ) ) ); connect( this, SIGNAL( loadBehaviourAtStop( int ) ), behaviourAtStop, SLOT( changeState( int ) ) ); behaviourAtStop->changeState( BackToStart ); _tool_bar->addWidget( autoScroll ); _tool_bar->addWidget( loopPoints ); _tool_bar->addWidget( behaviourAtStop ); } void TimeLineWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "lp0pos", (int) loopBegin() ); _this.setAttribute( "lp1pos", (int) loopEnd() ); _this.setAttribute( "lpstate", m_loopPoints ); _this.setAttribute( "stopbehaviour", m_behaviourAtStop ); } void TimeLineWidget::loadSettings( const QDomElement & _this ) { m_loopPos[0] = _this.attribute( "lp0pos" ).toInt(); m_loopPos[1] = _this.attribute( "lp1pos" ).toInt(); m_loopPoints = static_cast<LoopPointStates>( _this.attribute( "lpstate" ).toInt() ); update(); emit loopPointStateLoaded( m_loopPoints ); if( _this.hasAttribute( "stopbehaviour" ) ) { emit loadBehaviourAtStop( _this.attribute( "stopbehaviour" ).toInt() ); } } void TimeLineWidget::updatePosition( const TimePos & ) { const int new_x = markerX( m_pos ); if( new_x != m_posMarkerX ) { m_posMarkerX = new_x; m_changedPosition = true; emit positionChanged( m_pos ); update(); } } void TimeLineWidget::toggleAutoScroll( int _n ) { m_autoScroll = static_cast<AutoScrollStates>( _n ); } void TimeLineWidget::toggleLoopPoints( int _n ) { m_loopPoints = static_cast<LoopPointStates>( _n ); update(); } void TimeLineWidget::toggleBehaviourAtStop( int _n ) { m_behaviourAtStop = static_cast<BehaviourAtStopStates>( _n ); } void TimeLineWidget::paintEvent( QPaintEvent * ) { QPainter p( this ); // Draw background p.fillRect( 0, 0, width(), height(), p.background() ); // Clip so that we only draw everything starting from the offset const int leftMargin = m_xOffset + s_posMarkerPixmap->width() / 2; p.setClipRect(leftMargin, 0, width() - leftMargin, height() ); // Draw the loop rectangle int const & loopRectMargin = getLoopRectangleVerticalPadding(); int const loopRectHeight = this->height() - 2 * loopRectMargin; int const loopStart = markerX( loopBegin() ) + 8; int const loopEndR = markerX( loopEnd() ) + 9; int const loopRectWidth = loopEndR - loopStart; bool const loopPointsActive = loopPointsEnabled(); // Draw the main rectangle (inner fill only) QRect outerRectangle( loopStart, loopRectMargin, loopRectWidth - 1, loopRectHeight - 1 ); p.fillRect( outerRectangle, loopPointsActive ? getActiveLoopBrush() : getInactiveLoopBrush()); // Draw the bar lines and numbers // Activate hinting on the font QFont font = p.font(); font.setHintingPreference( QFont::PreferFullHinting ); p.setFont(font); int const fontAscent = p.fontMetrics().ascent(); int const fontHeight = p.fontMetrics().height(); QColor const & barLineColor = getBarLineColor(); QColor const & barNumberColor = getBarNumberColor(); bar_t barNumber = m_begin.getBar(); int const x = m_xOffset + s_posMarkerPixmap->width() / 2 - ( ( static_cast<int>( m_begin * m_ppb ) / TimePos::ticksPerBar() ) % static_cast<int>( m_ppb ) ); for( int i = 0; x + i * m_ppb < width(); ++i ) { ++barNumber; if( ( barNumber - 1 ) % qMax( 1, qRound( 1.0f / 3.0f * TimePos::ticksPerBar() / m_ppb ) ) == 0 ) { const int cx = x + qRound( i * m_ppb ); p.setPen( barLineColor ); p.drawLine( cx, 5, cx, height() - 6 ); const QString s = QString::number( barNumber ); p.setPen( barNumberColor ); p.drawText( cx + 5, ((height() - fontHeight) / 2) + fontAscent, s ); } } // Draw the main rectangle (outer border) p.setPen( loopPointsActive ? getActiveLoopColor() : getInactiveLoopColor() ); p.setBrush( Qt::NoBrush ); p.drawRect( outerRectangle ); // Draw the inner border outline (no fill) QRect innerRectangle = outerRectangle.adjusted( 1, 1, -1, -1 ); p.setPen( loopPointsActive ? getActiveLoopInnerColor() : getInactiveLoopInnerColor() ); p.setBrush( Qt::NoBrush ); p.drawRect( innerRectangle ); // Only draw the position marker if the position line is in view if (m_posMarkerX >= m_xOffset && m_posMarkerX < width() - s_posMarkerPixmap->width() / 2) { // Let the position marker extrude to the left p.setClipping(false); p.setOpacity(0.6); p.drawPixmap(m_posMarkerX, height() - s_posMarkerPixmap->height(), *s_posMarkerPixmap); } } void TimeLineWidget::mousePressEvent( QMouseEvent* event ) { if( event->x() < m_xOffset ) { return; } if( event->button() == Qt::LeftButton && !(event->modifiers() & Qt::ShiftModifier) ) { m_action = MovePositionMarker; if( event->x() - m_xOffset < s_posMarkerPixmap->width() ) { m_moveXOff = event->x() - m_xOffset; } else { m_moveXOff = s_posMarkerPixmap->width() / 2; } } else if( event->button() == Qt::LeftButton && (event->modifiers() & Qt::ShiftModifier) ) { m_action = SelectSongTCO; m_initalXSelect = event->x(); } else if( event->button() == Qt::RightButton ) { m_moveXOff = s_posMarkerPixmap->width() / 2; const TimePos t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * TimePos::ticksPerBar() / m_ppb ); const TimePos loopMid = ( m_loopPos[0] + m_loopPos[1] ) / 2; if( t < loopMid ) { m_action = MoveLoopBegin; } else if( t > loopMid ) { m_action = MoveLoopEnd; } if( m_loopPos[0] > m_loopPos[1] ) { qSwap( m_loopPos[0], m_loopPos[1] ); } m_loopPos[( m_action == MoveLoopBegin ) ? 0 : 1] = t; } if( m_action == MoveLoopBegin || m_action == MoveLoopEnd ) { delete m_hint; m_hint = TextFloat::displayMessage( tr( "Hint" ), tr( "Press <%1> to disable magnetic loop points." ).arg(UI_CTRL_KEY), embed::getIconPixmap( "hint" ), 0 ); } mouseMoveEvent( event ); } void TimeLineWidget::mouseMoveEvent( QMouseEvent* event ) { parentWidget()->update(); // essential for widgets that this timeline had taken their mouse move event from. const TimePos t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * TimePos::ticksPerBar() / m_ppb ); switch( m_action ) { case MovePositionMarker: m_pos.setTicks(t.getTicks()); Engine::getSong()->setToTime(t, m_mode); if (!( Engine::getSong()->isPlaying())) { //Song::Mode_None is used when nothing is being played. Engine::getSong()->setToTime(t, Song::Mode_None); } m_pos.setCurrentFrame( 0 ); m_pos.setJumped( true ); updatePosition(); positionMarkerMoved(); break; case MoveLoopBegin: case MoveLoopEnd: { const int i = m_action - MoveLoopBegin; // i == 0 || i == 1 if( event->modifiers() & Qt::ControlModifier ) { // no ctrl-press-hint when having ctrl pressed delete m_hint; m_hint = nullptr; m_loopPos[i] = t; } else { m_loopPos[i] = t.quantize(1.0); } // Catch begin == end if( m_loopPos[0] == m_loopPos[1] ) { // Note, swap 1 and 0 below and the behavior "skips" the other // marking instead of pushing it. if( m_action == MoveLoopBegin ) { m_loopPos[0] -= TimePos::ticksPerBar(); } else { m_loopPos[1] += TimePos::ticksPerBar(); } } update(); break; } case SelectSongTCO: emit regionSelectedFromPixels( m_initalXSelect , event->x() ); break; default: break; } } void TimeLineWidget::mouseReleaseEvent( QMouseEvent* event ) { delete m_hint; m_hint = nullptr; if ( m_action == SelectSongTCO ) { emit selectionFinished(); } m_action = NoAction; }
zonkmachine/lmms
src/gui/TimeLineWidget.cpp
C++
gpl-2.0
12,090
[ 30522, 1013, 1008, 1008, 17060, 9148, 24291, 1012, 18133, 2361, 1011, 2465, 17060, 1010, 5052, 1037, 2051, 1011, 2240, 2007, 2597, 12115, 1008, 1008, 9385, 1006, 1039, 1007, 2432, 1011, 2297, 16858, 18629, 12881, 7959, 2140, 1026, 11291, 35...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Geranium pratense L. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Sp. pl. 2:681. 1753 #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Geraniales/Geraniaceae/Geranium/Geranium pratense/README.md
Markdown
apache-2.0
193
[ 30522, 1001, 16216, 21578, 2819, 10975, 3686, 12325, 1048, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 1996, 10161, 1997, 2166, 1010, 3822, 2254, 2249, 1001, 1001, 1001, 1001, 2405, 1999, 11867, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for `KBOOpenData_activity` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_activity`; CREATE TABLE IF NOT EXISTS `KBOOpenData_activity` ( `EntityNumber` varchar(13) NOT NULL COMMENT '9999.999.999 of 9.999.999.999', `ActivityGroup` varchar(6) NOT NULL COMMENT '(6)X', `NaceVersion` enum('2003','2008') NOT NULL, `NaceCode` varchar(9) NOT NULL COMMENT '(5)9 of (7)9', `Classification` char(4) NOT NULL COMMENT 'XXXX', PRIMARY KEY (`EntityNumber`,`ActivityGroup`,`NaceVersion`,`NaceCode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_address` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_address`; CREATE TABLE IF NOT EXISTS `KBOOpenData_address` ( `EntityNumber` varchar(13) NOT NULL COMMENT '9999.999.999 of 9.999.999.999', `TypeOfAddress` char(4) NOT NULL COMMENT 'XXXX', `CountryNL` varchar(100) DEFAULT NULL COMMENT '100(X)', `CountryFR` varchar(100) DEFAULT NULL COMMENT '100(X)', `Zipcode` varchar(20) DEFAULT NULL COMMENT '20(X)', `MunicipalityNL` varchar(200) DEFAULT NULL COMMENT '200(X)', `MunicipalityFR` varchar(200) DEFAULT NULL COMMENT '200(X)', `StreetNL` varchar(200) DEFAULT NULL COMMENT '200(X)', `StreetFR` varchar(200) DEFAULT NULL COMMENT '200(X)', `HouseNumber` varchar(22) DEFAULT NULL COMMENT '22(X)', `Box` varchar(20) DEFAULT NULL COMMENT '20(X)', `ExtraAddressInfo` varchar(80) DEFAULT NULL COMMENT '80(X)', `DateStrikingOff` char(10) NOT NULL COMMENT 'XX-XX-XXXX', PRIMARY KEY (`EntityNumber`,`TypeOfAddress`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_code` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_code`; CREATE TABLE IF NOT EXISTS `KBOOpenData_code` ( `Category` varchar(255) NOT NULL, `Code` varchar(255) NOT NULL, `Language` enum('DE','EN','FR','NL') NOT NULL, `Description` text NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_contact` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_contact`; CREATE TABLE IF NOT EXISTS `KBOOpenData_contact` ( `EntityNumber` varchar(13) NOT NULL COMMENT '9999.999.999 of 9.999.999.999', `EntityContact` varchar(3) NOT NULL COMMENT '(3)X', `ContactType` varchar(5) NOT NULL COMMENT '5(X)', `Value` varchar(254) NOT NULL COMMENT '(254)X', PRIMARY KEY (`EntityNumber`,`EntityContact`,`ContactType`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_denomination` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_denomination`; CREATE TABLE IF NOT EXISTS `KBOOpenData_denomination` ( `EntityNumber` varchar(13) NOT NULL COMMENT '9999.999.999 of 9.999.999.999', `Language` char(1) NOT NULL COMMENT 'X', `TypeOfDenomination` char(3) NOT NULL COMMENT 'XXX', `Denomination` varchar(320) NOT NULL COMMENT '(320)X', PRIMARY KEY (`EntityNumber`,`TypeOfDenomination`,`Language`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_enterprise` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_enterprise`; CREATE TABLE IF NOT EXISTS `KBOOpenData_enterprise` ( `EnterpriseNumber` varchar(12) NOT NULL COMMENT '9999.999.999', `Status` char(2) NOT NULL COMMENT 'XX', `JuridicalSituation` char(3) NOT NULL COMMENT 'XXX', `TypeOfEnterprise` char(1) NOT NULL COMMENT 'X', `JuridicalForm` char(3) DEFAULT NULL COMMENT 'XXX', `StartDate` char(10) NOT NULL COMMENT 'XX-XX-XXXX', PRIMARY KEY (`EnterpriseNumber`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_establishment` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_establishment`; CREATE TABLE IF NOT EXISTS `KBOOpenData_establishment` ( `EstablishmentNumber` varchar(13) NOT NULL DEFAULT '' COMMENT '9.999.999.999', `StartDate` char(10) NOT NULL COMMENT 'XX-XX-XXXX', `EnterpriseNumber` varchar(12) NOT NULL COMMENT '9999.999.999', PRIMARY KEY (`EstablishmentNumber`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_meta` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_meta`; CREATE TABLE IF NOT EXISTS `KBOOpenData_meta` ( `Variable` varchar(255) NOT NULL, `Value` varchar(255) DEFAULT NULL, PRIMARY KEY (`Variable`), UNIQUE KEY `metaUnique` (`Variable`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `KBOOpenData_mutationlog` -- ---------------------------- -- DROP TABLE IF EXISTS `KBOOpenData_mutationlog`; CREATE TABLE IF NOT EXISTS `KBOOpenData_mutationlog` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `tableName` varchar(64) NOT NULL, `recordKey` varchar(32) NOT NULL, `data_old` text, `data_new` text, `action` enum('insert','update','delete') NOT NULL, `mutationTimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=ARCHIVE AUTO_INCREMENT=64756 DEFAULT CHARSET=utf8;
TomLous/datatools
v1/lib/Tool/KBOOpenData/sql/db-000.sql
SQL
apache-2.0
5,288
[ 30522, 2275, 3415, 21183, 2546, 2620, 1025, 2275, 3097, 1035, 3145, 1035, 14148, 1027, 1014, 1025, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict"; var List = require("./list"); var FastSet = require("./fast-set"); var GenericCollection = require("./generic-collection"); var GenericSet = require("./generic-set"); var ObservableObject = require("pop-observe/observable-object"); var ObservableRange = require("pop-observe/observable-range"); var equalsOperator = require("pop-equals"); var hashOperator = require("pop-hash"); var copy = require("./copy"); module.exports = Set; function Set(values, equals, hash, getDefault) { if (!(this instanceof Set)) { return new Set(values, equals, hash, getDefault); } equals = equals || equalsOperator; hash = hash || hashOperator; getDefault = getDefault || noop; this.contentEquals = equals; this.contentHash = hash; this.getDefault = getDefault; // a list of values in insertion order, used for all operations that depend // on iterating in insertion order this.order = new this.Order(undefined, equals); // a set of nodes from the order list, indexed by the corresponding value, // used for all operations that need to quickly seek value in the list this.store = new this.Store( undefined, function (a, b) { return equals(a.value, b.value); }, function (node) { return hash(node.value); } ); this.length = 0; this.addEach(values); } Set.Set = Set; // hack for MontageJS copy(Set.prototype, GenericCollection.prototype); copy(Set.prototype, GenericSet.prototype); copy(Set.prototype, ObservableObject.prototype); copy(Set.prototype, ObservableRange.prototype); Set.prototype.Order = List; Set.prototype.Store = FastSet; Set.prototype.constructClone = function (values) { return new this.constructor(values, this.contentEquals, this.contentHash, this.getDefault); }; Set.prototype.has = function (value) { var node = new this.order.Node(value); return this.store.has(node); }; Set.prototype.get = function (value) { var node = new this.order.Node(value); node = this.store.get(node); if (node) { return node.value; } else { return this.getDefault(value); } }; Set.prototype.add = function (value) { var node = new this.order.Node(value); if (!this.store.has(node)) { var index = this.length; if (this.dispatchesRangeChanges) { this.dispatchRangeWillChange([value], [], index); } this.order.add(value); node = this.order.head.prev; this.store.add(node); this.length++; if (this.dispatchesRangeChanges) { this.dispatchRangeChange([value], [], index); } return true; } return false; }; Set.prototype["delete"] = function (value) { var node = new this.order.Node(value); if (this.store.has(node)) { var node = this.store.get(node); if (this.dispatchesRangeChanges) { this.dispatchRangeWillChange([], [value], node.index); } this.store["delete"](node); // removes from the set this.order.splice(node, 1); // removes the node from the list this.length--; if (this.dispatchesRangeChanges) { this.dispatchRangeChange([], [value], node.index); } return true; } return false; }; Set.prototype.pop = function () { if (this.length) { var result = this.order.head.prev.value; this["delete"](result); return result; } }; Set.prototype.shift = function () { if (this.length) { var result = this.order.head.next.value; this["delete"](result); return result; } }; Set.prototype.one = function () { if (this.length > 0) { return this.store.one().value; } }; Set.prototype.clear = function () { var clearing; if (this.dispatchesRangeChanges) { clearing = this.toArray(); this.dispatchRangeWillChange([], clearing, 0); } this.store.clear(); this.order.clear(); this.length = 0; if (this.dispatchesRangeChanges) { this.dispatchRangeChange([], clearing, 0); } }; Set.prototype.reduce = function (callback, basis /*, thisp*/) { var thisp = arguments[2]; var list = this.order; var index = 0; return list.reduce(function (basis, value) { return callback.call(thisp, basis, value, index++, this); }, basis, this); }; Set.prototype.reduceRight = function (callback, basis /*, thisp*/) { var thisp = arguments[2]; var list = this.order; var index = this.length - 1; return list.reduceRight(function (basis, value) { return callback.call(thisp, basis, value, index--, this); }, basis, this); }; Set.prototype.toArray = function () { return this.order.toArray(); }; Set.prototype.iterate = function () { return this.order.iterate(); }; Set.prototype.log = function () { var set = this.store; return set.log.apply(set, arguments); }; Set.prototype.makeRangeChangesObservable = function () { this.order.makeRangeChangesObservable(); }; function noop() {}
leogoesger/bloc-frontend-project-starter
node_modules/collections/set.js
JavaScript
apache-2.0
5,090
[ 30522, 1000, 2224, 9384, 1000, 1025, 13075, 2862, 1027, 5478, 1006, 1000, 1012, 1013, 2862, 1000, 1007, 1025, 13075, 3435, 13462, 1027, 5478, 1006, 1000, 1012, 1013, 3435, 1011, 2275, 1000, 1007, 1025, 13075, 12391, 26895, 18491, 1027, 5478...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jsonp({"cep":"32676602","logradouro":"Rua Ant\u00f4nio Machado","bairro":"Laranjeiras","cidade":"Betim","uf":"MG","estado":"Minas Gerais"});
lfreneda/cepdb
api/v1/32676602.jsonp.js
JavaScript
cc0-1.0
141
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 28188, 2581, 28756, 2692, 2475, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 21766, 2050, 14405, 1032, 1057, 8889, 2546, 2549, 27678, 24532, 9365, 1000...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using NUnit.Framework; using Should; namespace Configurator.Tests { public class GetTests : BaseTest { [Test] [ExpectedException(typeof(ConfigurationKeyNotFoundException))] public void Should_Validate_Key() { Config.Get<int>("test-int2"); } [Test] [ExpectedException(typeof(ConnectionStringNotFoundException))] public void Should_Validate_ConnectionString() { Config.GetConnectionString("connection-nope"); } [Test] public void Should_Get_ConnectionString() { Config .GetConnectionString("connection") .ShouldEqual("connection-string"); } [Test] public void Should_Get_Int() { Config .Get<int>("test-int") .ShouldEqual(5); } [Test] public void Should_Get_DateTime() { Config .Get<DateTime>("test-datetime") .ShouldEqual(new DateTime(2013, 1, 1)); } [Test] public void Should_Get_String() { Config .Get<string>("test-string") .ShouldEqual("test"); } [Test] public void Should_Get_Decimal() { Config .Get<decimal>("test-decimal") .ShouldEqual(9.5m); } [Test] public void Should_Get_Boolean() { Config .Get<bool>("test-bool") .ShouldEqual(true); } [Test] public void Should_Get_Int_with_type() { Config .Get(typeof(int), "test-int") .ShouldEqual(5); } [Test] public void Should_Get_DateTime_with_type() { Config .Get(typeof(DateTime), "test-datetime") .ShouldEqual(new DateTime(2013, 1, 1)); } [Test] public void Should_Get_String_with_type() { Config .Get(typeof(string), "test-string") .ShouldEqual("test"); } [Test] public void Should_Get_Decimal_with_type() { Config .Get(typeof(decimal), "test-decimal") .ShouldEqual(9.5m); } [Test] public void Should_Get_Boolean_with_type() { Config .Get(typeof(bool), "test-bool") .ShouldEqual(true); } } }
luisrudge/configurator
src/Configurator.Tests/GetTests.cs
C#
mit
2,626
[ 30522, 2478, 2291, 1025, 2478, 16634, 4183, 1012, 7705, 1025, 2478, 2323, 1025, 3415, 15327, 9530, 8873, 27390, 8844, 1012, 5852, 1063, 2270, 2465, 2131, 22199, 2015, 1024, 2918, 22199, 1063, 1031, 3231, 1033, 1031, 3517, 10288, 24422, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module.exports = { errorcodes: { NoError: 0, GeneralError: 1, InvalidGame: 2, Timeout: 3, InvalidRequest: 4, DoNotTrack: 5, GeoIPDisabled: 100, LeaderboardsDisabled: 200, InvalidName: 201, InvalidAuthKey: 202, NoFacebookId: 203, NoTableName: 204, InvalidPermalink: 205, NoLeaderboardId: 206, InvalidLeaderboardId: 207, PlayerBanned: 208, NotBestScore: 209, GameVarsDisabled: 300, PlayerLevelsDisabled: 400, InvalidRating: 401, AlreadyRated: 402, NoLevelName: 403, NoLevelId: 404, LevelAlreadyExists: 405, AchievementsDisabled: 500, NoPlayerId: 501, NoPlayerName: 502, NoAchievement: 503, InvalidAchievement: 504, AlreadyHadAchievementNotSaved: 505, AlreadyHadAchievementSaved: 506, NewsletterDisabled: 600, MailChimpNotConfigured: 601, MailChimpError: 602 }, descriptions: { // General Errors "0": "No error", "1": "General error, this typically means the player is unable to connect", "2": "Invalid game credentials. Make sure you use the keys you set up in your database", "3": "Request timed out", "4": "Invalid request", // GeoIP Errors "100": "GeoIP API has been disabled for this game", // Leaderboard Errors "200": "Leaderboard API has been disabled for this game", "201": "The player's name was not provided when saving a score", "203": "Player is banned from submitting scores in this game", "204": "Score was not saved because it was not the player's best. You can allow players to have more than one score by specifying allowduplicates=true in your save options", // GameVars Errors "300": "GameVars API has been disabled for this game", // LevelSharing Errors "400": "Level sharing API has been disabled for this game", "401": "Invalid rating value (must be 1 - 10)", "402": "Player has already rated that level", "403": "Missing level name", "404": "Missing levelid", "405": "Level already exists", // Achievement errors "500": "Achievements API has been disabled for this game", "501": "Missing playerid", "502": "Missing player name", "503": "Missing achievement", "504": "Invalid achievement for achievement key", "505": "Player already had the achievement. You can overwrite old achievements with overwrite=true or save each time the player is awarded with allowduplicates=true", "506": "Player already had the achievement and it was overwritten or a duplicate was saved successfully", // Newsletter errors "600": "Newsletter API has been disabled for this game", "601": "MailChimp API key is not configured", "602": "The MailChimp API returned an error" } };
aliirz/apiserver
api/errorcodes.js
JavaScript
mit
2,946
[ 30522, 11336, 1012, 14338, 1027, 1063, 7561, 23237, 1024, 1063, 2053, 2121, 29165, 1024, 1014, 1010, 2236, 2121, 29165, 1024, 1015, 1010, 19528, 16650, 1024, 1016, 1010, 2051, 5833, 1024, 1017, 1010, 19528, 2890, 15500, 1024, 1018, 1010, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'test_helper' class SCMAdaptersGitTest < MiniTest::Unit::TestCase def test_api config = MiniTest::Mock.new assert adapter = BriefMail::SCMAdapters::Git.new(config) %w( diff_stat log ).each do |name| assert adapter.respond_to?(name), %(Should respond to "%s" method) % name end %w( subdirs_diff_stat subdirs_log ).each do |name| assert adapter.respond_to?(name), %(Should respond to "%s" method) % name end end def test_log config = MiniTest::Mock.new assert adapter = BriefMail::SCMAdapters::Git.new(config) # %x() is syntatic sugar for backtick (`) method: adapter.stub(:`, %(Command output)) do config.expect :previous_revision, 1 config.expect :from_user, {} assert_equal %(Command output), adapter.log config.verify end end def test_diff_stat config = MiniTest::Mock.new assert adapter = BriefMail::SCMAdapters::Git.new(config) adapter.stub(:`, %(Command output)) do config.expect :previous_revision, 1 assert_equal %(Command output), adapter.diff_stat config.verify end end def test_subdirs_diff_stat config = MiniTest::Mock.new assert adapter = BriefMail::SCMAdapters::Git.new(config) def Dir.chdir(*args) yield if block_given? end adapter.stub(:`, %(Command output)) do config.expect :current_revision, 2 config.expect :previous_revision, 1 assert_equal({ "output" => "Command output"}, adapter.subdirs_diff_stat) config.verify end end def test_subdirs_log config = MiniTest::Mock.new assert adapter = BriefMail::SCMAdapters::Git.new(config) def Dir.chdir(*args) yield if block_given? end adapter.stub(:`, %(Command output)) do config.expect :current_revision, 2 config.expect :previous_revision, 1 config.expect :from_user, {} assert_equal({ "output" => "Command output"}, adapter.subdirs_log) config.verify end end end
sce/brief_mail
test/scm_adapters/git_test.rb
Ruby
mit
1,999
[ 30522, 5478, 1005, 3231, 1035, 2393, 2121, 1005, 2465, 8040, 23574, 13876, 2545, 23806, 22199, 1026, 7163, 22199, 1024, 1024, 3131, 1024, 1024, 3231, 18382, 13366, 3231, 1035, 17928, 9530, 8873, 2290, 1027, 7163, 22199, 1024, 1024, 12934, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var windowHeight = $(window).height(); var menuBarHeight = $('#codeplayer-menubar').height(); $('.codeplayer-code-container').css('height', (windowHeight - menuBarHeight) + 'px'); $('.codeplayer-toogle').click(function() { $(this).toggleClass('codeplayer-selected'); var codeContainerDiv = '#codeplayer-' + $(this).html() + '-container'; $(codeContainerDiv).toggle(); var showingDivs = $('.codeplayer-code-container').filter(function() { return $((this)).css('display') != 'none'; }).length; var divWidthPercentage = 100 / showingDivs; $('.codeplayer-code-container').css('width', divWidthPercentage + '%'); }); $('#codeplayer-runbuttondiv').click(function() { var iframeContent = '<style>' + $('#codeplayer-cssCode').val() + '</style>' + $('#codeplayer-htmlCode').val(); $('#codeplayer-iframe').contents().find('html').html(iframeContent); document.getElementById('codeplayer-iframe').contentWindow. eval($('#codeplayer-jsCode').val()) });
phillipemoreira/web-development
robpercival/4.jQuery/js/codeplayer.js
JavaScript
mit
1,020
[ 30522, 13075, 3332, 26036, 13900, 1027, 1002, 1006, 3332, 1007, 1012, 4578, 1006, 1007, 1025, 13075, 12183, 8237, 26036, 13900, 1027, 1002, 1006, 1005, 1001, 3642, 13068, 2121, 1011, 12183, 8237, 1005, 1007, 1012, 4578, 1006, 1007, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var AIO = require('../../index'); // create an instance aio = AIO(process.env.AIO_KEY || 'xxxxxxxxxxxx'); // get a list of all groups aio.groups(function(err, data) { if(err) { return console.error(err); } // log data array console.log(data); }); // get a specific group by name aio.groups('Test', function(err, data) { if(err) { return console.error(err); } // log data object console.log(data); });
bbx10/io-client-node
examples/groups/read.js
JavaScript
mit
435
[ 30522, 13075, 9932, 2080, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 5950, 1005, 1007, 1025, 1013, 1013, 3443, 2019, 6013, 9932, 2080, 1027, 9932, 2080, 1006, 2832, 1012, 4372, 2615, 1012, 9932, 2080, 1035, 3145, 1064, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="http://localhost/" /> <title>Aprove and Delete Mission</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr><td rowspan="1" colspan="3">Approve and Delete Mission</td></tr> </thead><tbody> <tr> <td>setTimeout</td> <td>45000</td> <td></td> </tr> <tr> <td>open</td> <td>index.php/mashableInbox/default</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>A mission status has changed</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=Click Here</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>New mission ${randomSuffix}</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>open</td> <td>index.php/mashableInbox/default/list?modelClassName=Mission</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>//div[@id='MashableInboxForm_optionForModel_area']/label[1]</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <!--tr> <td>click</td> <td>//div[@id='MissionsListView']/div/table/tbody/tr/td[3]/div/a/span[3]</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr--> <tr> <td>type</td> <td>id=MashableInboxForm_searchTerm</td> <td>New mission</td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>New mission ${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='MissionsListView']/div/table/tbody/tr/td/a</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>css=span.z-label</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Accepted</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Accepted</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>New mission ${randomSuffix}</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Accepted</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Jill Smith</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>I picked it... soon ill have it.</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Start this one really quick or the candy goes away...</td> <td></td> </tr> <!--Edit Mission--> <tr> <td>clickAndWait</td> <td>link=Edit</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>id=Mission_description</td> <td>New mission ${randomSuffix} - Great Job</td> </tr> <tr> <td>click</td> <td>css=button.ui-datepicker-trigger</td> <td></td> </tr> <tr> <td>type</td> <td>id=Mission_dueDateTime</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>name=save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>New mission ${randomSuffix} - Great Job</td> <td></td> </tr> <!--Remove comments--> <tr> <td>click</td> <td>xpath=//div[@class='comment-content']/span[2]/a</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>xpath=//div[@class='comment-content']/span[2]/a</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextNotPresent</td> <td>I picked it... soon ill have it.</td> <td></td> </tr> <tr> <td>assertTextNotPresent</td> <td>Start this one really quick or the candy goes away...</td> <td></td> </tr> <!--Delete mission--> <tr> <td>clickAndWait</td> <td>link=Delete</td> <td></td> </tr> <tr> <td>waitForConfirmation</td> <td>Are you sure you want to delete this mission?</td> <td></td> </tr> <tr> <td>chooseOkOnNextConfirmation</td> <td></td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>id=MashableInboxForm_searchTerm</td> <td>New mission ${randomSuffix}</td> </tr> <tr> <td>keyUp</td> <td>MashableInboxForm_searchTerm</td> <td>\10</td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>No results found.</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>No results found.</td> <td></td> </tr> <!--tr> <td>clickAndWait</td> <td>//div[@id='RecentlyViewedView']/ul/li/a/span[2]</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForText</td> <td>//div[@id='ModelNotFoundView']/h2</td> <td>The record you are trying to access does not exist.</td> </tr--> </tbody></table> </body> </html>
sandeep1027/zurmo_
app/protected/modules/missions/tests/functional/cases/ApproveMission.html
HTML
agpl-3.0
6,982
[ 30522, 1026, 1029, 20950, 2544, 1027, 1000, 1015, 1012, 1014, 1000, 17181, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1029, 1028, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 1060, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// GoSquared var GoSquared = {}; GoSquared.acct = "GSN-064561-T"; (function(w){ function gs(){ w._gstc_lt = +new Date; var d = document, g = d.createElement("script"); g.type = "text/javascript"; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js"; var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s); } w.addEventListener ? w.addEventListener("load", gs, false) : w.attachEvent("onload", gs); })(window); // Google Analytics var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-40084408-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); })();
Moussa/Wiki-Fi
static/js/analytics.js
JavaScript
gpl-3.0
905
[ 30522, 1013, 1013, 2175, 2015, 16211, 5596, 13075, 2175, 2015, 16211, 5596, 1027, 1063, 1065, 1025, 2175, 2015, 16211, 5596, 1012, 16222, 2102, 1027, 1000, 28177, 2078, 1011, 5757, 19961, 2575, 2487, 1011, 1056, 1000, 1025, 1006, 3853, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Collections.Generic; using System.Windows.Forms; using System.Xml; using System.Xml.XPath; namespace PlaylistEditor { class HTMLHandler { public static string XPathHTML(HtmlElement elem) { string elemXPath = ""; string children = ""; List<string> ParentTagsList = new List<string>(); List<string> TagsList = new List<string>(); while (elem.Parent != null) { //from actual node go to parent HtmlElement prnt = elem.Parent; ParentTagsList.Add(prnt.TagName); children += "|" + prnt.TagName; //loop through all the children foreach (HtmlElement chld in prnt.Children) { //=> this code is retrieving all the paths to the root. //=>I will create an array with it instead of looping trough all the childern of the parent TagsList.Add(chld.TagName); } elem = elem.Parent; TagsList.Add(elem.TagName); } string prevtag = ""; //holds the previous tag to create the duplicate tag index int tagcount = 1; //holds the duplicate tag index foreach (string tag in TagsList) { if (tag == prevtag) { //if (tagcount == 1) //{ // tagcount++; // int prvtaglength = ("/" + tag + "/").Length; // if (prvtaglength > elemXPath.Length - prvtaglength) // { // elemXPath = "/" + tag + "[" + tagcount + "]"; // } // else // { // elemXPath = elemXPath.Substring(prvtaglength, elemXPath.Length - prvtaglength); // elemXPath = "/" + tag + "[" + tagcount + "]/" + elemXPath; // } //} //else //{ int prvtaglength = ("/" + tag + "[" + tagcount + "]/").Length; if (prvtaglength > elemXPath.Length - prvtaglength) { elemXPath = "/" + tag + "[" + tagcount + "]"; } else { elemXPath = elemXPath.Substring(prvtaglength, elemXPath.Length - prvtaglength); tagcount++; elemXPath = "/" + tag + "[" + tagcount + "]/" + elemXPath; } //} } else { tagcount = 1; elemXPath = "/" + tag + "[" + tagcount + "]" + elemXPath; } prevtag = tag; } //this.txtExtracted.Text = children + Environment.NewLine + elemXPath.ToLower(); return elemXPath.ToLower(); } public static string XPathHTMLSimple(HtmlElement elem) { HtmlElement selelem = elem; string elemXPath = ""; string prntXPath = ""; string children = ""; List<string> ParentTagsList = new List<string>(); List<string> TagsList = new List<string>(); //loop through the parents until reaching root while (elem.Parent != null) { //from actual node go to parent HtmlElement prnt = elem.Parent; ParentTagsList.Add(prnt.TagName); prntXPath = getParentLocation(prnt) + prntXPath; elem = elem.Parent; } //Add selected element to path; elemXPath = getParentLocation(selelem); //Join the selected path with the route to root elemXPath = prntXPath + elemXPath; ////br[1]/div[1]/ul[8]/li[1]/a //TODO: The XPath should be shorten to the nearest unique value and use // (from root XPath indicator) //this.txtExtracted.Text = children + Environment.NewLine + elemXPath.ToLower(); return elemXPath.ToLower(); } public static string XPathHTMLtoXMLBackwards(HtmlElement elem) { string prntXPath = ""; List<string> ParentTagsList = new List<string>(); string XMLelem = ""; XPathNavigator xpathNav = null; //Convert selected element to XML XMLelem = XMLHandler.HTMLtoXMLString(elem.OuterHtml); //TODO!! ==V //The search has to be done after the complete document is in xml not using parent and intermediate conversions //the result is not the same XmlDocument prntXDoc = null; //loop through the parents until reaching root while (elem.Parent != null) { //(Using HTMLElement) //from actual node go to parent //HtmlElement prnt = elem.Parent; //ParentTagsList.Add(prnt.TagName); //prntXPath = getParentLocation(prnt) + prntXPath; //(Using HTMLDocument) prntXDoc = XMLHandler.HTMLtoXML(elem.Parent.OuterHtml); string Xelem = XMLHandler.HTMLtoXMLString(elem.OuterHtml); ParentTagsList.Add(prntXDoc.DocumentElement.Name); prntXPath = XMLHandler.getParentXPath(prntXDoc.FirstChild.ChildNodes, Xelem, elem.TagName.ToLower()) + prntXPath; elem = elem.Parent; } if (prntXDoc != null) { prntXPath = "/" + prntXDoc.FirstChild.Name + "[1]" + prntXPath; } ////br[1]/div[1]/ul[8]/li[1]/a ///html[1]/body[1]/br[1]/p[1]/hr[1]/center[1]/hr[1]/p[1]/p[1] //TODO: The XPath should be shorten to the nearest unique value and use // (from root XPath indicator) //this.txtExtracted.Text = prntXPath; return prntXPath.ToLower(); } public static string XPathHTMLtoXML(string html, string elem, string tagname) { string prntXPath = ""; List<string> ParentTagsList = new List<string>(); string XMLelem = ""; //Convert selected element to XML XMLelem = XMLHandler.HTMLtoXMLString(elem); //TODO!! ==V //The search has to be done after the complete document is in xml not using parent and intermediate conversions //the result is not the same XmlDocument prntXDoc = null; prntXDoc = XMLHandler.HTMLtoXML(html); prntXPath = XMLHandler.getChildrenXPath(prntXDoc.FirstChild.ChildNodes, XMLelem) + prntXPath; if (prntXDoc != null) { prntXPath = "//" + prntXDoc.FirstChild.Name + "[1]" + prntXPath; } ////br[1]/div[1]/ul[8]/li[1]/a ///html[1]/body[1]/br[1]/p[1]/hr[1]/center[1]/hr[1]/p[1]/p[1] //TODO: The XPath should be shorten to the nearest unique value and use // (from root XPath indicator) //this.txtExtracted.Text = prntXPath; return prntXPath.ToLower(); } public static string getParentLocation(HtmlElement selelem) { string elemXPath = ""; string prevtag = ""; //holds the previous tag to create the duplicate tag index int tagcount = 0; //holds the duplicate tag index if (selelem.Parent != null && selelem.Parent.Children != null) { foreach (HtmlElement chld in selelem.Parent.Children) { string tag = chld.TagName; if (tag == selelem.TagName)//Only write to XPath if the tag is the same not if it is a sibling. 7-13-2015 { //if (tag == prevtag) //{ tagcount++; int prvtaglength = ("/" + tag + "[" + tagcount + "]/").Length; if (prvtaglength > elemXPath.Length - prvtaglength) { elemXPath = "/" + tag + "[" + tagcount + "]"; } else { elemXPath = elemXPath.Substring(prvtaglength, elemXPath.Length - prvtaglength); tagcount++; elemXPath = elemXPath + "/" + tag + "[" + tagcount + "]"; } //} //else //{ // tagcount = 1; // elemXPath = elemXPath + "/" + tag + "[" + tagcount + "]"; //} } prevtag = tag; if (chld.InnerHtml == selelem.InnerHtml) { break; } } } return elemXPath; } } }
jeborgesm/PlaylistEditor
PlaylistEditor/Objects/HTMLHandler.cs
C#
apache-2.0
9,234
[ 30522, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 3645, 1012, 3596, 1025, 2478, 2291, 1012, 20950, 1025, 2478, 2291, 1012, 20950, 1012, 26726, 8988, 1025, 3415, 15327, 2377, 9863, 2098, 15660, 1063, 2465, 16129, 11774, 391...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.formulasearchengine.mathosphere.mlp.text; import com.google.common.collect.Lists; import org.junit.Assert; import org.junit.Test; import java.io.File; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * Created by Moritz on 12.12.2015. */ public class WikidataInterfaceTest { String[] qIds = new String[] {"Q7913892", "Q12503", "Q3176558", "Q36161", "Q739925", "Q49008", "Q12503", "Q5156597", "Q11567", "Q1413083", "Q50700", "Q50701", "Q935944", "Q50701", "Q935944", "Q1144319", "Q50700", "Q3150667", "Q2256802", "Q729113", "Q21199", "Q33456", "Q44946", "Q230883", "Q21199", "Q21199", "Q50700", "Q50700", "Q50700", "Q50700", "Q378201", "Q302462", "Q3913", "Q3913", "Q3913", "Q12916", "Q12916", "Q11352", "Q2303886", "Q526719", "Q11348", "Q1027788", "Q12916", "Q12916", "Q946764", "Q19033", "Q126017", "Q230963", "Q2303886", "Q168698", "Q917476", "Q17285", "Q1663694", "Q1663694", "Q1663694", "Q1663694", "Q5597315", "Q5597315", "Q2303886", "Q46276", "Q2140940", "Q36253", "Q1096885", "Q189569", "Q3176558", "Q188889", "Q188889", "Q13824", "Q2111", "Q174102", "Q1440227", "Q167", "Q1515261", "Q1128317", "Q111059", "Q111059", "Q43260", "Q3150667", "Q43260", "Q11567", "Q2095069", "Q21199", "Q21199", "Q2303886", "Q2303886", "Q1137759", "Q193796", "Q12916", "Q6520159", "Q11471", "Q167", "Q12916", "Q12916", "Q21199", "Q21199", "Q3686031", "Q11471", "Q9492", "Q12916", "Q4440864", "Q12916", "Q18373", "Q2111", "Q1289248", "Q876346", "Q1289248", "Q464794", "Q193794", "Q192826", "Q11471", "Q929043", "Q2518235", "Q782566", "Q1074380", "Q1413083", "Q1413083", "Q1008943", "Q1256787", "Q13471665", "Q1289248", "Q2337858", "Q11348", "Q11348", "Q11348", "Q11471", "Q2918589", "Q1045555", "Q21199", "Q82580", "Q18848", "Q18848", "Q1952404", "Q11703678", "Q11703678", "Q2303886", "Q1096885", "Q4440864", "Q2362761", "Q11471", "Q3176558", "Q30006", "Q11567", "Q3258885", "Q131030", "Q21406831", "Q131030", "Q186290", "Q1591095", "Q11348", "Q3150667", "Q474715", "Q379825", "Q379825", "Q192704", "Q44432", "Q44432", "Q319913", "Q12916", "Q12916", "Q2627460", "Q2627460", "Q190109", "Q83478", "Q18848", "Q379825", "Q844128", "Q2608202", "Q29539", "Q11465", "Q176737", "Q176737", "Q176737", "Q1413083", "Q1759756", "Q900231", "Q39297", "Q39297", "Q39552", "Q39297", "Q1948412", "Q3554818", "Q21199", "Q12916", "Q168698", "Q50701", "Q11053", "Q12916", "Q12916", "Q12916", "Q12503", "Q12503", "Q176623", "Q10290214", "Q10290214", "Q505735", "Q1057607", "Q11471", "Q1057607", "Q5227327", "Q6901742", "Q159375", "Q2858846", "Q1134404", "Q12916", "Q4440864", "Q838611", "Q44946", "Q173817", "Q12916", "Q21199", "Q12916", "Q190056", "Q10290214", "Q10290214", "Q506041", "Q2858846"}; @Test public void testGetAliases() throws Exception { for (String qid : qIds) { Path file = Paths.get(File.createTempFile("temp", Long.toString(System.nanoTime())).getPath()); List<String> aliases = WikidataInterface.getAliases(qid); aliases = aliases.stream().map(a -> "\"" + a + "\"").collect(Collectors.toList()); Files.write(file, aliases, Charset.forName("UTF-8")); } } @Test public void testGetEntities() throws Exception { final ArrayList<String> expected = Lists.newArrayList("Q12916"); Assert.assertEquals(expected.get(0), WikidataInterface.getEntities("real number").get(0)); } }
TU-Berlin/mathosphere
mathosphere-core/src/test/java/com/formulasearchengine/mathosphere/mlp/text/WikidataInterfaceTest.java
Java
apache-2.0
6,118
[ 30522, 7427, 4012, 1012, 25814, 14644, 21043, 3170, 1012, 8785, 25444, 1012, 19875, 2361, 1012, 3793, 1025, 12324, 4012, 1012, 8224, 1012, 2691, 1012, 8145, 1012, 7201, 1025, 12324, 8917, 1012, 12022, 4183, 1012, 20865, 1025, 12324, 8917, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.sentenial.ws.client.dd; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CommunicationLanguage. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="CommunicationLanguage"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}token"> * &lt;enumeration value="pt"/> * &lt;enumeration value="nl"/> * &lt;enumeration value="fr"/> * &lt;enumeration value="en"/> * &lt;enumeration value="it"/> * &lt;enumeration value="es"/> * &lt;enumeration value="de"/> * &lt;enumeration value="sk"/> * &lt;enumeration value="fr_BE"/> * &lt;enumeration value="nl_BE"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "CommunicationLanguage", namespace = "urn:com:sentenial:origix:ws:common:types") @XmlEnum public enum CommunicationLanguage { @XmlEnumValue("pt") PT("pt"), @XmlEnumValue("nl") NL("nl"), @XmlEnumValue("fr") FR("fr"), @XmlEnumValue("en") EN("en"), @XmlEnumValue("it") IT("it"), @XmlEnumValue("es") ES("es"), @XmlEnumValue("de") DE("de"), @XmlEnumValue("sk") SK("sk"), @XmlEnumValue("fr_BE") FR_BE("fr_BE"), @XmlEnumValue("nl_BE") NL_BE("nl_BE"); private final String value; CommunicationLanguage(String v) { value = v; } public String value() { return value; } public static CommunicationLanguage fromValue(String v) { for (CommunicationLanguage c: CommunicationLanguage.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
whelanp/sentenial-ws-client
src/main/java/com/sentenial/ws/client/dd/CommunicationLanguage.java
Java
mit
1,851
[ 30522, 7427, 4012, 1012, 2741, 19825, 2140, 1012, 1059, 2015, 1012, 7396, 1012, 20315, 1025, 12324, 9262, 2595, 1012, 20950, 1012, 14187, 1012, 5754, 17287, 3508, 1012, 20950, 2368, 2819, 1025, 12324, 9262, 2595, 1012, 20950, 1012, 14187, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import {BasePaginator, errors} from './base-paginator'; import PaginatorError from '../paginator-error'; import * as queryHandler from '../helpers/query-handler-stub'; import * as request from '../helpers/request-spy'; const {assert, expect} = chai; chai.use(chaiAsPromised); chai.use(sinonChai); describe('drf-paginator', function() { afterEach(function() { request.spy.reset(); queryHandler.resetSpies(); }); describe('BasePaginator', function() { let paginator; const makePaginator = function(queryParams) { paginator = new BasePaginator(request.spy) .setQueryHandler(queryHandler.stub); if (queryParams) { paginator.setQueryParams(queryParams); } }; describe('page', function() { beforeEach(function() { makePaginator(); }); it('defaults to zero', function() { expect(paginator.page).to.equal(0); }); }); describe('queryHandler', function() { beforeEach(function() { paginator = new BasePaginator(request.spy); }); it('defaults to `null`', function() { expect(paginator.page).to.equal(0); }); }); describe('next', function() { beforeEach(function() { makePaginator(); }); it('returns a promise that resolves', function() { const promise = paginator.next(); return expect(promise).to.eventually.resolve; }); it('returns a promise with a response object', function() { const response = paginator.next(); return expect(response).to.eventually.be.an('object'); }); it('increments the page', function() { expect(paginator.page).to.equal(0); const page = paginator.next() .then(() => paginator.page); return expect(page).to.eventually.equal(1); }); it('sends a request using the request function', function() { const requestCallCount = paginator.next() .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(1); }); }); describe('prev', function() { beforeEach(function() { makePaginator({ page: 2 }); }); it('returns a promise that resolves', function() { const promise = paginator.prev(); return expect(promise).to.eventually.resolve; }); it('returns a promise with a response object', function() { const response = paginator.prev(); return expect(response).to.eventually.be.an('object'); }); it('decrements the page', function() { expect(paginator.page).to.equal(2); const page = paginator.prev() .then(() => paginator.page); return expect(page).to.eventually.equal(1); }); it('sends a request using the request function', function() { const requestCallCount = paginator.prev() .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(1); }); }); describe('first', function() { beforeEach(function() { makePaginator(); }); it('returns a promise that resolves', function() { const promise = paginator.first(); return expect(promise).to.eventually.resolve; }); it('returns a promise with a response object', function() { const response = paginator.first(); return expect(response).to.eventually.be.an('object'); }); it('sets the page to the first page ', function() { expect(paginator.page).to.equal(0); const page = paginator.first() .then(() => paginator.page); return expect(page).to.eventually.equal(1); }); it('sends a request using the request function', function() { const requestCallCount = paginator.first() .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(1); }); }); describe('last', function() { beforeEach(function() { makePaginator(); }); it('returns a promise that resolves', function() { const promise = paginator.last(); return expect(promise).to.eventually.resolve; }); it('returns a promise with a response object', function() { const response = paginator.last(); return expect(response).to.eventually.be.an('object'); }); it('sets the paginator\'s current page to the last page', function() { expect(paginator.page).to.equal(0); const page = paginator.last() .then(() => paginator.page); return expect(page).to.eventually.equal(10); }); it('sends requests to get the page count and the last page.', function() { const requestCallCount = paginator.last() .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(2); }); }); describe('current', function() { beforeEach(function() { makePaginator({ page: 1 }); }); it('returns a promise that resolves', function() { const promise = paginator.current(); return expect(promise).to.eventually.resolve; }); it('doesn\'t change the page', function() { expect(paginator.page).to.equal(1); const page = paginator.current() .then(() => paginator.page); return expect(page).to.eventually.equal(1); }); it('sends a request using the request function', function() { const requestCallCount = paginator.current() .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(1); }); }); describe('fetchPage', function() { beforeEach(function() { makePaginator(); }); it('returns a promise that resolves', function() { const promise = paginator.fetchPage(1); return expect(promise).to.eventually.resolve; }); it('returns a promise with a response object', function() { const response = paginator.fetchPage(1); return expect(response).to.eventually.be.an('object'); }); it('sends a request using the request function', function() { const requestCallCount = paginator.fetchPage(1) .then(request.getCallCount); return expect(requestCallCount).to.eventually.equal(1); }); it('returns a rejected promise for pages before the first page', function() { const promise = paginator.fetchPage(0); return expect(promise).to.eventually.be.rejectedWith(Error); }); it('rejects pages after the last page when the page count is known', function() { // The max page of the fixture is 10 const promise = paginator.fetchPageCount() .then(() => paginator.fetchPage(13)); return expect(promise).to.eventually.be.rejectedWith(Error); }); it('accepts pages after the last page when the page count is unknown', function() { const promise = paginator.fetchPage(13); return expect(promise).to.eventually.resolve; }); it('clone responses', function() { const first = paginator.fetchPage(1); const second = first.then(() => paginator.fetchPage(1)); return Promise.all([first, second]) .spread(assert.notStrictEqual); }); it('caches requests', function() { const first = paginator.fetchPage(1) .then((res) => res.uniqueValue); const second = first.then(() => paginator.fetchPage(1)) .then((res) => res.uniqueValue); return Promise.all([first, second]) .spread(assert.strictEqual); }); it('calls the query handler\'s `onResponse` method', function() { const onResponseCallCount = paginator.fetchPage(1) .then(() => queryHandler.stub.onResponse.callCount); return expect(onResponseCallCount).to.eventually.equal(1); }); it('throws an error if the query handler isn\'t set', function() { paginator.queryHandler = null; const check = function() { paginator.fetchPage(1); }; const msg = errors.queryHandlerMissing; return expect(check).to.throw(PaginatorError, msg); }); }); describe('fetchPageCount', function() { beforeEach(function() { makePaginator(); sinon.spy(paginator, 'fetchPage'); }); afterEach(function() { paginator.fetchPage.restore(); }); it('returns a promise that resolves', function() { const promise = paginator.fetchPageCount(); return expect(promise).to.eventually.resolve; }); it('returns a promise with the paginator\'s page count', function() { const pageCount = paginator.fetchPageCount(); return expect(pageCount).to.eventually.equal(10); }); it('caches the page count', function() { const fetchPageCallCount = paginator.fetchPageCount() .then(() => paginator.fetchPageCount()) .then(() => paginator.fetchPage.callCount); return expect(fetchPageCallCount).to.eventually.equal(1); }); }); describe('setQueryHandler', function() { beforeEach(function() { paginator = new BasePaginator(request.spy); }); it('sets the query handler', function() { const obj = {}; paginator.setQueryHandler(obj); expect(paginator.queryHandler).to.equal(obj); }); it('is a fluent method', function() { var result = paginator.setQueryHandler({}); expect(result).to.equal(paginator); }); }); describe('setQueryParams', function() { beforeEach(function() { makePaginator(); }); it('sets the parameters in the query handler', function() { const queryParams = { page: 42 }; paginator.setQueryParams(queryParams); expect(paginator.queryHandler.setParams) .to.have.been.calledWithMatch(queryParams); }); it('updates the paginator\'s page based on the given parameters', function() { expect(paginator.page).to.equal(0); paginator.setQueryParams({ page: 42 }); expect(paginator.page).to.equal(42); }); it('is a fluent method', function() { var result = paginator.setQueryParams({}); expect(result).to.equal(paginator); }); }); }); });
yola/drf-paginator
src/paginators/base-paginator-spec.js
JavaScript
mit
10,685
[ 30522, 12324, 15775, 2072, 2013, 1005, 15775, 2072, 1005, 1025, 12324, 15775, 7951, 21572, 28732, 2094, 2013, 1005, 15775, 2072, 1011, 2004, 1011, 5763, 1005, 1025, 12324, 19432, 2078, 2013, 1005, 19432, 2078, 1005, 1025, 12324, 19432, 12680,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* pointbreak.js - PointBreak provides a friendly interface to matchMedia with named media queries and easy to create callbacks. Authors & copyright (c) 2013: WebLinc, David Knight. */ (function(win) { 'use strict'; var EVENT_TYPE_MATCH = 'match', EVENT_TYPE_UNMATCH = 'unmatch'; // Create a point object which contains the functionality to trigger events and name alias for the media query function createPoint() { return { name : null, media : '', mql : null, listeners : { once : { match : null, unmatch : null }, match : [], unmatch : [] }, trigger : function(type) { var listenerType = this.listeners[type]; for (var i = 0, len = listenerType.length; i < len; i++) { var listener = listenerType[i]; if (typeof(listener.callback) === 'function') { listener.callback.call(win, this, listener.data); } } }, handleListener: null, // Fires 'callback' that matches the 'type' immediately now : function(type, callback, data) { var matches = this.mql && this.mql.matches; if ((type === EVENT_TYPE_MATCH && matches) || (type === EVENT_TYPE_UNMATCH && !matches)) { callback.call(win, this, data || {}); } return this; }, // Fired the first time the conditions are matched or unmatched once : function(type, callback, data) { var matches = this.mql && this.mql.matches; if ((type === EVENT_TYPE_MATCH && matches) || (type === EVENT_TYPE_UNMATCH && !matches)) { this.once[type] = null; callback.call(win, this, data || {}); } else { this.once[type] = { callback : callback, data : data }; } return this; }, // Fired each time the conditions are matched or unmatched which could be multiple times during a session on : function(type, callback, data) { this.listeners[type].push({ callback : callback, data : data || {} }); return this; }, // Removes a specific callback or all callbacks if 'callback' is undefined for 'match' or 'unmatch' off : function(type, callback) { if (callback) { var listenerType = this.listeners[type]; for (var i = 0; i < listenerType.length; i++) { if (listenerType[i].callback === callback) { listenerType.splice(i, 1); i--; } } } else { this.listeners[type] = []; this.once[type] = null; } return this; } }; } // Interface for points that provides easy get/set methods and storage in the 'points' object win.PointBreak = { // Contains alias for media queries points: {}, // PointBreak.set('xsmall', '(min-width: 320px) and (max-width: 480px)') set: function (name, value) { var point = this.points[name]; // Reset 'listeners' and removeListener from 'mql' (MediaQueryList) // else create point object and add 'name' property if (point) { point.mql.removeListener(point.handleListener); point .off(EVENT_TYPE_MATCH) .off(EVENT_TYPE_UNMATCH); } else { point = this.points[name] = createPoint(); point.name = name; } // Set up listener function for 'mql' point.handleListener = function(mql) { var type = (mql.matches && EVENT_TYPE_MATCH) || EVENT_TYPE_UNMATCH, once = point.once[type]; // 'point' comes from the 'set' scope if (typeof(once) === 'function') { point.once[type] = null; once.call(win, point); } point.trigger(type); }; // Set up matchMedia and listener, requires matchMedia support or equivalent polyfill to evaluate media query // See https://github.com/weblinc/media-match or https://github.com/paulirish/matchMedia.js for matchMedia polyfill point.media = value || 'all'; point.mql = (win.matchMedia && win.matchMedia(point.media)) || { matches : false, media : point.media, addListener : function() {}, removeListener : function() {} }; point.mql.addListener(point.handleListener); return point; }, // PointBreak.get('xsmall') get: function(name) { return this.points[name] || null; }, // PointBreak.matches('xsmall') matches: function(name) { return (this.points[name] && this.points[name].mql.matches) || false; }, // PointBreak.lastMatch('xsmall small medium') lastMatch: function(nameList) { var list = nameList.indexOf(' ') ? nameList.split(' ') : [nameList], name = '', result = ''; for (var i = 0, len = list.length; i < len; i++) { name = list[i]; if (this.points[name] && this.points[name].mql.matches) { result = name; } } return result; } }; })(window);
weblinc/pointbreak.js
pointbreak.js
JavaScript
mit
6,390
[ 30522, 1013, 1008, 2391, 23890, 1012, 1046, 2015, 1011, 2391, 23890, 3640, 1037, 5379, 8278, 2000, 2674, 16969, 2007, 2315, 2865, 10861, 5134, 1998, 3733, 2000, 3443, 2655, 12221, 1012, 6048, 1004, 9385, 1006, 1039, 1007, 2286, 1024, 4773, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
### Remove trailing spaces `:%s/\s\+$//e` ### Create a password-protected file using vim: `vim -x ostechnix.txt` ### To remove the password, open the file using vim: `vim ostechnix.txt` And type: `:set key=` Finally type `:wq` to save and close the file. ### Indent the whole file in VIM ([Source](https://stackoverflow.com/questions/506075/how-do-i-fix-the-indentation-of-an-entire-file-in-vi)) `gg=G` ### Text selection ([Source](https://www.cs.swarthmore.edu/oldhelp/vim/selection.html)) ``` V - selects entire lines v - selects range of text ctrl-v - selects columns gv - reselect block ``` ### Basics (command mode) * `:open FILE_PATH` : open a file * `x` - to delete the unwanted character * `u` - to undo the last the command and U to undo the whole line * `CTRL-R` to redo * `U` - return the last line which was modified to its original state (reverse all changes in last modified line) * `A` - to append text at the end * `:wq` - to save and exit * `:q!` - to trash all changes * `dw` - move the cursor to the beginning of the word to delete that word * `2w` - to move the cursor two words forward. * `3e` - to move the cursor to the end of the third word forward. * `0` (zero) to move to the start of the line. * `d2w` - which deletes 2 words .. You can change the paramater, e.g `d3w` for deleting three consecutive words. * `dd` to delete the line and `2dd` to delete to line . Change the number for deleting the number of consecutive words. * `p` - puts the previously deleted text after the cursor(Type `dd` to delete the line and store it in a Vim register. and `p` to put the line) * `r` - to replace the letter e.g press re to replace the letter with e * `ce` - to change until the end of a word (place the cursor on the u in lubw it will delete ubw ) * `ce` - deletes the word and places you in Insert mode * `G` - to move you to the bottom of the file. * `gg` - to move you to the start of the file. * Type the number of the line you were on and then `G` % to find a matching ),], or } * `:s/old/new/g` to substitute 'new' for 'old' where `g` is globally * `/` backward search n to find the next occurrence and N to search in opposite direction * `?` forward search * `:!` to run the shell commands like `:!dir`, `:!ls` * `:w` - TEST (where TEST is the filename you chose.) . Save the file * `v` - starts visual mode for selecting the lines and you can perform operation on that like d delete * `:r` - Filename will insert the content into the current file * `R` - to replace more than one character * `y` - operator to copy text using `v` visual mode and `p` to paste it * `yw` - (copy)yanks one word * `o` - opens a line below the cursor and start Insert mode. * `O` - opens a line above the cursor. * `a` - inserts text after the cursor. * `A` - inserts text after the end of the line. * `e` - command moves to the end of a word. * `y` - operator yanks (copies) text,`p` puts (pastes) it. * `R` - enters Replace mode until `<ESC>` is pressed. * `ctrl-w` to jump from one window to another (see also Window Management section) ### Executing commands (shell) use current buffer as input of a shell command * `:%! grep hello` to search for all lines containing hello in the current buffer ([Source](https://superuser.com/a/1507327/453117)) ### Window management * `:tabe filename` to open a file in a new tab ([Source](https://unix.stackexchange.com/a/27587/220566)) * `gT` and `gt` can be used to switch between tabs ([Source](https://unix.stackexchange.com/a/27587/220566)) * `vim -p file1 file2` to open files in tabs ([Source](https://unix.stackexchange.com/questions/27586/how-can-i-edit-multiple-files-in-vim#comment37261_27587)) * `:sp [file]` or `Ctrl+W, s` : split the window (horizontally) ([Source](https://unix.stackexchange.com/a/27616/220566)) * `:vsp [file]` or `Ctrl+W, v` : split the window (vertically) ([Source](https://unix.stackexchange.com/a/27616/220566)) * `Ctrl+w, l` : move to the right window from the left ([Source](https://linuxhint.com/how-to-use-vim-split-screen/)) * `Ctrl+w, h` : move to the left window again ([Source](https://linuxhint.com/how-to-use-vim-split-screen/)) * To find more commands: [How To Use VIM Split Screen](https://linuxhint.com/how-to-use-vim-split-screen/) ### Buffer management * `:bf` go to first file * `:bn` go to next file * `:bp` go to previous file * `:bl` go to last file * `:bw` close file * `:help buffer` to find more information ### YouCompleteMe * `Ctrl+<SPACE>` trigger auto completion ### Sources * [Basic Vim commands - For getting started](https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started)
MorganGeek/bookmarks
cheat/vim.md
Markdown
gpl-3.0
4,639
[ 30522, 1001, 1001, 1001, 6366, 12542, 7258, 1036, 1024, 1003, 1055, 1013, 1032, 1055, 1032, 1009, 1002, 1013, 1013, 1041, 1036, 1001, 1001, 1001, 3443, 1037, 20786, 1011, 5123, 5371, 2478, 6819, 2213, 1024, 1036, 6819, 2213, 1011, 1060, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
;(function(root) { /** * Constructs a new cross storage client given the url to a hub. By default, * an iframe is created within the document body that points to the url. It * also accepts an options object, which may include a timeout, frameId, and * promise. The timeout, in milliseconds, is applied to each request and * defaults to 5000ms. The options object may also include a frameId, * identifying an existing frame on which to install its listeners. If the * promise key is supplied the constructor for a Promise, that Promise library * will be used instead of the default window.Promise. * * @example * var storage = new CrossStorageClient('https://store.example.com/hub.html'); * * @example * var storage = new CrossStorageClient('https://store.example.com/hub.html', { * timeout: 5000, * frameId: 'storageFrame' * }); * * @constructor * * @param {string} url The url to a cross storage hub * @param {object} [opts] An optional object containing additional options, * including timeout, frameId, and promise * * @property {string} _id A UUID v4 id * @property {function} _promise The Promise object to use * @property {string} _frameId The id of the iFrame pointing to the hub url * @property {string} _origin The hub's origin * @property {object} _requests Mapping of request ids to callbacks * @property {bool} _connected Whether or not it has connected * @property {bool} _closed Whether or not the client has closed * @property {int} _count Number of requests sent * @property {function} _listener The listener added to the window * @property {Window} _hub The hub window */ function CrossStorageClient(url, opts) { opts = opts || {}; this._id = CrossStorageClient._generateUUID(); this._promise = opts.promise || Promise; this._frameId = opts.frameId || 'CrossStorageClient-' + this._id; this._origin = CrossStorageClient._getOrigin(url); this._requests = {}; this._connected = false; this._closed = false; this._count = 0; this._timeout = opts.timeout || 5000; this._listener = null; this._installListener(); var frame; if (opts.frameId) { frame = document.getElementById(opts.frameId); } // If using a passed iframe, poll the hub for a ready message if (frame) { this._poll(); } // Create the frame if not found or specified frame = frame || this._createFrame(url); this._hub = frame.contentWindow; } /** * The styles to be applied to the generated iFrame. Defines a set of properties * that hide the element by positioning it outside of the visible area, and * by modifying its display. * * @member {Object} */ CrossStorageClient.frameStyle = { display: 'none', position: 'absolute', top: '-999px', left: '-999px' }; /** * Returns the origin of an url, with cross browser support. Accommodates * the lack of location.origin in IE, as well as the discrepancies in the * inclusion of the port when using the default port for a protocol, e.g. * 443 over https. Defaults to the origin of window.location if passed a * relative path. * * @param {string} url The url to a cross storage hub * @returns {string} The origin of the url */ CrossStorageClient._getOrigin = function(url) { var uri, protocol, origin; uri = document.createElement('a'); uri.href = url; if (!uri.host) { uri = window.location; } if (!uri.protocol || uri.protocol === ':') { protocol = window.location.protocol; } else { protocol = uri.protocol; } origin = protocol + '//' + uri.host; origin = origin.replace(/:80$|:443$/, ''); return origin; }; /** * UUID v4 generation, taken from: http://stackoverflow.com/questions/ * 105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 * * @returns {string} A UUID v4 string */ CrossStorageClient._generateUUID = function() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }); }; /** * Returns a promise that is fulfilled when a connection has been established * with the cross storage hub. Its use is required to avoid sending any * requests prior to initialization being complete. * * @returns {Promise} A promise that is resolved on connect */ CrossStorageClient.prototype.onConnect = function() { var client = this; if (this._connected) { return this._promise.resolve(); } else if (this._closed) { return this._promise.reject(new Error('CrossStorageClient has closed')); } // Queue connect requests for client re-use if (!this._requests.connect) { this._requests.connect = []; } return new this._promise(function(resolve, reject) { var timeout = setTimeout(function() { reject(new Error('CrossStorageClient could not connect')); }, client._timeout); client._requests.connect.push(function(err) { clearTimeout(timeout); if (err) return reject(err); resolve(); }); }); }; /** * Sets a key to the specified value, optionally accepting a ttl to passively * expire the key after a number of milliseconds. Returns a promise that is * fulfilled on success, or rejected if any errors setting the key occurred, * or the request timed out. * * @param {string} key The key to set * @param {*} value The value to assign * @param {int} ttl Time to live in milliseconds * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype.set = function(key, value, ttl) { return this._request('set', { key: key, value: value, ttl: ttl }); }; /** * Accepts one or more keys for which to retrieve their values. Returns a * promise that is settled on hub response or timeout. On success, it is * fulfilled with the value of the key if only passed a single argument. * Otherwise it's resolved with an array of values. On failure, it is rejected * with the corresponding error message. * * @param {...string} key The key to retrieve * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype.get = function(key) { var args = Array.prototype.slice.call(arguments); return this._request('get', {keys: args}); }; /** * Accepts one or more keys for deletion. Returns a promise that is settled on * hub response or timeout. * * @param {...string} key The key to delete * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype.del = function() { var args = Array.prototype.slice.call(arguments); return this._request('del', {keys: args}); }; /** * Returns a promise that, when resolved, indicates that all localStorage * data has been cleared. * * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype.clear = function() { return this._request('clear'); }; /** * Returns a promise that, when resolved, passes an array of all keys * currently in storage. * * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype.getKeys = function() { return this._request('getKeys'); }; /** * Deletes the iframe and sets the connected state to false. The client can * no longer be used after being invoked. */ CrossStorageClient.prototype.close = function() { var frame = document.getElementById(this._frameId); if (frame) { frame.parentNode.removeChild(frame); } // Support IE8 with detachEvent if (window.removeEventListener) { window.removeEventListener('message', this._listener, false); } else { window.detachEvent('onmessage', this._listener); } this._connected = false; this._closed = true; }; /** * Installs the necessary listener for the window message event. When a message * is received, the client's _connected status is changed to true, and the * onConnect promise is fulfilled. Given a response message, the callback * corresponding to its request is invoked. If response.error holds a truthy * value, the promise associated with the original request is rejected with * the error. Otherwise the promise is fulfilled and passed response.result. * * @private */ CrossStorageClient.prototype._installListener = function() { var client = this; this._listener = function(message) { var i, error, response; // Ignore invalid messages, those not from the correct hub, or when // the client has closed if (client._closed || !message.data || typeof message.data !== 'string' || message.origin !== client._origin) { return; } // LocalStorage isn't available in the hub if (message.data === 'cross-storage:unavailable') { if (!client._closed) client.close(); if (!client._requests.connect) return; error = new Error('Closing client. Could not access localStorage in hub.'); for (i = 0; i < client._requests.connect.length; i++) { client._requests.connect[i](error); } return; } // Handle initial connection if (message.data.indexOf('cross-storage:') !== -1 && !client._connected) { client._connected = true; if (!client._requests.connect) return; for (i = 0; i < client._requests.connect.length; i++) { client._requests.connect[i](error); } delete client._requests.connect; } if (message.data === 'cross-storage:ready') return; // All other messages try { response = JSON.parse(message.data); } catch(e) { return; } if (!response.id) return; if (client._requests[response.id]) { client._requests[response.id](response.error, response.result); } }; // Support IE8 with attachEvent if (window.addEventListener) { window.addEventListener('message', this._listener, false); } else { window.attachEvent('onmessage', this._listener); } }; /** * Invoked when a frame id was passed to the client, rather than allowing * the client to create its own iframe. Polls the hub for a ready event to * establish a connected state. */ CrossStorageClient.prototype._poll = function() { var client, interval; client = this; interval = setInterval(function() { if (client._connected) return clearInterval(interval); if (!client._hub) return; client._hub.postMessage('cross-storage:poll', client._origin); }, 1000); }; /** * Creates a new iFrame containing the hub. Applies the necessary styles to * hide the element from view, prior to adding it to the document body. * Returns the created element. * * @private * * @param {string} url The url to the hub * returns {HTMLIFrameElement} The iFrame element itself */ CrossStorageClient.prototype._createFrame = function(url) { var frame, key; frame = window.document.createElement('iframe'); frame.id = this._frameId; // Style the iframe for (key in CrossStorageClient.frameStyle) { if (CrossStorageClient.frameStyle.hasOwnProperty(key)) { frame.style[key] = CrossStorageClient.frameStyle[key]; } } window.document.body.appendChild(frame); frame.src = url; return frame; }; /** * Sends a message containing the given method and params to the hub. Stores * a callback in the _requests object for later invocation on message, or * deletion on timeout. Returns a promise that is settled in either instance. * * @private * * @param {string} method The method to invoke * @param {*} params The arguments to pass * @returns {Promise} A promise that is settled on hub response or timeout */ CrossStorageClient.prototype._request = function(method, params) { var req, client; if (this._closed) { return this._promise.reject(new Error('CrossStorageClient has closed')); } client = this; client._count++; req = { id: this._id + ':' + client._count, method: 'cross-storage:' + method, params: params }; return new this._promise(function(resolve, reject) { var timeout, originalToJSON; // Timeout if a response isn't received after 4s timeout = setTimeout(function() { if (!client._requests[req.id]) return; delete client._requests[req.id]; reject(new Error('Timeout: could not perform ' + req.method)); }, client._timeout); // Add request callback client._requests[req.id] = function(err, result) { clearTimeout(timeout); if (err) return reject(new Error(err)); resolve(result); }; // In case we have a broken Array.prototype.toJSON, e.g. because of // old versions of prototype if (Array.prototype.toJSON) { originalToJSON = Array.prototype.toJSON; Array.prototype.toJSON = null; } // Send serialized message client._hub.postMessage(JSON.stringify(req), client._origin); // Restore original toJSON if (originalToJSON) { Array.prototype.toJSON = originalToJSON; } }); }; /** * Export for various environments. */ if (typeof module !== 'undefined' && module.exports) { module.exports = CrossStorageClient; } else if (typeof exports !== 'undefined') { exports.CrossStorageClient = CrossStorageClient; } else if (typeof define === 'function' && define.amd) { define('CrossStorageClient', [], function() { return CrossStorageClient; }); } else { root.CrossStorageClient = CrossStorageClient; } }(this));
emiljas/cross-storage
lib/client.js
JavaScript
apache-2.0
14,264
[ 30522, 1025, 1006, 3853, 1006, 7117, 1007, 1063, 1013, 1008, 1008, 1008, 9570, 2015, 1037, 2047, 2892, 5527, 7396, 2445, 1996, 24471, 2140, 2000, 1037, 9594, 1012, 2011, 12398, 1010, 1008, 2019, 2065, 6444, 2063, 2003, 2580, 2306, 1996, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* @flow */ import { PropTypes } from 'react'; export function notImplemented(props: Object, propName: string, componentName: string): ?Error { if (props[propName]) { return new Error(`<${componentName}> "${propName}" is not implemented.`); } return null; } export function falsy(props: Object, propName: string, componentName: string): ?Error { if (props[propName]) { return new Error(`<${componentName}> should not have a "${propName}" prop.`); } return null; } export const component = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
Right-Men/Ironman
node_modules/react-router-native/modules/PropTypes.js
JavaScript
apache-2.0
570
[ 30522, 1013, 1008, 1030, 4834, 1008, 1013, 12324, 1063, 17678, 13874, 2015, 1065, 2013, 1005, 10509, 1005, 1025, 9167, 3853, 2025, 5714, 10814, 3672, 2098, 1006, 24387, 1024, 4874, 1010, 17678, 18442, 1024, 5164, 1010, 6922, 18442, 1024, 51...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
abstract class AbstractClass { constructor(str: string, other: AbstractClass) { this.method(parseInt(str)); let val = this.prop.toLowerCase(); if (!str) { this.prop = "Hello World"; } this.cb(str); // OK, reference is inside function const innerFunction = () => { return this.prop; } // OK, references are to another instance other.cb(other.prop); } abstract prop: string; abstract cb: (s: string) => void; abstract method(num: number): void; other = this.prop; fn = () => this.prop; method2() { this.prop = this.prop + "!"; } } abstract class DerivedAbstractClass extends AbstractClass { cb = (s: string) => {}; constructor(str: string, other: AbstractClass, yetAnother: DerivedAbstractClass) { super(str, other); // there is no implementation of 'prop' in any base class this.cb(this.prop.toLowerCase()); this.method(1); // OK, references are to another instance other.cb(other.prop); yetAnother.cb(yetAnother.prop); } } class Implementation extends DerivedAbstractClass { prop = ""; cb = (s: string) => {}; constructor(str: string, other: AbstractClass, yetAnother: DerivedAbstractClass) { super(str, other, yetAnother); this.cb(this.prop); } method(n: number) { this.cb(this.prop + n); } } class User { constructor(a: AbstractClass) { a.prop; a.cb("hi"); a.method(12); a.method2(); } }
weswigham/TypeScript
tests/cases/compiler/abstractPropertyInConstructor.ts
TypeScript
apache-2.0
1,679
[ 30522, 10061, 2465, 10061, 26266, 1063, 9570, 2953, 1006, 2358, 2099, 1024, 5164, 1010, 2060, 1024, 10061, 26266, 1007, 1063, 2023, 1012, 4118, 1006, 11968, 20240, 3372, 1006, 2358, 2099, 1007, 1007, 1025, 2292, 11748, 1027, 2023, 1012, 176...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
This library makes it easy to add basic CORS support to your [Jersey 1](https://jersey.java.net/) app. To learn more about CORS, see documentation from [MDN](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) and [W3](http://www.w3.org/TR/cors/). # Usage To get started, add a dependency to your Gradle build file: compile com.palominolabs.jersey:jersey-cors-filter:VERSION where `VERSION` is the latest released version. If you're using Maven, know that your life could be greatly improved by switching to Gradle and use this dependency block: <dependency> <groupId>com.palominolabs.jersey</groupId> <artifactId>jersey-cors-filter</artifactId> <version>VERSION</version> </dependency> ## Registering the filter with Jersey This library includes a `ResourceFilterFactory` implementation: [`CorsResourceFilterFactory`](https://github.com/palominolabs/jersey-cors-filter/blob/master/src/main/java/com/palominolabs/jersey/cors/CorsResourceFilterFactory.java). You need to inform Jersey that you want to use this as a filter. Typically you would do this by setting the Jersey init param `com.sun.jersey.spi.container.ResourceFilters` (which, if using the servlet/Jersey integration, can be done by setting servlet init params); the param name is also available more conveniently in code as `ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES`. ### With embedded Jetty's ServletContainer This is how to do it when using the jersey-servlet `ServletContainer` servlet with embedded Jetty: ServletHolder servletHolder = new ServletHolder(new ServletContainer()); servletHolder.initParameters.put( ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES, CorsResourceFilterFactory.class.getCanonicalName() ); ### With Guice If your app uses [Guice](http://code.google.com/p/google-guice/), you need to add the CorsResourceFilterFactory to the properties used for instantiating the GuiceContainer. In your ServletModule.configureServlets(): bind(GuiceContainer.class); HashMap<String, String> guiceContainerProps = Maps.newHashMap(); guiceContainerProps.put(ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES, CorsResourceFilterFactory.class.getCanonicalName()); serve("/*").with(GuiceContainer.class, guiceContainerProps); ## Configuring CORS headers Once the filter is registered, you can annotate your resource methods (`@GET`, `@POST`, etc.) with [`@Cors`](https://github.com/palominolabs/jersey-cors-filter/blob/master/src/main/java/com/palominolabs/jersey/cors/Cors.java) to send basic resource response headers and your `@OPTIONS` methods with [`@CorsPreflight`](https://github.com/palominolabs/jersey-cors-filter/blob/master/src/main/java/com/palominolabs/jersey/cors/CorsPreflight.java) to send preflight request response headers. @Path("foo") class FooResource { @GET @Cors String get() { return 'x' } @OPTIONS @CorsPreflight String options() { return 'foo' } } You can also apply `@Cors` and `@CorsPreflight` to resource classes, which will act as if you applied `@Cors` to all non-`@OPTIONS` methods and `@CorsPreflight` to all `@OPTIONS` methods, respectively. // Equivalent to above resource class @Path("foo") @Cors @CorsPreflight class FooResource { @GET String get() { return 'x' } @OPTIONS String options() { return 'foo' } } ## Custom CORS headers Out of the box, the filter will send `Access-Control-Allow-Origin: *` for methods annotated `@Cors`, while methods annotated `@CorsPreflight` will send `Access-Control-Allow-Methods: GET` and `Access-Control-Max-Age: 86400`. This is plenty for most purposes, allowing `GET` requests from anywhere and instructing the user agent (i.e. the browser) cache the results of the CORS for 24 hours. If you need to change those defaults, or specify other headers like `Access-Control-Allow-Headers`, [`CorsConfig`](https://github.com/palominolabs/jersey-cors-filter/blob/master/src/main/java/com/palominolabs/jersey/cors/CorsConfig.java) defines various param names to set. These are loaded by the filter out of the standard Jersey property mechanism. If you're using Jersey via the Servlet API, setting servlet init params should do the trick. Map<String, Object> props = Maps.newHashMap() props.put(CorsConfig.ALLOW_ORIGIN, 'http://foo.com') props.put(CorsConfig.EXPOSE_HEADERS, 'x-foo') props.put(CorsConfig.MAX_AGE, 12345) props.put(CorsConfig.ALLOW_CREDENTIALS, true) props.put(CorsConfig.ALLOW_METHODS, 'POST') props.put(CorsConfig.ALLOW_HEADERS, 'x-bar') DefaultResourceConfig config = new DefaultResourceConfig() config.setPropertiesAndFeatures(props) CorsResourceFilterFactory factory = new CorsResourceFilterFactory(config) // Register your FilterFactory with the ServletHolder as above ## Overriding with annotations If you need to override any of these settings for a method or class, you can do so via the optional values on `@Cors` and `@CorsPreflight`, as in `@Cors(exposeHeaders = "X-FooBar")`. Values specified on method annotations take precedence over class annotations. @Path("foo") @Cors( allowCredentials = FALSE, allowOrigin = 'http://asdfasdf.com', exposeHeaders = 'x-asdfasdf' ) @CorsPreflight( allowCredentials = FALSE, allowHeaders = 'x-asdfasdf', allowMethods = 'DELETE', maxAge = 54321, allowOrigin = 'http://foo.com' ) static class FooResource { @GET @Cors( allowCredentials = TRUE, allowOrigin = 'http://foo.com', exposeHeaders = 'x-foo' ) String get() { return 'x' } @POST @Cors( allowCredentials = TRUE, allowOrigin = 'http://foo.com', exposeHeaders = 'x-foo' ) String post() { return 'y' } @OPTIONS @CorsPreflight( allowCredentials = TRUE, allowHeaders = 'x-foo', allowMethods = 'GET,POST', maxAge = 12345 ) String options() { return 'foo' } } ## More See the [CorsResourceFilterFactory test](https://github.com/palominolabs/jersey-cors-filter/blob/master/src/test/groovy/com/palominolabs/jersey/cors/CorsResourceFilterFactoryTest.groovy) for complete examples of how the jersey-cors-filter can be used.
palominolabs/jersey-cors-filter
README.md
Markdown
apache-2.0
6,626
[ 30522, 2023, 3075, 3084, 2009, 3733, 2000, 5587, 3937, 2522, 2869, 2490, 2000, 2115, 1031, 3933, 1015, 1033, 1006, 16770, 1024, 1013, 1013, 3933, 1012, 9262, 1012, 5658, 1013, 1007, 10439, 1012, 2000, 4553, 2062, 2055, 2522, 2869, 1010, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2019 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 "chrome/browser/metrics/chrome_metrics_services_manager_client.h" #include "base/base_switches.h" #include "base/command_line.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "components/metrics/enabled_state_provider.h" #include "components/metrics/metrics_pref_names.h" #include "components/metrics/metrics_reporting_default_state.h" #include "components/metrics/metrics_service_accessor.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" TEST(ChromeMetricsServicesManagerClientTest, ForceTrialsDisablesReporting) { TestingPrefServiceSimple local_state; metrics::RegisterMetricsReportingStatePrefs(local_state.registry()); // First, test with UMA reporting setting defaulting to off. local_state.registry()->RegisterBooleanPref( metrics::prefs::kMetricsReportingEnabled, false); // Force the pref to be used, even in unofficial builds. ChromeMetricsServiceAccessor::SetForceIsMetricsReportingEnabledPrefLookup( true); ChromeMetricsServicesManagerClient client(&local_state); const metrics::EnabledStateProvider& provider = client.GetEnabledStateProviderForTesting(); metrics_services_manager::MetricsServicesManagerClient* base_client = &client; // The provider and client APIs should agree. EXPECT_EQ(provider.IsConsentGiven(), base_client->IsMetricsConsentGiven()); EXPECT_EQ(provider.IsReportingEnabled(), base_client->IsMetricsReportingEnabled()); // Both consent and reporting should be false. EXPECT_FALSE(provider.IsConsentGiven()); EXPECT_FALSE(provider.IsReportingEnabled()); // Set the pref to true. local_state.SetBoolean(metrics::prefs::kMetricsReportingEnabled, true); // The provider and client APIs should agree. EXPECT_EQ(provider.IsConsentGiven(), base_client->IsMetricsConsentGiven()); EXPECT_EQ(provider.IsReportingEnabled(), base_client->IsMetricsReportingEnabled()); // Both consent and reporting should be true. EXPECT_TRUE(provider.IsConsentGiven()); EXPECT_TRUE(provider.IsReportingEnabled()); // Set --force-fieldtrials= command-line flag, which should disable reporting // but not consent. base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kForceFieldTrials, "Foo/Bar"); // The provider and client APIs should agree. EXPECT_EQ(provider.IsConsentGiven(), base_client->IsMetricsConsentGiven()); EXPECT_EQ(provider.IsReportingEnabled(), base_client->IsMetricsReportingEnabled()); // Consent should be true but reporting should be false. EXPECT_TRUE(provider.IsConsentGiven()); EXPECT_FALSE(provider.IsReportingEnabled()); }
endlessm/chromium-browser
chrome/browser/metrics/chrome_metrics_services_manager_client_unittest.cc
C++
bsd-3-clause
2,912
[ 30522, 1013, 1013, 9385, 10476, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, 2179, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Brasa\RecursoHumanoBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table(name="rhu_proyeccion") * @ORM\Entity(repositoryClass="Brasa\RecursoHumanoBundle\Repository\RhuProyeccionRepository") */ class RhuProyeccion { /** * @ORM\Id * @ORM\Column(name="codigo_proyeccion_pk", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $codigoProyeccionPk; /** * @ORM\Column(name="fecha_desde", type="date", nullable=true) */ private $fechaDesde; /** * @ORM\Column(name="fecha_hasta", type="date", nullable=true) */ private $fechaHasta; /** * @ORM\Column(name="codigo_empleado_fk", type="integer", nullable=true) */ private $codigoEmpleadoFk; /** * @ORM\Column(name="codigo_contrato_fk", type="integer", nullable=true) */ private $codigoContratoFk; /** * @ORM\Column(name="dias", type="integer") */ private $dias = 0; /** * @ORM\Column(name="dias_ausentismo", type="integer") */ private $diasAusentismo = 0; /** * @ORM\Column(name="vr_salario", type="float") */ private $vrSalario = 0; /** * @ORM\Column(name="vr_vacaciones", type="float") */ private $vrVacaciones = 0; /** * @ORM\Column(name="dias_prima", type="integer") */ private $diasPrima = 0; /** * @ORM\Column(name="fecha_desde_prima", type="date", nullable=true) */ private $fechaDesdePrima; /** * @ORM\Column(name="vr_primas", type="float") */ private $vrPrimas = 0; /** * @ORM\Column(name="vr_primas_real", type="float") */ private $vrPrimasReal = 0; /** * @ORM\Column(name="vr_salario_promedio_primas", type="float") */ private $vrSalarioPromedioPrimas = 0; /** * @ORM\Column(name="vr_salario_promedio_primas_real", type="float") */ private $vrSalarioPromedioPrimasReal = 0; /** * @ORM\Column(name="porcentaje_primas", type="float") */ private $porcentajePrimas = 0; /** * @ORM\Column(name="diferencia_primas", type="float") */ private $vrDiferenciaPrimas = 0; /** * @ORM\Column(name="dias_ausentismo_primas", type="integer") */ private $diasAusentismoPrimas = 0; /** * @ORM\Column(name="dias_cesantias", type="integer") */ private $diasCesantias = 0; /** * @ORM\Column(name="fecha_desde_cesantias", type="date", nullable=true) */ private $fechaDesdeCesantias; /** * @ORM\Column(name="vr_cesantias", type="float") */ private $vrCesantias = 0; /** * @ORM\Column(name="vr_cesantias_real", type="float") */ private $vrCesantiasReal = 0; /** * @ORM\Column(name="vr_intereses_cesantias", type="float") */ private $vrInteresesCesantias = 0; /** * @ORM\Column(name="vr_intereses_cesantias_real", type="float") */ private $vrInteresesCesantiasReal = 0; /** * @ORM\Column(name="vr_diferencia_intereses_cesantias", type="float") */ private $vrDiferenciaInteresesCesantias = 0; /** * @ORM\Column(name="vr_salario_promedio_cesantias", type="float") */ private $vrSalarioPromedioCesantias = 0; /** * @ORM\Column(name="vr_salario_promedio_cesantias_real", type="float") */ private $vrSalarioPromedioCesantiasReal = 0; /** * @ORM\Column(name="porcentaje_cesantias", type="float") */ private $porcentajeCesantias = 0; /** * @ORM\Column(name="diferencia_cesantias", type="float") */ private $vrDiferenciaCesantias = 0; /** * @ORM\ManyToOne(targetEntity="RhuEmpleado", inversedBy="proyeccionesEmpleadoRel") * @ORM\JoinColumn(name="codigo_empleado_fk", referencedColumnName="codigo_empleado_pk") */ protected $empleadoRel; /** * @ORM\ManyToOne(targetEntity="RhuContrato", inversedBy="proyeccionesContratoRel") * @ORM\JoinColumn(name="codigo_contrato_fk", referencedColumnName="codigo_contrato_pk") */ protected $contratoRel; /** * Get codigoProyeccionPk * * @return integer */ public function getCodigoProyeccionPk() { return $this->codigoProyeccionPk; } /** * Set fechaDesde * * @param \DateTime $fechaDesde * * @return RhuProyeccion */ public function setFechaDesde($fechaDesde) { $this->fechaDesde = $fechaDesde; return $this; } /** * Get fechaDesde * * @return \DateTime */ public function getFechaDesde() { return $this->fechaDesde; } /** * Set fechaHasta * * @param \DateTime $fechaHasta * * @return RhuProyeccion */ public function setFechaHasta($fechaHasta) { $this->fechaHasta = $fechaHasta; return $this; } /** * Get fechaHasta * * @return \DateTime */ public function getFechaHasta() { return $this->fechaHasta; } /** * Set codigoEmpleadoFk * * @param integer $codigoEmpleadoFk * * @return RhuProyeccion */ public function setCodigoEmpleadoFk($codigoEmpleadoFk) { $this->codigoEmpleadoFk = $codigoEmpleadoFk; return $this; } /** * Get codigoEmpleadoFk * * @return integer */ public function getCodigoEmpleadoFk() { return $this->codigoEmpleadoFk; } /** * Set codigoContratoFk * * @param integer $codigoContratoFk * * @return RhuProyeccion */ public function setCodigoContratoFk($codigoContratoFk) { $this->codigoContratoFk = $codigoContratoFk; return $this; } /** * Get codigoContratoFk * * @return integer */ public function getCodigoContratoFk() { return $this->codigoContratoFk; } /** * Set dias * * @param integer $dias * * @return RhuProyeccion */ public function setDias($dias) { $this->dias = $dias; return $this; } /** * Get dias * * @return integer */ public function getDias() { return $this->dias; } /** * Set diasAusentismo * * @param integer $diasAusentismo * * @return RhuProyeccion */ public function setDiasAusentismo($diasAusentismo) { $this->diasAusentismo = $diasAusentismo; return $this; } /** * Get diasAusentismo * * @return integer */ public function getDiasAusentismo() { return $this->diasAusentismo; } /** * Set vrSalario * * @param float $vrSalario * * @return RhuProyeccion */ public function setVrSalario($vrSalario) { $this->vrSalario = $vrSalario; return $this; } /** * Get vrSalario * * @return float */ public function getVrSalario() { return $this->vrSalario; } /** * Set vrVacaciones * * @param float $vrVacaciones * * @return RhuProyeccion */ public function setVrVacaciones($vrVacaciones) { $this->vrVacaciones = $vrVacaciones; return $this; } /** * Get vrVacaciones * * @return float */ public function getVrVacaciones() { return $this->vrVacaciones; } /** * Set diasPrima * * @param integer $diasPrima * * @return RhuProyeccion */ public function setDiasPrima($diasPrima) { $this->diasPrima = $diasPrima; return $this; } /** * Get diasPrima * * @return integer */ public function getDiasPrima() { return $this->diasPrima; } /** * Set fechaDesdePrima * * @param \DateTime $fechaDesdePrima * * @return RhuProyeccion */ public function setFechaDesdePrima($fechaDesdePrima) { $this->fechaDesdePrima = $fechaDesdePrima; return $this; } /** * Get fechaDesdePrima * * @return \DateTime */ public function getFechaDesdePrima() { return $this->fechaDesdePrima; } /** * Set vrPrimas * * @param float $vrPrimas * * @return RhuProyeccion */ public function setVrPrimas($vrPrimas) { $this->vrPrimas = $vrPrimas; return $this; } /** * Get vrPrimas * * @return float */ public function getVrPrimas() { return $this->vrPrimas; } /** * Set vrSalarioPromedioPrimas * * @param float $vrSalarioPromedioPrimas * * @return RhuProyeccion */ public function setVrSalarioPromedioPrimas($vrSalarioPromedioPrimas) { $this->vrSalarioPromedioPrimas = $vrSalarioPromedioPrimas; return $this; } /** * Get vrSalarioPromedioPrimas * * @return float */ public function getVrSalarioPromedioPrimas() { return $this->vrSalarioPromedioPrimas; } /** * Set vrSalarioPromedioPrimasReal * * @param float $vrSalarioPromedioPrimasReal * * @return RhuProyeccion */ public function setVrSalarioPromedioPrimasReal($vrSalarioPromedioPrimasReal) { $this->vrSalarioPromedioPrimasReal = $vrSalarioPromedioPrimasReal; return $this; } /** * Get vrSalarioPromedioPrimasReal * * @return float */ public function getVrSalarioPromedioPrimasReal() { return $this->vrSalarioPromedioPrimasReal; } /** * Set porcentajePrimas * * @param float $porcentajePrimas * * @return RhuProyeccion */ public function setPorcentajePrimas($porcentajePrimas) { $this->porcentajePrimas = $porcentajePrimas; return $this; } /** * Get porcentajePrimas * * @return float */ public function getPorcentajePrimas() { return $this->porcentajePrimas; } /** * Set vrDiferenciaPrimas * * @param float $vrDiferenciaPrimas * * @return RhuProyeccion */ public function setVrDiferenciaPrimas($vrDiferenciaPrimas) { $this->vrDiferenciaPrimas = $vrDiferenciaPrimas; return $this; } /** * Get vrDiferenciaPrimas * * @return float */ public function getVrDiferenciaPrimas() { return $this->vrDiferenciaPrimas; } /** * Set diasCesantias * * @param integer $diasCesantias * * @return RhuProyeccion */ public function setDiasCesantias($diasCesantias) { $this->diasCesantias = $diasCesantias; return $this; } /** * Get diasCesantias * * @return integer */ public function getDiasCesantias() { return $this->diasCesantias; } /** * Set fechaDesdeCesantias * * @param \DateTime $fechaDesdeCesantias * * @return RhuProyeccion */ public function setFechaDesdeCesantias($fechaDesdeCesantias) { $this->fechaDesdeCesantias = $fechaDesdeCesantias; return $this; } /** * Get fechaDesdeCesantias * * @return \DateTime */ public function getFechaDesdeCesantias() { return $this->fechaDesdeCesantias; } /** * Set vrCesantias * * @param float $vrCesantias * * @return RhuProyeccion */ public function setVrCesantias($vrCesantias) { $this->vrCesantias = $vrCesantias; return $this; } /** * Get vrCesantias * * @return float */ public function getVrCesantias() { return $this->vrCesantias; } /** * Set vrInteresesCesantias * * @param float $vrInteresesCesantias * * @return RhuProyeccion */ public function setVrInteresesCesantias($vrInteresesCesantias) { $this->vrInteresesCesantias = $vrInteresesCesantias; return $this; } /** * Get vrInteresesCesantias * * @return float */ public function getVrInteresesCesantias() { return $this->vrInteresesCesantias; } /** * Set vrSalarioPromedioCesantias * * @param float $vrSalarioPromedioCesantias * * @return RhuProyeccion */ public function setVrSalarioPromedioCesantias($vrSalarioPromedioCesantias) { $this->vrSalarioPromedioCesantias = $vrSalarioPromedioCesantias; return $this; } /** * Get vrSalarioPromedioCesantias * * @return float */ public function getVrSalarioPromedioCesantias() { return $this->vrSalarioPromedioCesantias; } /** * Set vrSalarioPromedioCesantiasReal * * @param float $vrSalarioPromedioCesantiasReal * * @return RhuProyeccion */ public function setVrSalarioPromedioCesantiasReal($vrSalarioPromedioCesantiasReal) { $this->vrSalarioPromedioCesantiasReal = $vrSalarioPromedioCesantiasReal; return $this; } /** * Get vrSalarioPromedioCesantiasReal * * @return float */ public function getVrSalarioPromedioCesantiasReal() { return $this->vrSalarioPromedioCesantiasReal; } /** * Set porcentajeCesantias * * @param float $porcentajeCesantias * * @return RhuProyeccion */ public function setPorcentajeCesantias($porcentajeCesantias) { $this->porcentajeCesantias = $porcentajeCesantias; return $this; } /** * Get porcentajeCesantias * * @return float */ public function getPorcentajeCesantias() { return $this->porcentajeCesantias; } /** * Set vrDiferenciaCesantias * * @param float $vrDiferenciaCesantias * * @return RhuProyeccion */ public function setVrDiferenciaCesantias($vrDiferenciaCesantias) { $this->vrDiferenciaCesantias = $vrDiferenciaCesantias; return $this; } /** * Get vrDiferenciaCesantias * * @return float */ public function getVrDiferenciaCesantias() { return $this->vrDiferenciaCesantias; } /** * Set empleadoRel * * @param \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadoRel * * @return RhuProyeccion */ public function setEmpleadoRel(\Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadoRel = null) { $this->empleadoRel = $empleadoRel; return $this; } /** * Get empleadoRel * * @return \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado */ public function getEmpleadoRel() { return $this->empleadoRel; } /** * Set contratoRel * * @param \Brasa\RecursoHumanoBundle\Entity\RhuContrato $contratoRel * * @return RhuProyeccion */ public function setContratoRel(\Brasa\RecursoHumanoBundle\Entity\RhuContrato $contratoRel = null) { $this->contratoRel = $contratoRel; return $this; } /** * Get contratoRel * * @return \Brasa\RecursoHumanoBundle\Entity\RhuContrato */ public function getContratoRel() { return $this->contratoRel; } /** * Set vrPrimasReal * * @param float $vrPrimasReal * * @return RhuProyeccion */ public function setVrPrimasReal($vrPrimasReal) { $this->vrPrimasReal = $vrPrimasReal; return $this; } /** * Get vrPrimasReal * * @return float */ public function getVrPrimasReal() { return $this->vrPrimasReal; } /** * Set vrCesantiasReal * * @param float $vrCesantiasReal * * @return RhuProyeccion */ public function setVrCesantiasReal($vrCesantiasReal) { $this->vrCesantiasReal = $vrCesantiasReal; return $this; } /** * Get vrCesantiasReal * * @return float */ public function getVrCesantiasReal() { return $this->vrCesantiasReal; } /** * Set vrInteresesCesantiasReal * * @param float $vrInteresesCesantiasReal * * @return RhuProyeccion */ public function setVrInteresesCesantiasReal($vrInteresesCesantiasReal) { $this->vrInteresesCesantiasReal = $vrInteresesCesantiasReal; return $this; } /** * Get vrInteresesCesantiasReal * * @return float */ public function getVrInteresesCesantiasReal() { return $this->vrInteresesCesantiasReal; } /** * Set vrDiferenciaInteresesCesantias * * @param float $vrDiferenciaInteresesCesantias * * @return RhuProyeccion */ public function setVrDiferenciaInteresesCesantias($vrDiferenciaInteresesCesantias) { $this->vrDiferenciaInteresesCesantias = $vrDiferenciaInteresesCesantias; return $this; } /** * Get vrDiferenciaInteresesCesantias * * @return float */ public function getVrDiferenciaInteresesCesantias() { return $this->vrDiferenciaInteresesCesantias; } /** * Set diasAusentismoPrimas * * @param integer $diasAusentismoPrimas * * @return RhuProyeccion */ public function setDiasAusentismoPrimas($diasAusentismoPrimas) { $this->diasAusentismoPrimas = $diasAusentismoPrimas; return $this; } /** * Get diasAusentismoPrimas * * @return integer */ public function getDiasAusentismoPrimas() { return $this->diasAusentismoPrimas; } }
wariox3/brasa
src/Brasa/RecursoHumanoBundle/Entity/RhuProyeccion.php
PHP
mit
18,149
[ 30522, 1026, 1029, 25718, 3415, 15327, 11655, 3736, 1032, 28667, 9236, 11631, 19042, 16429, 8630, 2571, 1032, 9178, 1025, 2224, 8998, 1032, 2030, 2213, 1032, 12375, 2004, 2030, 2213, 1025, 1013, 1008, 1008, 1008, 1030, 2030, 2213, 1032, 279...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{{ define "title" }}{{ .Collection.Name }} — Facette{{ end }} {{ define "head" }} <link rel="search" href="{{ .URLPrefix }}/browse/opensearch.xml" title="Add {{ .Request.Host }} search" type="application/opensearchdescription+xml"> <script src="{{ .URLPrefix }}{{ asset "/static/jquery.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/jquery.datepicker.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/i18next.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/highcharts.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/highcharts.exporting.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/rgbcolor.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/canvg.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/moment.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/sprintf.js" }}"></script> <script src="{{ .URLPrefix }}{{ asset "/static/facette.js" }}"></script> {{ end }} {{ define "content" }}{{ $prefix := .URLPrefix }}{{ $q := .Request.FormValue "q" }} <nav> <dl class="graphlist"> <dt>Graphs</dt>{{ if .Collection.Entries }}{{ if ne $q "" }} <dd><a href="{{ .URLPrefix }}{{ .Request.URL.Path }}"><span class="icon icon-remove"></span> Remove Filter</a></dd>{{ else }} <dd><a href="{{ .URLPrefix }}/browse/"><span class="icon icon-arrow-left"></span> Back to Collections</a></dd>{{ end }}{{ range $index, $entry := .Collection.Entries }} <dd><a href="#graph-{{ $index }}" title="{{ $entry.Options.title }}">{{ $entry.Options.title }}</a></dd>{{ end }}{{ else }} <dd><a href="{{ .URLPrefix }}/browse/"><span class="icon icon-arrow-left"></span> Back to Collections</a></dd> <dd class="placeholder icon icon-info">No graph</dd>{{ end }} </dl> </nav> <article data-pane="collection-show" data-paneopts="id: {{ .Collection.ID }}"> <header> <h1>{{ .Collection.Name }}</h1> <nav> <ul>{{ if not .ReadOnly }} <li><a class="icon icon-edit" href="#edit-collection" title="Edit Collection"></a></li>{{ end }} <li> <a class="icon icon-time" href="#set-global-range" title="Set Time Range"></a> <div class="menu"> <div class="menucntr"> <div class="menuitem"><a href="#range-1h">1h</a></div> <div class="menuitem"><a href="#range-3h">3h</a></div> <div class="menuitem"><a href="#range-1d">1d</a></div> <div class="menuitem"><a href="#range-7d">7d</a></div> <div class="menuitem"><a href="#range-1mo">1mo</a></div> <div class="menuitem"><a href="#range-1y">1y</a></div> <div class="menuitem"><a href="#range-custom">Custom…</a></div> </div> </div> </li> <li><a class="icon icon-refresh" href="#set-global-refresh" title="Set Refresh Interval"></a></li> <li><a class="icon icon-print" href="#print" title="Print Page"></a></li> </ul> </nav> <form action="{{ .URLPrefix }}{{ .Request.URL.Path }}" method="get"> <div class="filter icon icon-search"> <input name="q" placeholder="Search for Graph" type="text" value="{{ $q }}"> </div> </form> <div class="right"> <a class="icon icon-toggle-off" href="#toggle-legends"> Toggle Legends</a> </div> </header> <section class="scrollarea full">{{ if .Collection.Entries }}{{ template "template_graph" }}{{ range $index, $value := .Collection.Entries }} <div data-graph="{{ $value.ID }}" data-graphopts="{{ dump $value.Options }}" id="graph-{{ $index }}"></div>{{ end }}{{ else if .Collection.Children }} <h1>Sub-Collections</h1> <ul>{{ range $index, $value := .Collection.Children }} <li><a href="{{ $prefix }}/browse/collections/{{ $value.ID }}">{{ $value.Name }}</a></li>{{ end }} </ul>{{ else if eq $q "" }} <div class="mesgitem info">The collection is empty</div>{{ else }} <div class="mesgitem warning">Your search doesn’t match any graph <a href="{{ .Request.URL.Path }}">Reset</a></div>{{ end }} </section> </article> {{ end }}
vovkasm/facette
cmd/facette/template/browse/collection.html
HTML
bsd-3-clause
4,090
[ 30522, 1063, 1063, 9375, 1000, 2516, 1000, 1065, 1065, 1063, 1063, 1012, 3074, 1012, 2171, 1065, 1065, 1517, 2227, 4674, 1063, 1063, 2203, 1065, 1065, 1063, 1063, 9375, 1000, 2132, 1000, 1065, 1065, 1026, 30524, 1065, 1013, 11347, 2063, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\ProcessUtils; /** * @group legacy */ class ProcessUtilsTest extends TestCase { /** * @dataProvider dataArguments */ public function testEscapeArgument($result, $argument) { $this->assertSame($result, ProcessUtils::escapeArgument($argument)); } public function dataArguments() { if ('\\' === \DIRECTORY_SEPARATOR) { return [ ['"\"php\" \"-v\""', '"php" "-v"'], ['"foo bar"', 'foo bar'], ['^%"path"^%', '%path%'], ['"<|>\\" \\"\'f"', '<|>" "\'f'], ['""', ''], ['"with\trailingbs\\\\"', 'with\trailingbs\\'], ]; } return [ ["'\"php\" \"-v\"'", '"php" "-v"'], ["'foo bar'", 'foo bar'], ["'%path%'", '%path%'], ["'<|>\" \"'\\''f'", '<|>" "\'f'], ["''", ''], ["'with\\trailingbs\\'", 'with\trailingbs\\'], ["'withNonAsciiAccentLikeéÉèÈàÀöä'", 'withNonAsciiAccentLikeéÉèÈàÀöä'], ]; } }
agencja-acclaim/gulp-bower-webapp
wp-content/plugins/updraftplus/vendor/symfony/process/Tests/ProcessUtilsTest.php
PHP
mit
1,426
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 25353, 2213, 14876, 4890, 7427, 1012, 1008, 1008, 1006, 1039, 1007, 6904, 11283, 2078, 8962, 2368, 19562, 1026, 6904, 11283, 2078, 1030, 25353, 2213, 14876, 489...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef __INC_BLOCK_H #define __INC_BLOCK_H #include "vp8/common/onyx.h" #include "vp8/common/blockd.h" #include "vp8/common/entropymv.h" #include "vp8/common/entropy.h" #include "vpx_ports/mem.h" #define MAX_MODES 20 #define MAX_ERROR_BINS 1024 typedef struct { MV mv; int offset; } search_site; typedef struct block { short *src_diff; short *coeff; short *quant; short *quant_fast; short *quant_shift; short *zbin; short *zrun_zbin_boost; short *round; short zbin_extra; unsigned char **base_src; int src; int src_stride; } BLOCK; typedef struct { int count; struct { B_PREDICTION_MODE mode; int_mv mv; } bmi[16]; } PARTITION_INFO; typedef struct macroblock { DECLARE_ALIGNED(16, short, src_diff[400]); DECLARE_ALIGNED(16, short, coeff[400]); DECLARE_ALIGNED(16, unsigned char, thismb[256]); unsigned char *thismb_ptr; BLOCK block[25]; YV12_BUFFER_CONFIG src; MACROBLOCKD e_mbd; PARTITION_INFO *partition_info; PARTITION_INFO *pi; PARTITION_INFO *pip; int ref_frame_cost[MAX_REF_FRAMES]; search_site *ss; int ss_count; int searches_per_step; int errorperbit; int sadperbit16; int sadperbit4; int rddiv; int rdmult; unsigned int * mb_activity_ptr; int * mb_norm_activity_ptr; signed int act_zbin_adj; signed int last_act_zbin_adj; int *mvcost[2]; int *mvsadcost[2]; int (*mbmode_cost)[MB_MODE_COUNT]; int (*intra_uv_mode_cost)[MB_MODE_COUNT]; int (*bmode_costs)[10][10]; int *inter_bmode_costs; int (*token_costs)[COEF_BANDS][PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; int mv_col_min; int mv_col_max; int mv_row_min; int mv_row_max; int skip; unsigned int encode_breakout; signed char *gf_active_ptr; unsigned char *active_ptr; MV_CONTEXT *mvc; int optimize; int q_index; #if CONFIG_TEMPORAL_DENOISING MB_PREDICTION_MODE best_sse_inter_mode; int_mv best_sse_mv; MV_REFERENCE_FRAME best_reference_frame; MV_REFERENCE_FRAME best_zeromv_reference_frame; unsigned char need_to_clamp_best_mvs; #endif int skip_true_count; unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; unsigned int MVcount [2] [MVvals]; int ymode_count [VP8_YMODES]; int uv_mode_count[VP8_UV_MODES]; int64_t prediction_error; int64_t intra_error; int count_mb_ref_frame_usage[MAX_REF_FRAMES]; int rd_thresh_mult[MAX_MODES]; int rd_threshes[MAX_MODES]; unsigned int mbs_tested_so_far; unsigned int mode_test_hit_counts[MAX_MODES]; int zbin_mode_boost_enabled; int zbin_mode_boost; int last_zbin_mode_boost; int last_zbin_over_quant; int zbin_over_quant; int error_bins[MAX_ERROR_BINS]; void (*short_fdct4x4)(short *input, short *output, int pitch); void (*short_fdct8x4)(short *input, short *output, int pitch); void (*short_walsh4x4)(short *input, short *output, int pitch); void (*quantize_b)(BLOCK *b, BLOCKD *d); void (*quantize_b_pair)(BLOCK *b1, BLOCK *b2, BLOCKD *d0, BLOCKD *d1); } MACROBLOCK; #endif
qtekfun/htcDesire820Kernel
external/libvpx/libvpx/vp8/encoder/block.h
C
gpl-2.0
3,672
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1996, 4773, 2213, 2622, 6048, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2224, 1997, 2023, 3120, 3642, 30524, 2622, 6048, 2089, 1008, 2022, 2179, 1999, 1996, 6048, 5371, 1999, 1996, 71...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ package mod._streams.uno; import com.sun.star.io.XActiveDataSink; import com.sun.star.io.XActiveDataSource; import com.sun.star.io.XDataOutputStream; import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import java.io.PrintWriter; import java.util.ArrayList; import lib.TestCase; import lib.TestEnvironment; import lib.TestParameters; /** * Test for object which is represented by service * <code>com.sun.star.io.DataInputStream</code>. * <ul> * <li> <code>com::sun::star::io::XInputStream</code></li> * <li> <code>com::sun::star::io::XDataInputStream</code></li> * <li> <code>com::sun::star::io::XConnectable</code></li> * <li> <code>com::sun::star::io::XActiveDataSink</code></li> * </ul> * @see com.sun.star.io.DataInputStream * @see com.sun.star.io.XInputStream * @see com.sun.star.io.XDataInputStream * @see com.sun.star.io.XConnectable * @see com.sun.star.io.XActiveDataSink * @see ifc.io._XInputStream * @see ifc.io._XDataInputStream * @see ifc.io._XConnectable * @see ifc.io._XActiveDataSink */ public class DataInputStream extends TestCase { /** * Creates a TestEnvironment for the interfaces to be tested. * Creates <code>com.sun.star.io.DataInputStream</code> object, * connects it to <code>com.sun.star.io.DataOutputStream</code> * through <code>com.sun.star.io.Pipe</code>. All of possible data * types are written into <code>DataOutputStream</code>. * Object relations created : * <ul> * <li> <code>'StreamData'</code> for * {@link ifc.io._XDataInputStream}(the data that should be written into * the stream) </li> * <li> <code>'ByteData'</code> for * {@link ifc.io._XInputStream}(the data that should be written into * the stream) </li> * <li> <code>'StreamWriter'</code> for * {@link ifc.io._XDataInputStream} * {@link ifc.io._XInputStream}(a stream to write data to) </li> * <li> <code>'Connectable'</code> for * {@link ifc.io._XConnectable}(another object that can be connected) </li> * <li> <code>'InputStream'</code> for * {@link ifc.io._XActiveDataSink}(an input stream to set and get) </li> * </ul> */ @Override protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { Object oInterface = null; XMultiServiceFactory xMSF = Param.getMSF(); oInterface = xMSF.createInstance("com.sun.star.io.DataInputStream"); XInterface oObj = (XInterface) oInterface; // creating and connecting DataOutputStream to the // DataInputStream created through the Pipe XActiveDataSink xDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj); XInterface oPipe = (XInterface) xMSF.createInstance("com.sun.star.io.Pipe"); XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe); XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe); XInterface oDataOutput = (XInterface) xMSF.createInstance("com.sun.star.io.DataOutputStream"); XDataOutputStream xDataOutput = UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ; XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ; xDataSource.setOutputStream(xPipeOutput) ; xDataSink.setInputStream(xPipeInput) ; // all data types for writing to an XDataInputStream ArrayList<Object> data = new ArrayList<Object>() ; data.add(Boolean.TRUE) ; data.add(Byte.valueOf((byte)123)) ; data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; data.add(new Float(1.234)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe byte[] byteData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 } ; // creating a connectable object for XConnectable interface XInterface xConnect = (XInterface)xMSF.createInstance( "com.sun.star.io.DataInputStream") ; // creating an input stream to set in XActiveDataSink XInterface oDataInput = (XInterface) xMSF.createInstance( "com.sun.star.io.Pipe" ); log.println("creating a new environment for object"); TestEnvironment tEnv = new TestEnvironment( oObj ); // adding sequence of data that must be read // by XDataInputStream interface methods tEnv.addObjRelation("StreamData", data) ; // add a writer tEnv.addObjRelation("StreamWriter", xDataOutput); // add a connectable tEnv.addObjRelation("Connectable", xConnect); // add an inputStream tEnv.addObjRelation("InputStream", oDataInput); tEnv.addObjRelation("ByteData", byteData); return tEnv; } // finish method getTestEnvironment }
jvanz/core
qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
Java
gpl-3.0
6,006
[ 30522, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 21091, 7245, 6610, 2622, 1012, 1008, 1008, 2023, 3120, 3642, 2433, 2003, 3395, 2000, 1996, 3408, 1997, 1996, 9587, 5831, 4571, 2270, 1008, 6105, 1010, 1058, 1012, 1016, 1012, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <folly/detail/CacheLocality.h> #include <folly/portability/GTest.h> #include <sched.h> #include <memory> #include <thread> #include <type_traits> #include <unordered_map> #include <glog/logging.h> using namespace folly::detail; /// This is the relevant nodes from a production box's sysfs tree. If you /// think this map is ugly you should see the version of this test that /// used a real directory tree. To reduce the chance of testing error /// I haven't tried to remove the common prefix static std::unordered_map<std::string, std::string> fakeSysfsTree = { {"/sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu0/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu0/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu0/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu0/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu1/cache/index0/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu1/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu1/cache/index1/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu1/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu1/cache/index2/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu1/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu1/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu1/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu2/cache/index0/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu2/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu2/cache/index1/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu2/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu2/cache/index2/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu2/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu2/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu2/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu3/cache/index0/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu3/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu3/cache/index1/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu3/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu3/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu3/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu3/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu4/cache/index0/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu4/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu4/cache/index1/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu4/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu4/cache/index2/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu4/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu4/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu4/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu5/cache/index0/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu5/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu5/cache/index1/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu5/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu5/cache/index2/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu5/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu5/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu5/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu6/cache/index0/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu6/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu6/cache/index1/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu6/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu6/cache/index2/shared_cpu_list", "5-6"}, {"/sys/devices/system/cpu/cpu6/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu6/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu6/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu7/cache/index0/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu7/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu7/cache/index1/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu7/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu7/cache/index2/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu7/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu7/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu7/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu8/cache/index0/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu8/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu8/cache/index1/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu8/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu8/cache/index2/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu8/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu8/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu8/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu9/cache/index0/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu9/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu9/cache/index1/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu9/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu9/cache/index2/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu9/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu9/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu9/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu10/cache/index0/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu10/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu10/cache/index1/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu10/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu10/cache/index2/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu10/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu10/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu10/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu11/cache/index0/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu11/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu11/cache/index1/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu11/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu11/cache/index2/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu11/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu11/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu11/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu12/cache/index0/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu12/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu12/cache/index1/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu12/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu12/cache/index2/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu12/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu12/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu12/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu13/cache/index0/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu13/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu13/cache/index1/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu13/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu13/cache/index2/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu13/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu13/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu13/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu14/cache/index0/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu14/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu14/cache/index1/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu14/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu14/cache/index2/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu14/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu14/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu14/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu15/cache/index0/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu15/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu15/cache/index1/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu15/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu15/cache/index2/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu15/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu15/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu15/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu16/cache/index0/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu16/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu16/cache/index1/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu16/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu16/cache/index2/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu16/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu16/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu16/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu17/cache/index0/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu17/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu17/cache/index1/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu17/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu17/cache/index2/shared_cpu_list", "0,17"}, {"/sys/devices/system/cpu/cpu17/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu17/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu17/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu18/cache/index0/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu18/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu18/cache/index1/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu18/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu18/cache/index2/shared_cpu_list", "1,18"}, {"/sys/devices/system/cpu/cpu18/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu18/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu18/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu19/cache/index0/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu19/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu19/cache/index1/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu19/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu19/cache/index2/shared_cpu_list", "2,19"}, {"/sys/devices/system/cpu/cpu19/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu19/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu19/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu20/cache/index0/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu20/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu20/cache/index1/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu20/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu20/cache/index2/shared_cpu_list", "3,20"}, {"/sys/devices/system/cpu/cpu20/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu20/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu20/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu21/cache/index0/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu21/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu21/cache/index1/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu21/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu21/cache/index2/shared_cpu_list", "4,21"}, {"/sys/devices/system/cpu/cpu21/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu21/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu21/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu22/cache/index0/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu22/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu22/cache/index1/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu22/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu22/cache/index2/shared_cpu_list", "7,22"}, {"/sys/devices/system/cpu/cpu22/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu22/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu22/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu23/cache/index0/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu23/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu23/cache/index1/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu23/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu23/cache/index2/shared_cpu_list", "8,23"}, {"/sys/devices/system/cpu/cpu23/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu23/cache/index3/shared_cpu_list", "0-8,17-23"}, {"/sys/devices/system/cpu/cpu23/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu24/cache/index0/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu24/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu24/cache/index1/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu24/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu24/cache/index2/shared_cpu_list", "9,24"}, {"/sys/devices/system/cpu/cpu24/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu24/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu24/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu25/cache/index0/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu25/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu25/cache/index1/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu25/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu25/cache/index2/shared_cpu_list", "10,25"}, {"/sys/devices/system/cpu/cpu25/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu25/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu25/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu26/cache/index0/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu26/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu26/cache/index1/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu26/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu26/cache/index2/shared_cpu_list", "11,26"}, {"/sys/devices/system/cpu/cpu26/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu26/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu26/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu27/cache/index0/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu27/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu27/cache/index1/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu27/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu27/cache/index2/shared_cpu_list", "12,27"}, {"/sys/devices/system/cpu/cpu27/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu27/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu27/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu28/cache/index0/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu28/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu28/cache/index1/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu28/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu28/cache/index2/shared_cpu_list", "13,28"}, {"/sys/devices/system/cpu/cpu28/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu28/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu28/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu29/cache/index0/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu29/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu29/cache/index1/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu29/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu29/cache/index2/shared_cpu_list", "14,29"}, {"/sys/devices/system/cpu/cpu29/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu29/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu29/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu30/cache/index0/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu30/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu30/cache/index1/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu30/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu30/cache/index2/shared_cpu_list", "15,30"}, {"/sys/devices/system/cpu/cpu30/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu30/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu30/cache/index3/type", "Unified"}, {"/sys/devices/system/cpu/cpu31/cache/index0/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu31/cache/index0/type", "Data"}, {"/sys/devices/system/cpu/cpu31/cache/index1/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu31/cache/index1/type", "Instruction"}, {"/sys/devices/system/cpu/cpu31/cache/index2/shared_cpu_list", "16,31"}, {"/sys/devices/system/cpu/cpu31/cache/index2/type", "Unified"}, {"/sys/devices/system/cpu/cpu31/cache/index3/shared_cpu_list", "9-16,24-31"}, {"/sys/devices/system/cpu/cpu31/cache/index3/type", "Unified"}}; /// This is the expected CacheLocality structure for fakeSysfsTree static const CacheLocality nonUniformExampleLocality = {32, {16, 16, 2}, {0, 2, 4, 6, 8, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}}; TEST(CacheLocality, FakeSysfs) { auto parsed = CacheLocality::readFromSysfsTree([](std::string name) { auto iter = fakeSysfsTree.find(name); return iter == fakeSysfsTree.end() ? std::string() : iter->second; }); auto& expected = nonUniformExampleLocality; EXPECT_EQ(expected.numCpus, parsed.numCpus); EXPECT_EQ(expected.numCachesByLevel, parsed.numCachesByLevel); EXPECT_EQ(expected.localityIndexByCpu, parsed.localityIndexByCpu); } #if FOLLY_HAVE_LINUX_VDSO TEST(Getcpu, VdsoGetcpu) { unsigned cpu; Getcpu::resolveVdsoFunc()(&cpu, nullptr, nullptr); EXPECT_TRUE(cpu < CPU_SETSIZE); } #endif #ifdef FOLLY_TLS TEST(ThreadId, SimpleTls) { unsigned cpu = 0; auto rv = folly::detail::FallbackGetcpu<SequentialThreadId<std::atomic>>::getcpu( &cpu, nullptr, nullptr); EXPECT_EQ(rv, 0); EXPECT_TRUE(cpu > 0); unsigned again; folly::detail::FallbackGetcpu<SequentialThreadId<std::atomic>>::getcpu( &again, nullptr, nullptr); EXPECT_EQ(cpu, again); } #endif TEST(ThreadId, SimplePthread) { unsigned cpu = 0; auto rv = folly::detail::FallbackGetcpu<HashingThreadId>::getcpu( &cpu, nullptr, nullptr); EXPECT_EQ(rv, 0); EXPECT_TRUE(cpu > 0); unsigned again; folly::detail::FallbackGetcpu<HashingThreadId>::getcpu( &again, nullptr, nullptr); EXPECT_EQ(cpu, again); } #ifdef FOLLY_TLS static FOLLY_TLS unsigned testingCpu = 0; static int testingGetcpu(unsigned* cpu, unsigned* node, void* /* unused */) { if (cpu != nullptr) { *cpu = testingCpu; } if (node != nullptr) { *node = testingCpu; } return 0; } #endif TEST(AccessSpreader, Simple) { for (size_t s = 1; s < 200; ++s) { EXPECT_LT(AccessSpreader<>::current(s), s); } } #ifdef FOLLY_TLS #define DECLARE_SPREADER_TAG(tag, locality, func) \ namespace { \ template <typename dummy> \ struct tag {}; \ } \ namespace folly { \ namespace detail { \ template <> \ const CacheLocality& CacheLocality::system<tag>() { \ static auto* inst = new CacheLocality(locality); \ return *inst; \ } \ template <> \ Getcpu::Func AccessSpreader<tag>::pickGetcpuFunc() { \ return func; \ } \ } \ } DECLARE_SPREADER_TAG(ManualTag, CacheLocality::uniform(16), testingGetcpu) TEST(AccessSpreader, Wrapping) { // this test won't pass unless locality.numCpus divides kMaxCpus auto numCpus = CacheLocality::system<ManualTag>().numCpus; EXPECT_EQ(0, 128 % numCpus); for (size_t s = 1; s < 200; ++s) { for (size_t c = 0; c < 400; ++c) { testingCpu = c; auto observed = AccessSpreader<ManualTag>::current(s); testingCpu = c % numCpus; auto expected = AccessSpreader<ManualTag>::current(s); EXPECT_EQ(expected, observed) << "numCpus=" << numCpus << ", s=" << s << ", c=" << c; } } } #endif
charsyam/folly
folly/test/CacheLocalityTest.cpp
C++
apache-2.0
25,381
[ 30522, 1013, 1008, 1008, 9385, 2418, 9130, 1010, 4297, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$(window).load(function(){FusionCharts.ready(function () { var revenueChart = new FusionCharts({ type: 'column2d', renderAt: 'chart-container', width: '500', height: '300', dataFormat: 'json', dataSource: { "chart": { "caption": "Monthly Revenue", "subCaption": "Last year", "xAxisName": "Month", "yAxisName": "Amount (In USD)", "numberPrefix": "$", "theme": "fint", //Configure x-axis labels to display in staggered mode "labelDisplay": "stagger", "staggerLines": "3" }, "data": [{ "label": "January", "value": "420000" }, { "label": "February", "value": "810000" }, { "label": "March", "value": "720000" }, { "label": "April", "value": "550000" }, { "label": "May", "value": "910000" }, { "label": "June", "value": "510000" }, { "label": "July", "value": "680000" }, { "label": "August", "value": "620000" }, { "label": "September", "value": "610000" }, { "label": "October", "value": "490000" }, { "label": "November", "value": "900000" }, { "label": "December", "value": "730000" }] } }).render(); });});
sguha-work/fiddletest
fiddles/Chart/Data-Labels/Configuring-x-axis-data-labels-display---staggered-mode_468/demo.js
JavaScript
gpl-2.0
1,780
[ 30522, 1002, 1006, 3332, 1007, 1012, 7170, 1006, 3853, 1006, 1007, 1063, 10077, 7507, 21217, 1012, 3201, 1006, 3853, 1006, 1007, 1063, 13075, 6599, 7507, 5339, 1027, 2047, 10077, 7507, 21217, 1006, 1063, 2828, 1024, 1005, 5930, 2475, 2094, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * @file fsfloaterprofile.cpp * @brief Legacy Profile Floater * * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ * Phoenix Firestorm Viewer Source Code * Copyright (C) 2012, Kadah Coba * * 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; * version 2.1 of the License only. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA * http://www.firestormviewer.org * $/LicenseInfo$ */ #include "llviewerprecompiledheaders.h" #include "fsfloaterprofile.h" // Newview #include "fspanelprofile.h" #include "llagent.h" //gAgent #include "llavatarnamecache.h" #include "fspanelprofileclassifieds.h" static const std::string PANEL_PROFILE_VIEW = "panel_profile_view"; FSFloaterProfile::FSFloaterProfile(const LLSD& key) : LLFloater(key) , mAvatarId(LLUUID::null) { } FSFloaterProfile::~FSFloaterProfile() { } void FSFloaterProfile::onOpen(const LLSD& key) { LLUUID id; if(key.has("id")) { id = key["id"]; } if(!id.notNull()) return; setAvatarId(id); FSPanelProfile* panel_profile = findChild<FSPanelProfile>(PANEL_PROFILE_VIEW); panel_profile->onOpen(getAvatarId()); if (getAvatarId() == gAgent.getID()) { getChild<LLUICtrl>("ok_btn")->setVisible( true ); getChild<LLUICtrl>("cancel_btn")->setVisible( true ); } // Update the avatar name. LLAvatarNameCache::get(getAvatarId(), boost::bind(&FSFloaterProfile::onAvatarNameCache, this, _1, _2)); } BOOL FSFloaterProfile::postBuild() { childSetAction("ok_btn", boost::bind(&FSFloaterProfile::onOKBtn, this)); childSetAction("cancel_btn", boost::bind(&FSFloaterProfile::onCancelBtn, this)); return TRUE; } void FSFloaterProfile::onOKBtn() { if (getAvatarId() == gAgent.getID()) { FSPanelProfile* panel_profile = findChild<FSPanelProfile>(PANEL_PROFILE_VIEW); panel_profile->apply(); } closeFloater(); } void FSFloaterProfile::onCancelBtn() { closeFloater(); } void FSFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { setTitle(av_name.getCompleteName()); } // eof
gabeharms/firestorm
indra/newview/fsfloaterprofile.cpp
C++
lgpl-2.1
2,663
[ 30522, 1013, 1008, 1008, 1008, 1030, 5371, 1042, 22747, 4135, 24932, 21572, 8873, 2571, 1012, 18133, 2361, 1008, 1030, 4766, 8027, 6337, 14257, 2121, 1008, 1008, 1002, 6105, 2378, 14876, 1024, 2034, 29100, 1027, 2262, 1004, 6105, 1027, 1042...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* arch/arm/mach-exynos/hardware.c * * Meizu Mobilephone Hardware information support * * Author : Li Tao <litao@meizu.com> * * This program 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. */ #include <linux/fs.h> #include <linux/init.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/bootinfo.h> #include <asm/mach-types.h> #include <mach/hardware.h> unsigned int meizu_board_mdm_type(void) { unsigned int mdm_type = MEIZU_MDM_XMM6260; if (machine_is_m69()) mdm_type = MEIZU_MDM_SC8803G; return mdm_type; } /* ID PCB NFC * 000 V1.0 T * 001 V1.0 F * 010 V2.0 T * 011 V2.0 F */ bool meizu_board_have_nfc(void) { bool have_nfc = false; u8 board_version = m6x_get_board_version(); /*bit0: [0] NFC-> true, [1] NFC-> false*/ if (!(board_version & 0x1)) have_nfc = true; return have_nfc; } static int c_show(struct seq_file *m, void *v) { u8 board_version = m6x_get_board_version(); seq_printf(m, "SOC\t\t: %s\n", "EXYNOS5410"); seq_printf(m, "Version\t\t: %d\n", board_version); seq_printf(m, "NFC\t\t: %s\n", meizu_board_have_nfc()? "true":"false"); seq_printf(m, "Modem\t\t: %s\n", (meizu_board_mdm_type() == MEIZU_MDM_XMM6260)? "WCDMA":"TD-SCDMA"); return 0; } /*proc functions*/ static void *c_start(struct seq_file *m, loff_t *pos) { return *pos < 1 ? (void *)1 : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { ++*pos; return NULL; } static void c_stop(struct seq_file *m, void *v) { } static const struct seq_operations hwinfo_op = { .start = c_start, .next = c_next, .stop = c_stop, .show = c_show }; static int hwinfo_open(struct inode *inode, struct file *file) { return seq_open(file, &hwinfo_op); } static const struct file_operations proc_hwinfo_operations = { .open = hwinfo_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; static int __init proc_hwinfo_init(void) { proc_create("hwinfo", 0, NULL, &proc_hwinfo_operations); return 0; } module_init(proc_hwinfo_init); MODULE_DESCRIPTION("Meizu Mobilephone Hardware Information"); MODULE_AUTHOR("Li Tao <litao@meizu.com>"); MODULE_LICENSE("GPL");
meizuosc/m35x
arch/arm/mach-exynos/hardware.c
C
gpl-2.0
2,336
[ 30522, 1013, 1008, 7905, 1013, 2849, 1013, 24532, 1011, 4654, 6038, 2891, 1013, 8051, 1012, 1039, 1008, 1008, 19734, 9759, 4684, 9864, 8051, 2592, 2490, 1008, 1008, 3166, 1024, 5622, 20216, 1026, 5507, 7113, 1030, 19734, 9759, 1012, 4012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Copyright 2015 Metaswitch Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import unittest from mock import patch, Mock, call from nose_parameterized import parameterized from netaddr import IPAddress, IPNetwork from subprocess import CalledProcessError from calico_ctl.bgp import * from calico_ctl import container from calico_ctl import utils from pycalico.datastore_datatypes import Endpoint, IPPool class TestContainer(unittest.TestCase): @parameterized.expand([ ({'<CONTAINER>':'node1', 'ip':1, 'add':1, '<IP>':'127.a.0.1'}, True), ({'<CONTAINER>':'node1', 'ip':1, 'add':1, '<IP>':'aa:bb::zz'}, True), ({'add':1, '<CONTAINER>':'node1', '<IP>':'127.a.0.1'}, True), ({'add':1, '<CONTAINER>':'node1', '<IP>':'aa:bb::zz'}, True) ]) def test_validate_arguments(self, case, sys_exit_called): """ Test validate_arguments for calicoctl container command """ with patch('sys.exit', autospec=True) as m_sys_exit: # Call method under test container.validate_arguments(case) # Assert method exits if bad input self.assertEqual(m_sys_exit.called, sys_exit_called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_add(self, m_netns, m_get_pool_or_exit, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add method of calicoctl container command """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'}, 'HostConfig': {'NetworkMode': "not host"} } m_client.get_endpoint.side_effect = KeyError m_client.get_default_next_hops.return_value = 'next_hops' # Call method under test test_return = container.container_add('container1', '1.1.1.1', 'interface') # Assert m_enforce_root.assert_called_once_with() m_get_container_info_or_exit.assert_called_once_with('container1') m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) m_get_pool_or_exit.assert_called_once_with(IPAddress('1.1.1.1')) m_client.get_default_next_hops.assert_called_once_with(utils.hostname) # Check an enpoint object was returned self.assertTrue(isinstance(test_return, Endpoint)) self.assertTrue(m_netns.create_veth.called) self.assertTrue(m_netns.move_veth_into_ns.called) self.assertTrue(m_netns.add_ip_to_ns_veth.called) self.assertTrue(m_netns.add_ns_default_route.called) self.assertTrue(m_netns.get_ns_veth_mac.called) self.assertTrue(m_client.set_endpoint.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) def test_container_add_container_host_ns(self, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add method of calicoctl container command when the container shares the host namespace. """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'}, 'HostConfig': {'NetworkMode': 'host'} } m_client.get_endpoint.side_effect = KeyError # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_add, 'container1', '1.1.1.1', 'interface') m_enforce_root.assert_called_once_with() @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) def test_container_add_existing_container( self, m_get_pool_or_exit, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add when a container already exists. Do not raise an exception when the client tries 'get_endpoint' Assert that the system then exits and all expected calls are made """ # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_add, 'container1', '1.1.1.1', 'interface') # Assert only expected calls were made self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_get_pool_or_exit.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) def test_container_add_container_not_running( self, m_get_pool_or_exit, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add when a container is not running get_container_info_or_exit returns a running state of value 0 Assert that the system then exits and all expected calls are made """ # Set up mock object m_client.get_endpoint.side_effect = KeyError m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 0, 'Pid': 'Pid_info'} } # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_add, 'container1', '1.1.1.1', 'interface') # Assert only expected calls were made self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_get_pool_or_exit.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) def test_container_add_not_ipv4_configured( self, m_get_pool_or_exit, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add when the client cannot obtain next hop IPs client.get_default_next_hops returns an empty dictionary, which produces a KeyError when trying to determine the IP. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_client.get_endpoint.side_effect = KeyError m_client.get_default_next_hops.return_value = {} # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_add, 'container1', '1.1.1.1', 'interface') # Assert only expected calls were made self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_client.get_default_next_hops.called) self.assertFalse(m_client.assign_address.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_add_ip_previously_assigned( self, m_netns, m_get_pool_or_exit, m_client, m_get_container_info_or_exit, m_enforce_root): """ Test container_add when an ip address is already assigned in pool client.assign_address returns an empty list. Assert that the system then exits and all expected calls are made """ # Set up mock object m_client.get_endpoint.side_effect = KeyError m_client.assign_address.return_value = [] # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_add, 'container1', '1.1.1.1', 'interface') # Assert only expected calls were made self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_client.get_default_next_hops.called) self.assertTrue(m_client.assign_address.called) self.assertFalse(m_netns.create_veth.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_id', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_remove(self, m_netns, m_client, m_get_container_id, m_enforce_root): """ Test for container_remove of calicoctl container command """ # Set up mock objects m_get_container_id.return_value = 666 ipv4_nets = set() ipv4_nets.add(IPNetwork(IPAddress('1.1.1.1'))) ipv6_nets = set() m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv4_nets = ipv4_nets m_endpoint.ipv6_nets = ipv6_nets m_endpoint.endpoint_id = 12 m_endpoint.name = "eth1234" ippool = IPPool('1.1.1.1/24') m_client.get_endpoint.return_value = m_endpoint m_client.get_ip_pools.return_value = [ippool] # Call method under test container.container_remove('container1') # Assert m_enforce_root.assert_called_once_with() m_get_container_id.assert_called_once_with('container1') m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) self.assertEqual(m_client.unassign_address.call_count, 1) m_netns.remove_veth.assert_called_once_with("eth1234") m_client.remove_workload.assert_called_once_with( utils.hostname, utils.ORCHESTRATOR_ID, 666) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_container_id', autospec=True) @patch('calico_ctl.container.client', autospec=True) def test_container_remove_no_endpoint( self, m_client, m_get_container_id, m_enforce_root): """ Test for container_remove when the client cannot obtain an endpoint client.get_endpoint raises a KeyError. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_client.get_endpoint.side_effect = KeyError # Call function under test expecting a SystemExit self.assertRaises(SystemExit, container.container_remove, 'container1') # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_id.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_client.get_ip_pools.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_add_ipv4( self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add with an ipv4 ip argument Assert that the correct calls associated with an ipv4 address are made """ # Set up mock objects pool_return = 'pool' m_get_pool_or_exit.return_value = pool_return m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_endpoint = Mock() m_client.get_endpoint.return_value = m_endpoint # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' ip_addr = IPAddress(ip) interface = 'interface' # Call method under test container.container_ip_add(container_name, ip, interface) # Assert m_enforce_root.assert_called_once_with() m_get_pool_or_exit.assert_called_once_with(ip_addr) m_get_container_info_or_exit.assert_called_once_with(container_name) m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) m_client.assign_address.assert_called_once_with(pool_return, ip_addr) m_endpoint.ipv4_nets.add.assert_called_once_with(IPNetwork(ip_addr)) m_client.update_endpoint.assert_called_once_with(m_endpoint) m_netns.add_ip_to_ns_veth.assert_called_once_with( 'Pid_info', ip_addr, interface ) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_add_ipv6( self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add with an ipv6 ip argument Assert that the correct calls associated with an ipv6 address are made """ # Set up mock objects pool_return = 'pool' m_get_pool_or_exit.return_value = pool_return m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_endpoint = Mock() m_client.get_endpoint.return_value = m_endpoint # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' ip_addr = IPAddress(ip) interface = 'interface' # Call method under test container.container_ip_add(container_name, ip, interface) # Assert m_enforce_root.assert_called_once_with() m_get_pool_or_exit.assert_called_once_with(ip_addr) m_get_container_info_or_exit.assert_called_once_with(container_name) m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) m_client.assign_address.assert_called_once_with(pool_return, ip_addr) m_endpoint.ipv6_nets.add.assert_called_once_with(IPNetwork(ip_addr)) m_client.update_endpoint.assert_called_once_with(m_endpoint) m_netns.add_ip_to_ns_veth.assert_called_once_with( 'Pid_info', ip_addr, interface ) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client.get_endpoint', autospec=True) def test_container_ip_add_container_not_running( self, m_client_get_endpoint, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add when the container is not running get_container_info_or_exit returns a running state of value 0. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 0, 'Pid': 'Pid_info'} } # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_get_pool_or_exit.called) self.assertFalse(m_client_get_endpoint.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.print_container_not_in_calico_msg', autospec=True) def test_container_ip_add_container_not_in_calico( self, m_print_container_not_in_calico_msg, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add when the container is not networked into calico client.get_endpoint raises a KeyError. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_client.get_endpoint.return_value = Mock() m_client.get_endpoint.side_effect = KeyError # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test expecting a System Exit self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) m_print_container_not_in_calico_msg.assert_called_once_with(container_name) self.assertFalse(m_client.assign_address.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_add_fail_assign_address( self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add when the client cannot assign an IP client.assign_address returns an empty list. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_client.assign_address.return_value = [] # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_netns.add_ip_to_ns_veth.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns.add_ip_to_ns_veth', autospec=True) def test_container_ip_add_error_updating_datastore( self, m_netns_add_ip_to_ns_veth, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_add when the client fails to update endpoint client.update_endpoint raises a KeyError. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_pool_or_exit.return_value = 'pool' m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_client.update_endpoint.side_effect = KeyError # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_client.assign_address.called) m_client.unassign_address.assert_called_once_with('pool', ip) self.assertFalse(m_netns_add_ip_to_ns_veth.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns.add_ip_to_ns_veth', autospec=True) def test_container_ip_add_netns_error_ipv4( self, m_netns_add_ip_to_ns_veth, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_add when netns cannot add an ipv4 to interface netns.add_ip_to_ns_veth throws a CalledProcessError. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_get_pool_or_exit.return_value = 'pool' m_endpoint = Mock() m_client.get_endpoint.return_value = m_endpoint err = CalledProcessError( 1, m_netns_add_ip_to_ns_veth, "Error updating container") m_netns_add_ip_to_ns_veth.side_effect = err # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_client.assign_address.called) self.assertTrue(m_netns_add_ip_to_ns_veth.called) m_endpoint.ipv4_nets.remove.assert_called_once_with( IPNetwork(IPAddress(ip)) ) m_client.update_endpoint.assert_has_calls([ call(m_endpoint), call(m_endpoint)]) m_client.unassign_address.assert_called_once_with('pool', ip) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.print_container_not_in_calico_msg', autospec=True) @patch('calico_ctl.container.netns.add_ip_to_ns_veth', autospec=True) def test_container_ip_add_netns_error_ipv6( self, m_netns, m_print_container_not_in_calico_msg, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_add when netns cannot add an ipv6 to interface netns.add_ip_to_ns_veth throws a CalledProcessError. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_get_pool_or_exit.return_value = 'pool' m_endpoint = Mock() m_client.get_endpoint.return_value = m_endpoint err = CalledProcessError(1, m_netns, "Error updating container") m_netns.side_effect = err # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test self.assertRaises(SystemExit, container.container_ip_add, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_client.assign_address.called) self.assertTrue(m_netns.called) m_endpoint.ipv6_nets.remove.assert_called_once_with( IPNetwork(IPAddress(ip)) ) m_client.update_endpoint.assert_has_calls([ call(m_endpoint), call(m_endpoint)]) m_client.unassign_address.assert_called_once_with('pool', ip) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_remove_ipv4(self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_remove with an ipv4 ip argument """ # Set up mock objects m_get_pool_or_exit.return_value = 'pool' m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } ipv4_nets = set() ipv4_nets.add(IPNetwork(IPAddress('1.1.1.1'))) m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv4_nets = ipv4_nets m_client.get_endpoint.return_value = m_endpoint # Set up arguments to pass to method under test container_name = 'container1' ip = '1.1.1.1' interface = 'interface' # Call method under test container.container_ip_remove(container_name, ip, interface) # Assert m_enforce_root.assert_called_once_with() m_get_pool_or_exit.assert_called_once_with(IPAddress(ip)) m_get_container_info_or_exit.assert_called_once_with(container_name) m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) m_client.update_endpoint.assert_called_once_with(m_endpoint) m_netns.remove_ip_from_ns_veth.assert_called_once_with( 'Pid_info', IPAddress(ip), interface ) m_client.unassign_address.assert_called_once_with('pool', ip) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_remove_ipv6(self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_remove with an ipv6 ip argument """ # Set up mock objects m_get_pool_or_exit.return_value = 'pool' m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } ipv6_nets = set() ipv6_nets.add(IPNetwork(IPAddress('1::1'))) m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv6_nets = ipv6_nets m_client.get_endpoint.return_value = m_endpoint # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test container.container_ip_remove(container_name, ip, interface) # Assert m_enforce_root.assert_called_once_with() m_get_pool_or_exit.assert_called_once_with(IPAddress(ip)) m_get_container_info_or_exit.assert_called_once_with(container_name) m_client.get_endpoint.assert_called_once_with( hostname=utils.hostname, orchestrator_id=utils.ORCHESTRATOR_ID, workload_id=666 ) m_client.update_endpoint.assert_called_once_with(m_endpoint) m_netns.remove_ip_from_ns_veth.assert_called_once_with( 'Pid_info', IPAddress(ip), interface ) m_client.unassign_address.assert_called_once_with('pool', ip) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) def test_container_ip_remove_not_running( self, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_remove when the container is not running get_container_info_or_exit returns a running state of value 0. Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 0, 'Pid': 'Pid_info'} } # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_remove, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertFalse(m_client.get_endpoint.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) def test_container_ip_remove_ip_not_assigned( self, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_remove when an IP address is not assigned to a container client.get_endpoint returns an endpoint with no ip nets Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } ipv6_nets = set() m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv6_nets = ipv6_nets m_client.get_endpoint.return_value = m_endpoint # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_remove, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_client.update_endpoint.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) def test_container_ip_remove_container_not_on_calico( self, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test for container_ip_remove when container is not networked into Calico client.get_endpoint raises a KeyError Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } m_client.get_endpoint.side_effect = KeyError # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_remove, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertFalse(m_client.update_endpoint.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_remove_fail_updating_datastore( self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_remove when client fails to update endpoint in datastore client.update_endpoint throws a KeyError Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } ipv6_nets = set() ipv6_nets.add(IPNetwork(IPAddress('1::1'))) m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv6_nets = ipv6_nets m_client.get_endpoint.return_value = m_endpoint m_client.update_endpoint.side_effect = KeyError # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_remove, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_client.update_endpoint.called) self.assertFalse(m_netns.remove_ip_from_ns_veth.called) @patch('calico_ctl.container.enforce_root', autospec=True) @patch('calico_ctl.container.get_pool_or_exit', autospec=True) @patch('calico_ctl.container.get_container_info_or_exit', autospec=True) @patch('calico_ctl.container.client', autospec=True) @patch('calico_ctl.container.netns', autospec=True) def test_container_ip_remove_netns_error( self, m_netns, m_client, m_get_container_info_or_exit, m_get_pool_or_exit, m_enforce_root): """ Test container_ip_remove when client fails on removing ip from interface netns.remove_ip_from_ns_veth raises a CalledProcessError Assert that the system then exits and all expected calls are made """ # Set up mock objects m_get_container_info_or_exit.return_value = { 'Id': 666, 'State': {'Running': 1, 'Pid': 'Pid_info'} } ipv6_nets = set() ipv6_nets.add(IPNetwork(IPAddress('1::1'))) m_endpoint = Mock(spec=Endpoint) m_endpoint.ipv6_nets = ipv6_nets m_client.get_endpoint.return_value = m_endpoint err = CalledProcessError(1, m_netns, "Error removing ip") m_netns.remove_ip_from_ns_veth.side_effect = err # Set up arguments to pass to method under test container_name = 'container1' ip = '1::1' interface = 'interface' # Call method under test expecting a SystemExit self.assertRaises(SystemExit, container.container_ip_remove, container_name, ip, interface) # Assert self.assertTrue(m_enforce_root.called) self.assertTrue(m_get_pool_or_exit.called) self.assertTrue(m_get_container_info_or_exit.called) self.assertTrue(m_client.get_endpoint.called) self.assertTrue(m_client.update_endpoint.called) self.assertTrue(m_netns.remove_ip_from_ns_veth.called) self.assertFalse(m_client.unassign_address.called)
TeaBough/calico-docker
calico_containers/tests/unit/container_test.py
Python
apache-2.0
39,497
[ 30522, 1001, 9385, 2325, 18804, 26760, 20189, 6125, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1001, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
RSpec.describe Porch::ProcStepDecorator do describe ".decorates?" do it "returns true if the step is a proc" do expect(described_class).to be_decorates Proc.new {} end it "returns true if the step is a lambda" do expect(described_class).to be_decorates lambda {} end it "returns false if the step is a class" do expect(described_class).to_not be_decorates Object end end describe "#execute" do let(:context) { Hash.new } let(:organizer) { double(:organizer) } let(:step) { Proc.new {} } subject { described_class.new step, organizer } it "calls the proc with the context" do expect(step).to receive(:call).with(context) subject.execute context end end end
jwright/porch
spec/porch/step_decorators/proc_step_decorator_spec.rb
Ruby
mit
747
[ 30522, 12667, 5051, 2278, 1012, 6235, 7424, 1024, 1024, 4013, 6169, 2618, 17299, 8586, 6525, 4263, 2079, 6235, 1000, 1012, 29460, 2015, 1029, 1000, 2079, 2009, 1000, 5651, 2995, 2065, 1996, 3357, 2003, 1037, 4013, 2278, 1000, 2079, 5987, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>hello-backbonejs</title> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script> <script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.6/underscore-min.js"></script> <script src="http://ajax.cdnjs.com/ajax/libs/backbone.js/0.3.3/backbone-min.js"></script> <script src="4.js"></script> </body> </html>
juhnowski/backbone_hello_world
4.html
HTML
mit
514
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 2516, 1028, 7592, 1011, 21505, 22578, 1026, 1013, 2516, 1028, 1026, 1013, 213...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* arch/arm/mach-msm/smd_private.h * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. * */ #ifndef _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_ #define _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_ #include <linux/types.h> #include <linux/spinlock.h> struct smem_heap_info { unsigned initialized; unsigned free_offset; unsigned heap_remaining; unsigned reserved; }; struct smem_heap_entry { unsigned allocated; unsigned offset; unsigned size; unsigned reserved; }; struct smem_proc_comm { unsigned command; unsigned status; unsigned data1; unsigned data2; }; #define PC_APPS 0 #define PC_MODEM 1 #define VERSION_QDSP6 4 #define VERSION_APPS_SBL 6 #define VERSION_MODEM_SBL 7 #define VERSION_APPS 8 #define VERSION_MODEM 9 #define VERSION_DSPS 10 #define SMD_HEAP_SIZE 512 struct smem_shared { struct smem_proc_comm proc_comm[4]; unsigned version[32]; struct smem_heap_info heap_info; struct smem_heap_entry heap_toc[SMD_HEAP_SIZE]; }; #if defined(CONFIG_MSM_SMD_PKG4) struct smsm_interrupt_info { uint32_t aArm_en_mask; uint32_t aArm_interrupts_pending; uint32_t aArm_wakeup_reason; uint32_t aArm_rpc_prog; uint32_t aArm_rpc_proc; char aArm_smd_port_name[20]; uint32_t aArm_gpio_info; }; #elif defined(CONFIG_MSM_SMD_PKG3) struct smsm_interrupt_info { uint32_t aArm_en_mask; uint32_t aArm_interrupts_pending; uint32_t aArm_wakeup_reason; }; #else #error No SMD Package Specified; aborting #endif #if defined(CONFIG_MSM_N_WAY_SMSM) enum { SMSM_APPS_STATE, SMSM_MODEM_STATE, SMSM_Q6_STATE, SMSM_APPS_DEM, SMSM_MODEM_DEM, SMSM_Q6_DEM, SMSM_POWER_MASTER_DEM, SMSM_TIME_MASTER_DEM, SMSM_NUM_ENTRIES, }; #else enum { SMSM_APPS_STATE = 1, SMSM_MODEM_STATE = 3, SMSM_NUM_ENTRIES, }; #endif enum { SMSM_APPS, SMSM_MODEM, SMSM_Q6, SMSM_NUM_HOSTS, }; #define SZ_DIAG_ERR_MSG 0xC8 #define ID_DIAG_ERR_MSG SMEM_DIAG_ERR_MESSAGE #define ID_SMD_CHANNELS SMEM_SMD_BASE_ID #define ID_SHARED_STATE SMEM_SMSM_SHARED_STATE #define ID_CH_ALLOC_TBL SMEM_CHANNEL_ALLOC_TBL #define SMSM_INIT 0x00000001 #define SMSM_OSENTERED 0x00000002 #define SMSM_SMDWAIT 0x00000004 #define SMSM_SMDINIT 0x00000008 #define SMSM_RPCWAIT 0x00000010 #define SMSM_RPCINIT 0x00000020 #define SMSM_RESET 0x00000040 #define SMSM_RSA 0x00000080 #define SMSM_RUN 0x00000100 #define SMSM_PWRC 0x00000200 #define SMSM_TIMEWAIT 0x00000400 #define SMSM_TIMEINIT 0x00000800 #define SMSM_PWRC_EARLY_EXIT 0x00001000 #define SMSM_WFPI 0x00002000 #define SMSM_SLEEP 0x00004000 #define SMSM_SLEEPEXIT 0x00008000 #define SMSM_OEMSBL_RELEASE 0x00010000 #define SMSM_APPS_REBOOT 0x00020000 #define SMSM_SYSTEM_POWER_DOWN 0x00040000 #define SMSM_SYSTEM_REBOOT 0x00080000 #define SMSM_SYSTEM_DOWNLOAD 0x00100000 #define SMSM_PWRC_SUSPEND 0x00200000 #define SMSM_APPS_SHUTDOWN 0x00400000 #define SMSM_SMD_LOOPBACK 0x00800000 #define SMSM_RUN_QUIET 0x01000000 #define SMSM_MODEM_WAIT 0x02000000 #define SMSM_MODEM_BREAK 0x04000000 #define SMSM_MODEM_CONTINUE 0x08000000 #define SMSM_SYSTEM_REBOOT_USR 0x20000000 #define SMSM_SYSTEM_PWRDWN_USR 0x40000000 #define SMSM_UNKNOWN 0x80000000 #define SMSM_WKUP_REASON_RPC 0x00000001 #define SMSM_WKUP_REASON_INT 0x00000002 #define SMSM_WKUP_REASON_GPIO 0x00000004 #define SMSM_WKUP_REASON_TIMER 0x00000008 #define SMSM_WKUP_REASON_ALARM 0x00000010 #define SMSM_WKUP_REASON_RESET 0x00000020 void *smem_alloc(unsigned id, unsigned size); void *smem_get_entry(unsigned id, unsigned *size); int smsm_change_state(uint32_t smsm_entry, uint32_t clear_mask, uint32_t set_mask); int smsm_change_intr_mask(uint32_t smsm_entry, uint32_t clear_mask, uint32_t set_mask); int smsm_get_intr_mask(uint32_t smsm_entry, uint32_t *intr_mask); uint32_t smsm_get_state(uint32_t smsm_entry); void smsm_print_sleep_info(uint32_t sleep_delay, uint32_t sleep_limit, uint32_t irq_mask, uint32_t wakeup_reason, uint32_t pending_irqs); void smsm_reset_modem(unsigned mode); void smsm_reset_modem_cont(void); void smd_sleep_exit(void); #define SMEM_NUM_SMD_STREAM_CHANNELS 64 #define SMEM_NUM_SMD_BLOCK_CHANNELS 64 enum { /* fixed items */ SMEM_PROC_COMM = 0, SMEM_HEAP_INFO, SMEM_ALLOCATION_TABLE, SMEM_VERSION_INFO, SMEM_HW_RESET_DETECT, SMEM_AARM_WARM_BOOT, SMEM_DIAG_ERR_MESSAGE, SMEM_SPINLOCK_ARRAY, SMEM_MEMORY_BARRIER_LOCATION, SMEM_FIXED_ITEM_LAST = SMEM_MEMORY_BARRIER_LOCATION, /* dynamic items */ SMEM_AARM_PARTITION_TABLE, SMEM_AARM_BAD_BLOCK_TABLE, SMEM_RESERVE_BAD_BLOCKS, SMEM_WM_UUID, SMEM_CHANNEL_ALLOC_TBL, SMEM_SMD_BASE_ID, SMEM_SMEM_LOG_IDX = SMEM_SMD_BASE_ID + SMEM_NUM_SMD_STREAM_CHANNELS, SMEM_SMEM_LOG_EVENTS, SMEM_SMEM_STATIC_LOG_IDX, SMEM_SMEM_STATIC_LOG_EVENTS, SMEM_SMEM_SLOW_CLOCK_SYNC, SMEM_SMEM_SLOW_CLOCK_VALUE, SMEM_BIO_LED_BUF, SMEM_SMSM_SHARED_STATE, SMEM_SMSM_INT_INFO, SMEM_SMSM_SLEEP_DELAY, SMEM_SMSM_LIMIT_SLEEP, SMEM_SLEEP_POWER_COLLAPSE_DISABLED, SMEM_KEYPAD_KEYS_PRESSED, SMEM_KEYPAD_STATE_UPDATED, SMEM_KEYPAD_STATE_IDX, SMEM_GPIO_INT, SMEM_MDDI_LCD_IDX, SMEM_MDDI_HOST_DRIVER_STATE, SMEM_MDDI_LCD_DISP_STATE, SMEM_LCD_CUR_PANEL, SMEM_MARM_BOOT_SEGMENT_INFO, SMEM_AARM_BOOT_SEGMENT_INFO, SMEM_SLEEP_STATIC, SMEM_SCORPION_FREQUENCY, SMEM_SMD_PROFILES, SMEM_TSSC_BUSY, SMEM_HS_SUSPEND_FILTER_INFO, SMEM_BATT_INFO, SMEM_APPS_BOOT_MODE, SMEM_VERSION_FIRST, SMEM_VERSION_SMD = SMEM_VERSION_FIRST, SMEM_VERSION_LAST = SMEM_VERSION_FIRST + 24, SMEM_OSS_RRCASN1_BUF1, SMEM_OSS_RRCASN1_BUF2, SMEM_ID_VENDOR0, SMEM_ID_VENDOR1, SMEM_ID_VENDOR2, SMEM_HW_SW_BUILD_ID, SMEM_SMD_BLOCK_PORT_BASE_ID, SMEM_SMD_BLOCK_PORT_PROC0_HEAP = SMEM_SMD_BLOCK_PORT_BASE_ID + SMEM_NUM_SMD_BLOCK_CHANNELS, SMEM_SMD_BLOCK_PORT_PROC1_HEAP = SMEM_SMD_BLOCK_PORT_PROC0_HEAP + SMEM_NUM_SMD_BLOCK_CHANNELS, SMEM_I2C_MUTEX = SMEM_SMD_BLOCK_PORT_PROC1_HEAP + SMEM_NUM_SMD_BLOCK_CHANNELS, SMEM_SCLK_CONVERSION, SMEM_SMD_SMSM_INTR_MUX, SMEM_SMSM_CPU_INTR_MASK, SMEM_APPS_DEM_SLAVE_DATA, SMEM_QDSP6_DEM_SLAVE_DATA, SMEM_CLKREGIM_BSP, SMEM_CLKREGIM_SOURCES, SMEM_SMD_FIFO_BASE_ID, SMEM_USABLE_RAM_PARTITION_TABLE = SMEM_SMD_FIFO_BASE_ID + SMEM_NUM_SMD_STREAM_CHANNELS, SMEM_POWER_ON_STATUS_INFO, SMEM_DAL_AREA, SMEM_SMEM_LOG_POWER_IDX, SMEM_SMEM_LOG_POWER_WRAP, SMEM_SMEM_LOG_POWER_EVENTS, SMEM_ERR_CRASH_LOG, SMEM_ERR_F3_TRACE_LOG, SMEM_SMD_BRIDGE_ALLOC_TABLE, SMEM_SMDLITE_TABLE, SMEM_SD_IMG_UPGRADE_STATUS, SMEM_SEFS_INFO, SMEM_RESET_LOG, SMEM_RESET_LOG_SYMBOLS, SMEM_MEM_LAST = SMEM_RESET_LOG_SYMBOLS, SMEM_NUM_ITEMS, }; enum { SMEM_APPS_Q6_SMSM = 3, SMEM_Q6_APPS_SMSM = 5, SMSM_NUM_INTR_MUX = 8, }; #define SMD_SS_CLOSED 0x00000000 #define SMD_SS_OPENING 0x00000001 #define SMD_SS_OPENED 0x00000002 #define SMD_SS_FLUSHING 0x00000003 #define SMD_SS_CLOSING 0x00000004 #define SMD_SS_RESET 0x00000005 #define SMD_SS_RESET_OPENING 0x00000006 #define SMD_BUF_SIZE 8192 #define SMD_CHANNELS 64 #define SMD_HEADER_SIZE 20 #ifdef CONFIG_PANTECH_ERR_CRASH_LOGGING #define MAX_CRASH_BUF_SIZE 0x60000 // 384Kbytes #endif /* 'type' field of smd_alloc_elm structure * has the following breakup * bits 0-7 -> channel type * bits 8-11 -> xfer type * bits 12-31 -> reserved */ struct smd_alloc_elm { char name[20]; uint32_t cid; uint32_t type; uint32_t ref_count; }; #define SMD_CHANNEL_TYPE(x) ((x) & 0x000000FF) #define SMD_XFER_TYPE(x) (((x) & 0x00000F00) >> 8) struct smd_half_channel { unsigned state; unsigned char fDSR; unsigned char fCTS; unsigned char fCD; unsigned char fRI; unsigned char fHEAD; unsigned char fTAIL; unsigned char fSTATE; unsigned char fBLOCKREADINTR; unsigned tail; unsigned head; }; extern spinlock_t smem_lock; int smsm_check_for_modem_crash(void); void *smem_find(unsigned id, unsigned size); void *smem_get_entry(unsigned id, unsigned *size); void smd_diag(void); #ifdef CONFIG_PANTECH_ERR_CRASH_LOGGING void smem_diag_set_message(char *message); #endif /* CONFIG_PANTECH_ERR_CRASH_LOGGING */ #endif
n8ohu/android_kernel_pantech_lgvr
arch/arm/mach-msm/smd_private.h
C
gpl-2.0
8,763
[ 30522, 1013, 1008, 7905, 1013, 30524, 1012, 1044, 1008, 1008, 9385, 1006, 1039, 1007, 2289, 8224, 1010, 4297, 1012, 1008, 9385, 1006, 1039, 1007, 2289, 1011, 2230, 1010, 3642, 13158, 7057, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <title>Image->6502 Assembly</title> <style> .hide {display:none} </style> </head> <body> <img id="sourceImage" src="chrome.jpg" class="hide"/> <canvas id="workCanvas" width="32" height="32" class="hide" style="border: 1px solid black"></canvas> <p> Drag and drop images (32x32 or smaller) onto canvas below.<br> <canvas id="displayCanvas" width="256" height="144" style="border: 1px solid black"></canvas><br> KEY - Left: Original, Right: Result, Bottom: the color palette (fixed). </p> <p> Assembly code for <a href="http://skilldrick.github.io/easy6502">Easy 6502</a> processor.<br> <textarea rows="16" id='hex'></textarea> </p> <p>Some example images you can use: <img draggable="true" src="chrome.jpg"> <img draggable="true" src="chrome1.png"> <img draggable="true" src="chrome2.png"> <img draggable="true" src="facebook.ico"> <img draggable="true" src="gmail.jpg"> <img draggable="true" src="matlab.ico"> </p> <script type="text/javascript" src="image2asm.js"></script> </body> </html>
wmhilton/img2asm6502
index.html
HTML
mit
1,050
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 3746, 1011, 1028, 13757, 2475, 3320, 1026, 1013, 2516, 1028, 1026, 2806, 1028, 1012, 5342, 1063, 4653, 1024, 3904, 1065, 1026, 1013, 2806, 1028, 1026, 1013, 2132, 1028, 1026, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.meituan.davy.myapplication.github; import android.support.v4.app.Fragment; import com.meituan.davy.myapplication.ContainerActivity; public class GithubActivity extends ContainerActivity { @Override protected Fragment getFragment() { return new GithubFragment(); } }
davyjoneswang/UsefulDemSuit
app/src/main/java/com/meituan/davy/myapplication/github/GithubActivity.java
Java
apache-2.0
300
[ 30522, 7427, 4012, 1012, 19734, 26302, 2078, 1012, 23255, 1012, 2026, 29098, 19341, 3508, 1012, 21025, 2705, 12083, 1025, 12324, 11924, 1012, 2490, 1012, 1058, 2549, 1012, 10439, 1012, 15778, 1025, 12324, 4012, 1012, 19734, 26302, 2078, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* jshint browser: true */ /* global $ */ "use strict"; var formField = require("../ui/utils/form-field.js"); module.exports = function(core, config, store) { function addBanMenu(from, menu, next) { var room = store.get("nav", "room"), rel = store.getRelation(), senderRelation = store.getRelation(room, from), senderRole, senderTransitionRole; senderRelation = senderRelation ? senderRelation : {}; senderRole = senderRelation.role ? senderRelation.role : "none"; senderTransitionRole = senderRelation.transitionRole ? senderRelation.transitionRole : "none"; if (/^guest-/.test(from)) senderRole = "guest"; switch (senderRole) { case "follower": case "none": case "moderator": case "registered": if (senderRole === "moderator" && rel.role !== "owner") break; menu.items.banuser = { prio: 550, text: "Ban user", action: function() { core.emit("expel-up", { to: room, ref: from, role: "banned", transitionRole: senderRole, transitionType: null }); } }; break; case "banned": menu.items.unbanuser = { prio: 550, text: "unban user", action: function() { core.emit("admit-up", { to: room, ref: from, role: senderTransitionRole || "follower" }); } }; break; case "owner": case "guest": break; } next(); } core.on("conf-show", function(tabs, next) { var room = tabs.room, antiAbuse, $div; room.params = room.params || {}; antiAbuse = room.params.antiAbuse = room.params.antiAbuse || {}; antiAbuse.block = antiAbuse.block || { english: false }; antiAbuse.customPhrases = antiAbuse.customPhrases || []; if (typeof antiAbuse.spam !== "boolean") { antiAbuse.spam = true; } $div = $("<div>").append( formField("Spam control", "toggle", "spam-control", antiAbuse.spam), formField("Blocked words list", "check", "blocklists", [ ["list-en-strict", "English abusive words", antiAbuse.block.english] ]), formField("Custom blocked phrases/word", "area", "block-custom", antiAbuse.customPhrases.join("\n")), formField("", "info", "spam-control-helper-text", "One phrase/word each line") ); tabs.spam = { text: "Spam control", html: $div }; next(); }, 600); core.on("conf-save", function(room, next) { room.params = room.params || {}; room.params.antiAbuse = { spam: $("#spam-control").is(":checked"), block: { english: $("#list-en-strict").is(":checked") }, customPhrases: $("#block-custom").val().split("\n").map(function(item) { return (item.trim()).toLowerCase(); }) }; next(); }, 500); core.on("text-menu", function(menu, next) { var textObj = menu.textObj, room = store.get("nav", "room"), rel = store.getRelation(); if (!(rel && (/(owner|moderator|su)/).test(rel.role) && textObj)) { return next(); } if (textObj.tags && textObj.tags.indexOf("hidden") > -1) { menu.items.unhidemessage = { prio: 500, text: "Unhide message", action: function() { var tags = Array.isArray(textObj.tags) ? textObj.tags.slice(0) : []; core.emit("edit-up", { to: room, ref: textObj.id, tags: tags.filter(function(t) { return t !== "hidden"; }) }); } }; } else { menu.items.hidemessage = { prio: 500, text: "Hide message", action: function() { var tags = Array.isArray(textObj.tags) ? textObj.tags.slice(0) : []; tags.push("hidden"); core.emit("edit-up", { to: room, ref: textObj.id, tags: tags }); } }; } addBanMenu(textObj.from, menu, next); }, 500); core.on("people-menu", function(menu, next) { var rel = store.getRelation(); if (!(rel && (/(owner|moderator|su)/).test(rel.role))) { return next(); } addBanMenu(menu.user.id, menu, next); }, 500); core.on("thread-menu", function(menu, next) { var threadObj = menu.threadObj, room = store.get("nav", "room"), rel = store.getRelation(); if (!(rel && (/(owner|moderator)/).test(rel.role) && threadObj)) { return next(); } if (threadObj.tags && threadObj.tags.indexOf("thread-hidden") > -1) { menu.items.unhidethread = { prio: 500, text: "Unhide discussion", action: function() { var tags = Array.isArray(threadObj.tags) ? threadObj.tags.slice(0) : []; core.emit("edit-up", { to: room, ref: threadObj.id, tags: tags.filter(function(t) { return t !== "thread-hidden"; }), color: threadObj.color // Ugly hack around lack of color info on a discussion }); } }; } else { menu.items.hidethread = { prio: 500, text: "Hide discussion", action: function() { var tags = Array.isArray(threadObj.tags) ? threadObj.tags.slice(0) : []; tags.push("thread-hidden"); core.emit("edit-up", { to: room, ref: threadObj.id, tags: tags, color: threadObj.color }); } }; } next(); }, 500); };
metao1/chat
anti-abuse/anti-abuse-client.js
JavaScript
mit
5,048
[ 30522, 1013, 1008, 1046, 17426, 2102, 16602, 1024, 2995, 1008, 1013, 1013, 1008, 3795, 1002, 1008, 1013, 1000, 2224, 9384, 1000, 1025, 13075, 2433, 3790, 1027, 5478, 1006, 1000, 1012, 1012, 1013, 21318, 1013, 21183, 12146, 1013, 2433, 1011,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php $lan = array( 'dashboard' => 'dashboard', 'Main' => 'Main', 'Send a campaign' => 'Send a campaign', 'Start or continue a campaign' => 'Start or continue a campaign', 'Manage Campaigns' => 'Manage Campaigns', 'View current campaigns' => 'View current campaigns', 'Manage Subscribers' => 'Manage Subscribers', 'Search, edit and add Subscribers' => 'Search, edit and add Subscribers', 'List and user functions' => 'List and user functions', 'Manage Lists' => 'Manage Lists', 'View, edit and add lists, that your subscribers can sign up to' => 'View, edit and add lists, that your subscribers can sign up to', 'List all Users' => 'List all Subscribers', 'Reconcile the User Database' => 'Reconcile the Subscriber Database', 'Import Users' => 'Import Subscribers', 'Export Users' => 'Export Subscribers', 'Configuration Functions' => 'Configuration Functions', 'Configure Attributes' => 'Configure Attributes', 'Control values for' => 'Control values for', 'Configure Subscribe Pages' => 'Configure Subscribe Pages', 'Administrator Functions' => 'Administrator Functions', 'Message Functions' => 'Message Functions', 'Configure Templates' => 'Configure Templates', 'List all Messages' => 'List all Messages', 'Initialise Keymanager' => 'Initialise Keymanager', 'Get RSS feeds' => 'Get RSS feeds', 'View RSS items' => 'View RSS items', 'System Functions' => 'System Functions', 'View the eventlog' => 'View the eventlog', );
washingtonstateuniversity/WSU-Lists
www/admin/lan/en/account.php
PHP
gpl-2.0
1,482
[ 30522, 1026, 1029, 25718, 1002, 17595, 1027, 9140, 1006, 1005, 24923, 1005, 1027, 1028, 1005, 24923, 1005, 1010, 1005, 2364, 1005, 1027, 1028, 1005, 2364, 1005, 1010, 1005, 4604, 1037, 3049, 1005, 1027, 1028, 1005, 4604, 1037, 3049, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { Type } from "@angular/core"; import { GridViewComponent } from './grid-view.component'; export * from "./grid-view.component"; export const HBR_GRIDVIEW_DIRECTIVES: Type<any>[] = [ GridViewComponent ];
steven-zou/harbor
src/portal/lib/src/gridview/index.ts
TypeScript
apache-2.0
217
[ 30522, 12324, 1063, 2828, 1065, 2013, 1000, 1030, 16108, 1013, 4563, 1000, 1025, 12324, 1063, 8370, 8584, 9006, 29513, 3372, 1065, 2013, 1005, 1012, 1013, 8370, 1011, 3193, 1012, 6922, 1005, 1025, 9167, 1008, 2013, 1000, 1012, 1013, 8370, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#if CORECLR /********************************************************************++ Copyright (c) Microsoft Corporation. All rights reserved. --********************************************************************/ using System; using System.Management.Automation; using System.Net.Http; using System.Text; namespace Microsoft.PowerShell.Commands { /// <summary> /// The Invoke-RestMethod command /// This command makes an HTTP or HTTPS request to a web service, /// and returns the response in an appropriate way. /// Intended to work against the wide spectrum of "RESTful" web services /// currently deployed across the web. /// </summary> [Cmdlet(VerbsLifecycle.Invoke, "RestMethod", HelpUri = "http://go.microsoft.com/fwlink/?LinkID=217034")] public partial class InvokeRestMethodCommand : WebRequestPSCmdlet { #region Virtual Method Overrides /// <summary> /// Process the web reponse and output corresponding objects. /// </summary> /// <param name="response"></param> internal override void ProcessResponse(HttpResponseMessage response) { if (null == response) { throw new ArgumentNullException("response"); } using (BufferingStreamReader responseStream = new BufferingStreamReader(StreamHelper.GetResponseStream(response))) { if (ShouldWriteToPipeline) { // First see if it is an RSS / ATOM feed, in which case we can // stream it - unless the user has overriden it with a return type of "XML" if (TryProcessFeedStream(responseStream)) { // Do nothing, content has been processed. } else { // determine the response type RestReturnType returnType = CheckReturnType(response); // get the response encoding Encoding encoding = ContentHelper.GetEncoding(response); object obj = null; Exception ex = null; string str = StreamHelper.DecodeStream(responseStream, encoding); bool convertSuccess = false; // On CoreCLR, we need to explicity load Json.NET JsonObject.ImportJsonDotNetModule(this); if (returnType == RestReturnType.Json) { convertSuccess = TryConvertToJson(str, out obj, ref ex) || TryConvertToXml(str, out obj, ref ex); } // default to try xml first since it's more common else { convertSuccess = TryConvertToXml(str, out obj, ref ex) || TryConvertToJson(str, out obj, ref ex); } if (!convertSuccess) { // fallback to string obj = str; } WriteObject(obj); } } if (ShouldSaveToOutFile) { StreamHelper.SaveStreamToFile(responseStream, QualifiedOutFile, this); } } } #endregion Virtual Method Overrides #region Helper Methods private RestReturnType CheckReturnType(HttpResponseMessage response) { if (null == response) { throw new ArgumentNullException("response"); } RestReturnType rt = RestReturnType.Detect; string contentType = ContentHelper.GetContentType(response); if (string.IsNullOrEmpty(contentType)) { rt = RestReturnType.Detect; } else if (ContentHelper.IsJson(contentType)) { rt = RestReturnType.Json; } else if (ContentHelper.IsXml(contentType)) { rt = RestReturnType.Xml; } return (rt); } #endregion Helper Methods } } #endif
kmosher/PowerShell
src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/InvokeRestMethodCommand.CoreClr.cs
C#
mit
4,302
[ 30522, 1001, 2065, 4563, 20464, 2099, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Skeleton subclass for performing query and update operations on the 'ordencompradetalle' table. * * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. * * @package propel.generator.hva */ class OrdencompradetallePeer extends BaseOrdencompradetallePeer { }
Illescas28/hva_08_05_2016
module/Propel/build/classes/hva/OrdencompradetallePeer.php
PHP
bsd-3-clause
424
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 13526, 4942, 26266, 2005, 4488, 23032, 1998, 10651, 3136, 2006, 1996, 1005, 2030, 4181, 9006, 18098, 9648, 9080, 2571, 1005, 2795, 1012, 1008, 1008, 1008, 1008, 2017, 2323, 5587, 3176, 4725,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * CPU side of CALDGEMM implementation. * * Copyright 2015: * - David Rohr (drohr@jwdt.org) * - Matthias Bach (bach@compeng.uni-frankfurt.de) * - Matthias Kretz (kretz@compeng.uni-frankfurt.de) * * This file is part of CALDGEMM. * * CALDGEMM 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. * * CALDGEMM 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 CALDGEMM. If not, see <http://www.gnu.org/licenses/>. */ #include "caldgemm.h" #include "cmodules/qmalloc.h" #include "cmodules/affinity.h" #include "cmodules/qmath.h" #include <algorithm> #ifndef _WIN32 #include <syscall.h> #include <errno.h> #include <sys/time.h> #include <sys/resource.h> #include <unistd.h> #else extern "C" { void ___chkstk() {} void __imp__cprintf() {} } #endif #ifdef USE_OLD_HUGE_MALLOC #include <sys/mman.h> #include <sys/ipc.h> #include <sys/shm.h> #endif #include <math.h> #include <emmintrin.h> #define MPOL_DEFAULT 0 #define MPOL_PREFERRED 1 #define MPOL_BIND 2 #define MPOL_INTERLEAVE 3 #ifndef SHM_HUGETLB #define SHM_HUGETLB 04000 #endif #ifdef USE_MKL #include <mkl_service.h> #endif #include <math.h> #include "cmodules/os_low_level_helper.h" #ifdef _NO_AFFINITY #define sched_setaffinity(a, b, c) 0 #endif #if !defined(USE_GOTO_BLAS) | defined(_WIN32) extern "C" { extern int get_num_procs(); int get_num_procs() { char* omp_threads = getenv("OMP_NUM_THREADS"); if (omp_threads != NULL) return(atoi(omp_threads)); return(get_number_of_cpu_cores()); } } #endif extern "C" int HPL_CALDGEMM_gpu_height; int HPL_CALDGEMM_gpu_height = 1024; #ifdef DEBUG_MSG_TIMED inline void printelapsedtime(bool reset = false) { static int init = 1; static long long int begin; if (init == 1 || reset) { init = 0; timespec b; clock_gettime(CLOCK_REALTIME, &b); begin = (long long int) b.tv_sec * 1000000 + (long long int) b.tv_nsec / 1000; } timespec a; clock_gettime(CLOCK_REALTIME, &a); fprintf(STD_OUT, "%lld ", (long long int) a.tv_sec * 1000000 + (long long int) a.tv_nsec / 1000 - begin); } #define fprintf(file, ...) {printelapsedtime();fprintf(STD_OUT, __VA_ARGS__);} #endif //#define fprintf(file, ...) {fprintf(STD_OUT, "Thread %d ", gettid());fprintf(stderr, __VA_ARGS__);} caldgemm::caldgemm_config_backend* caldgemm::create_caldgemm_config_backend() { return(new caldgemm_config_backend); } void caldgemm::caldgemm_config_backend::printConfig(caldgemm::caldgemm_config_backend* oldConfig) {} caldgemm::caldgemm_config_backend::~caldgemm_config_backend() {} int caldgemm::caldgemm_config_backend::ParseBackendOptions(unsigned int argc, char** argv) { if (argc > 1) { fprintf(STD_OUT, "Invalid Backend Options\n"); return(1); } return(0); } void caldgemm::ResetRatios() { for (int i = 0;i < caldgemm::max_linpack_callback_types;i++) { linpack_last_mn[i] = -1.; linpackGPURatios[i] = 1.; linpackBcastTime[i] = 0; linpackCPUDGEMMTime[i] = 0; } } caldgemm::caldgemm() { caldgemm_initialized = false; ResetRatios(); avggflops = 0; avgngflops = 0; conf_numprocs_real = get_number_of_cpu_cores(); char* omp_threads = getenv("OMP_NUM_THREADS"); if (omp_threads != NULL) { conf_numprocs = atoi(omp_threads); } else { conf_numprocs = conf_numprocs_real; } FILE* fp; fp = fopen("/proc/cpuinfo", "r"); conf_cpufreq = 2100; if (fp) { char tmpbuffer[256]; while (!feof(fp)) { if (fgets(tmpbuffer, 255, fp) == 0) break; if (strncmp(tmpbuffer, "cpu MHz", 7) == 0) { float tmpval; char* ptr = tmpbuffer; while (*(ptr++) != ':'); sscanf(ptr, "%f", &tmpval); conf_cpufreq = (int) tmpval; break; } } fclose(fp); } matrix_m = (size_t) -1; matrix_n = (size_t) -1; pipelineBuffer = 0; cParam.dynamic_size = 0; //Make Valgrind happy for (unsigned int i = 0;i < max_devices;i++) { dma_fetch_queue_tasks[i].k = (size_t) -1; for (int j = 0;j < obuffercount;j++) { dma_pending[i][j] = false; } } conf_gpushaders = 0; conf_gpufreq = 0; warn_wrong_memory_allocation = true; } caldgemm::~caldgemm() { if (caldgemm_initialized) ExitCALDGEMM(); } caldgemm::caldgemm_config::caldgemm_config() { static const char* EmptyOut = ""; Verify = false; Disassemble = false; PrintILKernel = false; Quiet = true; DisplayTiming = false; DeviceNum = -1; ImprovedScheduler = false; ImprovedSchedulerBalance = 1; SimpleGPUQueuing = false; AlternateSimpleQueuing = false; AlternateSimpleQueuingMulti = false; NumDevices = max_devices; NumActiveDevices = 0; max_bbuffers = 0; OpenCLPlatform = 0; Width = 1024; Height = 0; //Auto Height, Initialize later AutoHeight = true; Iterations = 1; DstMemory = 'c'; ImplicitDriverSync = -1; VerboseTiming = false; AsyncTiming = false; TabularTiming = false; Debug = false; MultiThread = true; MultiThreadDivide = true; RereserveLinpackCPU = false; UseGPU = true; UseCPU = true; GPURatio = -1.0; GPURatioDuringFact = 0.0; GPURatioMax = 1.0; GPURatioMarginTime = 0.0; GPURatioMarginTimeDuringFact = 0.3; GPURatioLookaheadSizeMod = 0.2; GPURatioPenalties = 1; GPURatioPenaltyFactor = 0.9; DynamicSched = true; ThirdPhaseDynamicRuns = true; SecondPhaseDynamicRuns = true; MemPolicy = true; DumpMatrix = false; DivideToGPU = false; AsyncDMA = true; KeepBuffersMapped = true; NoPerformanceWarnings = false; PinCPU = -1; ForceNumCPUThreads = 0; CPUCoreOffset = 0; PinMainThread = -1; SpawnGPUThread = -2; PinDeviceRuntimeThreads = -2; SlowCPU = false; LinpackNodes = 0; LinpackSwapN = NULL; HPLFactorizeRestrictCPUs = 2; HPLFactorizeRestrictCallback = NULL; MPIRank = -1; PreOut = EmptyOut; GPUClock = 0; SmallTiles = 0; ThreadSaveDriver = 0; SkipCPUProcessing = false; OutputThreads = -1; RepinDuringActiveWaitForEvent = 0; RepinMainThreadAlways = 0; SleepDuringActiveWait = -1; NumaPinning = false; ThirdPhaseThreshold = 0; AlternateLookahead = 0; ParallelDMA = 0; GroupParallelDMA = 0; LASWPSleep = 0; MinimizeCPUPart = 0; MinimizeCPUDuringFact = 0; PinBroadcastThread = -1; UseDMAFetchQueue = 0; GPU_C = -1; NoConcurrentKernels = 0; ForceKernelVariant = -1; PreallocData = 0; AsyncSideQueue = false; AsyncSideQueueBalance = 0; AsyncDGEMMThreshold = 480; AsyncDTRSMThreshold = 192; AsyncDTRSM = false; AsyncSideQueueUseInactiveDeviceSet = 0; Use3rdPartyTranspose = false; CPUInContext = 1; PipelinedOperation = false; PipelineDoubleBuffer = false; for (unsigned int i = 0;i < caldgemm::max_devices;i++) { GPUMapping[i] = 0; PostprocessMapping[i] = -1; AllocMapping[i] = -1; DMAMapping[i] = 0; DeviceNums[i] = i; } nExcludeCPUCores = 0; ExcludeCPUCores = NULL; ShowConfig = 0; ShowThreadPinning = 0; PipelinedMidMarker = 0; linpack_factorize_function = NULL; linpack_broadcast_function = NULL; linpack_swap_function = NULL; InitBackendArgc(); config_backend = NULL; } caldgemm::caldgemm_config::caldgemm_config(const caldgemm::caldgemm_config& other) { memcpy(this, &other, sizeof(*this)); InitBackendArgc(); if (other.config_backend) { config_backend = other.config_backend->Clone(); } else { config_backend = NULL; } } void caldgemm::caldgemm_config::InitBackendArgc() { argc_backend = 1; argv_backend = (char**) malloc(2 * sizeof(char*)); argv_backend[0] = "backend_options"; argv_backend[1] = NULL; } void caldgemm::caldgemm_config::AddBackendArgv(char* option) { argv_backend = (char**) realloc(argv_backend, (argc_backend + 2) * sizeof(char*)); argv_backend[argc_backend++] = option; argv_backend[argc_backend] = NULL; } int caldgemm::caldgemm_config::InitializeBackendOptions() { int retVal = config_backend->ParseBackendOptions(argc_backend, argv_backend); free(argv_backend); InitBackendArgc(); return(retVal); } int caldgemm::getcpumask(cpu_set_t* set) { int retVal = 0; for (int i = 0;i < 24;i++) { if (CPU_ISSET(i, set)) retVal |= (1 << i); } return(retVal); } void caldgemm::print_submatrices(double* M, size_t width, size_t height, size_t pitch, size_t subx, size_t suby, size_t stridex, size_t stridey, double* M2) { fprintf(STD_OUT, "Matrix %lld x %lld, Subblocks %lld x %lld, Strides: %lld / %lld\n", (long long int) width, (long long int) height, (long long int) subx, (long long int) suby, (long long int) stridex, (long long int) stridey); for (size_t j = 0;j < height;j += stridey) { for (size_t jj = j;jj < j + suby && jj < height;jj++) { for (size_t i = 0;i < width;i += stridex) { for (size_t ii = i;ii < i + subx && ii < width;ii++) { if (M2 != NULL) { char tmpcolor[16] = "0"; if (cParam.dynamic_run) { if (DGEMM_favor_m) { if (jj >= gpu_m - cParam.dynamic_run && ii >= gpu_n - cParam.dynamic_size) sprintf(tmpcolor, "01;33"); } else { if (jj >= gpu_m - cParam.dynamic_size && ii >= gpu_n - cParam.dynamic_run) sprintf(tmpcolor, "01;33"); } } if (DGEMM_split_m) //favor splitting m because of consecutive memory { if (jj >= matrix_m - cParam.cblas_size || ii >= matrix_n - matrix_n % Config->Height) sprintf(tmpcolor, "01;34"); } else { if (jj >= matrix_m - matrix_m % Config->Height || ii >= matrix_n - cParam.cblas_size) sprintf(tmpcolor, "01;34"); } size_t k = ((gpu_m + Config->Height - 1) / Config->Height) * ((gpu_n + Config->Height - 1) / Config->Height); for (int l = 0;l < (int) cParam.dynamic_run2;l++) { k--; size_t cpublockm, cpublockn; DGEMM_getblocks(k, cpublockm, cpublockn); while ((DGEMM_favor_m ? (cpublockm * Config->Height >= gpu_m - cParam.dynamic_run && cpublockn * Config->Height >= gpu_n - cParam.dynamic_size) : (cpublockn * Config->Height >= gpu_n - cParam.dynamic_run && cpublockm * Config->Height >= gpu_m - cParam.dynamic_size))) { k--; DGEMM_getblocks(k, cpublockm, cpublockn); } if (jj / Config->Height == cpublockm && ii / Config->Height == cpublockn) { sprintf(tmpcolor, "01;35"); } } int ok = isDoubleEqual(M[jj * pitch + ii], M2[jj * pitch + ii]); #ifndef _WIN32 fprintf(STD_OUT, "\33[%sm%d\33[%sm", ok ? "01;32" : "01;31", ok, tmpcolor); #endif fprintf(STD_OUT, "%+10.3f\t", M[jj * pitch + ii]); } else { fprintf(STD_OUT, " %+10.3f\t", M[jj * pitch + ii]); } } } #ifndef _WIN32 fprintf(STD_OUT, "\33[0m"); #endif fprintf(STD_OUT, "\n"); } } fprintf(STD_OUT, "Done\n"); } void caldgemm::ensure_omp_thread_pinning(const char* baseName) { #ifndef USE_GOTO_BLAS if (!Config->UseCPU) return; if (Config->Debug) fprintf(STD_OUT, "Performing OpenMP Blas Thread Pinning\n"); int* cpu_order = new int[conf_numprocs]; if (Config->NumaPinning && conf_numprocs % 4 == 0) { cpu_order[0] = 0; int cpu_num = 1; int old_divider = conf_numprocs; if (Config->NumaPinning >= 2) old_divider /= 2; int divider = old_divider / 2; do { int cpu_num_end = cpu_num; for (int tmp_num = 0;tmp_num < cpu_num_end;tmp_num++) { cpu_order[cpu_num++] = cpu_order[tmp_num] + divider; } int cpu_num_end2 = cpu_num; for (int i = 1;i < old_divider / divider - 1;i++) { for (int tmp_num = cpu_num_end;tmp_num < cpu_num_end2;tmp_num++) { cpu_order[cpu_num++] = cpu_order[tmp_num] + 2 * i; } } old_divider = divider; divider = (divider % 2 == 0 && divider % 4 != 0 && divider > 2) ? 2 : divider / 2; } while (divider > 0); if (Config->NumaPinning >= 2) { for (int i = 0;i < conf_numprocs / 2;i++) { cpu_order[i + conf_numprocs / 2] = cpu_order[i] + conf_numprocs / 2; } } if (Config->Debug) { for (int i = 0;i < conf_numprocs;i++) fprintf(STD_OUT, "Numa ID %d Core %d\n", i, cpu_order[i]); } } else { if (Config->NumaPinning) fprintf(STD_OUT, "NUMA Pinning only available if number of processors is divisible by 4\n"); for (int i = 0;i < conf_numprocs;i++) cpu_order[i] = i; } static int nInitialization = 0; nInitialization++; cpu_set_t oldaffinity; sched_getaffinity(0, sizeof(oldaffinity), &oldaffinity); cpu_set_t noaffinity; CPU_ZERO(&noaffinity); for (int i = 0;i < conf_numprocs;i++) CPU_SET(i + Config->CPUCoreOffset, &noaffinity); sched_setaffinity(0, sizeof(noaffinity), &noaffinity); setUnknownNames("Unknown - Before OMP Thread Creation"); #pragma omp parallel num_threads(conf_numprocs) { int thread_id = omp_get_thread_num(); if (getThreadName(-1, NULL) == NULL) { char tmp[128]; sprintf(tmp, "OpenMP Init %d %s%s%s Thread %d", nInitialization, baseName ? "(" : "", baseName ? baseName : "", baseName ? ")" : "", thread_id); setThreadName(tmp); } int localcore = thread_id * 2; #pragma omp critical { int nFreeCores = 0; bool checkBroadcastCore = Config->ForceNumCPUThreads == 0 || broadcast_cpu_core < Config->ForceNumCPUThreads; if (thread_id == nFreeCores) localcore = main_blas_core; nFreeCores++; for (int i = 0;i < conf_numprocs;i++) { if (cpuUsed(cpu_order[i]) == false && (!checkBroadcastCore || cpu_order[i] != broadcast_cpu_core) && cpu_order[i] != main_blas_core) { if (thread_id == nFreeCores) localcore = cpu_order[i]; nFreeCores++; } } if (checkBroadcastCore) { if (thread_id == nFreeCores) localcore = broadcast_cpu_core; nFreeCores++; } for (int j = 0;j < 2;j++) { for (int i = 0;i < conf_numprocs;i++) { if (cpuUsed(cpu_order[i]) && cpu_order[i] != main_blas_core) { size_t m = matrix_m, n = matrix_n; matrix_m = matrix_n = (size_t) -1; bool isDMACore = cpuUsed(cpu_order[i]); matrix_m = matrix_n = 0; if (cpuUsed(cpu_order[i])) isDMACore = false; matrix_m = m; matrix_n = n; if ((Config->ParallelDMA != 0 && isDMACore) ^ j) { if (thread_id == nFreeCores) localcore = cpu_order[i]; nFreeCores++; } } } } } sched_setaffinity_set_core(localcore + Config->CPUCoreOffset); if (Config->Debug) fprintf(STD_OUT, "OpenMP BLAS thread %d pinned to core %d\n", thread_id, localcore); } setUnknownNames("Unknown OMP Thread"); sched_setaffinity(0, sizeof(oldaffinity), &oldaffinity); delete[] cpu_order; #endif } int caldgemm::CheckParams() { if (Config->PipelinedOperation) { fprintf(STD_OUT, "Pipelined Mode not supported by backend!\n"); return(1); } return(0); } int caldgemm::WaitForCALDGEMMProgress(size_t n) { return(0); //Default backend does not support pipelined mode, so we do not have to bother. } int caldgemm::InitCALDGEMM(caldgemm_config* pInfo, bool nocalinit) { Config = pInfo; if (Config->ForceNumCPUThreads) conf_numprocs = Config->ForceNumCPUThreads; #if defined(USE_GOTO_BLAS) & !defined(_WIN32) else conf_numprocs = get_num_procs(); #endif #ifdef USE_GOTO_BLAS if (!Config->Quiet) fprintf(STD_OUT, "Initializing GotoBLAS\n"); gotoblas_init(); #endif if (Config->Iterations > 1 && Config->UseCPU) { fprintf(STD_OUT, "ERROR: Multiple Iterations not supported with CPU enabled\n"); return(1); } #ifdef _WIN32 strcpy(hostname, "Win32"); #else gethostname(hostname, 255); #endif #ifdef USE_GOTO_BLAS sched_getaffinity(0, sizeof(oldcpumask), &oldcpumask); //GotoBLAS has its own thread pinning, store old value here. #endif if (Config->PinCPU != -1) { for (unsigned int i = 0;i < max_devices;i++) Config->GPUMapping[i] = Config->PinCPU; } CPU_ZERO(&gpumask); if (Config->PinMainThread == -1) Config->PinMainThread = Config->GPUMapping[0]; CPU_SET(Config->PinMainThread + Config->CPUCoreOffset, &gpumask); if (Config->Debug) fprintf(STD_OUT, "Init Caldgemm, setting CPU mask %X\n", getcpumask(&gpumask)); if (0 != sched_setaffinity(0, sizeof(gpumask), &gpumask)) { fprintf(STD_OUT, "Error setting CPU affinity\n"); return(1); } if (Config->SlowCPU) { Config->DynamicSched = false; Config->SmallTiles = 1; } if (SimpleQueuingAvailable() < 3 && Config->AlternateSimpleQueuingMulti) { fprintf(STD_OUT, "Alternate Simple Multi Queuing not supported by backend, disabling\n"); Config->AlternateSimpleQueuingMulti = false; } if (SimpleQueuingAvailable() < 2 && Config->AlternateSimpleQueuing) { fprintf(STD_OUT, "Alternate Simple Queuing not supported by backend, disabling\n"); Config->AlternateSimpleQueuing = false; } if (SimpleQueuingAvailable() < 1 && Config->SimpleGPUQueuing) { fprintf(STD_OUT, "Simple GPU Queuing not supported by backend, disabling\n"); Config->SimpleGPUQueuing = false; } if (PipelinedModeAvailable() < 2 && Config->PipelineDoubleBuffer) { fprintf(STD_OUT, "Pipelined mode with double buffering not supported by backend, disabling\n"); Config->PipelineDoubleBuffer = false; } if (PipelinedModeAvailable() < 1 && Config->PipelinedOperation) { fprintf(STD_OUT, "Pipelined operation not supported by backend, disabling\n"); Config->PipelinedOperation = false; Config->PipelinedMidMarker = 0; } if (AsyncModeAvailable() < 2 && Config->AsyncDTRSM) { fprintf(STD_OUT, "Async Side-queue with DTRSM not supported by backend, disabling async DTRSM\n"); Config->AsyncDTRSM = false; } if (AsyncModeAvailable() < 1 && Config->AsyncSideQueue) { fprintf(STD_OUT, "Async Side-queue not supported by backend, disabling\n"); Config->AsyncSideQueue = false; } if (Config->AlternateSimpleQueuingMulti) Config->AlternateSimpleQueuing = true; if (Config->AlternateSimpleQueuing) Config->SimpleGPUQueuing = true; if (!Config->SimpleGPUQueuing && Config->PipelinedOperation) { fprintf(STD_OUT, "Pipeline Operation requires SimpleGPUQueuing!\n"); return(1); } if (Config->SimpleGPUQueuing && !Config->GPU_C) { fprintf(STD_OUT, "Simple GPU Queuing requires GPU_C!\n"); return(1); } if (!Config->PipelinedOperation) { Config->PipelinedMidMarker = 0; Config->PipelineDoubleBuffer = false; } if (Config->MultiThread == false) Config->MultiThreadDivide = false; if (Config->MultiThread == false || !Config->UseCPU) Config->SpawnGPUThread = -2; if (Config->ParallelDMA || Config->SimpleGPUQueuing) Config->ImprovedScheduler = true; if ((Config->AsyncSideQueue || Config->SimpleGPUQueuing) && (Config->GPU_C == 0 || UseInputPthreads() || UseOutputPthreads())) { fprintf(STD_OUT, "ASYNC Side queue / Simple GPU Queuing can only work with GPU_C\n"); Config->AsyncSideQueue = false; } if (!Config->AsyncSideQueue) Config->AsyncDTRSM = false; setThreadName(Config->SpawnGPUThread == -2 ? "Main (GPU)" : "Main (CPU)"); #ifndef USE_GOTO_BLAS if (Config->ParallelDMA && Config->linpack_broadcast_function && (Config->ParallelDMA > Config->AlternateLookahead || Config->DynamicSched)) { fprintf(STD_OUT, "WARNING: There is a possible thread-pinning collision when using Parallel DMA in multi-node HPL if either Dynamic Scheduling is activated or ParallelDMA > AlternateLookahead\n"); } #endif if (CheckParams()) return(1); if (ValidateRuntime()) return(1); if (Config->Height == 0) Config->Height = 4096; //Runtime did not set suggested value, so we use the default if (Config->ImplicitDriverSync == -1) Config->ImplicitDriverSync = 1; buffersSwitchable = (KernelSettings.transposeA ^ KernelSettings.transposeB); if (Config->Debug) fprintf(STD_OUT, "Initializing Backend\n"); setUnknownNames("Unknown - Before Runtime Initialization"); if (Config->PinDeviceRuntimeThreads != -2) { cpu_set_t affinity; CPU_ZERO(&affinity); if (Config->PinDeviceRuntimeThreads == -1) for (int i = 0;i < conf_numprocs;i++) CPU_SET(i + Config->CPUCoreOffset, &affinity); else CPU_SET(Config->PinDeviceRuntimeThreads + Config->CPUCoreOffset, &affinity); if (0 != sched_setaffinity(0, sizeof(affinity), &affinity)) { fprintf(STD_OUT, "Error setting CPU affinity\n"); return(1); } } if (Initialize(nocalinit) || !Config->UseGPU) { gpu_available = false; } if (!gpu_available) { if (!AllowCPUFallback()) return(1); if (!Config->Quiet && Config->UseGPU) fprintf(STD_OUT, "No GPU available, falling back to CPU\n"); nDevices = 0; Config->UseGPU = 0; Config->UseCPU = 1; Config->KeepBuffersMapped = 0; } if (Config->PinDeviceRuntimeThreads != -2 && 0 != sched_setaffinity(0, sizeof(gpumask), &gpumask)) { fprintf(STD_OUT, "Error setting CPU affinity\n"); return(1); } if (Config->ParallelDMA && Config->GroupParallelDMA) { for (int i = 0;i < nDevices;i++) { if (Config->AllocMapping[i] == -1) { fprintf(STD_OUT, "Error during initialization, GroupParallelDMA activated but AllocMapping not set for GPU %d\n", i); return(1); } bool found = false; for (int j = 0;j < nDevices;j++) { if (Config->DMAMapping[j] == Config->AllocMapping[i]) { found = true; break; } } if (found == false) { fprintf(STD_OUT, "Error during initialization, No DMAMapping thread found that maps to the AllocMapping of GPU %d\n", i); return(1); } } } if (CheckDevices()) return(1); outputthreads = Config->OutputThreads == -1 ? (Config->KeepBuffersMapped || Config->DstMemory == 'g' ? CALDGEMM_OUTPUT_THREADS : CALDGEMM_OUTPUT_THREADS_SLOW) : Config->OutputThreads; if (Config->UseGPU && InitDevices()) return(1); min_bbuffers = max_bbuffers; for (int i = 0;i < nDevices;i++) { if (bbuffers[i] < min_bbuffers) min_bbuffers = bbuffers[i]; } if (!Config->Quiet) { if (nDevices) { fprintf(STD_OUT, "Running on %d devices with %d bbuffers (%s)\n", nDevices, min_bbuffers, hostname); } else { fprintf(STD_OUT, "Running on CPU only (%s)\n", hostname); } } int thread = (Config->PinDeviceRuntimeThreads >= 0 ? Config->PinDeviceRuntimeThreads : Config->PinMainThread) + Config->CPUCoreOffset; setUnknownAffinity(1, &thread); setUnknownNames("Device Runtime"); if (Config->PinBroadcastThread == -1) { int linpackCPU = 0; while (linpackCPU < conf_numprocs) { if (cpuUsed(linpackCPU) == false) break; linpackCPU++; } if (linpackCPU >= conf_numprocs) linpackCPU = 0; broadcast_cpu_core = linpackCPU; } else { broadcast_cpu_core = Config->PinBroadcastThread; } if (Config->Debug) fprintf(STD_OUT, "Broadcast CPU core set to %d\n", broadcast_cpu_core); #ifndef USE_GOTO_BLAS //If we do not use GotoBLAS thread pinning determine main blas thread only after determining GPU devices to avoid collisions. Store the thread afterward as for GotoBLAS. if (Config->UseCPU) { if (Config->SpawnGPUThread >= 0) { main_blas_core = Config->SpawnGPUThread; if (Config->PinBroadcastThread == -1 && main_blas_core == broadcast_cpu_core) { fprintf(STD_OUT, "Your pinning of the Main CPU thread (Config->SpawnGPUThread) collides with autoselected linpack blas core, please set Config->PinBroadcastThread!"); return(1); } } else { main_blas_core = 0; while ((cpuUsed(main_blas_core) || broadcast_cpu_core == main_blas_core) && main_blas_core < conf_numprocs - 1) main_blas_core++; } } else { main_blas_core = Config->PinMainThread; } if (Config->Debug) fprintf(STD_OUT, "Pinning Main OpenMP BLAS thread to core %d\n", main_blas_core); sched_setaffinity_set_core(main_blas_core + Config->CPUCoreOffset); sched_getaffinity(0, sizeof(oldcpumask), &oldcpumask); //As for GotoBLAS above, store pinning here #else //Set main blas core for GotoBLAS for (int i = 0;i < conf_numprocs;i++) { main_blas_core = 0; if (CPU_ISSET(i, &oldcpumask)) { main_blas_core = i; break; } } #endif if (Config->MultiThread && UseOutputPthreads()) { for (int device_num = 0;device_num < nDevices;device_num++) { for (int i = 0;i < (Config->OutputThreads == -1 ? max_outputthreads : Config->OutputThreads);i++) { mParam[device_num][i].num_device = device_num; mParam[device_num][i].cls = this; mParam[device_num][i].terminate = false; mParam[device_num][i].nMergeThread = i; pthread_t thr; pthread_create(&thr, NULL, merge_wrapper, &mParam[device_num][i]); while (mParam[device_num][i].mergeThreadMutex[0].Trylock() != EBUSY) mParam[device_num][i].mergeThreadMutex[0].Unlock(); } } } if (Config->MultiThread && UseMutexPerDevice()) { for (int i = 0;i < nDevices;i++) { pthread_mutex_init(&device_mutex[i], NULL); } } sched_setaffinity(0, sizeof(gpumask), &gpumask); #ifdef CALDGEMM_DIVIDE_STATIC_BUFFER divide_tmpBuffer = allocDivideBuffer(); #endif if (Config->AlternateLookahead) { pthread_mutex_init(&tilesRemainingMutex, NULL); alternateLookaheadMutex.Lock(); } if (Config->MultiThread) { linpackParameters.terminate = false; linpackParameters.linpackMutex[1].Lock(); pthread_t thr; pthread_create(&thr, NULL, linpack_broadcast_wrapper, this); if (Config->Debug) fprintf(STD_OUT, "Waiting for linpack slave to start\n"); while (linpackParameters.linpackMutex[0].Trylock() != EBUSY) linpackParameters.linpackMutex[0].Unlock(); pthread_mutex_init(&scheduleMutex, NULL); divideThreads = 0; if (Config->MultiThreadDivide && UseInputPthreads()) { for (int i = 0;i < nDevices;i++) { DGEMMTasks[i].mutex_start.Lock(); DGEMMTasks[i].mutex_finished.Lock(); if (Config->GPUMapping[i] == Config->PinMainThread) continue; int found = 0; for (int j = 0;j < i;j++) { if (Config->GPUMapping[i] == Config->GPUMapping[j]) { found = 1; break; } } if (found == 0) { pthread_t thr; dParam[divideThreads].cls = this; dParam[divideThreads].CPUCore = Config->GPUMapping[i]; dParam[divideThreads].nThread = divideThreads; dParam[divideThreads].terminate = 0; pthread_create(&thr, NULL, divide_wrapper, &dParam[divideThreads]); DGEMMTasks[divideThreads].mutex_finished.Lock(); divideThreads++; } } } } for (int l = 0;l < nDevices;l++) { for (int i = 0;i < obuffercount;i++) DGEMMPrepareTaskEventReady[l][i] = false; DGEMMTasks[l].thread_running = 0; DGEMMTasks[l].skip_device_to = -1; DGEMMTasks[l].device = l; } if (Config->Debug) fprintf(STD_OUT, "Using %d CPU cores at %d MHz, %d GPUs of %d shaders at %d MHz\n", conf_numprocs, conf_cpufreq, nDevices, conf_gpushaders, conf_gpufreq); ensure_omp_thread_pinning(Config->SpawnGPUThread != -2 ? NULL : "Main"); if (Config->UseCPU) { cParam.cls = this; cParam.terminate = false; cParam.cblasMutex[0].Lock(); if (Config->MultiThread) { pthread_t thr; pthread_create(&thr, NULL, cblas_wrapper, &cParam); if (Config->Debug) fprintf(STD_OUT, "Waiting for cblas slave to start\n"); while (cParam.cblasMutex[1].Trylock() != EBUSY) cParam.cblasMutex[1].Unlock(); } } if (Config->ParallelDMA && nDevices) { DMAThreads.SetNumberOfThreads(nDevices - 1, this, &caldgemm::DMA_wrapper, 1, &Config->DMAMapping[1]); } if (Config->ThreadSaveDriver == -1) { pthread_mutex_init(&globalDriverLock, NULL); } if (Config->UseDMAFetchQueue) { for (int i = 0;i < nDevices;i++) { pthread_mutex_init(&dma_fetch_queue_tasks[i].mutex, NULL); } } #ifndef _WIN32 if (Config->UseGPU && Config->UseCPU) { for (int i = 0;i < conf_numprocs;i++) { if (CPU_ISSET(i, &oldcpumask) && cpuUsed(i)) fprintf(STD_OUT, "WARNING: Core %d used by GotoBLAS main thread and CALDGEMM, be sure not to use CPU and GPU at the same time!\n", i); } } #endif if (Config->MemPolicy) { #ifdef _WIN32 #else unsigned long nodemask = 0xffffff; syscall(SYS_set_mempolicy, MPOL_INTERLEAVE, &nodemask, sizeof(nodemask) * 8); #endif } if (Config->PreallocData) { if (Preallocate()) return(1); } /*fprintf(STD_OUT, "Setting FIFO scheduler\n"); sched_param param; sched_getparam(0, &param); param.sched_priority = 1; if (0 != sched_setscheduler(0, SCHED_FIFO, &param)) { fprintf(STD_OUT, "Error setting scheduler\n"); return(1); }*/ //setpriority(PRIO_PROCESS, 0, -20); if (Config->Debug) fprintf(STD_OUT, "Caldgemm Init complete, setting CPU mask %X\n", getcpumask(&oldcpumask)); sched_setaffinity(0, sizeof(oldcpumask), &oldcpumask); goto_set_num_threads(conf_numprocs); if (FinishDataInit()) return(1); finishData->running = false; for (int i = 0;i < nDevices;i++) for (int j = 0;j < 2;j++) DGEMMTasks[i].PrepareTasks[j].j = DGEMMTasks[i].PrepareTasks[j].k = 0; //Fix valgrind warning cParam.cblas_size = cParam.dynamic_run = 0; nDevicesInitialized = nDevices; if (Config->NumActiveDevices > 0 && Config->NumActiveDevices < nDevices) nDevices = Config->NumActiveDevices; caldgemm_initialized = true; if (Config->ShowConfig) printConfig(); return(0); } int caldgemm::broadcastcore() { return(broadcast_cpu_core); } bool caldgemm::cpuUsed(int cpu) { if (Config->UseGPU && cpu == Config->PinMainThread) return(true); for (int i = 0;i < nDevices;i++) { if (UseInputPthreads()) { int procsreq = 1; for (int j = i;j < nDevices;j++) { if (Config->GPUMapping[i] == Config->GPUMapping[j] && Config->PostprocessMapping[j] == -1) procsreq += outputthreads; } if ((Config->MultiThreadDivide ? (cpu >= Config->GPUMapping[i]) : (cpu > Config->GPUMapping[i])) && cpu < Config->GPUMapping[i] + procsreq) return(true); } if (UseOutputPthreads()) { if (Config->PostprocessMapping[i] != -1 && cpu >= Config->PostprocessMapping[i] && cpu < Config->PostprocessMapping[i] + outputthreads) return(true); } if (Config->ParallelDMA && matrix_n >= Config->ParallelDMA) { if (((matrix_n < Config->GroupParallelDMA || (signed) Config->GroupParallelDMA == -1) ? Config->AllocMapping[i] : Config->DMAMapping[i]) == cpu) return(true); } } for (int i = 0;i < Config->nExcludeCPUCores;i++) if (Config->ExcludeCPUCores[i] == cpu) return(true); if (Config->PinDeviceRuntimeThreads == cpu) return(true); return(false); } int caldgemm::reserve_cpu_cores() { int nthreads = 0; int mainfound = 0; if (UseOutputPthreads() || UseInputPthreads() || Config->ParallelDMA || Config->GroupParallelDMA) { for (int i = 0;i < nDevices;i++) { int offset = 0; for (int j = 0;j < i;j++) { if (Config->GPUMapping[i] == Config->GPUMapping[j] && Config->PostprocessMapping[j] != -1) offset++; } if (matrix_n >= Config->ParallelDMA && Config->ParallelDMA != 0) { if (matrix_n < Config->GroupParallelDMA) { if (Config->AllocMapping[i] != Config->PinMainThread) { bool found = false; for (int j = 0;j < i;j++) { if (Config->AllocMapping[j] == Config->AllocMapping[i]) { found = true; break; } } if (!found) { caldgemm_goto_reserve_cpu(Config->AllocMapping[i], 1); if (Config->Debug) fprintf(STD_OUT, "Reserving Core %d for Grouped DMA Thread\n", Config->AllocMapping[i]); nthreads++; } } } else if (i) { caldgemm_goto_reserve_cpu(Config->DMAMapping[i], 1); if (Config->Debug) fprintf(STD_OUT, "Reserving Core %d for DMA Thread\n", Config->DMAMapping[i]); nthreads++; } } else if (offset == 0 && Config->MultiThreadDivide && UseInputPthreads()) { caldgemm_goto_reserve_cpu(Config->GPUMapping[i], 1); if (Config->Debug) fprintf(STD_OUT, "Reserving Core %d for DivideBuffer\n", Config->GPUMapping[i]); nthreads++; if (Config->GPUMapping[i] == Config->PinMainThread) mainfound = 1; } if (UseOutputPthreads()) { for (int j = 0;j < outputthreads;j++) { const int merge_core = Config->PostprocessMapping[i] == -1 ? (Config->GPUMapping[i] + 1 + offset * outputthreads + j) : (Config->PostprocessMapping[i] + j); caldgemm_goto_reserve_cpu(merge_core, 1); if (Config->Debug) fprintf(STD_OUT, "Reserving Core %d for MergeBuffer\n", merge_core); } nthreads += outputthreads; } } } if (mainfound == 0 || !Config->MultiThreadDivide) { caldgemm_goto_reserve_cpu(Config->PinMainThread, 1); if (Config->Debug) fprintf(STD_OUT, "Reserving Core %d for Main Thread\n", Config->PinMainThread); if (Config->ForceNumCPUThreads == 0 || Config->PinMainThread < Config->ForceNumCPUThreads) nthreads++; } for (int i = 0;i < Config->nExcludeCPUCores;i++) { caldgemm_goto_reserve_cpu(Config->ExcludeCPUCores[i], 1); if (Config->Debug) fprintf(STD_OUT, "Excluding Core %d\n", Config->ExcludeCPUCores[i]); } if (Config->ForceNumCPUThreads) nthreads += Config->nExcludeCPUCores; if (Config->PinDeviceRuntimeThreads >= 0) { caldgemm_goto_reserve_cpu(Config->PinDeviceRuntimeThreads, 1); if (Config->ForceNumCPUThreads == 0 || Config->PinDeviceRuntimeThreads < Config->ForceNumCPUThreads) nthreads++; nthreads++; } if (Config->Debug) fprintf(STD_OUT, "Reserved %d cores\n", nthreads); return(nthreads); } void caldgemm::DMA_wrapper(caldgemm::clsDMAParam* par) { { char tmpName[32]; sprintf(tmpName, "DMA Thread %d", par->threadNum); setThreadName(tmpName); } if (Config->Debug) fprintf(STD_OUT, "DMA wrapper thread %d running\n", par->threadNum); while(par->WaitForTask()) { if (Config->Debug) fprintf(STD_OUT, "DMA wrapper thread %d starting processing\n", par->threadNum); RunCALDGEMMMain(par->threadNum); } if (Config->Debug) fprintf(STD_OUT, "DMA wrapper thread %d terminating\n", par->threadNum); } void* caldgemm::linpack_broadcast_wrapper(void* arg) { return ((caldgemm*) arg)->linpack_broadcast_wrapper_a(); } void* caldgemm::linpack_broadcast_wrapper_a() { setThreadName("Linpack Broadcast Wrapper"); if (Config->Debug) fprintf(STD_OUT, "Linpack broadcast helper thread started\n"); int linpackCPU = broadcast_cpu_core; if (linpackCPU >= conf_numprocs_real) linpackCPU = 0; if (Config->Debug) fprintf(STD_OUT, "Linpack Thread, core %d\n", linpackCPU); sched_setaffinity_set_core(linpackCPU + Config->CPUCoreOffset); linpackParameters.linpackMutex[0].Lock(); while (linpackParameters.linpackMutex[0].Lock() == 0 && linpackParameters.terminate == false) { Timers.LinpackTimer2.Start(); Config->linpack_broadcast_function(); Timers.LinpackTimer2.Stop(); Timers.BcastTimer.Start(); linpackParameters.linpackMutex[1].Unlock(); } if (Config->Debug) fprintf(STD_OUT, "linpack slave terminating\n"); linpackParameters.linpackMutex[1].Unlock(); pthread_exit(NULL); return(NULL); } int caldgemm::cpuScheduler() { int retVal = 0; if (Config->UseCPU && Config->MultiThread && Config->DynamicSched && (Config->ParallelDMA == 0 || Config->ParallelDMA > matrix_n)) { const size_t mb = (gpu_m + Config->Height - 1) / Config->Height; const size_t nb = (gpu_n + Config->Height - 1) / Config->Height; size_t nBlocks = mb * nb; pthread_mutex_lock(&scheduleMutex); const size_t k = gpu_k_barrier == -1 ? 0 : gpu_k_barrier; if ((size_t) gpu_k_barrier < nBlocks - 1) { size_t blockm, blockn; DGEMM_getblocks(k, blockm, blockn); if (cParam.dynamic_run == 0 && Config->SecondPhaseDynamicRuns) { cParam.dynamic_size = ((1.0f - gpu_ratio_used) * (float) (nBlocks - k - 1) + 0.5) * Config->Height; if (cParam.dynamic_size > (nBlocks - k - 1) * Config->Height) cParam.dynamic_size = (nBlocks - k - 1) * Config->Height; if (cParam.dynamic_size > Config->Height) { cParam.dynamic_run = 1 + cParam.dynamic_size / mymin(gpu_m, gpu_n); cParam.dynamic_size /= cParam.dynamic_run; cParam.dynamic_size -= cParam.dynamic_size % Config->Height; cParam.dynamic_run *= Config->Height; if (cParam.dynamic_size && (DGEMM_favor_m ? gpu_n : gpu_m) % Config->Height) { const size_t adjustment = Config->Height - (DGEMM_favor_m ? gpu_n : gpu_m) % Config->Height; if (Config->Debug) fprintf(STD_OUT, "Adjusting second phase run size for small tiles: %lld - %lld = %lld\n", (long long int) cParam.dynamic_size, (long long int) adjustment, (long long int) cParam.dynamic_size - adjustment); cParam.dynamic_size -= adjustment; } if (cParam.dynamic_run && (DGEMM_favor_m ? gpu_m : gpu_n) % Config->Height) { const size_t adjustment = Config->Height - (DGEMM_favor_m ? gpu_m : gpu_n) % Config->Height; if (Config->Debug) fprintf(STD_OUT, "Adjusting second phase run row size for small tiles: %lld - %lld = %lld\n", (long long int) cParam.dynamic_run, (long long int) adjustment, (long long int) cParam.dynamic_run - adjustment); cParam.dynamic_run -= adjustment; } while (DGEMM_favor_m ? (blockm * Config->Height >= gpu_m - cParam.dynamic_run && blockn * Config->Height >= gpu_n - cParam.dynamic_size) : (blockn * Config->Height >= gpu_n - cParam.dynamic_run && blockm * Config->Height >= gpu_m - cParam.dynamic_size)) { if (cParam.dynamic_run > Config->Height) { cParam.dynamic_run -= Config->Height; cParam.dynamic_size = mymin(gpu_m, gpu_n); } else { if (cParam.dynamic_size > Config->Height) { cParam.dynamic_size -= Config->Height; } else { cParam.dynamic_run = cParam.dynamic_size = 0; } } if (Config->Debug) fprintf(STD_OUT, "cParam dynamic size reduced to: %lld blockrows (%lld), %lld blocks (%lld)\n", (long long int) cParam.dynamic_run / Config->Height, (long long int) cParam.dynamic_run, (long long int) cParam.dynamic_size / Config->Height, (long long int) cParam.dynamic_size); } if (nBlocks >= 256 && nBlocks - k - 1 > 16 && cParam.dynamic_run == Config->Height && cParam.dynamic_size < mymin(gpu_m, gpu_n)) cParam.dynamic_size += Config->Height; if (!Config->Quiet) fprintf(STD_OUT, "Scheduling Additional CPU DGEMM Run over %lld blockrows (%lld), %lld blocks (%lld)\n", (long long int) cParam.dynamic_run / Config->Height, (long long int) cParam.dynamic_run, (long long int) cParam.dynamic_size / Config->Height, (long long int) cParam.dynamic_size); retVal = 1; } else { cParam.dynamic_size = 0; goto TryThirdRun; } } else { TryThirdRun: if (Config->ThirdPhaseDynamicRuns) { size_t test_cpu_k = cpu_k_barrier - 1; size_t cpublockm, cpublockn; DGEMM_getblocks(test_cpu_k, cpublockm, cpublockn); while (test_cpu_k > k && (DGEMM_favor_m ? (cpublockm * Config->Height >= gpu_m - cParam.dynamic_run && cpublockn * Config->Height >= gpu_n - cParam.dynamic_size) : (cpublockn * Config->Height >= gpu_n - cParam.dynamic_run && cpublockm * Config->Height >= gpu_m - cParam.dynamic_size))) { test_cpu_k--; DGEMM_getblocks(test_cpu_k, cpublockm, cpublockn); } if ((long long int) test_cpu_k > 0 && (signed) k <= (signed) test_cpu_k - 2 * nDevices + Config->ThirdPhaseThreshold) { if (!Config->Quiet) fprintf(STD_OUT, "Scheduling dynamic 3rd phase run, CPU taking tile %lld (k=%lld,m=%lld,n=%lld) from GPU (GPU k = %lld)\n", (long long int) test_cpu_k, (long long int) k, (long long int) cpublockm, (long long int) cpublockn, (long long int) gpu_k_barrier); cParam.dynamic_run2++; cParam.cpu_k = test_cpu_k; cpu_k_barrier = test_cpu_k; retVal = 1; } } } } pthread_mutex_unlock(&scheduleMutex); } return(retVal); } void caldgemm::RunLinpackFactorization(int old_goto_threads, int& require_threads) { const CBLAS_TRANSPOSE TransposeA = this->TransposeA ? CblasTrans : CblasNoTrans; const CBLAS_TRANSPOSE TransposeB = this->TransposeB ? CblasTrans : CblasNoTrans; const size_t A_pitch_use = (this->TransposeA ? 1 : A_pitch); if (ExecLinpack >= 2) { if (Config->AlternateLookahead > matrix_n) { if (!Config->Quiet) fprintf(STD_OUT, "\t\t\tWaiting for GPUs to finish initial DGEMM part to start Linpack factorization\n"); alternateLookaheadMutex.Lock(); if (Config->SimpleGPUQueuing) { CheckAlternateTilesRemainingSQ(); } _mm_mfence(); } else { if (!Config->Quiet) fprintf(STD_OUT, "\t\t\tDoing initial cblas runs to prepare Linpack factorization\n"); Timers.CPUTimer.Start(); cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, Config->Width, matrix_n, Config->Width, Alpha, A - Config->Width * A_pitch_use, A_pitch, B, B_pitch, Beta, C - Config->Width * C_pitch, C_pitch); Timers.CPUTimer.Stop(); } if (!Config->Quiet) fprintf(STD_OUT, "\t\t\tStarting Linpack factorization\n"); if (Config->HPLFactorizeRestrictCPUs == 1) { if (8 < old_goto_threads - require_threads) goto_set_num_threads(8); } else if (Config->HPLFactorizeRestrictCPUs >= 2) { caldgemm_goto_restrict_cpus(Config->HPLFactorizeRestrictCPUs); } Timers.LinpackTimer1.Start(); Config->linpack_factorize_function(); Timers.LinpackTimer1.Stop(); if (Config->HPLFactorizeRestrictCPUs >= 2) caldgemm_goto_restrict_cpus(0); } if (Config->LinpackNodes > 1) { if (Config->MultiThread) { caldgemm_goto_reserve_cpu(broadcast_cpu_core, 1); if (Config->ForceNumCPUThreads == 0 || broadcast_cpu_core < Config->ForceNumCPUThreads) require_threads++; linpackParameters.linpackMutex[0].Unlock(); } else { Timers.LinpackTimer2.Start(); Config->linpack_broadcast_function(); Timers.LinpackTimer2.Stop(); } } goto_set_num_threads(old_goto_threads - require_threads); } void* caldgemm::cblas_wrapper(void* arg) { return ((cblasParameters*) arg)->cls->cblas_wrapper_a(true); } int caldgemm::caldgemm_part_cpu() { const size_t A_pitch_use = (TransposeA ? 1 : A_pitch); const size_t B_pitch_use = (TransposeB ? B_pitch : 1); const CBLAS_TRANSPOSE TransposeA = this->TransposeA ? CblasTrans : CblasNoTrans; const CBLAS_TRANSPOSE TransposeB = this->TransposeB ? CblasTrans : CblasNoTrans; if (!Config->Quiet) fprintf(STD_OUT, "\t\tSlave thread starting cblas (m: %lld, n: %lld, cblas_size: %lld (%lld), dynamic: %lld/%lld, cpu_k: %lld)\n", (long long int) matrix_m, (long long int) matrix_n, (long long int) cParam.cblas_size, (long long int) Config->Height, (long long int) cParam.dynamic_run, (long long int) cParam.dynamic_size, (long long int) cParam.cpu_k); int old_goto_threads = conf_numprocs; int require_threads_base = reserve_cpu_cores(); if (Config->Debug) fprintf(STD_OUT, "Reserving %d threads for gpu \n", require_threads_base); if (old_goto_threads > require_threads_base) { goto_set_num_threads(old_goto_threads - require_threads_base); } else { goto_set_num_threads(1); caldgemm_goto_reserve_cpus(0); } Timers.TotalCPUTimer.Start(); Timers.LinpackTimer3.Start(); bool cpus_restricted = false; if (Config->HPLFactorizeRestrictCPUs >= 2 && (Config->LinpackSwapN != NULL || (ExecLinpack && Config->AlternateLookahead <= matrix_n))) { caldgemm_goto_restrict_cpus(Config->HPLFactorizeRestrictCPUs); cpus_restricted = true; } if (Config->LinpackSwapN != NULL) { Config->linpack_swap_function(); } Timers.LinpackTimer3.Stop(); if (Config->HPLFactorizeRestrictCallback != NULL) require_threads_base += Config->HPLFactorizeRestrictCallback(matrix_n); int require_threads = require_threads_base; if ((ExecLinpack && Config->AlternateLookahead <= matrix_n) || ExecLinpack == 1) { RunLinpackFactorization(old_goto_threads, require_threads); } if (cpus_restricted) { caldgemm_goto_restrict_cpus(0); if (old_goto_threads > require_threads) { goto_set_num_threads(old_goto_threads - require_threads); } else { goto_set_num_threads(1); } } Timers.CPUTimer.Start(); bool linpackfinished = false; do { if (cParam.dynamic_run2) { size_t blockm, blockn; DGEMM_getblocks(cParam.cpu_k, blockm, blockn); VT_USER_START_A("CPU DGEMM Phase 3"); cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, blockm == gpu_m / Config->Height ? (gpu_m % Config->Height) : Config->Height, blockn == gpu_n / Config->Height ? (gpu_n % Config->Height) : Config->Height, Config->Width, Alpha, A + blockm * Config->Height * A_pitch_use, A_pitch, B + blockn * Config->Height * B_pitch_use, B_pitch, Beta, C + blockm * Config->Height * C_pitch + blockn * Config->Height, C_pitch); VT_USER_END_A("CPU DGEMM Phase 3"); } else { if (cParam.dynamic_run) { VT_USER_START_A("CPU DGEMM Phase 2"); if (DGEMM_favor_m) { cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, cParam.dynamic_run, cParam.dynamic_size, Config->Width, Alpha, A + (gpu_m - cParam.dynamic_run) * A_pitch_use, A_pitch, B + (gpu_n - cParam.dynamic_size) * B_pitch_use, B_pitch, Beta, C + (gpu_m - cParam.dynamic_run) * C_pitch + gpu_n - cParam.dynamic_size, C_pitch); } else { cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, cParam.dynamic_size, cParam.dynamic_run, Config->Width, Alpha, A + (gpu_m - cParam.dynamic_size) * A_pitch_use, A_pitch, B + (gpu_n - cParam.dynamic_run) * B_pitch_use, B_pitch, Beta, C + (gpu_m - cParam.dynamic_size) * C_pitch + gpu_n - cParam.dynamic_run, C_pitch); } VT_USER_END_A("CPU DGEMM Phase 2"); } size_t cblas2; if (Config->RereserveLinpackCPU) { if (ExecLinpack && Config->LinpackNodes > 1 && Config->MultiThread && (((double) matrix_m * (double) matrix_n) - linpack_last_mn[ExecLinpack]) / linpack_last_mn[ExecLinpack] < 0.3 && linpackCPUDGEMMTime[ExecLinpack] - linpackBcastTime[ExecLinpack] > 5.0) { cblas2 = (double) (DGEMM_split_m ? matrix_n : matrix_m) * (linpackBcastTime[ExecLinpack] + 3.0) / linpackCPUDGEMMTime[ExecLinpack]; if (!Config->Quiet) fprintf(STD_OUT, "Splitting CPU DGEMM for later enabling additional cores, cblas2=%lld\n", (long long int) cblas2); } else { cblas2 = 0; } if (cblas2 % 8) cblas2 += 8 - cblas2 % 8; } else { cblas2 = 0; } if (DGEMM_split_m) //favor splitting m because of consecutive memory { if (matrix_n != gpu_n && cParam.borders_done == false) { VT_USER_START_A("CPU DGEMM Borders"); cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, matrix_m - cParam.cblas_size, matrix_n - gpu_n, Config->Width, Alpha, A, A_pitch, B + gpu_n * B_pitch_use, B_pitch, Beta, C + gpu_n, C_pitch); VT_USER_END_A("CPU DGEMM Borders"); } if (ExecLinpack >= 2 && cParam.borders_done == false && Config->AlternateLookahead > matrix_n) { Timers.CPUTimer.Stop(); RunLinpackFactorization(old_goto_threads, require_threads); Timers.CPUTimer.Start(); } if (cParam.dynamic_run == 0) { VT_USER_START_A("CPU DGEMM Phase 1"); if (cblas2) { cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, cParam.cblas_size, cblas2, Config->Width, Alpha, A + (matrix_m - cParam.cblas_size) * A_pitch_use, A_pitch, B, B_pitch, Beta, C + (matrix_m - cParam.cblas_size) * C_pitch, C_pitch); if (linpackParameters.linpackMutex[1].Trylock() == EBUSY) { if (!Config->NoPerformanceWarnings) fprintf(STD_OUT, "WARNING: Linpack broadcast was not finished at predicted time, running CPU DGEMM with reduced core count\n"); } else { Timers.BcastTimer.Stop(); if (!Config->NoPerformanceWarnings && Timers.BcastTimer.GetElapsedTime() > 1.0) fprintf(STD_OUT, "Bcast core idle for %2.4f seconds\n", Timers.BcastTimer.GetElapsedTime()); int require_threads_new = require_threads_base; if (Config->Debug) fprintf(STD_OUT, "Reserving %d threads for gpu during second cpu run\n", require_threads_new); if (old_goto_threads > require_threads_new) { goto_set_num_threads(old_goto_threads - require_threads_new); caldgemm_goto_reserve_cpu(broadcast_cpu_core, 0); } else { goto_set_num_threads(1); caldgemm_goto_reserve_cpus(0); } linpackfinished = true; } } cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, cParam.cblas_size, matrix_n - cblas2, Config->Width, Alpha, A + (matrix_m - cParam.cblas_size) * A_pitch_use, A_pitch, B + cblas2 * B_pitch_use, B_pitch, Beta, C + (matrix_m - cParam.cblas_size) * C_pitch + cblas2, C_pitch); VT_USER_END_A("CPU DGEMM Phase 1"); } } else { if (cParam.dynamic_run == 0) { VT_USER_START_A("CPU DGEMM Phase 1"); if (cblas2) { cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, cblas2, cParam.cblas_size, Config->Width, Alpha, A, A_pitch, B + (matrix_n - cParam.cblas_size) * B_pitch_use, B_pitch, Beta, C + matrix_n - cParam.cblas_size, C_pitch); if (linpackParameters.linpackMutex[1].Trylock() == EBUSY) { if (!Config->NoPerformanceWarnings) fprintf(STD_OUT, "Linpack broadcast was not finished at predicted time, running CPU DGEMM with reduced core count\n"); } else { int require_threads_new = require_threads_base; if (old_goto_threads > require_threads_new) { if (Config->Debug) fprintf(STD_OUT, "Reserving %d threads for gpu during second cpu run\n", require_threads_new); goto_set_num_threads(old_goto_threads - require_threads_new); caldgemm_goto_reserve_cpu(broadcast_cpu_core, 0); } else { goto_set_num_threads(1); caldgemm_goto_reserve_cpus(0); } linpackfinished = true; } } cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, matrix_m - cblas2, cParam.cblas_size, Config->Width, Alpha, A + cblas2 * A_pitch_use, A_pitch, B + (matrix_n - cParam.cblas_size) * B_pitch_use, B_pitch, Beta, C + cblas2 * C_pitch + matrix_n - cParam.cblas_size, C_pitch); VT_USER_END_A("CPU DGEMM Phase 1"); } if (ExecLinpack >= 2 && cParam.borders_done == false && Config->AlternateLookahead > matrix_n) { Timers.CPUTimer.Stop(); RunLinpackFactorization(old_goto_threads, require_threads); Timers.CPUTimer.Start(); } if (matrix_m != gpu_m && cParam.borders_done == false) { VT_USER_START_A("CPU DGEMM Borders"); cblas_dgemm(CblasRowMajor, TransposeA, TransposeB, matrix_m - gpu_m, matrix_n - cParam.cblas_size, Config->Width, Alpha, A + gpu_m * A_pitch_use, A_pitch, B, B_pitch, Beta, C + gpu_m * C_pitch, C_pitch); VT_USER_END_A("CPU DGEMM Borders"); } } } cParam.borders_done = true; if (Config->Debug) fprintf(STD_OUT, "cblas run completed\n"); } while (cpuScheduler()); Timers.CPUTimer.Stop(); if (linpackfinished == false && ExecLinpack && Config->MultiThread && Config->LinpackNodes > 1) { linpackParameters.linpackMutex[1].Lock(); } Timers.TotalCPUTimer.Stop(); goto_set_num_threads(old_goto_threads); caldgemm_goto_reserve_cpus(0); return(0); } int caldgemm::caldgemm_part_gpu() { const size_t mb = (gpu_m + Config->Height - 1) / Config->Height; const size_t nb = (gpu_n + Config->Height - 1) / Config->Height; const size_t nBlocks = mb * nb; if (Config->Debug) { if (DGEMM_favor_m) { fprintf(STD_OUT, "Favoring m direction, %lld blocks (%lld x %lld) (mb x nb)\n", (long long int) nBlocks, (long long int) mb, (long long int) nb); } else { fprintf(STD_OUT, "Not favoring m direction, %lld blocks (%lld x %lld) (mb x nb)\n", (long long int) nBlocks, (long long int) mb, (long long int) nb); } } if (!Config->NoPerformanceWarnings && (buffersSwitchable ? mymin(nb, mb) : nb) > (size_t) (bbuffers[0] * nDevices)) fprintf(STD_OUT, "WARNING: Insufficient buffers for Input Matrices, retransfer required\n"); Timers.GPUTimer.Start(); for (unsigned int i = 0; i < Config->Iterations; ++i) { AlternateLookaheadBlocksM = (std::min<size_t>(Config->Width, gpu_m) - 1) / Config->Height + 1; AlternateLookaheadTilesRemaining = AlternateLookaheadTilesFull = nb * AlternateLookaheadBlocksM; if (Config->ImprovedScheduler) { if (!Config->PreallocData) tileDistribution = new int[nBlocks]; for (int l = 0;l < nDevices;l++) first_device_k[l] = -1; size_t block_correction_factor = 0; if (Config->Height > CALDGEMM_MIN_CORRECTION_SIZE && Config->SmallTiles && Config->ImprovedSchedulerBalance == 1) { size_t undersize; size_t scaler; if (DGEMM_favor_m) { undersize = gpu_n % Config->Height; scaler = mb; } else { undersize = gpu_m % Config->Height; scaler = nb; } if (undersize) { if (undersize < CALDGEMM_MIN_CORRECTION_SIZE) undersize = CALDGEMM_MIN_CORRECTION_SIZE; block_correction_factor = (Config->Height - undersize) * scaler / Config->Height; } } bool balance2 = Config->ImprovedSchedulerBalance == 2 && (DGEMM_favor_m ? gpu_n : gpu_m) % Config->Height; int mb_use, nb_use, nBlocks_use; if (balance2) { mb_use = DGEMM_favor_m ? mb : (mb - 1); nb_use = DGEMM_favor_m ? (nb - 1) : nb; nBlocks_use = mb_use * nb_use; } else { mb_use = mb; nb_use = nb; nBlocks_use = nBlocks; } //size_t numt[4] = {0,0,0,0}, sizet[4] = {0,0,0,0}; for (size_t l = 0;l < nBlocks;l++) { size_t blockn, blockm; int k; if (DGEMM_favor_m) { blockn = l % nb; blockm = l / nb; if (balance2 && blockn == nb - 1) { tileDistribution[l] = nDevices - 1 - nDevices * blockm / mb; } else { k = blockn * mb_use + blockm; tileDistribution[l] = std::min<int>(nDevices * k / (nBlocks_use - block_correction_factor), nDevices - 1); } } else { blockm = l % mb; blockn = l / mb; if (balance2 && blockm == mb - 1) { tileDistribution[l] = nDevices - 1 - nDevices * blockn / nb; } else { k = blockn + blockm * nb_use; tileDistribution[l] = std::min<int>(nDevices * k / (nBlocks_use - block_correction_factor), nDevices - 1); } } /*numt[tileDistribution[l]]++; size_t height1 = (int) (((size_t) blockn == gpu_n / Config->Height) ? (gpu_n % Config->Height) : Config->Height); size_t height2 = (int) (((size_t) blockm == gpu_m / Config->Height) ? (gpu_m % Config->Height) : Config->Height); sizet[tileDistribution[l]] += height1 * height2;*/ if (first_device_k[tileDistribution[l]] == -1) first_device_k[tileDistribution[l]] = l; //if (Config->Debug) fprintf(STD_OUT, "Tile %lld (%lld / %lld) processed by device %d\n", (long long int) l, (long long int) blockm, (long long int) blockn, tileDistribution[l]); } //for (int l = 0;l < 4;l++) fprintf(STD_OUT, "TILESTAT %d: %3lld - %lld\n", l, (long long int) numt[l], (long long int) sizet[l]); //fprintf(STD_OUT, "TILESIZE %lld (factor %lld - miss %lld)\n", (long long int) (Config->Height * Config->Height), (long long int) block_correction_factor, (long long int) ((sizet[2] - sizet[3]) / (Config->Height * Config->Height))); if (Config->Debug) { for (size_t l = 0;l < nBlocks;l++) { fprintf(STD_OUT, "%d ", tileDistribution[l]); if ((l + 1) % (DGEMM_favor_m ? nb : mb) == 0) fprintf(STD_OUT, "\n"); } } } for (int ii = 0;ii < nDevices;ii++) { buffersMajor[ii] = -1; for (int j = 0;j < bbuffers[ii];j++) buffersMinor[ii][j] = -1; next_buffer_A[ii] = 0; next_buffer_B[ii] = 0; } if (Config->PreallocData && ((int) mb > Config->PreallocData || (int) nb > Config->PreallocData)) { fprintf(STD_OUT, "Value of PreallocData too small for current block count! (mb %d nb %d pre %d)", (int) mb, (int) nb, Config->PreallocData); return(1); } if (RunCALDGEMM_Init()) return(1); if (Config->ParallelDMA != 0 && matrix_n >= Config->ParallelDMA) { DMAThreads.Start(); RunCALDGEMMMain(0); DMAThreads.Sync(); } else { if (RunCALDGEMMMain()) return(1); } if (RunCALDGEMM_Exit()) return(0); if (Config->ImprovedScheduler) { if (!Config->PreallocData) delete[] tileDistribution; } if(Config->Verify && i < Config->Iterations - 1) AnalyzeResults(); } Timers.GPUTimer.Stop(); if (Config->MultiThread && Config->UseCPU) { Timers.ATime.Reset(); Timers.ATime.Start(); } if (Config->SpawnGPUThread == -2) { if (Config->Debug) fprintf(STD_OUT, "Caldgemm Main Thread, setting CPU mask %X\n", getcpumask(&oldcpumask)); sched_setaffinity(0, sizeof(oldcpumask), &oldcpumask); } return(0); } void* caldgemm::cblas_wrapper_a(bool thread) { if (thread) { setThreadName(Config->SpawnGPUThread != -2 ? "GPU Wrapper" : "CBLAS Wrapper"); if (Config->Debug) fprintf(STD_OUT, "Cblas helper thread started\n"); if (Config->SpawnGPUThread == -2) { ensure_omp_thread_pinning("CBLAS"); } if (Config->SpawnGPUThread != -2) { sched_setaffinity(0, sizeof(gpumask), &gpumask); } else if (Config->GPUMapping[0] + outputthreads * nDevices + 1 >= conf_numprocs) { sched_setaffinity_set_core(0 + Config->CPUCoreOffset); } else { if (Config->Debug) fprintf(STD_OUT, "Cblas thread Thread, setting CPU mask %X\n", getcpumask(&oldcpumask)); sched_setaffinity(0, sizeof(oldcpumask), &oldcpumask); } cParam.cblasMutex[1].Lock(); } while (cParam.cblasMutex[1].Lock() == 0 && cParam.terminate == false) { if (Config->SpawnGPUThread != -2) { caldgemm_part_gpu(); } else { caldgemm_part_cpu(); } if (Config->Debug) fprintf(STD_OUT, "\t\tUnlocking cblasmutex 0\n"); cParam.cblasMutex[0].Unlock(); if (!thread) break; } if (thread) { if (Config->Debug) fprintf(STD_OUT, "blas slave terminating\n"); cParam.cblasMutex[0].Unlock(); pthread_exit(NULL); } return(NULL); } void* caldgemm::divide_wrapper(void* arg) { return ((divideParameters*) arg)->cls->divide_wrapper_a((divideParameters*) arg); } void* caldgemm::divide_wrapper_a(divideParameters* par) { if (Config->Debug) fprintf(STD_OUT, "Divide Thread %d for core %d started\n", par->nThread, par->CPUCore); { char tmp[128]; sprintf(tmp, "Divide %d", par->nThread); setThreadName(tmp); } sched_setaffinity_set_core(par->CPUCore + Config->CPUCoreOffset); par->curDevice = -1; for (int i = 0;i < nDevices;i++) { if (Config->GPUMapping[i] == par->CPUCore) { if (par->curDevice == 1) par->curDevice = i; DGEMMTasks[i].next_device = &par->curDevice; } } double* tmpBuffer = allocDivideBuffer(); for (int i = 0;i < nDevices;i++) { if (Config->GPUMapping[i] == par->CPUCore) { par->firstDevice = i; break; } } int mutex_to_unlock = par->nThread; int i = 0; while (true) { if (Config->GPUMapping[i] == par->CPUCore) { par->reset = 0; par->curDevice = i; DGEMMTasks[mutex_to_unlock].mutex_finished.Unlock(); if (Config->Debug) fprintf(STD_OUT, "Divide Thread %d on Core %d waiting to operate on device %d\n", par->nThread, par->CPUCore, i); DGEMMTasks[i].mutex_start.Lock(); if (par->terminate) break; if (par->reset) { if (Config->Debug) fprintf(STD_OUT, "Divide Thread %d resetting\n", par->nThread); i = par->firstDevice; mutex_to_unlock = i; continue; } if (DGEMMTasks[i].skip_device_to != -1) { //fprintf(STD_OUT, "Skipping device %d, switching to %d\n", i, DGEMMTasks[i].skip_device_to); const int oldi = i; i = DGEMMTasks[i].skip_device_to; DGEMMTasks[oldi].skip_device_to = -1; DGEMMTasks[i].mutex_start.Lock(); } if (Config->Debug) fprintf(STD_OUT, "Divide Thread for device %d Starting processing (k = %d)\n", i, DGEMMTasks[i].k); DGEMMPrepareAndExecute(DGEMMTasks[i] CALDGEMM_DIVBUFB); mutex_to_unlock = i; } i = (i + 1) % nDevices; } freeDivideBuffer(tmpBuffer); if (Config->Debug) fprintf(STD_OUT, "Divide Thread %d for Core %d terminating\n", par->nThread, par->CPUCore); DGEMMTasks[par->nThread].mutex_finished.Unlock(); pthread_exit(NULL); return(NULL); } void* caldgemm::merge_wrapper(void* arg) { return ((mergeParameters*) arg)->cls->merge_wrapper_a((mergeParameters*) arg); } void* caldgemm::merge_wrapper_a(mergeParameters* par) { { char tmp[128]; sprintf(tmp, "Merge %d/%d", par->num_device, par->nMergeThread); setThreadName(tmp); } if (Config->Debug) fprintf(STD_OUT, "Merger Thread %d started\n", par->nMergeThread); int merge_core; if (Config->PostprocessMapping[par->num_device] == -1) { merge_core = Config->GPUMapping[par->num_device] + par->nMergeThread + 1; for (int i = 0;i < par->num_device;i++) { if (Config->GPUMapping[i] == Config->GPUMapping[par->num_device]) merge_core += outputthreads; } } else { merge_core = Config->PostprocessMapping[par->num_device] + par->nMergeThread; } if (Config->Debug) fprintf(STD_OUT, "Merge Thread %d, core %d\n", par->nMergeThread, merge_core); sched_setaffinity_set_core(merge_core % conf_numprocs_real + Config->CPUCoreOffset); //HighResTimer mergeTimer; par->mergeThreadMutex[0].Lock(); while (par->mergeThreadMutex[0].Lock() == 0 && par->terminate == false) { if (Config->Debug) fprintf(STD_OUT, "\t\tSlave thread %d (device %d) starting merge process for obuffer %d (k = %lld)\n", par->nMergeThread, par->num_device, par->nContext, (long long int) par->k); size_t blockm, blockn; DGEMM_getblocks(par->k, blockm, blockn); /*if (Config->Debug) { mergeTimer.Reset(); mergeTimer.Start(); }*/ RunMergeBuffers(par->dst, par->num_device, par->nContext, (blockn == gpu_n / Config->Height) ? (gpu_n % Config->Height) : Config->Height, (blockm == gpu_m / Config->Height) ? (gpu_m % Config->Height) : Config->Height, BufferHeight, BufferHeight, C_pitch); /*if (Config->Debug) { mergeTimer.Stop(); fprintf(STD_OUT, "\t\tMerge time: %2.3f\n", mergeTimer.GetElapsedTime()); }*/ if (!Config->SimpleGPUQueuing) CheckAlternateTilesRemaining(blockm); if (Config->Debug) fprintf(STD_OUT, "\t\tUnlocking mutex device %d obuffer %d (Slavethread %d)\n", par->num_device, par->nContext, par->nMergeThread); obufferMutex[par->num_device][par->nContext].Unlock(); par->mergeThreadMutex[1].Unlock(); } if (Config->Debug) fprintf(STD_OUT, "merge slave %d terminating\n", par->nMergeThread); par->mergeThreadMutex[1].Unlock(); pthread_exit(NULL); return(NULL); } int caldgemm::DumpMatrix(double* a, double* b, double* c, double alpha, double beta, int tmp_m, int tmp_k, int tmp_n, int Apitch, int Bpitch, int Cpitch) { int i = 0; char filename[256]; FILE* fp = NULL; do { if (fp) fclose(fp); sprintf(filename, "dump%d.out", i++); } while ((fp = fopen(filename, "r")) != NULL && i < 100); if (i == 100) { if (fp) fclose(fp); return(1); } fp = fopen(filename, "w+b"); int nWritten = 0; nWritten += fwrite(&a, sizeof(a), 1, fp); nWritten += fwrite(&b, sizeof(b), 1, fp); nWritten += fwrite(&c, sizeof(c), 1, fp); nWritten += fwrite(&alpha, sizeof(alpha), 1, fp); nWritten += fwrite(&beta, sizeof(beta), 1, fp); nWritten += fwrite(&tmp_m, sizeof(tmp_m), 1, fp); nWritten += fwrite(&tmp_k, sizeof(tmp_k), 1, fp); nWritten += fwrite(&tmp_n, sizeof(tmp_n), 1, fp); nWritten += fwrite(&Apitch, sizeof(Apitch), 1, fp); nWritten += fwrite(&Bpitch, sizeof(Bpitch), 1, fp); nWritten += fwrite(&Cpitch, sizeof(Cpitch), 1, fp); for (i = 0;i < tmp_m;i++) { nWritten += fwrite(a + i * Apitch, sizeof(double), tmp_k, fp); } for (i = 0;i < tmp_k;i++) { nWritten += fwrite(b + i * Bpitch, sizeof(double), tmp_n, fp); } fclose(fp); if (nWritten == 0) return(1); return(0); } void caldgemm::WaitForLASWP(size_t blockm) { if (Config->LinpackSwapN != NULL) { int shown = false; size_t need = (blockm + 1) * Config->Height; if (need > gpu_m) need = gpu_m; if (ExecLinpack >= 2 && Config->AlternateLookahead <= matrix_n) need += Config->Width; //if (Config->Debug) fprintf(STD_OUT, "Checking LASWP / DTRSM... current: %lld need: %lld\n", (long long int) *Config->LinpackSwapN, (long long int) need); while (*Config->LinpackSwapN < need) { if (Config->Debug && shown == false) { fprintf(STD_OUT, "Waiting for LASWP / DTRSM... current: %lld need: %lld\n", (long long int) *Config->LinpackSwapN, (long long int) need); shown = true; } #ifdef _WIN32 if (Config->LASWPSleep) Sleep(Config->LASWPSleep / 1000); #else if (Config->LASWPSleep) usleep(Config->LASWPSleep); #endif } } } int caldgemm::CheckAlternateTilesRemainingSQ() { return(0); } void caldgemm::CheckAlternateTilesRemaining(size_t m) { if (ExecLinpack >= 2 && Config->AlternateLookahead > matrix_n && AlternateLookaheadTilesRemaining) { //if (Config->Debug) fprintf(STD_OUT, "Checking Alternate Tiles: m = %lld - Remaining = %d\n", (long long int) m, (int) AlternateLookaheadTilesRemaining); if ((int) m < AlternateLookaheadBlocksM) { pthread_mutex_lock(&tilesRemainingMutex); if (--AlternateLookaheadTilesRemaining == 0) { if (Config->Debug) fprintf(STD_OUT, "GPU done with initial part, factorization may start\n"); alternateLookaheadMutex.Unlock(); } pthread_mutex_unlock(&tilesRemainingMutex); } } } int caldgemm::Preallocate() { for (int l = 0;l < nDevices;l++) { buffer_pointers_A[l] = new int[Config->PreallocData]; buffer_pointers_B[l] = new int[Config->PreallocData]; memset(buffer_pointers_A[l], 0, Config->PreallocData * sizeof(int)); memset(buffer_pointers_B[l], 0, Config->PreallocData * sizeof(int)); } tileDistribution = new int[Config->PreallocData * Config->PreallocData]; memset(tileDistribution, 0, Config->PreallocData * Config->PreallocData * sizeof(int)); return(0); } int caldgemm::PreallocateFree() { for (int l = 0;l < nDevices;l++) { delete[] buffer_pointers_A[l]; delete[] buffer_pointers_B[l]; } delete[] tileDistribution; return(0); } void caldgemm::SetNumberDevices(int n) { nDevices = n; if (nDevices <= 0) nDevices = 1; if (nDevices > nDevicesInitialized) nDevices = nDevicesInitialized; } int caldgemm::RunAsyncSingleTileDGEMM(const double* A, const double* B, double* C, double alpha, double beta, size_t m, size_t k, size_t n, size_t Apitch, size_t Bpitch, size_t Cpitch, bool orderColMajor, bool TransA, bool TransB) { fprintf(STD_OUT, "Async Queue not supported by backend\n"); return(1); } int caldgemm::RunAsyncSingleTileDTRSM(const CBLAS_ORDER Order, const CBLAS_SIDE Side, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag, const size_t M, const size_t N, const double alpha, const double *A, const size_t lda, double *B, const size_t ldb) { fprintf(STD_OUT, "Async Queue not supported by backend\n"); return(1); } int caldgemm::RunCALDGEMMMain(int parallelDevice) { const size_t mb = (gpu_m + Config->Height - 1) / Config->Height; const size_t nb = (gpu_n + Config->Height - 1) / Config->Height; const size_t nBlocks = mb * nb; //Check for double == 1.0 is unsafe and causes compiler warning const unsigned long long int double_one = 0x3FF0000000000000; //1.0 in double #if defined(CALDGEMM_44) && !defined(CALDGEMM_USE_MEMEXPORT) const unsigned long long int double_minus_one = 0xBFF0000000000000; const int kernel_num = Config->ForceKernelVariant != -1 ? Config->ForceKernelVariant : (((Config->Width == BufferWidth && reinterpret_cast<unsigned long long int &>(reinterpret_cast<char &>(Beta)) == double_one && reinterpret_cast<unsigned long long int &>(reinterpret_cast<char &>(Alpha)) == double_minus_one) ? 2 : (reinterpret_cast<unsigned long long int &>(reinterpret_cast<char &>(Alpha)) == double_one))); #else const int kernel_num = Config->ForceKernelVariant != -1 ? Config->ForceKernelVariant : ((reinterpret_cast<unsigned long long int &>(Alpha) == double_one)); #endif if ((Config->Debug) && Config->UseGPU) fprintf(STD_OUT, "Using Kernel %d (alpha=0x%llX (%2.3f), width = %lld)\n", kernel_num, (reinterpret_cast<long long int &>(Alpha)), Alpha, (long long int) Config->Width); int oldj[max_devices]; int j[max_devices]; int iMergeThread[max_devices]; size_t blockm = 0, blockn = 0; unsigned long long int lastk[max_devices]; size_t nextk = 0; size_t next_device_k[max_devices]; int ImprovedSchedPhase1 = Config->ImprovedScheduler; int forcePreparation[max_devices]; int myUseDevice = 0; int myNDevices; int myDevices[max_devices] = {0}; if (parallelDevice == -1) { myNDevices = nDevices; for (int i = 0;i < nDevices;i++) myDevices[i] = i; } else if (matrix_n >= Config->GroupParallelDMA) { myNDevices = 1; myDevices[0] = parallelDevice; } else { myNDevices = 0; for (int i = 0;i < nDevices;i++) { if (Config->AllocMapping[i] == Config->DMAMapping[parallelDevice]) myDevices[myNDevices++] = i; } if (myNDevices == 0) return(0); } int use_device = myDevices[myUseDevice]; for (int tl = 0;tl < myNDevices;tl++) { int l = myDevices[tl]; next_device_k[l] = (!Config->ImprovedScheduler || first_device_k[l] == -1) ? 0 : first_device_k[l]; j[l] = 0; iMergeThread[l] = 0; lastk[l] = -1; forcePreparation[l] = 0; if (!Config->PreallocData) { buffer_pointers_A[l] = new int[mb]; buffer_pointers_B[l] = new int[nb]; } for (size_t ll = 0;ll < mb;ll++) buffer_pointers_A[l][ll] = -1; for (size_t ll = 0;ll < nb;ll++) buffer_pointers_B[l][ll] = -1; } bool cpu_k_barrier_hit = false; if (gpu_n && gpu_m) { int currentPinning = Config->PinMainThread; #ifdef CALDGEMM_LOOP_DETECTION int loop_detect = -1, loop_detect2 = -1; #endif for (size_t k = 0;k < nBlocks + 2 * myNDevices;k++) { restartkloop: //fprintf(STD_OUT, "!!!!! k %lld nd k %lld nextk %lld\n", (long long int) k, (long long int) next_device_k[use_device], (long long int) nextk); if (Config->ImprovedScheduler && !ImprovedSchedPhase1 && tileDistribution[next_device_k[use_device]] < 0) next_device_k[use_device] = 0; if (next_device_k[use_device] != 0) k = next_device_k[use_device]; else if (nextk && nextk >= k) k = nextk + 1; if (next_device_k[use_device] >= nBlocks) next_device_k[use_device] = 0; if (k > nextk) nextk = k; if (k < nBlocks) { if (ImprovedSchedPhase1) { while (k < nBlocks && tileDistribution[k] != use_device) { if (Config->Debug) fprintf(STD_OUT, "Skipping tile %lld (m=%lld n=%lld) for device %d, will be processed by device %d\n", (long long int) k, (long long int) blockm, (long long int) blockn, use_device, tileDistribution[k]); k++; } if (k == nBlocks && parallelDevice == -1 && (Config->DynamicSched || (signed) nBlocks < 2 * nDevices)) goto endimprovedphase; if (k >= nBlocks) { next_device_k[use_device] = 0; if(!((obuffercount > 1) ? ((signed) lastk[use_device] != -1) : (k < nBlocks))) break; } } #ifdef CALDGEMM_LOOP_DETECTION if (loop_detect2 == (signed) k) { fprintf(STD_OUT, "SCHEDULING ERROR A: Loop Detected, device = %d, k = %lld, next_device_k = %lld, nextk = %lld, ImprovedSched = %d, Phase1 = %d\n", use_device, (long long int) k, (long long int) next_device_k[use_device], (long long int) nextk, (int) Config->ImprovedScheduler, (int) ImprovedSchedPhase1); exit(1); } loop_detect2 = k; #endif } if (k < nBlocks) { if (Config->ImprovedScheduler) { if (k >= nBlocks || tileDistribution[k] < 0) { if (Config->Debug) { DGEMM_getblocks(k, blockm, blockn); fprintf(STD_OUT, "Tile %lld (m=%lld n=%lld) already processed, skipping\n", (long long int) k, (long long int) blockm, (long long int) blockn); } #ifdef CALDGEMM_LOOP_DETECTION if (loop_detect == (signed) k) { fprintf(STD_OUT, "SCHEDULING ERROR B: Loop Detected, k = %lld, next_device_k = %lld, nextk = %lld, ImprovedSched = %d, Phase1 = %d\n", (long long int) k, (long long int) next_device_k[use_device], (long long int) nextk, (int) Config->ImprovedScheduler, (int) ImprovedSchedPhase1); exit(1); } loop_detect = k; #endif next_device_k[use_device] = 0; continue; } } #ifdef CALDGEMM_LOOP_DETECTION loop_detect = loop_detect2 = -1; #endif DGEMM_getblocks(k, blockm, blockn); if (cParam.dynamic_run) { if (DGEMM_favor_m) { if (blockm * Config->Height >= gpu_m - cParam.dynamic_run && blockn * Config->Height >= gpu_n - cParam.dynamic_size) { if (Config->Debug) fprintf(STD_OUT, "GPU skipping k = %lld (m=%lld n=%lld) (Dynamic Run 2nd Phase)\n", (long long int) k, (long long int) blockm, (long long int) blockn); next_device_k[use_device] = 0; continue; } } else { if (blockn * Config->Height >= gpu_n - cParam.dynamic_run && blockm * Config->Height >= gpu_m - cParam.dynamic_size) { if (Config->Debug) fprintf(STD_OUT, "GPU skipping k = %lld (m=%lld n=%lld)(Dynamic Run 2nd Phase)\n", (long long int) k, (long long int) blockm, (long long int) blockn); next_device_k[use_device] = 0; continue; } } } if (Config->MultiThread) pthread_mutex_lock(&scheduleMutex); if ((signed) k < cpu_k_barrier) { if ((signed int) k > (signed int) gpu_k_barrier) { gpu_k_barrier = k; } } else { if (Config->Debug) fprintf(STD_OUT, "gpu_k %lld (m=%lld n=%lld) reached cpu_k_barrier %lld, skipping remaining k (Dynamic Run 3rd Phase)\n", (long long int) k, (long long int) blockm, (long long int) blockn, (long long int) cpu_k_barrier); k = nBlocks; if (nextk < nBlocks) nextk = nBlocks; next_device_k[use_device] = 0; cpu_k_barrier_hit = true; } if (Config->MultiThread) pthread_mutex_unlock(&scheduleMutex); } if (ImprovedSchedPhase1 && k >= nBlocks && parallelDevice == -1 && (Config->DynamicSched || (signed) nBlocks < 2 * nDevices)) { endimprovedphase: if (Config->Debug) fprintf(STD_OUT, "First improved scheduling phase ended\n"); ImprovedSchedPhase1 = 0; k = nextk = 0; for (int l = 0;l < nDevices;l++) { next_device_k[l] = 0; forcePreparation[l] = 1; } goto restartkloop; } if (Config->RepinMainThreadAlways && currentPinning != Config->AllocMapping[use_device]) { sched_setaffinity_set_core(Config->AllocMapping[use_device] + Config->CPUCoreOffset); if (Config->Debug) fprintf(STD_OUT, "Repinning to %d\n", Config->AllocMapping[use_device]); currentPinning = Config->AllocMapping[use_device]; } if (k < nBlocks) { if (Config->Debug) fprintf(STD_OUT, "Iteration k = %lld, m = %lld, n = %lld (device %d obuffer %d)\n", (long long int) k, (long long int) blockm, (long long int) blockn, use_device, j[use_device]); if (Config->MultiThreadDivide && parallelDevice == -1 && Config->GPUMapping[use_device] != Config->PinMainThread && UseInputPthreads() && DGEMMTasks[use_device].thread_running) { DGEMMTasks[use_device].thread_running = 0; if (Config->Debug) fprintf(STD_OUT, "Waiting for divide thread for device %d (k=%lld lastk = %lld j=%d)\n", use_device, (long long int) k, lastk[use_device], oldj[use_device]); int tmpval = DGEMMTasks[use_device].mutex_finished.Trylock(); if (tmpval == EBUSY) { int tmp_device = *(DGEMMTasks[use_device].next_device); if (tmp_device != use_device && DGEMMTasks[tmp_device].thread_running == 0) { if (Config->Debug) fprintf(STD_OUT, "Divide thread waiting for wrong device, skipping device %d\n", tmp_device); DGEMMTasks[tmp_device].skip_device_to = use_device; DGEMMTasks[tmp_device].mutex_start.Unlock(); } DGEMMTasks[use_device].mutex_finished.Lock(); } else if (tmpval) fprintf(STD_OUT, "ERROR locking mutex_finished: %s - %d\n", __FILE__, __LINE__); if (Config->Debug) fprintf(STD_OUT, "Main thread: Divide thread for device %d finished\n", use_device); } DGEMMPrepareAndExecuteTask& Task = DGEMMTasks[use_device]; Task.PrepareTasks[0].j = Task.PrepareTasks[1].j = -1; Task.kernel_num = kernel_num; Task.k = k; Task.j = j[use_device]; if (next_device_k[use_device] == 0 || (signed) lastk[use_device] == -1 || obuffercount == 1 || Config->AsyncDMA == false || forcePreparation[use_device]) { Task.PrepareTasks[0].k = k; Task.PrepareTasks[0].j = j[use_device]; if (Config->ImprovedScheduler && !ImprovedSchedPhase1) { if ((size_t) buffersMajor[use_device] != (DGEMM_favor_m ? blockm : blockn)) { if (Config->Debug) fprintf(STD_OUT, "Resetting favored directions buffers for device %d\n", use_device); buffersMajor[use_device] = -1; } } forcePreparation[use_device] = 0; } if (obuffercount > 1 && (signed) lastk[use_device] != -1 && Config->AsyncDMA && k + (myNDevices - myUseDevice - 1) % myNDevices + 1 < nBlocks && cpu_k_barrier_hit == false) { if (ImprovedSchedPhase1) nextk = k + 1; else nextk++; size_t nextblockm, nextblockn; DGEMM_getblocks(nextk, nextblockm, nextblockn); if (cParam.dynamic_run || Config->ImprovedScheduler) { while ( nextk < nBlocks && ( (cParam.dynamic_run && (DGEMM_favor_m ? (nextblockm * Config->Height >= gpu_m - cParam.dynamic_run && nextblockn * Config->Height >= gpu_n - cParam.dynamic_size) : (nextblockn * Config->Height >= gpu_n - cParam.dynamic_run && nextblockm * Config->Height >= gpu_m - cParam.dynamic_size))) || (Config->ImprovedScheduler && tileDistribution[nextk] < 0) || (ImprovedSchedPhase1 && tileDistribution[nextk] != use_device) ) ) { nextk++; DGEMM_getblocks(nextk, nextblockm, nextblockn); } } if ((signed) nextk < cpu_k_barrier) { Task.PrepareTasks[1].k = nextk; Task.PrepareTasks[1].j = (j[use_device] + 1) % obuffercount; } next_device_k[use_device] = nextk; } else { if (ImprovedSchedPhase1) { next_device_k[use_device] = k + 1; forcePreparation[use_device] = 1; } else { next_device_k[use_device] = 0; } } if (Config->ImprovedScheduler) tileDistribution[k] = -1; if (Config->MultiThreadDivide && parallelDevice == -1 && Config->GPUMapping[use_device] != Config->PinMainThread && UseInputPthreads() && cpu_k_barrier_hit == false) { if (Config->Debug) fprintf(STD_OUT, "Starting PrepareAndExecute task on divide thread for device %d (k = %lld)\n", use_device, (long long int) k); DGEMMTasks[use_device].mutex_start.Unlock(); DGEMMTasks[use_device].thread_running = 1; } else { #ifdef CALDGEMM_DIVIDE_STATIC_BUFFER double* __restrict__ tmpBuffer = divide_tmpBuffer; #endif if (DGEMMPrepareAndExecute(Task CALDGEMM_DIVBUFB)) return(1); } } if (obuffercount == 1) { oldj[use_device] = j[use_device]; lastk[use_device] = k; } if ((obuffercount > 1) ? ((signed) lastk[use_device] != -1) : (k < nBlocks)) { if (nBlocks <= k && (signed) lastk[use_device] < cpu_k_barrier && Config->MultiThreadDivide && parallelDevice == -1 && Config->GPUMapping[use_device] != Config->PinMainThread && UseInputPthreads() && DGEMMTasks[use_device].thread_running) { DGEMMTasks[use_device].thread_running = 0; if (Config->Debug) fprintf(STD_OUT, "Waiting for divide thread for device %d (late phase, k=%lld lastk = %lld j=%d)\n", use_device, (long long int) k, lastk[use_device], oldj[use_device]); int tmpval = DGEMMTasks[use_device].mutex_finished.Trylock(); if (tmpval == EBUSY) { int tmp_device = *(DGEMMTasks[use_device].next_device); if (tmp_device != use_device && DGEMMTasks[tmp_device].thread_running == 0) { if (Config->Debug) fprintf(STD_OUT, "Divide thread waiting for wrong device (late phase), skipping device %d\n", tmp_device); DGEMMTasks[tmp_device].skip_device_to = use_device; DGEMMTasks[tmp_device].mutex_start.Unlock(); } DGEMMTasks[use_device].mutex_finished.Lock(); } else if (tmpval) fprintf(STD_OUT, "ERROR trylocking mutex_finished: %s - %d\n", __FILE__, __LINE__); } size_t lastm, lastn; DGEMM_getblocks(lastk[use_device], lastm, lastn); int must_lock = 0; if (Config->ThreadSaveDriver != 1) { if (parallelDevice >= 0) { must_lock = 1; } else if (Config->MultiThreadDivide) for (int ii = 0;ii < nDevices;ii++) { if (Config->GPUMapping[ii] != Config->PinMainThread) { must_lock = 1; break; } } } if ((signed long int) lastk[use_device] != -1 && lastk[use_device] < nBlocks) { while (DGEMMPrepareTaskEventReady[use_device][oldj[use_device]] == false); DGEMMPrepareTaskEventReady[use_device][oldj[use_device]] = false; if (WaitForEvent(oldj[use_device], use_device, must_lock)) return(1); if (Config->Debug && Config->GPU_C == 0) fprintf(STD_OUT, "Processing Output (Iteration %lld) for device %d tile %lld (m = %lld, n = %lld)\n", (long long int) k, use_device, (long long int) lastk[use_device], (long long int) lastm, (long long int) lastn); if (Config->UseDMAFetchQueue >= matrix_n && Config->DstMemory == 'g') { if (CheckDMAQueue(use_device, oldj[use_device])) return(1); } else if (Config->ImplicitDriverSync == 0 && Config->DstMemory == 'g') { if (FetchResult(use_device, oldj[use_device], lastm, lastn, Config->MultiThread && UseMutexPerDevice())) {fprintf(STD_OUT, "Error copying from GPU\n");return(1);} if (WaitForEvent(oldj[use_device], use_device)) return(1); } } if (Config->VerboseTiming) Timers.CounterMerge.Start(); if (k == nBlocks + 2 * myNDevices - 1 || Config->MultiThread == false || UseOutputPthreads() == 0) { if (lastk[use_device] < nBlocks) { if (Config->Debug && Config->GPU_C == 0) fprintf(STD_OUT, "\tMerging buffer (device %d, obuffer %d, k = %lld, main thread)\n", use_device, oldj[use_device], (long long int) lastk[use_device]); if (RunMergeBuffers(C + lastn * Config->Height + lastm * C_pitch * Config->Height, use_device, oldj[use_device], (lastn == gpu_n / Config->Height) ? (gpu_n % Config->Height) : Config->Height, (lastm == gpu_m / Config->Height) ? (gpu_m % Config->Height) : Config->Height, BufferHeight, BufferHeight, C_pitch)) {fprintf(STD_OUT, "Error merging\n"); return(1);} if (!Config->SimpleGPUQueuing) CheckAlternateTilesRemaining(lastm); if (Config->Debug) fprintf(STD_OUT, "Main thread unlocking obuffer mutex device %d obuffer %d\n", use_device, oldj[use_device]); if (Config->MultiThread && UseOutputPthreads()) obufferMutex[use_device][oldj[use_device]].Unlock(); } if (Config->MultiThread && UseOutputPthreads()) { for (int l = 0;l < obuffercount;l++) { for (int tll = 0;tll < myNDevices;tll++) { int ll = myDevices[tll]; if ((ll != use_device || l != oldj[ll]) && (signed) lastk[ll] != -1) { if (Config->Debug) fprintf(STD_OUT, "Waiting to finish merge process for device %d obuffer %d\n", ll, l); obufferMutex[ll][l].Lock(); obufferMutex[ll][l].Unlock(); } } } } } else if (lastk[use_device] < nBlocks) { if (Config->AsyncTiming) { Timers.ATime.Reset(); Timers.ATime.Start(); } mParam[use_device][iMergeThread[use_device]].mergeThreadMutex[1].Lock(); if (Config->AsyncTiming) { Timers.ATime.Stop(); if ((!Config->NoPerformanceWarnings && Timers.ATime.GetElapsedTime() > 0.001) || Config->Debug) fprintf(STD_OUT, "\t\tWARNING: Wait Time for merge thread: %1.5f\n", Timers.ATime.GetElapsedTime()); } if (Config->Debug) fprintf(STD_OUT, "\t\tUnlocking outputthread mutex %d to process device %d obuffer %d\n", iMergeThread[use_device], use_device, oldj[use_device]); mParam[use_device][iMergeThread[use_device]].nContext = oldj[use_device]; mParam[use_device][iMergeThread[use_device]].dst = C + (lastn * Config->Height + lastm * C_pitch * Config->Height); mParam[use_device][iMergeThread[use_device]].k = lastk[use_device]; mParam[use_device][iMergeThread[use_device]].mergeThreadMutex[0].Unlock(); iMergeThread[use_device] = (iMergeThread[use_device] + 1) % outputthreads; } if (Config->VerboseTiming) Timers.CounterMerge.Stop(); } oldj[use_device] = j[use_device]; j[use_device] = (j[use_device] + 1) % obuffercount; lastk[use_device] = k; if (Config->MultiThread) { myUseDevice = (myUseDevice + 1) % myNDevices; use_device = myDevices[myUseDevice]; } } if (currentPinning != Config->PinMainThread) { sched_setaffinity(0, sizeof(gpumask), &gpumask); } } if (Config->MultiThreadDivide && parallelDevice == -1 && UseInputPthreads()) { for (int l = 0;l < divideThreads;l++) { if (dParam[l].curDevice != dParam[l].firstDevice) { dParam[l].reset = 1; DGEMMTasks[dParam[l].curDevice].mutex_start.Unlock(); DGEMMTasks[dParam[l].firstDevice].mutex_finished.Lock(); } } } if (Config->PreallocData == 0) { for (int tl = 0;tl < myNDevices;tl++) { int l = myDevices[tl]; delete[] buffer_pointers_A[l]; delete[] buffer_pointers_B[l]; } } return(0); } int caldgemm::RunCALDGEMM(double* a, double* b, double* c, double alpha, double beta, size_t tmp_m, size_t tmp_k, size_t tmp_n, size_t Apitch, size_t Bpitch, size_t Cpitch, bool orderColMajor, bool TransA, bool TransB, int ExecuteLinpackCallbacks, int pipelined) { if (!caldgemm_initialized) { fprintf(STD_OUT, "Caldgemm not initialized, aborting DGEMM run\n"); return(1); } #ifdef DEBUG_MSG_TIMED if (Config->Debug) printelapsedtime("Resetting Timer\n"); #endif if (tmp_m == 0 || tmp_k == 0 || tmp_n == 0) { if (Config->LinpackSwapN != NULL) { HPL_CALDGEMM_gpu_height = 0; Config->linpack_swap_function(); Config->LinpackSwapN = 0; } if (ExecuteLinpackCallbacks) { Timers.LinpackTimer1.Start(); Config->linpack_factorize_function(); Timers.LinpackTimer1.Stop(); if (Config->LinpackNodes > 1) { Timers.LinpackTimer2.Start(); Config->linpack_broadcast_function(); Timers.LinpackTimer2.Stop(); } } return(0); //Do Nothing } bool forceCPU = false; bool forceReinit = false; double GPURatio; int old_outputthreads = outputthreads; size_t MaxGpuM, MaxGpuN; //Maximal values of m and n that can be given to GPU, This is below m,n if ExecuteLinpackCallback = true A = a; B = b; C = c; Alpha = alpha; Beta = beta; matrix_m = tmp_m; matrix_n = tmp_n; if ((signed) tmp_k != -1) Config->Width = tmp_k; A_pitch = ((signed) Apitch != -1) ? Apitch : Config->Width; B_pitch = ((signed) Bpitch != -1) ? Bpitch : matrix_n; C_pitch = ((signed) Cpitch != -1) ? Cpitch : matrix_n; ResetTimers(); if (orderColMajor) { double* tmpd; size_t tmpi; bool tmpt; tmpd = A; A = B; B = tmpd; tmpi = matrix_m; matrix_m = matrix_n; matrix_n = tmpi; tmpi = A_pitch; A_pitch = B_pitch; B_pitch = tmpi; tmpt = TransA;TransA = TransB;TransB = tmpt; } if (!Config->Quiet) fprintf(STD_OUT, "Starting DGEMM Run m=%lld k=%lld n=%lld Alpha=%f Beta=%f LDA=0x%lx LDB=0x%lx LDC=0x%lx At=%d Bt=%d ColMajor=%d (A=0x%llx, B=0x%llx, C=0x%llx, (C-A=%lld, (C-B)/w=%lld), Linpack=%d)\n", (long long int) matrix_m, (long long int) Config->Width, (long long int) matrix_n, Alpha, Beta, A_pitch, B_pitch, C_pitch, (int) (TransA), (int) (TransB), (int) (orderColMajor), (long long int) A, (long long int) B, (long long int) C, (long long int) ((size_t) C - (size_t) A) / sizeof(double), (long long int) ((size_t) C - (size_t) B) / sizeof(double) / Config->Width, (int) ExecuteLinpackCallbacks); TransposeA = TransA; TransposeB = TransB; ExecLinpack = ExecuteLinpackCallbacks; pipelinedRun = pipelined; orig_m = matrix_m; orig_n = matrix_n; orig_a = A; orig_b = B; orig_c = C; if (Config->Verify) { if (Config->PipelinedOperation) { fprintf(STD_OUT, "PipelinedOperation cannot be used in combination with Verify!\n"); return(1); } D = new double[(size_t) matrix_m * (size_t) C_pitch]; if (D == NULL) { fprintf(STD_OUT, "Memory allocation error\n"); return(1); } memcpy(D, C, matrix_m * C_pitch * sizeof(double)); } if (Config->DumpMatrix) DumpMatrix(A, B, C, Alpha, Beta, matrix_m, Config->Width, matrix_n, A_pitch, B_pitch, C_pitch); Timers.System.Start(); if (ExecLinpack >= 2 && Config->AlternateLookahead <= matrix_n) { if (matrix_m < Config->Width) { MaxGpuM = 0; } else { MaxGpuM = matrix_m - Config->Width; } } else { MaxGpuM = matrix_m; } MaxGpuN = matrix_n; #ifndef TESTMODE //Check if the GPU can/shall process the required dgemm task if (Config->Iterations > 1 || !Config->UseCPU); else if (Config->Width % 8 || Config->Width < 256) forceCPU = true; else if (MaxGpuM < Config->Height / 2 || MaxGpuN < Config->Height / 2) forceCPU = true; #ifdef _WIN32 else if (Alpha == 0.) forceCPU = true; #else else if (__fpclassify(Alpha) == FP_ZERO) forceCPU = true; #endif else if (((size_t) A) & (vcpysize - 1) || ((size_t) B) & (vcpysize - 1) || ((size_t) C) & (vcpysize - 1) || A_pitch & (vcpysize / sizeof(double) - 1) || B_pitch & (vcpysize / sizeof(double) - 1) || C_pitch & (vcpysize / sizeof(double) - 1)) { fprintf(STD_OUT, "Input addresses not aligned correctly: A 0x%llX B 0x%llX C 0x%llX Pitch 0x%llX 0x%llX 0x%llX\n", (long long int) A, (long long int) B, (long long int) C, (long long int) A_pitch, (long long int) B_pitch, (long long int) C_pitch); forceCPU = true; } #endif if (Config->AutoHeight) { #ifdef CALDGEMM_CUSTOM_AUTO_HEIGHT #include CALDGEMM_CUSTOM_AUTO_HEIGHT #else if (CaldgemmCustomAutoHeight(MaxGpuM, MaxGpuN, nDevices) == 0) { if (ExecLinpack >= 2 && !Config->SmallTiles) { if (MaxGpuM < 1024 || MaxGpuN < 1024) { Config->Height = 512; } else if (MaxGpuM < 2048 || MaxGpuN < 2048 || (MaxGpuM * MaxGpuN < 13 * 14 * 1024 * 1024 && mymax(MaxGpuN, MaxGpuM) % 2048 >= 1024) || (MaxGpuM * MaxGpuN < 16 * 1024 * 1024)) { Config->Height = 1024; } else if (MaxGpuM < 3072 || MaxGpuN < 3072 || (MaxGpuM * MaxGpuN < 20 * 21 * 1024 * 1024 && mymax(MaxGpuN, MaxGpuM) % 3072 >= 2048) || (MaxGpuM * MaxGpuN < 120 * 1024 * 1024)) { Config->Height = 2048; } else if (MaxGpuM < 4096 || MaxGpuN < 4096 || MaxGpuM * MaxGpuN < 27 * 28 * 1024 * 1024) { Config->Height = 3072; } else { Config->Height = 4096; } } else { if (MaxGpuM < 1024 || MaxGpuN < 1024) { Config->Height = 512; } else if (MaxGpuM < 2048 || MaxGpuN < 2048 || MaxGpuM * MaxGpuN < (size_t) nDevices * 16 * 1024 * 1024) { Config->Height = 1024; } else if (MaxGpuM < 3072 || MaxGpuN < 3072 || MaxGpuM * MaxGpuN < (size_t) nDevices * 120 * 1024 * 1024) { Config->Height = 2048; } else if (MaxGpuM < 4096 || MaxGpuN < 4096 || MaxGpuM * MaxGpuN < (size_t) nDevices * 40 * 40 * 1024 * 1024) { Config->Height = 3072; } else { Config->Height = 4096; } while (Config->SlowCPU && !Config->SmallTiles && Config->Height > 1024 && (MaxGpuM % Config->Height > 1024 || MaxGpuN % Config->Height > 1024)) Config->Height -= 1024; } } #endif if (Config->Height > BufferHeight) Config->Height = BufferHeight; if (Config->Height % KernelSettings.min_tile_size) { Config->Height = Config->Height > (size_t) KernelSettings.min_tile_size ? (Config->Height - Config->Height % KernelSettings.min_tile_size) : KernelSettings.min_tile_size; } if (Config->Debug) fprintf(STD_OUT, "Using Height %lld of max %lld\n", (long long int) Config->Height, (long long int) BufferHeight); } HPL_CALDGEMM_gpu_height = Config->Height; if (Config->UseGPU && (Config->Width > BufferWidth || Config->Height > BufferHeight)) forceReinit = true; if (Config->UseCPU) { if (Config->UseGPU == false || (forceReinit && (long long int) MaxGpuM * (long long int) MaxGpuN * (long long int) Config->Width < (long long int) 24 * 1024 * 1024 * 1024) || (Config->Width < 1024 && Config->Height < 1024) || (ExecLinpack && matrix_m < Config->Width)) forceCPU = true; } AlternateLookaheadTilesFull = 0; if (forceCPU) { if (Config->Debug) fprintf(STD_OUT, "Running CPU only DGEMM\n"); if (Config->ShowThreadPinning) printThreadPinning(); if (Config->LinpackSwapN != NULL) { HPL_CALDGEMM_gpu_height = 0; Config->linpack_swap_function(); } if (ExecLinpack) { size_t usewidth = Config->Width > matrix_m ? matrix_m : Config->Width; Timers.CPUTimer.Start(); cblas_dgemm(CblasRowMajor, TransposeA ? CblasTrans : CblasNoTrans, TransposeB ? CblasTrans : CblasNoTrans, usewidth, matrix_n, Config->Width, Alpha, A, A_pitch, B, B_pitch, Beta, C, C_pitch); Timers.CPUTimer.Stop(); if (Config->Debug) fprintf(STD_OUT, "DGEMM was running on CPU only, executing linpack callback functions\n"); Timers.LinpackTimer1.Start(); Config->linpack_factorize_function(); Timers.LinpackTimer1.Stop(); if (Config->LinpackNodes > 1) { Timers.LinpackTimer2.Start(); Config->linpack_broadcast_function(); Timers.LinpackTimer2.Stop(); } matrix_m -= usewidth; A += usewidth * (TransposeA ? 1 : A_pitch); C += usewidth * (C_pitch); } Timers.CPUTimer.Start(); goto_set_num_threads(conf_numprocs); if (matrix_m) cblas_dgemm(CblasRowMajor, TransposeA ? CblasTrans : CblasNoTrans, TransposeB ? CblasTrans : CblasNoTrans, matrix_m, matrix_n, Config->Width, Alpha, A, A_pitch, B, B_pitch, Beta, C, C_pitch); Timers.CPUTimer.Stop(); CPUOnlyRun = true; } else { CPUOnlyRun = false; if (ExecLinpack) { outputthreads = mymin(CALDGEMM_OUTPUT_THREADS_SLOW, outputthreads + CALDGEMM_EXTRA_OUTPUT_THREADS_LINPACK); } if (Config->SpawnGPUThread == -2) { if (Config->Debug) fprintf(STD_OUT, "Caldgemm Main Thread, setting CPU mask %X\n", getcpumask(&gpumask)); sched_setaffinity(0, sizeof(cpu_set_t), &gpumask); } if (forceReinit) { fprintf(STD_OUT, "WARNING: Reinit for increased buffer width / height\n"); fprintf(STD_OUT, "Reinit not yet implemented correctly, exiting"); exit(1); if (ReinitDevices()) return(1); } InitConstantData(alpha); if (Config->SlowCPU || matrix_n < Config->MinimizeCPUPart || (Config->MinimizeCPUDuringFact && ExecLinpack >= 2) || Config->GPURatio >= 1.0) { GPURatio = 1.0; } else { if (Config->GPURatio <= -0.999) //Auto determination (code must be adapted for each CPU / GPU config) { //Optimal ratio found using combined runs if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 5000000000) GPURatio = 0.75; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 600000000) GPURatio = 0.74; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 500000000) GPURatio = 0.73; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 200000000) GPURatio = 0.73; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 100000000) GPURatio = 0.72; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 7000000) GPURatio = 0.70; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 5000000) GPURatio = 0.67; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 2500000) GPURatio = 0.60; else if ((long long int) MaxGpuM * (long long int) MaxGpuN > (long long int) 1000000) GPURatio = 0.55; else GPURatio = 0.50; if (Config->Width < 1024) GPURatio *= (double) Config->Width / (double) 1024; if (Config->Height < 1024) GPURatio *= (double) Config->Height / (double) 1024 * (double) Config->Height / (double) 1024; const int require_threads = outputthreads * nDevices + 1 + (ExecLinpack && Config->LinpackNodes > 1); const double CPUscale = (double) (conf_cpufreq * mymax(conf_numprocs - require_threads, 1)) / (double) (2100 * (24 - require_threads)); const double GPUscale = (double) nDevices * conf_gpushaders * conf_gpufreq / (double) (850 * 20 * 64); if (Config->Debug) fprintf(STD_OUT, "GPU Curve Ration: %1.3f, CPUScale %1.3f, GPUScale %1.3f\n", GPURatio, CPUscale, GPUscale); GPURatio = GPUscale * GPURatio / (GPUscale * GPURatio + (1.0 - GPURatio) * CPUscale); if (Config->Debug) fprintf(STD_OUT, "GPURatio automatically set to %1.3f\n", GPURatio); if (GPURatio > 1.) GPURatio = 1.0; if ((matrix_n + 4) % 4096 < 8 && GPURatio > 0.5) GPURatio = 1. - 0.95 * (1. - GPURatio); } else { if (ExecLinpack > 1 && Config->GPURatioDuringFact > 0) GPURatio = Config->GPURatioDuringFact; else GPURatio = fabs(Config->GPURatio); } if (ExecLinpack && (Config->GPURatio < 0 || GPURatio < 0.99) && !Config->SlowCPU) { if (Config->GPURatio <= -0.99) //Auto determination { if (ExecLinpack > 1) GPURatio = 1.0 - (1.0 - GPURatio) * 0.80 * Config->Width / 1024; else GPURatio = 1.0 - (1.0 - GPURatio) * 0.90; if (GPURatio > 1.0) GPURatio = 1.0; } if (linpack_last_mn[ExecLinpack] > 0 && (((double) MaxGpuM * (double) MaxGpuN) - linpack_last_mn[ExecLinpack]) / linpack_last_mn[ExecLinpack] < 0.3 && linpackGPURatios[ExecLinpack] > 0.0001) { GPURatio = linpackGPURatios[ExecLinpack]; if (Config->Debug||1) fprintf(STD_OUT, "Taking GPU Ratio from table, entry %d, val %2.3f\n", ExecLinpack, 100 * GPURatio); } else { linpackGPURatios[ExecLinpack] = GPURatio; if (Config->Debug||1) fprintf(STD_OUT, "Initializing ratio table entry %d with %2.3f\n", ExecLinpack, 100 * GPURatio); } } if (Config->GPURatioMax > 0 && GPURatio > Config->GPURatioMax) GPURatio = Config->GPURatioMax;; if (Config->GPURatio < 0 && Config->GPURatio > -0.99) { double threshold = (ExecLinpack > 1 && Config->GPURatioDuringFact > 0.) ? Config->GPURatioDuringFact : -Config->GPURatio; if (GPURatio < threshold) GPURatio = threshold; } //if (Config->AlternateLookahead > matrix_n) GPURatio = 1. - (1. - GPURatio) * 0.88; } gpu_ratio_used = GPURatio; if (ExecLinpack >= 2 && Config->AlternateLookahead <= matrix_n) { matrix_m -= Config->Width; A += Config->Width * (TransposeA ? 1 : A_pitch); C += Config->Width * (C_pitch); HPL_CALDGEMM_gpu_height += Config->Width; } cParam.dynamic_run = 0; cParam.dynamic_run2 = 0; cParam.borders_done = false; SmallTileHeight = (Config->SmallTiles == 1 ? KernelSettings.min_tile_size : Config->Height); recalculate_ratio: if (Config->UseCPU == true && Config->UseGPU == true) { if ((DGEMM_split_m = ((Config->LinpackSwapN == NULL && (ExecLinpack == 0 || Config->AlternateLookahead <= matrix_n)) ? (matrix_m >= matrix_n) : 1))) { size_t virtualm = matrix_m + (matrix_n % SmallTileHeight) * matrix_m / matrix_n; if (ExecLinpack >= 2 && Config->AlternateLookahead <= matrix_n) virtualm += Config->Width * (Config->GPURatioLookaheadSizeMod + (float) matrix_m / matrix_n); gpu_m = GPURatio * (float) virtualm + (SmallTileHeight - 1); if (gpu_m > matrix_m) { if (Config->SmallTiles == 2 && SmallTileHeight > (size_t) KernelSettings.min_tile_size) { if (SmallTileHeight > 1024) SmallTileHeight = 1024; else SmallTileHeight = KernelSettings.min_tile_size; goto recalculate_ratio; } gpu_m = matrix_m; } gpu_m -= gpu_m % SmallTileHeight; cParam.cblas_size = matrix_m - gpu_m; gpu_n = matrix_n; gpu_n -= gpu_n % SmallTileHeight; if (Config->Debug) fprintf(STD_OUT, "Splitting: GPU: %lld x %lld, CPU: %lld x %lld, Tilesize %lld\n", (long long int) gpu_m, (long long int) gpu_n, (long long int) matrix_m - gpu_m, (long long int) gpu_n, (long long int) SmallTileHeight); } else { size_t virtualn = matrix_n + (matrix_m % SmallTileHeight) * matrix_n / matrix_m; if (ExecLinpack >= 2 && Config->AlternateLookahead <= matrix_n) virtualn += Config->Width * (Config->GPURatioLookaheadSizeMod + (float) matrix_n / matrix_m); gpu_n = GPURatio * (float) virtualn + (SmallTileHeight - 1); if (gpu_n > matrix_n) { if (Config->SmallTiles == 2 && SmallTileHeight > (size_t) KernelSettings.min_tile_size) { if (SmallTileHeight > 1024) SmallTileHeight = 1024; else SmallTileHeight = KernelSettings.min_tile_size; goto recalculate_ratio; } gpu_n = matrix_n; } gpu_n -= gpu_n % SmallTileHeight; cParam.cblas_size = matrix_n - gpu_n; gpu_m = matrix_m; gpu_m -= gpu_m % SmallTileHeight; if (Config->Debug) fprintf(STD_OUT, "Splitting: GPU: %lld x %lld, CPU: %lld x %lld, Tilesize %lld\n", (long long int) gpu_m, (long long int) gpu_n, (long long int) matrix_m, (long long int) matrix_n - gpu_n, (long long int) SmallTileHeight); } const size_t over_m = gpu_m % Config->Height, over_n = gpu_n % Config->Height; if (over_m < CALDGEMM_MIN_TILE_DIM2) gpu_m -= over_m; else { #ifdef CALDGEMM_CUSTOM_HEIGHT_MOD #define MOD_OVER over_m #define MOD_GPU gpu_m #include CALDGEMM_CUSTOM_HEIGHT_MOD #undef MOD_OVER #undef MOD_GPU #else CaldgemmCustomModHeight(over_m, gpu_m); #endif } if (over_n < CALDGEMM_MIN_TILE_DIM2) gpu_n -= over_n; else { #ifdef CALDGEMM_CUSTOM_HEIGHT_MOD #define MOD_OVER over_n #define MOD_GPU gpu_n #include CALDGEMM_CUSTOM_HEIGHT_MOD #undef MOD_OVER #undef MOD_GPU #else CaldgemmCustomModHeight(over_n, gpu_n); #endif } cParam.cblas_size = DGEMM_split_m ? (matrix_m - gpu_m) : (matrix_n - gpu_n); } else { if (warn_wrong_memory_allocation && (Config->GPU_C || Config->DstMemory == 'c')) { warn_wrong_memory_allocation = false; //Only warn once fprintf(STD_OUT, "WARNING, you are using GPU_C or '-o g' option, but apparently you did not use CALDGEMM memory allocation with gpu_accessible feature ('-_' is missing).\nYou must take care to allocate GPU accessible memory yourself, or this can lead to invalid memory accesses.\n"); } DGEMM_split_m = 0; if (matrix_n % SmallTileHeight || matrix_m % SmallTileHeight) { fprintf(STD_OUT, "Invalid matrix size for GPU only (%lld %% %lld = %lld, %lld %% %lld = %lld)\n", (long long int) matrix_n, (long long int) SmallTileHeight, (long long int) matrix_n % SmallTileHeight, (long long int) matrix_m, (long long int) SmallTileHeight, (long long int) matrix_m % SmallTileHeight); return(1); } if (ExecLinpack) { fprintf(STD_OUT, "Linpack callbacks in CALDGEMM are only possible with UseCPU = true!\n"); return(1); } gpu_n = matrix_n; gpu_m = matrix_m; } DGEMM_favor_m = (Config->LinpackSwapN == NULL && (ExecLinpack == 0 || Config->AlternateLookahead <= matrix_n)) ? (gpu_m >= gpu_n) : 1; if (!Config->Quiet) fprintf(STD_OUT, "Ratio %f - gpu_m %lld gpu_n %lld - Split %c Favor %c - Height %lld (/ %lld), Min Tiling %lld (%lld, %lld)\n", GPURatio, (long long int) gpu_m, (long long int) gpu_n, DGEMM_split_m ? 'm' : 'n', DGEMM_favor_m ? 'm' : 'n', (long long int) Config->Height, (long long int) BufferHeight, (long long int) SmallTileHeight, (long long int) (gpu_m % Config->Height), (long long int) (gpu_n % Config->Height)); if (Config->ShowThreadPinning) printThreadPinning(); const size_t mb = (gpu_m + Config->Height - 1) / Config->Height; const size_t nb = (gpu_n + Config->Height - 1) / Config->Height; const size_t nBlocks = mb * nb; cParam.cpu_k = nBlocks; cpu_k_barrier = nBlocks; gpu_k_barrier = -1; if (Config->UseCPU) { if (!Config->MultiThread) { cblas_wrapper_a(); } cParam.cblasMutex[1].Unlock(); } else if (Config->LinpackSwapN != NULL) { HPL_CALDGEMM_gpu_height = 0; Config->linpack_swap_function(); } if (Config->SpawnGPUThread != -2) { if (caldgemm_part_cpu()) return(1); } else { if (caldgemm_part_gpu()) return(1); } if (Config->UseCPU) { if (Config->Debug) fprintf(STD_OUT, "Waiting for CPU DGEMM to finish\n"); cParam.cblasMutex[0].Lock(); if (Config->MultiThread) { Timers.ATime.Stop(); cpu_wait_time = Timers.ATime.GetElapsedTime(); if (Config->DynamicSched && !Config->NoPerformanceWarnings && Timers.ATime.GetElapsedTime() >= 0.15 && cParam.cblas_size > 0) { fprintf(STD_OUT, "WARNING: CPU synchronisation took %2.4f sec\n", Timers.ATime.GetElapsedTime()); } else if (Config->Debug) { fprintf(STD_OUT, "CPU synchronisation took %2.4f sec\n", Timers.ATime.GetElapsedTime()); } } } } if (Config->LinpackSwapN != NULL) *Config->LinpackSwapN = 0; outputthreads = old_outputthreads; Timers.System.Stop(); if (Config->Debug) fprintf(STD_OUT, "DGEMM Run Complete\n"); if (finishData->running) { if (!Config->Quiet) fprintf(STD_OUT, "Waiting for previous pipelined DGEMM iteration to finish\n"); int retVal = FinishCALDGEMM(); if (retVal) return(retVal); } finishData->matrix_m = matrix_m; finishData->matrix_n = matrix_n; finishData->SmallTileHeight = SmallTileHeight; finishData->orig_m = orig_m; finishData->orig_n = orig_n; finishData->gpu_ratio_used = gpu_ratio_used; finishData->cpu_wait_time = cpu_wait_time; finishData->ExecLinpack = ExecLinpack; finishData->CPUOnlyRun = CPUOnlyRun; finishData->DGEMM_split_m = DGEMM_split_m; finishData->System = Timers.System.GetElapsedTime(); finishData->CPUTimer = Timers.CPUTimer.GetElapsedTime(); finishData->GPUTimer = Timers.GPUTimer.GetElapsedTime(); finishData->TotalCPUTimer = Timers.TotalCPUTimer.GetElapsedTime(); finishData->LinpackTimer1 = Timers.LinpackTimer1.GetElapsedTime(); finishData->LinpackTimer2 = Timers.LinpackTimer2.GetElapsedTime(); finishData->LinpackTimer3 = Timers.LinpackTimer3.GetElapsedTime(); finishData->BcastTimer = Timers.BcastTimer.GetElapsedTime(); finishData->divideA = Timers.divideA; finishData->divideB = Timers.divideB; finishData->divideC = Timers.divideC; finishData->device_kernel = Timers.device_kernel; finishData->cblas_size = cParam.cblas_size; finishData->dynamic_run = cParam.dynamic_run; finishData->dynamic_size = cParam.dynamic_size; finishData->cpu_k = cParam.cpu_k; finishData->dynamic_run2 = cParam.dynamic_run2; finishData->MidMarkerPos = Config->PipelinedMidMarker; FinishDataFill(); if (Config->PipelineDoubleBuffer) pipelineBuffer ^= 1; if (Config->PipelinedOperation && !CPUOnlyRun && pipelinedRun) { finishData->running = true; return(0); } else { finishData->running = false; return(FinishCALDGEMM(true)); } } int caldgemm::FinishDataInit() { finishData = new finishStruct; return(finishData == NULL); } void caldgemm::FinishDataFill(){} int caldgemm::FinishCALDGEMM(bool force) { if (!(force || finishData->running)) return(0); if (Config->PipelinedOperation) { int retVal = RunCALDGEMM_Finish(); finishData->running = false; if (retVal) return(retVal); } #ifdef TESTMODE print_submatrices(C, 12, 24, C_pitch, 1, 1, 1, 1); #endif if (!Config->NoPerformanceWarnings && Config->DynamicSched && Config->UseCPU && Config->UseGPU && !finishData->CPUOnlyRun && fabs(finishData->TotalCPUTimer - finishData->GPUTimer) > 1.0) { fprintf(STD_OUT, "WARNING: Bad GPU / CPU Splitting: GPU Time: %2.4f, CPU Time: %2.4f (m = %lld, n = %lld)\n", finishData->GPUTimer, finishData->TotalCPUTimer, (long long int) finishData->matrix_m, (long long int) finishData->matrix_n); } displayMatrixTiming("caldgemm"); if (Config->Verify) { A = orig_a; B = orig_b; C = orig_c; matrix_m = orig_m; matrix_n = orig_n; AnalyzeResults(); delete[] D; } if (finishData->ExecLinpack) { if (Config->GPURatioPenalties >= 2) { if (finishData->CPUTimer < 2.0) { finishData->gpu_ratio_used = 1. - Config->GPURatioPenaltyFactor * (1. - finishData->gpu_ratio_used); } if (finishData->ExecLinpack >= 2 && finishData->GPUTimer - finishData->LinpackTimer1 < 1.0) { finishData->gpu_ratio_used = 1. - Config->GPURatioPenaltyFactor * (1. - finishData->gpu_ratio_used); } } if (Config->GPURatioPenalties >= 1) { if (finishData->cpu_wait_time >= 0.05) { finishData->gpu_ratio_used = 1. - Config->GPURatioPenaltyFactor * (1. - finishData->gpu_ratio_used); } } const double tmpratio = finishData->cpu_wait_time > 0.15 ? 0.0 : 0.5; const double newratio = tmpratio * linpackGPURatios[finishData->ExecLinpack] + (1.0 - tmpratio) * finishData->gpu_ratio_used; if (Config->Debug) fprintf(STD_OUT, "updating ratio table entry %d (old: %2.3f, new: %2.3f, factor: %2.3f) => %2.3f\n", finishData->ExecLinpack, 100 * linpackGPURatios[finishData->ExecLinpack], 100 * finishData->gpu_ratio_used, tmpratio, 100 * newratio); linpackGPURatios[finishData->ExecLinpack] = newratio; linpackCPUDGEMMTime[finishData->ExecLinpack] = finishData->CPUTimer; linpackBcastTime[finishData->ExecLinpack] = finishData->LinpackTimer2; linpack_last_mn[finishData->ExecLinpack] = (double) finishData->orig_m * (double) finishData->orig_n; } return(0); } int caldgemm::RunCALDGEMM_Finish() {return(0);} int caldgemm::DGEMMPrepareAndExecute(caldgemm::DGEMMPrepareAndExecuteTask& Task CALDGEMM_DIVBUFA) { if (Config->MultiThread && UseMutexPerDevice()) pthread_mutex_lock(&device_mutex[Task.device]); if (Config->Debug) fprintf(STD_OUT, "DGEMMPrepareAndExecute device %d k1 %d j1 %d k2 %d j2 %d\n", Task.device, (int) Task.PrepareTasks[0].k, Task.PrepareTasks[0].j, (int) Task.PrepareTasks[1].k, Task.PrepareTasks[1].j); for (int l = 0;l < 2;l++) { if (Task.PrepareTasks[l].j != -1) { if (DGEMM_prepare(Task.PrepareTasks[l].k, Task.PrepareTasks[l].j, Task.device CALDGEMM_DIVBUFB)) return(1); } } if (Config->MultiThread && UseOutputPthreads()) { if (Config->Debug) fprintf(STD_OUT, "\tLocking obuffer mutex %d/%d\n", Task.device, Task.j); if (Config->AsyncTiming) { Timers.ATime.Reset(); Timers.ATime.Start(); } if (Config->MultiThread && UseMutexPerDevice()) pthread_mutex_unlock(&device_mutex[Task.device]); obufferMutex[Task.device][Task.j].Lock(); if (Config->MultiThread && UseMutexPerDevice()) pthread_mutex_lock(&device_mutex[Task.device]); if (Config->AsyncTiming) { Timers.ATime.Stop(); if ((!Config->NoPerformanceWarnings && Timers.ATime.GetElapsedTime() > 0.001) || Config->Debug) fprintf(STD_OUT, "\t\tWait Time for output buffer: %1.5f\n", Timers.ATime.GetElapsedTime()); } } size_t blockm, blockn; DGEMM_getblocks(Task.k, blockm, blockn); if (buffer_pointers_A[Task.device][blockm] < 0 || buffer_pointers_B[Task.device][blockn] < 0) { if (!Config->NoPerformanceWarnings) fprintf(STD_OUT, "WARNING, Buffer falsified by previous iteration, need to retransfer (ptr_a = %d, ptr_b = %d)\n", buffer_pointers_A[Task.device][blockm], buffer_pointers_B[Task.device][blockn]); if (DGEMM_prepare(Task.k, Task.j, Task.device CALDGEMM_DIVBUFB)) return(1); } if (ExecuteKernels(Task, blockm, blockn)) return(1); if (Config->SimpleGPUQueuing) CheckAlternateTilesRemaining(blockm); DGEMMPrepareTaskEventReady[Task.device][Task.j] = true; if (Config->MultiThread && UseMutexPerDevice()) pthread_mutex_unlock(&device_mutex[Task.device]); return(0); } void caldgemm::SetupBufferSizes() { if (Config->Height % KernelSettings.min_tile_size) { int new_tile_size = Config->Height > (size_t) KernelSettings.min_tile_size ? (Config->Height - Config->Height % KernelSettings.min_tile_size) : KernelSettings.min_tile_size; if (!Config->NoPerformanceWarnings) fprintf(STD_OUT, "Default buffer height %d does not fit tile size of %d, adjusting height to %d\n", (int) Config->Height, KernelSettings.min_tile_size, new_tile_size); Config->Height = new_tile_size; } if (Config->Width % KernelSettings.min_k) { int new_k = Config->Width > (size_t) KernelSettings.min_k ? (Config->Width - Config->Width % KernelSettings.min_k) : KernelSettings.min_k; if (!Config->NoPerformanceWarnings) fprintf(STD_OUT, "Default buffer width %d does not fit minimum k value of %d, adjusting width to %d\n", (int) Config->Width, KernelSettings.min_k, new_k); Config->Width = new_k; } BufferHeight = Config->Height; BufferWidth = Config->Width; } int caldgemm::ExitCALDGEMM() { if (!caldgemm_initialized) { fprintf(STD_OUT, "CALDGEMM not initialized, cannot uninitialize!\n"); return(1); } nDevices = nDevicesInitialized; if (Config->Debug) fprintf(STD_OUT, "Uninitializing CALDGEMM\n"); delete finishData; if (Config->PreallocData) if (PreallocateFree()) return(1); if (Config->UseGPU && ExitDevices()) return(1); if (Config->MultiThread && UseOutputPthreads()) { for (int num_device = 0;num_device < nDevices;num_device++) { for (int i = 0;i < (Config->OutputThreads == -1 ? max_outputthreads : Config->OutputThreads);i++) { if (Config->Debug) fprintf(STD_OUT, "Trying to terminate merge slave %d\n", i); mParam[num_device][i].terminate = true; mParam[num_device][i].mergeThreadMutex[1].Lock(); mParam[num_device][i].mergeThreadMutex[0].Unlock(); } } } ExitRuntime(); if (Config->UseCPU && Config->UseGPU) { if (Config->Debug) fprintf(STD_OUT, "Trying to terminate blas slave\n"); cParam.terminate = true; if (Config->MultiThread) { cParam.cblasMutex[1].Unlock(); if (Config->Debug) fprintf(STD_OUT, "Waiting for blas threads to terminate\n"); cParam.cblasMutex[0].Lock(); } for (int i = 0;i < 2;i++) cParam.cblasMutex[i].Unlock(); } if (Config->AlternateLookahead) { if (pthread_mutex_destroy(&tilesRemainingMutex)) fprintf(STD_OUT, "ERROR destroying tilesRemainingMutex: %s - %d\n", __FILE__, __LINE__); } if (Config->MultiThread) { if (Config->Debug) fprintf(STD_OUT, "Trying to terminate linpack slave\n"); linpackParameters.terminate = true; linpackParameters.linpackMutex[0].Unlock(); if (Config->Debug) fprintf(STD_OUT, "Waiting for linpack slave to terminate\n"); linpackParameters.linpackMutex[1].Lock(); for (int i = 0;i < 2;i++) linpackParameters.linpackMutex[i].Unlock(); if (UseOutputPthreads()) { if (Config->Debug) fprintf(STD_OUT, "Waiting for merge threads to terminate\n"); for (int i = 0;i < (Config->OutputThreads == -1 ? max_outputthreads : Config->OutputThreads);i++) { for (int num_device = 0;num_device < nDevices;num_device++) { mParam[num_device][i].mergeThreadMutex[1].Lock(); } } } if (Config->MultiThreadDivide && UseInputPthreads()) { for (int i = 0;i < divideThreads;i++) { dParam[i].terminate = 1; DGEMMTasks[dParam[i].curDevice].mutex_start.Unlock(); if (Config->Debug) fprintf(STD_OUT, "Waiting for divide threads to terminate\n"); DGEMMTasks[i].mutex_finished.Lock(); } } } if (Config->MultiThread) { if (UseOutputPthreads()) { for (int num_device = 0;num_device < nDevices;num_device++) { for (int i = 0;i < (Config->OutputThreads == -1 ? max_outputthreads : Config->OutputThreads);i++) { for (int j = 0;j < 2;j++) { mParam[num_device][i].mergeThreadMutex[j].Unlock(); } } } } if (pthread_mutex_destroy(&scheduleMutex)) fprintf(STD_OUT, "ERROR destroying schedule mutex\n"); if (Config->MultiThreadDivide && UseInputPthreads()) { for (int i = 0;i < nDevices;i++) { DGEMMTasks[i].mutex_start.Unlock(); DGEMMTasks[i].mutex_finished.Unlock(); } } if (Config->MultiThread && UseMutexPerDevice()) { for (int i = 0;i < nDevices;i++) { if (pthread_mutex_destroy(&device_mutex[i])) fprintf(STD_OUT, "ERROR destroying device_mutex: %s - %d\n", __FILE__, __LINE__); } } } if (Config->ThreadSaveDriver == -1) { pthread_mutex_destroy(&globalDriverLock); } if (Config->UseDMAFetchQueue) { for (int i = 0;i < nDevices;i++) { pthread_mutex_destroy(&dma_fetch_queue_tasks[i].mutex); } } #ifdef CALDGEMM_DIVIDE_STATIC_BUFFER freeDivideBuffer(divide_tmpBuffer); #endif caldgemm_initialized = false; return(0); } void caldgemm::ResetTimers() { //Reset Timers Timers.System.Reset(); Timers.Kernel.Reset(); Timers.CounterDivide.Reset(); Timers.CounterMerge.Reset(); Timers.CounterCopyTo.Reset(); Timers.CounterCopyFrom.Reset(); Timers.CPUTimer.Reset(); Timers.TotalCPUTimer.Reset(); Timers.GPUTimer.Reset(); Timers.divideA = Timers.divideB = Timers.divideC = 0; Timers.LinpackTimer1.Reset(); Timers.LinpackTimer2.Reset(); Timers.LinpackTimer3.Reset(); Timers.BcastTimer.Reset(); Timers.device_kernel = 0; } #define MAX_HUGE_ADDRESSES 256 double* huge_page_addresses[MAX_HUGE_ADDRESSES]; int nHugeAddresses = 0; #ifndef HUGE_PAGESIZE #define HUGE_PAGESIZE (1024 * 2048) #endif double* caldgemm::AllocMemory(size_t nDoubles, bool page_locked, bool huge_pages, bool gpuaccessible, bool interleave) { #ifndef USE_OLD_HUGE_MALLOC return((double*) qmalloc::qMalloc(nDoubles * sizeof(double), huge_pages, false, page_locked, NULL, interleave)); #else #ifdef WASTE_MEMORY nDoubles += 40 * 1024 * 1024; #endif double* ptr; #ifndef _WIN32 if (huge_pages) { if (nHugeAddresses >= MAX_HUGE_ADDRESSES - 1) { fprintf(STD_OUT, "No more huge_page memory available, increase MAX_HUGE_ADDRESSES\n"); return(NULL); } int shmid; void *address = NULL; if (Config->Debug) fprintf(STD_OUT, "Running Huge Maloc\n"); if ((shmid = shmget(IPC_PRIVATE, (nDoubles * sizeof(double) + HUGE_PAGESIZE) & ~(HUGE_PAGESIZE - 1), SHM_HUGETLB | IPC_CREAT | 0600)) < 0) { fprintf(STD_OUT, "Memory allocation error (shmget).\n"); return(NULL); } ptr = (double*) shmat(shmid, NULL, SHM_RND); if ((long long int) address == -1) { fprintf(STD_OUT, "Memory allocation error (shmat).\n"); return(NULL); } shmctl(shmid, IPC_RMID, NULL); if (page_locked && shmctl(shmid, SHM_LOCK, NULL) == -1) { fprintf(STD_OUT, "ERROR locking HugePage Memory\n"); shmdt((void*) ptr); return(NULL); } huge_page_addresses[nHugeAddresses++] = ptr; } else #endif { #ifdef _WIN32 ptr = (double*) VirtualAlloc(NULL, nDoubles * sizeof(double), MEM_COMMIT, PAGE_READWRITE); #else ptr = new double[nDoubles]; #endif } if (ptr == NULL) return(NULL); #ifdef WASTE_MEMORY nDoubles -= 40 * 1024 * 1024; ptr += 20 * 1024 * 1024; #endif if (!huge_pages && page_locked) { #ifdef _WIN32 size_t minp, maxp; HANDLE pid = GetCurrentProcess(); if (GetProcessWorkingSetSize(pid, &minp, &maxp) == 0) fprintf(STD_OUT, "Error getting minimum working set size\n"); if (SetProcessWorkingSetSize(pid, minp + nDoubles * sizeof(double), maxp + nDoubles * sizeof(double)) == 0) fprintf(STD_OUT, "Error settings maximum working set size\n"); if (VirtualLock(ptr, nDoubles * sizeof(double)) == 0) #else if (mlock(ptr, nDoubles * sizeof(double))) #endif { fprintf(STD_OUT, "ERROR locking Pages\n"); if (!huge_pages) { #ifdef _WIN32 DWORD err = GetLastError(); fprintf(STD_OUT, "Error Number: %d\n", err); VirtualFree(ptr, 0, MEM_RELEASE); #else delete[] ptr; #endif } return(NULL); } } return(ptr); #endif } int caldgemm::FreeMemory(double* ptr, bool gpuaccessible) { #ifndef USE_OLD_HUGE_MALLOC qmalloc::qFree(ptr); #else #ifdef WASTE_MEMORY ptr -= 20 * 1024 * 1024; #endif #ifndef _WIN32 for (int i = 0;i < nHugeAddresses;i++) { if (huge_page_addresses[i] == ptr) { shmdt((void*) ptr); huge_page_addresses[i] = huge_page_addresses[--nHugeAddresses]; return; } } #endif #ifdef _WIN32 VirtualFree(ptr, 0, MEM_RELEASE); #else delete[] ptr; #endif #endif return(0); } void caldgemm::displayMatrixTiming(const char* name) { double gflops_CPU = (double) 1e-09 * finishData->orig_m * finishData->orig_n * (2 * Config->Width + 2) * (double) Config->Iterations / finishData->System; avggflops = ((double) avgngflops * avggflops + gflops_CPU) / (double) (avgngflops + 1); avgngflops++; if (!Config->Quiet || (Config->DisplayTiming /*&& matrix_m * matrix_n >= 16 * 24 * 1024 * 1024*/)) fprintf(STD_OUT, "%sProgram: %s Sizes - A: %lldx%lld B: %lldx%lld C:%lldx%lld (Host: %s) System Time %2.3f System Gflops %2.3f\n", Config->PreOut, name, (long long int) finishData->orig_m, (long long int) Config->Width, (long long int) Config->Width, (long long int) finishData->orig_n, (long long int) finishData->orig_m, (long long int) finishData->orig_n, hostname, finishData->System, gflops_CPU); if (Config->UseCPU == true && Config->UseGPU == true) { double flopsc, flopsg; if (finishData->CPUOnlyRun) { flopsc = (double) 1e-09 * finishData->orig_m * finishData->orig_n * (2 * Config->Width + 2) * Config->Iterations / finishData->CPUTimer; flopsg = 0.0; } else if (finishData->DGEMM_split_m) { flopsc = (double) 1e-09 * (finishData->dynamic_run * finishData->dynamic_size + finishData->cblas_size * finishData->matrix_n + (finishData->matrix_n % finishData->SmallTileHeight) * (finishData->matrix_m - finishData->cblas_size) + finishData->dynamic_run2 * Config->Height * Config->Height + (finishData->ExecLinpack >= 2 && Config->AlternateLookahead <= finishData->matrix_n ? Config->Width * finishData->matrix_n : 0)) * (2 * Config->Width + 2) * Config->Iterations / finishData->CPUTimer; flopsg = (double) 1e-09 * ((finishData->matrix_m - finishData->cblas_size) * (finishData->matrix_n - finishData->matrix_n % finishData->SmallTileHeight) - finishData->dynamic_run * finishData->dynamic_size - finishData->dynamic_run2 * Config->Height * Config->Height) * (2 * Config->Width + 2) * Config->Iterations / finishData->GPUTimer; } else { flopsc = (double) 1e-09 * (finishData->dynamic_run * finishData->dynamic_size + finishData->cblas_size * finishData->matrix_m + (finishData->matrix_m % finishData->SmallTileHeight) * (finishData->matrix_n - finishData->cblas_size) + finishData->dynamic_run2 * Config->Height * Config->Height + (finishData->ExecLinpack >= 2 && Config->AlternateLookahead <= finishData->matrix_n ? Config->Width * finishData->matrix_n : 0)) * (2 * Config->Width + 2) * Config->Iterations / finishData->CPUTimer; flopsg = (double) 1e-09 * ((finishData->matrix_n - finishData->cblas_size) * (finishData->matrix_m - finishData->matrix_m % finishData->SmallTileHeight) - finishData->dynamic_run * finishData->dynamic_size - finishData->dynamic_run2 * Config->Height * Config->Height) * (2 * Config->Width + 2) * Config->Iterations / finishData->GPUTimer; } if (Config->GPUClock && finishData->matrix_m * finishData->matrix_n >= 24 * 24 * 1024 * 1024 && flopsg <= (double) 460 * (double) Config->GPUClock / (double) 850 - (double) 20) { fprintf(STD_OUT, "%sThrottling: %s (%2.3f GFlops)\n", Config->PreOut, hostname, flopsg); } //const double gpu_ratio_used_new = std::min(1.0, flopsg / (flopsc * (Timers.System.GetElapsedTime() - Timers.LinpackTimer1.GetElapsedTime() - (ExecLinpack > 1 ? Config->GPURatioMarginTimeDuringFact : Config->GPURatioMarginTime) - Timers.LinpackTimer3.GetElapsedTime()) / Timers.System.GetElapsedTime() + flopsg)); double gpu_ratio_used_new = mymin(1.0, flopsg / (flopsc * (finishData->CPUTimer - (finishData->ExecLinpack > 1 ? Config->GPURatioMarginTimeDuringFact : Config->GPURatioMarginTime)) / finishData->TotalCPUTimer + flopsg)); if (gpu_ratio_used_new < 0) finishData->gpu_ratio_used = 1.; if (!Config->Quiet || (Config->DisplayTiming /*&& matrix_m * matrix_n >= 16 * 24 * 1024 * 1024*/)) { char timingoutputbase[1024]; char *timingoutput = timingoutputbase; timingoutput += sprintf(timingoutput, "%sGPU Time %2.4f (%2.4f Gflops) CPU Time %2.4f (%2.4f Gflops)", Config->PreOut, finishData->GPUTimer, flopsg, finishData->CPUTimer, flopsc); if (finishData->ExecLinpack) timingoutput += sprintf(timingoutput, " Linpack Time: %2.4f (%d, %2.4f, %2.4f) Total CPU Time: %2.4f", finishData->LinpackTimer1, finishData->ExecLinpack, finishData->LinpackTimer2, finishData->LinpackTimer3, finishData->TotalCPUTimer); if (Config->TabularTiming) { timingoutput += sprintf(timingoutput, " --- GPU Ratio - Real: %2.3f Corrected: %2.3f Guessed: %2.3f , m*n: %.1E, CPU Wait Time: %2.3f", (flopsg / (flopsc + flopsg)), gpu_ratio_used_new, finishData->gpu_ratio_used, (double) (finishData->matrix_m * finishData->matrix_n), finishData->cpu_wait_time > 0.001 ? finishData->cpu_wait_time : (finishData->TotalCPUTimer - finishData->GPUTimer)); } sprintf(timingoutput, "\n"); fwrite(timingoutputbase, 1, strlen(timingoutputbase), STD_OUT); } finishData->gpu_ratio_used = gpu_ratio_used_new; } if ((!Config->Quiet || (Config->DisplayTiming /*&& matrix_n * matrix_m >= 16 * 24 * 1024 * 1024*/)) && Config->VerboseTiming) { double gflops = (double) 1e-09 * matrix_m * matrix_n * (2 * Config->Width - 1) * (double)Config->Iterations / Timers.Kernel.GetElapsedTime(); #ifdef CALDGEMM_BENCHMARK_KERNEL gflops *= (double) CALDGEMM_BENCHMARK_KERNEL; #endif double copyto = Config->DivideToGPU ? 0 : ((double) 1e-09 * ((Config->Height * Timers.divideA + Config->Height * Timers.divideB) * Config->Width + Timers.divideC * Config->Height * Config->Height) * sizeof(double) * (double)Config->Iterations / Timers.CounterCopyTo.GetElapsedTime()); double copyfrom = Config->DstMemory == 'g' ? ((double) 1e-09 * matrix_m * matrix_n * sizeof(double) * (double)Config->Iterations / Timers.CounterCopyFrom.GetElapsedTime()) : 0; double copyMerge = Config->MultiThread || UseOutputPthreads() == 0 ? 0 :((double) 1e-09 * matrix_m * matrix_n * sizeof(double) * (double)Config->Iterations / Timers.CounterMerge.GetElapsedTime()); double copyDivide = UseInputPthreads() ? (double) 1e-09 * (Config->Height * Timers.divideA + Config->Height * Timers.divideB) * Config->Width * sizeof(double) * (double)Config->Iterations / Timers.CounterDivide.GetElapsedTime() : 0; fprintf(STD_OUT, "Times: Kernel Divide (%d,%d) Merge Copy To Copy From\n", Timers.divideA, Timers.divideB); fprintf(STD_OUT, " %2.4f (%2.4f Gflops) %2.4f (%2.4f GB/s) %2.4f (%2.4f GB/s) %2.4f (%2.4f GB/s) %2.4f (%2.4f Gb/s)\n", Timers.Kernel.GetElapsedTime(), gflops, Timers.CounterDivide.GetElapsedTime(), copyDivide, Timers.CounterMerge.GetElapsedTime(), copyMerge, Timers.CounterCopyTo.GetElapsedTime(), copyto, Timers.CounterCopyFrom.GetElapsedTime(), copyfrom); double gflops_device = 0; if (Timers.device_kernel) { gflops_device = (double) matrix_m * matrix_n * (2 * Config->Width - 1) * (double)Config->Iterations / (double) Timers.device_kernel; fprintf(STD_OUT, " %2.4f (%2.4f Gflops)\n", (double) Timers.device_kernel * 1e-09, gflops_device); } if (Config->TabularTiming) { fprintf(STD_OUT, "TIMES:\tw\t%lld\th\t%lld\tkernel\t%2.4f / %2.4f\tdivide\t%2.4f\tmerge\t%2.4f\tcopyto\t%2.4f\tcopyfr\t%2.4f\n", (long long int) Config->Width, (long long int) Config->Height, gflops, gflops_device, copyDivide, copyMerge, copyto, copyfrom); } } } unsigned int caldgemm::AnalyzeResults() { size_t errors = 0; size_t total = 0; if (!Config->Quiet) fprintf(STD_OUT, "Verifying results can take a long time on large matrices.\n"); HighResTimer Timer; Timer.Reset(); Timer.Start(); cblas_dgemm(CblasRowMajor, TransposeA ? CblasTrans : CblasNoTrans, TransposeB ? CblasTrans : CblasNoTrans, matrix_m, matrix_n, Config->Width, Alpha, A, A_pitch, B, B_pitch, Beta, D, C_pitch); Timer.Stop(); if (!Config->Quiet) fprintf(STD_OUT, "CPU Time: %f Gflops: %f\n", Timer.GetElapsedTime(), (double)1e-09 * 2 * matrix_m * matrix_n * Config->Width / Timer.GetElapsedTime()); #ifdef TESTMODE fprintf(STD_OUT, "Reference Matrix:\n"); print_submatrices(D, 12, 24, C_pitch, 1, 1, 1, 1); #endif int nblocksm = 0; int* errortiles = NULL; if (Config->Height) { nblocksm = matrix_m / Config->Height + 1; errortiles = (int*) malloc((matrix_n / Config->Height + 1) * nblocksm * sizeof(int)); memset(errortiles, 0, (matrix_n / Config->Height + 1) * nblocksm * sizeof(int)); } size_t errorsrel[3]; memset(errorsrel, 0, 3 * sizeof(size_t)); for (size_t i=0; i < matrix_m; i++) { for (size_t j=0; j < matrix_n; j++) { if (!isDoubleEqual(C[i * C_pitch + j],D[i * C_pitch + j])) { if (errors < 5) fprintf(STD_OUT, "Error found at row %lld, col %lld: Expected: %3.5le, Found: %3.5le, Diff: %3.5le, Relative: %3.5le\n", (long long int) i, (long long int) j, D[i * C_pitch + j], C[i * C_pitch + j], D[i * C_pitch + j] - C[i * C_pitch + j], (D[i * C_pitch + j] - C[i * C_pitch + j]) / D[i * C_pitch + j]); ++errors; if (Config->Height) errortiles[j / Config->Height * nblocksm + i / Config->Height]++; if (fabs((C[i * C_pitch + j] - D[i * C_pitch + j]) / D[i * C_pitch + j]) > 0.05) errorsrel[0]++; else if (fabs((C[i * C_pitch + j] - D[i * C_pitch + j]) / D[i * C_pitch + j]) < 0.0001) errorsrel[2]++; else errorsrel[1]++; } ++total; } } if (errors) { fprintf(STD_OUT, "%lld out of %lld elements were incorrect (Rel errors > 0.05: %lld, > 0.0001: %lld, rest: %lld)\n", (long long int) errors, (long long int) total, (long long int) errorsrel[0], (long long int) errorsrel[1], (long long int) errorsrel[2]); if (errorsrel[0] == 0) { fprintf(STD_OUT, "Passed with Warnings!!!\n"); } else { fprintf(STD_OUT, "FAILED (Host %s)\n", hostname); } } else if (!Config->Quiet) { fprintf(STD_OUT, "Passed!\n"); } if (!Config->NoPerformanceWarnings && (errors || Config->Debug) && Config->Height) { fprintf(STD_OUT, "GPU output matrix\n"); print_submatrices(C, matrix_n, matrix_m, C_pitch, 1, 1, Config->Height, Config->Height); fprintf(STD_OUT, "Reference matrix\n"); print_submatrices(D, matrix_n, matrix_m, C_pitch, 1, 1, Config->Height, Config->Height, C); } if (!Config->NoPerformanceWarnings && errors && Config->Height) { fprintf(STD_OUT, "Number of errors in tiles\n"); for (size_t i = 0;i < matrix_m;i += Config->Height) { for (size_t j = 0;j < matrix_n;j += Config->Height) { fprintf(STD_OUT, "%8d\t", errortiles[j / Config->Height * nblocksm + i / Config->Height]); } fprintf(STD_OUT, "\n"); } } if (Config->Height) free(errortiles); return(errors == 0); } bool caldgemm::isDoubleEqual(double a, double b) { if (!qIsFinite(a) || !qIsFinite(b)) return(false); double valmax = fabs(a) > fabs(b) ? fabs(a) : fabs(b); if (valmax < 1e-15) { return(fabs(a - b) < 1e16); } else if (valmax < 1e-9) { return(fabs((a - b)/valmax) < 5e-2); } else if(valmax < 1e-8) { return (fabs((a-b)/valmax) < 1e-3); } else { return (fabs((a-b)/valmax) < 1e-4); } } int caldgemm::DGEMM_prepare(size_t k, int j, unsigned int num_device CALDGEMM_DIVBUFA) { #ifdef CALDGEMM_BENCHMARK_KERNEL return(0); #endif size_t blockm, blockn; DGEMM_getblocks(k, blockm, blockn); bool buffersSufficiant0, buffersSufficiant; #ifdef REUSE_BBUFFERS if (DGEMM_favor_m) { buffersSufficiant0 = true; buffersSufficiant = next_buffer_B[num_device] < bbuffers[num_device]; } else { buffersSufficiant0 = buffersSwitchable; buffersSufficiant = buffersSwitchable && next_buffer_A[num_device] < bbuffers[num_device]; } #else buffersSufficiant0 = buffersSufficiant = false; #endif if (Config->Debug) fprintf(STD_OUT, "Running Preprocessing device = %d k = %lld\n", num_device, (long long int) k); //if (Config->Debug) fprintf(STD_OUT, "device %d Favor %d major %d minor %d blockm %d blockn %d\n", (int) num_device, (int) DGEMM_favor_m, (int) buffersMajor[num_device], (int) buffersMinor[num_device][DGEMM_favor_m ? blockn : blockm], (int) blockm, (int) blockn); const bool prepareM = DGEMM_favor_m ? (buffersMajor[num_device] < (signed long long int) blockm) : (!buffersSufficiant0 || buffer_pointers_A[num_device][blockm] == -1); const bool prepareN = DGEMM_favor_m ? (!buffersSufficiant0 || buffer_pointers_B[num_device][blockn] == -1) : (buffersMajor[num_device] < (signed long long int) blockn); if (prepareM) { WaitForLASWP(blockm); if (DGEMM_favor_m) buffersMajor[num_device] = blockm; else if (buffersSufficiant0) { const int buffer_pos = next_buffer_A[num_device] % (buffersSufficiant ? bbuffers[num_device] : ibuffercount); if (buffersMinor[num_device][next_buffer_A[num_device] % bbuffers[num_device]] != -1) { static bool bbuffer_warning_shown = false; if (Config->Debug || !(Config->NoPerformanceWarnings || bbuffer_warning_shown)) { bbuffer_warning_shown = true; fprintf(STD_OUT, "WARNING: Insufficient BBuffers, replacing blockm %d by %d in buffer %d\n", buffersMinor[num_device][buffer_pos], (int) blockm, buffer_pos); } buffer_pointers_A[num_device][buffersMinor[num_device][buffer_pos]] = -1; } buffersMinor[num_device][buffer_pos] = blockm; } buffer_pointers_A[num_device][blockm] = next_buffer_A[num_device]; } else if (Config->Debug) fprintf(STD_OUT, "\tSkipping preprocessing part of A (device = %d, k = %lld, j = %d, m = %lld, n = %lld)\n", num_device, (long long int) k, j, (long long int) blockm, (long long int) blockn); if (prepareN) { if (!DGEMM_favor_m) buffersMajor[num_device] = blockn; else if (buffersSufficiant0) { const int buffer_pos = next_buffer_B[num_device] % (buffersSufficiant ? bbuffers[num_device] : ibuffercount); if (buffersMinor[num_device][buffer_pos] != -1) { static bool bbuffer_warning_shown = false; if (Config->Debug || !(Config->NoPerformanceWarnings || bbuffer_warning_shown)) { bbuffer_warning_shown = true; fprintf(STD_OUT, "WARNING: Insufficient BBuffers, replacing blockn %d by %d in buffer %d\n", buffersMinor[num_device][buffer_pos], (int) blockn, buffer_pos); } buffer_pointers_B[num_device][buffersMinor[num_device][buffer_pos]] = -1; } buffersMinor[num_device][buffer_pos] = blockn; } buffer_pointers_B[num_device][blockn] = next_buffer_B[num_device]; } else if (Config->Debug) fprintf(STD_OUT, "\tSkipping preprocessing part of B (device = %d, k = %lld, j = %d, m = %lld, n = %lld)\n", num_device, (long long int) k, j, (long long int) blockm, (long long int) blockn); if (prepareM || prepareN) dma_pending[num_device][j] = true; if(DGEMM_prepare_backend(k, j, num_device, prepareM, prepareN, buffersSufficiant, buffersSufficiant0 CALDGEMM_DIVBUFB)) return(1); if (prepareM) next_buffer_A[num_device]++; if (prepareN) next_buffer_B[num_device]++; return(0); } void caldgemm::printConfig(caldgemm::caldgemm_config* newConfig, caldgemm::caldgemm_config* oldConfig) { caldgemm_config* myConfig = newConfig ? newConfig : Config; PRINT_CONFIG_INT(AsyncDMA); PRINT_CONFIG_INT(PipelinedOperation); PRINT_CONFIG_INT(PipelinedMidMarker); PRINT_CONFIG_INT(PipelineDoubleBuffer); PRINT_CONFIG_INT(DivideToGPU); PRINT_CONFIG_CHAR(DstMemory); PRINT_CONFIG_INT(ImplicitDriverSync); PRINT_CONFIG_INT(UseDMAFetchQueue); PRINT_CONFIG_INT(DynamicSched); PRINT_CONFIG_INT(SecondPhaseDynamicRuns); PRINT_CONFIG_INT(ThirdPhaseDynamicRuns); PRINT_CONFIG_INT(ThirdPhaseThreshold); PRINT_CONFIG_INT(KeepBuffersMapped); PRINT_CONFIG_INT(MemPolicy); PRINT_CONFIG_INT(MultiThread); PRINT_CONFIG_INT(MultiThreadDivide); PRINT_CONFIG_INT(ImprovedScheduler); PRINT_CONFIG_INT(ImprovedSchedulerBalance); PRINT_CONFIG_INT(SimpleGPUQueuing); PRINT_CONFIG_INT(AlternateSimpleQueuing); PRINT_CONFIG_INT(AlternateSimpleQueuingMulti); PRINT_CONFIG_INT(ParallelDMA); PRINT_CONFIG_INT(GroupParallelDMA); PRINT_CONFIG_DOUBLE(GPURatio); PRINT_CONFIG_DOUBLE(GPURatioDuringFact); PRINT_CONFIG_DOUBLE(GPURatioMax); PRINT_CONFIG_DOUBLE(GPURatioMarginTime); PRINT_CONFIG_DOUBLE(GPURatioMarginTimeDuringFact); PRINT_CONFIG_DOUBLE(GPURatioLookaheadSizeMod); PRINT_CONFIG_INT(GPURatioPenalties); PRINT_CONFIG_DOUBLE(GPURatioPenaltyFactor); PRINT_CONFIG_INT(MinimizeCPUPart); PRINT_CONFIG_INT(MinimizeCPUDuringFact); PRINT_CONFIG_INT(UseCPU); PRINT_CONFIG_INT(UseGPU); PRINT_CONFIG_INT(RereserveLinpackCPU); PRINT_CONFIG_INT(GPU_C); PRINT_CONFIG_INT(NoConcurrentKernels); PRINT_CONFIG_INT(OpenCLPlatform); PRINT_CONFIG_INT(DeviceNum); PRINT_CONFIG_INT(NumDevices); PRINT_CONFIG_INT(NumActiveDevices); PRINT_CONFIG_LOOP_INT(DeviceNums, NumDevices); PRINT_CONFIG_INT(max_bbuffers); PRINT_CONFIG_INT(PreallocData); PRINT_CONFIG_INT(CPUInContext); PRINT_CONFIG_INT(Debug); PRINT_CONFIG_INT(DumpMatrix); PRINT_CONFIG_INT(Iterations); PRINT_CONFIG_INT(Verify); PRINT_CONFIG_INT(SkipCPUProcessing); PRINT_CONFIG_INT(ForceKernelVariant); PRINT_CONFIG_LOOP_INT(GPUMapping, NumDevices); PRINT_CONFIG_LOOP_INT(PostprocessMapping, NumDevices); PRINT_CONFIG_LOOP_INT(AllocMapping, NumDevices); PRINT_CONFIG_LOOP_INT(DMAMapping, NumDevices); PRINT_CONFIG_INT(PinMainThread); PRINT_CONFIG_INT(PinDeviceRuntimeThreads); PRINT_CONFIG_INT(PinBroadcastThread); PRINT_CONFIG_INT(RepinDuringActiveWaitForEvent); PRINT_CONFIG_INT(RepinMainThreadAlways); PRINT_CONFIG_INT(SpawnGPUThread); PRINT_CONFIG_INT(SleepDuringActiveWait); PRINT_CONFIG_INT(ThreadSaveDriver); PRINT_CONFIG_INT(PinCPU); PRINT_CONFIG_INT(ForceNumCPUThreads); PRINT_CONFIG_INT(CPUCoreOffset); PRINT_CONFIG_INT(SlowCPU); PRINT_CONFIG_INT(OutputThreads); PRINT_CONFIG_INT(NumaPinning); PRINT_CONFIG_INT(AlternateLookahead); PRINT_CONFIG_INT(AsyncSideQueue); PRINT_CONFIG_INT(AsyncSideQueueBalance); PRINT_CONFIG_INT(AsyncDGEMMThreshold); PRINT_CONFIG_INT(AsyncDTRSMThreshold); PRINT_CONFIG_INT(AsyncDTRSM); PRINT_CONFIG_INT(AsyncSideQueueUseInactiveDeviceSet); PRINT_CONFIG_INT(Use3rdPartyTranspose); PRINT_CONFIG_INT(Height); PRINT_CONFIG_INT(Width); PRINT_CONFIG_INT(AutoHeight); PRINT_CONFIG_INT(SmallTiles); PRINT_CONFIG_INT(Disassemble); PRINT_CONFIG_INT(PrintILKernel); PRINT_CONFIG_INT(AsyncTiming); PRINT_CONFIG_INT(DisplayTiming); PRINT_CONFIG_INT(NoPerformanceWarnings); PRINT_CONFIG_STRING(PreOut); PRINT_CONFIG_INT(Quiet); PRINT_CONFIG_INT(TabularTiming); PRINT_CONFIG_INT(VerboseTiming); PRINT_CONFIG_INT(LinpackNodes); PRINT_CONFIG_INT(MPIRank); PRINT_CONFIG_INT(GPUClock); PRINT_CONFIG_INT(HPLFactorizeRestrictCPUs); PRINT_CONFIG_INT(LASWPSleep); PRINT_CONFIG_LOOP_INT(ExcludeCPUCores, nExcludeCPUCores); PRINT_CONFIG_INT(ShowConfig); PRINT_CONFIG_INT(ShowThreadPinning); PRINT_CONFIG_INT_THIS(BufferWidth); PRINT_CONFIG_INT_THIS(BufferHeight); if (myConfig->config_backend && (oldConfig == NULL || oldConfig->config_backend)) { myConfig->config_backend->printConfig(oldConfig ? oldConfig->config_backend : NULL); } } double caldgemm::getMaxGPUTemperature() { return(0.); } int caldgemm::RunCALDGEMM_Init() { return(0); } int caldgemm::RunCALDGEMM_Exit() { return(0); } void caldgemm::SetDefaultKernelSettings() { #ifdef CALDGEMM_TRANSPOSED_A KernelSettings.transposeA = true; #else KernelSettings.transposeA = false; #endif #ifdef CALDGEMM_TRANSPOSED_B KernelSettings.transposeB = true; #else KernelSettings.transposeB = false; #endif KernelSettings.texture_buffers = true; KernelSettings.tiling_x = TILING_X; KernelSettings.tiling_y = TILING_Y; KernelSettings.group_size_x = 16; KernelSettings.group_size_y = 16; KernelSettings.min_tile_size = CALDGEMM_MIN_TILE_DIM; KernelSettings.min_k = 4; } int caldgemm::CaldgemmCustomAutoHeight(size_t MaxGpuM, size_t MaxGpuN, int nDevices) {return 0;} int caldgemm::CaldgemmCustomModHeight(size_t MOD_OVER, size_t MOD_GPU) {return 0;} int caldgemm::ParseParameters(unsigned int argc, char** argv, caldgemm_config* Config) { #include "caldgemm_parse_parameters.h" return(0); } int caldgemm::ParseParameters(char* params, caldgemm_config* Config) { if (Config->Debug) fprintf(STD_OUT, "Parsing CALDGEMM Parameters: '%s'\n", params); char* tmpParams = new char[strlen(params) + 1]; //This memory will be leaked, in case of string parameters we need to keep a copy, and we do not know how long params will live. strcpy(tmpParams, params); int argc = 1; char** argv = new char*[strlen(params) / 2 + 3]; char* tmppos = tmpParams; argv[0] = "caldgemm"; while (*tmppos != 0) { while (*tmppos == ' ' || *tmppos == ' ') tmppos++; if (*tmppos == 0) break; argv[argc++] = tmppos; while (*tmppos != ' ' && *tmppos != ' ' && *tmppos != 0) tmppos++; if (*tmppos) *(tmppos++) = 0; } argv[argc] = NULL; int retVal = ParseParameters(argc, argv, Config); delete[] argv; retVal |= Config->InitializeBackendOptions(); return(retVal); } int caldgemm::AllowCPUFallback() {return(1);} int caldgemm::SimpleQueuingAvailable() {return(0);} int caldgemm::PipelinedModeAvailable() {return(0);} int caldgemm::AsyncModeAvailable() {return(0);} bool caldgemm::NeedSimpleQueueKernelEvent(int blockm, int blockn, int k, int device) { int mb = (gpu_m + Config->Height - 1) / Config->Height; int nb = (gpu_n + Config->Height - 1) / Config->Height; if (DGEMM_favor_m ? (blockm != mb - 1) : (blockn != nb - 1)) { int kklast = k + (DGEMM_favor_m ? nb : mb); kklast -= kklast % (DGEMM_favor_m ? nb : mb); int num = 0; for (int kk = k;kk < kklast;kk++) { if (tileDistribution[kk] == device) { if (++num == ibuffercount) break; } } if (num < ibuffercount) { return(true); } } return(false); } #ifndef USE_GOTO_BLAS static int caldgemm_restrict_cpus = 0; static int current_num_threads = get_num_procs(); void cblas_dscala(blasint N, double alpha, double *X, blasint incX) { int oldthreads = 0; if (caldgemm_restrict_cpus > 2 && current_num_threads > 8) { oldthreads = current_num_threads; omp_set_num_threads(8); } cblas_dscal(N, alpha, X, incX); if (oldthreads) omp_set_num_threads(oldthreads); } void cblas_daxpya(blasint n, double alpha, double *x, blasint incx, double *y, blasint incy) { int oldthreads = 0; if (caldgemm_restrict_cpus > 2 && current_num_threads > 8) { oldthreads = current_num_threads; omp_set_num_threads(8); } cblas_daxpy(n, alpha, x, incx, y, incy); if (oldthreads) omp_set_num_threads(oldthreads); } void cblas_dgemma(CBLAS_ENUM CBLAS_ORDER Order, CBLAS_ENUM CBLAS_TRANSPOSE TransA, CBLAS_ENUM CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K, double alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc) { int oldthreads = 0; if (caldgemm_restrict_cpus) { int nthreads = 0; long long int tflops = (long long int) M * (long long int) N * (long long int) K; if (tflops <= 16384) nthreads = 1; else if (tflops <= 65536) nthreads = 2; else if (tflops < 200000 || (tflops > 2000000 && tflops < 4000000)) nthreads = 3; else if (tflops <= 2000000) nthreads = 4; else if (tflops <= 26542080) nthreads = 8; else if (tflops <= 56623104) nthreads = 12; else if (tflops <= 89915392) nthreads = 16; else if (tflops <= 262144000) nthreads = 20; if (nthreads && nthreads < current_num_threads) { oldthreads = current_num_threads; omp_set_num_threads(nthreads); } } cblas_dgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc); if (oldthreads) omp_set_num_threads(oldthreads); } void cblas_dgemva(CBLAS_ENUM CBLAS_ORDER order, CBLAS_ENUM CBLAS_TRANSPOSE trans, blasint m, blasint n, double alpha, double *a, blasint lda, double *x, blasint incx, double beta, double *y, blasint incy) { int oldthreads = 0; if (caldgemm_restrict_cpus) { int nthreads = 0; if (n >= 4 * m) { long long int tflops = (long long int) n * 64; if (tflops <= 458752) nthreads = 4; else if (tflops <= 655360) nthreads = 8; } else { long long int tflops = (long long int) m * (long long int) n; if (tflops < 102400) nthreads = 1; else if (tflops < 3686400) nthreads = 3; else nthreads = 4; } if (caldgemm_restrict_cpus > 2 && nthreads > 8) nthreads = 8; if (nthreads && nthreads < current_num_threads) { oldthreads = current_num_threads; omp_set_num_threads(nthreads); } } cblas_dgemv(order, trans, m, n, alpha, a, lda, x, incx, beta, y, incy); if (oldthreads) omp_set_num_threads(oldthreads); } void cblas_dtrsma(CBLAS_ENUM CBLAS_ORDER Order, CBLAS_ENUM CBLAS_SIDE Side, CBLAS_ENUM CBLAS_UPLO Uplo, CBLAS_ENUM CBLAS_TRANSPOSE TransA, CBLAS_ENUM CBLAS_DIAG Diag, blasint M, blasint N, double alpha, double *A, blasint lda, double *B, blasint ldb) { int oldthreads = 0; if (caldgemm_restrict_cpus) { int nthreads = 0; long long int tflops = (long long int) N * (long long int) N * (long long int) M; if (tflops <= 32768) nthreads = 1; else if (tflops <= 110592) nthreads = 3; else if (tflops <= 100000000) nthreads = 4; else if (tflops <= 1000000000) nthreads = 16; if (caldgemm_restrict_cpus > 2 && nthreads > 8) nthreads = 8; if (nthreads && nthreads < current_num_threads) { oldthreads = current_num_threads; omp_set_num_threads(nthreads); } } cblas_dtrsm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb); if (oldthreads) omp_set_num_threads(oldthreads); } void caldgemm_goto_restrict_cpus(int val) { caldgemm_restrict_cpus = val; } void goto_set_num_threads(int num) { current_num_threads = num; omp_set_num_threads(num); #ifdef USE_MKL mkl_set_num_threads(num); #endif } #endif // vim: ts=4 sw=4 noet sts=4 tw=100
davidrohr/caldgemm
caldgemm.cpp
C++
lgpl-3.0
144,733
[ 30522, 1013, 1008, 1008, 1008, 17368, 2217, 1997, 10250, 11818, 7382, 7375, 1012, 1008, 1008, 9385, 2325, 1024, 1008, 1011, 2585, 20996, 8093, 1006, 2852, 11631, 2099, 1030, 1046, 21724, 2102, 1012, 8917, 1007, 1008, 1011, 17885, 10384, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* ** 2004 May 22 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains code that modified the OS layer in order to simulate ** the effect on the database file of an OS crash or power failure. This ** is used to test the ability of SQLite to recover from those situations. */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqliteInt.h" #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" #endif #ifndef SQLITE_OMIT_DISKIO /* This file is a no-op if disk I/O is disabled */ /* #define TRACE_CRASHTEST */ typedef struct CrashFile CrashFile; typedef struct CrashGlobal CrashGlobal; typedef struct WriteBuffer WriteBuffer; /* ** Method: ** ** This layer is implemented as a wrapper around the "real" ** sqlite3_file object for the host system. Each time data is ** written to the file object, instead of being written to the ** underlying file, the write operation is stored in an in-memory ** structure (type WriteBuffer). This structure is placed at the ** end of a global ordered list (the write-list). ** ** When data is read from a file object, the requested region is ** first retrieved from the real file. The write-list is then ** traversed and data copied from any overlapping WriteBuffer ** structures to the output buffer. i.e. a read() operation following ** one or more write() operations works as expected, even if no ** data has actually been written out to the real file. ** ** When a fsync() operation is performed, an operating system crash ** may be simulated, in which case exit(-1) is called (the call to ** xSync() never returns). Whether or not a crash is simulated, ** the data associated with a subset of the WriteBuffer structures ** stored in the write-list is written to the real underlying files ** and the entries removed from the write-list. If a crash is simulated, ** a subset of the buffers may be corrupted before the data is written. ** ** The exact subset of the write-list written and/or corrupted is ** determined by the simulated device characteristics and sector-size. ** ** "Normal" mode: ** ** Normal mode is used when the simulated device has none of the ** SQLITE_IOCAP_XXX flags set. ** ** In normal mode, if the fsync() is not a simulated crash, the ** write-list is traversed from beginning to end. Each WriteBuffer ** structure associated with the file handle used to call xSync() ** is written to the real file and removed from the write-list. ** ** If a crash is simulated, one of the following takes place for ** each WriteBuffer in the write-list, regardless of which ** file-handle it is associated with: ** ** 1. The buffer is correctly written to the file, just as if ** a crash were not being simulated. ** ** 2. Nothing is done. ** ** 3. Garbage data is written to all sectors of the file that ** overlap the region specified by the WriteBuffer. Or garbage ** data is written to some contiguous section within the ** overlapped sectors. ** ** Device Characteristic flag handling: ** ** If the IOCAP_ATOMIC flag is set, then option (3) above is ** never selected. ** ** If the IOCAP_ATOMIC512 flag is set, and the WriteBuffer represents ** an aligned write() of an integer number of 512 byte regions, then ** option (3) above is never selected. Instead, each 512 byte region ** is either correctly written or left completely untouched. Similar ** logic governs the behavior if any of the other ATOMICXXX flags ** is set. ** ** If either the IOCAP_SAFEAPPEND or IOCAP_SEQUENTIAL flags are set ** and a crash is being simulated, then an entry of the write-list is ** selected at random. Everything in the list after the selected entry ** is discarded before processing begins. ** ** If IOCAP_SEQUENTIAL is set and a crash is being simulated, option ** (1) is selected for all write-list entries except the last. If a ** crash is not being simulated, then all entries in the write-list ** that occur before at least one write() on the file-handle specified ** as part of the xSync() are written to their associated real files. ** ** If IOCAP_SAFEAPPEND is set and the first byte written by the write() ** operation is one byte past the current end of the file, then option ** (1) is always selected. */ /* ** Each write operation in the write-list is represented by an instance ** of the following structure. ** ** If zBuf is 0, then this structure represents a call to xTruncate(), ** not xWrite(). In that case, iOffset is the size that the file is ** truncated to. */ struct WriteBuffer { i64 iOffset; /* Byte offset of the start of this write() */ int nBuf; /* Number of bytes written */ u8 *zBuf; /* Pointer to copy of written data */ CrashFile *pFile; /* File this write() applies to */ WriteBuffer *pNext; /* Next in CrashGlobal.pWriteList */ }; struct CrashFile { const sqlite3_io_methods *pMethod; /* Must be first */ sqlite3_file *pRealFile; /* Underlying "real" file handle */ char *zName; int flags; /* Flags the file was opened with */ /* Cache of the entire file. This is used to speed up OsRead() and ** OsFileSize() calls. Although both could be done by traversing the ** write-list, in practice this is impractically slow. */ u8 *zData; /* Buffer containing file contents */ int nData; /* Size of buffer allocated at zData */ i64 iSize; /* Size of file in bytes */ }; struct CrashGlobal { WriteBuffer *pWriteList; /* Head of write-list */ WriteBuffer *pWriteListEnd; /* End of write-list */ int iSectorSize; /* Value of simulated sector size */ int iDeviceCharacteristics; /* Value of simulated device characteristics */ int iCrash; /* Crash on the iCrash'th call to xSync() */ char zCrashFile[500]; /* Crash during an xSync() on this file */ }; static CrashGlobal g = {0, 0, SQLITE_DEFAULT_SECTOR_SIZE, 0, 0}; /* ** Set this global variable to 1 to enable crash testing. */ static int sqlite3CrashTestEnable = 0; static void *crash_malloc(int nByte){ return (void *)Tcl_AttemptAlloc((size_t)nByte); } static void crash_free(void *p){ Tcl_Free(p); } static void *crash_realloc(void *p, int n){ return (void *)Tcl_AttemptRealloc(p, (size_t)n); } /* ** Wrapper around the sqlite3OsWrite() function that avoids writing to the ** 512 byte block begining at offset PENDING_BYTE. */ static int writeDbFile(CrashFile *p, u8 *z, i64 iAmt, i64 iOff){ int rc = SQLITE_OK; int iSkip = 0; if( (iAmt-iSkip)>0 ){ rc = sqlite3OsWrite(p->pRealFile, &z[iSkip], (int)(iAmt-iSkip), iOff+iSkip); } return rc; } /* ** Flush the write-list as if xSync() had been called on file handle ** pFile. If isCrash is true, simulate a crash. */ static int writeListSync(CrashFile *pFile, int isCrash){ int rc = SQLITE_OK; int iDc = g.iDeviceCharacteristics; WriteBuffer *pWrite; WriteBuffer **ppPtr; /* If this is not a crash simulation, set pFinal to point to the ** last element of the write-list that is associated with file handle ** pFile. ** ** If this is a crash simulation, set pFinal to an arbitrarily selected ** element of the write-list. */ WriteBuffer *pFinal = 0; if( !isCrash ){ for(pWrite=g.pWriteList; pWrite; pWrite=pWrite->pNext){ if( pWrite->pFile==pFile ){ pFinal = pWrite; } } }else if( iDc&(SQLITE_IOCAP_SEQUENTIAL|SQLITE_IOCAP_SAFE_APPEND) ){ int nWrite = 0; int iFinal; for(pWrite=g.pWriteList; pWrite; pWrite=pWrite->pNext) nWrite++; sqlite3_randomness(sizeof(int), &iFinal); iFinal = ((iFinal<0)?-1*iFinal:iFinal)%nWrite; for(pWrite=g.pWriteList; iFinal>0; pWrite=pWrite->pNext) iFinal--; pFinal = pWrite; } #ifdef TRACE_CRASHTEST if( pFile ){ printf("Sync %s (is %s crash)\n", pFile->zName, (isCrash?"a":"not a")); } #endif ppPtr = &g.pWriteList; for(pWrite=*ppPtr; rc==SQLITE_OK && pWrite; pWrite=*ppPtr){ sqlite3_file *pRealFile = pWrite->pFile->pRealFile; /* (eAction==1) -> write block out normally, ** (eAction==2) -> do nothing, ** (eAction==3) -> trash sectors. */ int eAction = 0; if( !isCrash ){ eAction = 2; if( (pWrite->pFile==pFile || iDc&SQLITE_IOCAP_SEQUENTIAL) ){ eAction = 1; } }else{ char random; sqlite3_randomness(1, &random); /* Do not select option 3 (sector trashing) if the IOCAP_ATOMIC flag ** is set or this is an OsTruncate(), not an Oswrite(). */ if( (iDc&SQLITE_IOCAP_ATOMIC) || (pWrite->zBuf==0) ){ random &= 0x01; } /* If IOCAP_SEQUENTIAL is set and this is not the final entry ** in the truncated write-list, always select option 1 (write ** out correctly). */ if( (iDc&SQLITE_IOCAP_SEQUENTIAL && pWrite!=pFinal) ){ random = 0; } /* If IOCAP_SAFE_APPEND is set and this OsWrite() operation is ** an append (first byte of the written region is 1 byte past the ** current EOF), always select option 1 (write out correctly). */ if( iDc&SQLITE_IOCAP_SAFE_APPEND && pWrite->zBuf ){ i64 iSize; sqlite3OsFileSize(pRealFile, &iSize); if( iSize==pWrite->iOffset ){ random = 0; } } if( (random&0x06)==0x06 ){ eAction = 3; }else{ eAction = ((random&0x01)?2:1); } } switch( eAction ){ case 1: { /* Write out correctly */ if( pWrite->zBuf ){ rc = writeDbFile( pWrite->pFile, pWrite->zBuf, pWrite->nBuf, pWrite->iOffset ); }else{ rc = sqlite3OsTruncate(pRealFile, pWrite->iOffset); } *ppPtr = pWrite->pNext; #ifdef TRACE_CRASHTEST if( isCrash ){ printf("Writing %d bytes @ %d (%s)\n", pWrite->nBuf, (int)pWrite->iOffset, pWrite->pFile->zName ); } #endif crash_free(pWrite); break; } case 2: { /* Do nothing */ ppPtr = &pWrite->pNext; #ifdef TRACE_CRASHTEST if( isCrash ){ printf("Omiting %d bytes @ %d (%s)\n", pWrite->nBuf, (int)pWrite->iOffset, pWrite->pFile->zName ); } #endif break; } case 3: { /* Trash sectors */ u8 *zGarbage; int iFirst = (int)(pWrite->iOffset/g.iSectorSize); int iLast = (int)((pWrite->iOffset+pWrite->nBuf-1)/g.iSectorSize); assert(pWrite->zBuf); #ifdef TRACE_CRASHTEST printf("Trashing %d sectors (%d bytes) @ %lld (sector %d) (%s)\n", 1+iLast-iFirst, (1+iLast-iFirst)*g.iSectorSize, pWrite->iOffset, iFirst, pWrite->pFile->zName ); #endif zGarbage = crash_malloc(g.iSectorSize); if( zGarbage ){ sqlite3_int64 i; for(i=iFirst; rc==SQLITE_OK && i<=iLast; i++){ sqlite3_randomness(g.iSectorSize, zGarbage); rc = writeDbFile( pWrite->pFile, zGarbage, g.iSectorSize, i*g.iSectorSize ); } crash_free(zGarbage); }else{ rc = SQLITE_NOMEM; } ppPtr = &pWrite->pNext; break; } default: assert(!"Cannot happen"); } if( pWrite==pFinal ) break; } if( rc==SQLITE_OK && isCrash ){ exit(-1); } for(pWrite=g.pWriteList; pWrite && pWrite->pNext; pWrite=pWrite->pNext); g.pWriteListEnd = pWrite; return rc; } /* ** Add an entry to the end of the write-list. */ static int writeListAppend( sqlite3_file *pFile, sqlite3_int64 iOffset, const u8 *zBuf, int nBuf ){ WriteBuffer *pNew; assert((zBuf && nBuf) || (!nBuf && !zBuf)); pNew = (WriteBuffer *)crash_malloc(sizeof(WriteBuffer) + nBuf); if( pNew==0 ){ fprintf(stderr, "out of memory in the crash simulator\n"); } memset(pNew, 0, sizeof(WriteBuffer)+nBuf); pNew->iOffset = iOffset; pNew->nBuf = nBuf; pNew->pFile = (CrashFile *)pFile; if( zBuf ){ pNew->zBuf = (u8 *)&pNew[1]; memcpy(pNew->zBuf, zBuf, nBuf); } if( g.pWriteList ){ assert(g.pWriteListEnd); g.pWriteListEnd->pNext = pNew; }else{ g.pWriteList = pNew; } g.pWriteListEnd = pNew; return SQLITE_OK; } /* ** Close a crash-file. */ static int cfClose(sqlite3_file *pFile){ CrashFile *pCrash = (CrashFile *)pFile; writeListSync(pCrash, 0); sqlite3OsClose(pCrash->pRealFile); return SQLITE_OK; } /* ** Read data from a crash-file. */ static int cfRead( sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst ){ CrashFile *pCrash = (CrashFile *)pFile; int nCopy = (int)MIN((i64)iAmt, (pCrash->iSize - iOfst)); if( nCopy>0 ){ memcpy(zBuf, &pCrash->zData[iOfst], nCopy); } /* Check the file-size to see if this is a short-read */ if( nCopy<iAmt ){ return SQLITE_IOERR_SHORT_READ; } return SQLITE_OK; } /* ** Write data to a crash-file. */ static int cfWrite( sqlite3_file *pFile, const void *zBuf, int iAmt, sqlite_int64 iOfst ){ CrashFile *pCrash = (CrashFile *)pFile; if( iAmt+iOfst>pCrash->iSize ){ pCrash->iSize = (int)(iAmt+iOfst); } while( pCrash->iSize>pCrash->nData ){ u8 *zNew; int nNew = (pCrash->nData*2) + 4096; zNew = crash_realloc(pCrash->zData, nNew); if( !zNew ){ return SQLITE_NOMEM; } memset(&zNew[pCrash->nData], 0, nNew-pCrash->nData); pCrash->nData = nNew; pCrash->zData = zNew; } memcpy(&pCrash->zData[iOfst], zBuf, iAmt); return writeListAppend(pFile, iOfst, zBuf, iAmt); } /* ** Truncate a crash-file. */ static int cfTruncate(sqlite3_file *pFile, sqlite_int64 size){ CrashFile *pCrash = (CrashFile *)pFile; assert(size>=0); if( pCrash->iSize>size ){ pCrash->iSize = (int)size; } return writeListAppend(pFile, size, 0, 0); } /* ** Sync a crash-file. */ static int cfSync(sqlite3_file *pFile, int flags){ CrashFile *pCrash = (CrashFile *)pFile; int isCrash = 0; const char *zName = pCrash->zName; const char *zCrashFile = g.zCrashFile; int nName = (int)strlen(zName); int nCrashFile = (int)strlen(zCrashFile); if( nCrashFile>0 && zCrashFile[nCrashFile-1]=='*' ){ nCrashFile--; if( nName>nCrashFile ) nName = nCrashFile; } #ifdef TRACE_CRASHTEST printf("cfSync(): nName = %d, nCrashFile = %d, zName = %s, zCrashFile = %s\n", nName, nCrashFile, zName, zCrashFile); #endif if( nName==nCrashFile && 0==memcmp(zName, zCrashFile, nName) ){ #ifdef TRACE_CRASHTEST printf("cfSync(): name matched, g.iCrash = %d\n", g.iCrash); #endif if( (--g.iCrash)==0 ) isCrash = 1; } return writeListSync(pCrash, isCrash); } /* ** Return the current file-size of the crash-file. */ static int cfFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ CrashFile *pCrash = (CrashFile *)pFile; *pSize = (i64)pCrash->iSize; return SQLITE_OK; } /* ** Calls related to file-locks are passed on to the real file handle. */ static int cfLock(sqlite3_file *pFile, int eLock){ return sqlite3OsLock(((CrashFile *)pFile)->pRealFile, eLock); } static int cfUnlock(sqlite3_file *pFile, int eLock){ return sqlite3OsUnlock(((CrashFile *)pFile)->pRealFile, eLock); } static int cfCheckReservedLock(sqlite3_file *pFile, int *pResOut){ return sqlite3OsCheckReservedLock(((CrashFile *)pFile)->pRealFile, pResOut); } static int cfFileControl(sqlite3_file *pFile, int op, void *pArg){ if( op==SQLITE_FCNTL_SIZE_HINT ){ CrashFile *pCrash = (CrashFile *)pFile; i64 nByte = *(i64 *)pArg; if( nByte>pCrash->iSize ){ if( SQLITE_OK==writeListAppend(pFile, nByte, 0, 0) ){ pCrash->iSize = (int)nByte; } } return SQLITE_OK; } return sqlite3OsFileControl(((CrashFile *)pFile)->pRealFile, op, pArg); } /* ** The xSectorSize() and xDeviceCharacteristics() functions return ** the global values configured by the [sqlite_crashparams] tcl * interface. */ static int cfSectorSize(sqlite3_file *pFile){ return g.iSectorSize; } static int cfDeviceCharacteristics(sqlite3_file *pFile){ return g.iDeviceCharacteristics; } /* ** Pass-throughs for WAL support. */ static int cfShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ return sqlite3OsShmLock(((CrashFile*)pFile)->pRealFile, ofst, n, flags); } static void cfShmBarrier(sqlite3_file *pFile){ sqlite3OsShmBarrier(((CrashFile*)pFile)->pRealFile); } static int cfShmUnmap(sqlite3_file *pFile, int delFlag){ return sqlite3OsShmUnmap(((CrashFile*)pFile)->pRealFile, delFlag); } static int cfShmMap( sqlite3_file *pFile, /* Handle open on database file */ int iRegion, /* Region to retrieve */ int sz, /* Size of regions */ int w, /* True to extend file if necessary */ void volatile **pp /* OUT: Mapped memory */ ){ return sqlite3OsShmMap(((CrashFile*)pFile)->pRealFile, iRegion, sz, w, pp); } static const sqlite3_io_methods CrashFileVtab = { 2, /* iVersion */ cfClose, /* xClose */ cfRead, /* xRead */ cfWrite, /* xWrite */ cfTruncate, /* xTruncate */ cfSync, /* xSync */ cfFileSize, /* xFileSize */ cfLock, /* xLock */ cfUnlock, /* xUnlock */ cfCheckReservedLock, /* xCheckReservedLock */ cfFileControl, /* xFileControl */ cfSectorSize, /* xSectorSize */ cfDeviceCharacteristics, /* xDeviceCharacteristics */ cfShmMap, /* xShmMap */ cfShmLock, /* xShmLock */ cfShmBarrier, /* xShmBarrier */ cfShmUnmap /* xShmUnmap */ }; /* ** Application data for the crash VFS */ struct crashAppData { sqlite3_vfs *pOrig; /* Wrapped vfs structure */ }; /* ** Open a crash-file file handle. ** ** The caller will have allocated pVfs->szOsFile bytes of space ** at pFile. This file uses this space for the CrashFile structure ** and allocates space for the "real" file structure using ** sqlite3_malloc(). The assumption here is (pVfs->szOsFile) is ** equal or greater than sizeof(CrashFile). */ static int cfOpen( sqlite3_vfs *pCfVfs, const char *zName, sqlite3_file *pFile, int flags, int *pOutFlags ){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; int rc; CrashFile *pWrapper = (CrashFile *)pFile; sqlite3_file *pReal = (sqlite3_file*)&pWrapper[1]; memset(pWrapper, 0, sizeof(CrashFile)); rc = sqlite3OsOpen(pVfs, zName, pReal, flags, pOutFlags); if( rc==SQLITE_OK ){ i64 iSize; pWrapper->pMethod = &CrashFileVtab; pWrapper->zName = (char *)zName; pWrapper->pRealFile = pReal; rc = sqlite3OsFileSize(pReal, &iSize); pWrapper->iSize = (int)iSize; pWrapper->flags = flags; } if( rc==SQLITE_OK ){ pWrapper->nData = (int)(4096 + pWrapper->iSize); pWrapper->zData = crash_malloc(pWrapper->nData); if( pWrapper->zData ){ /* os_unix.c contains an assert() that fails if the caller attempts ** to read data from the 512-byte locking region of a file opened ** with the SQLITE_OPEN_MAIN_DB flag. This region of a database file ** never contains valid data anyhow. So avoid doing such a read here. ** ** UPDATE: It also contains an assert() verifying that each call ** to the xRead() method reads less than 128KB of data. */ i64 iOff; memset(pWrapper->zData, 0, pWrapper->nData); for(iOff=0; iOff<pWrapper->iSize; iOff += 512){ int nRead = (int)(pWrapper->iSize - iOff); if( nRead>512 ) nRead = 512; rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], nRead, iOff); } }else{ rc = SQLITE_NOMEM; } } if( rc!=SQLITE_OK && pWrapper->pMethod ){ sqlite3OsClose(pFile); } return rc; } static int cfDelete(sqlite3_vfs *pCfVfs, const char *zPath, int dirSync){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xDelete(pVfs, zPath, dirSync); } static int cfAccess( sqlite3_vfs *pCfVfs, const char *zPath, int flags, int *pResOut ){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xAccess(pVfs, zPath, flags, pResOut); } static int cfFullPathname( sqlite3_vfs *pCfVfs, const char *zPath, int nPathOut, char *zPathOut ){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); } static void *cfDlOpen(sqlite3_vfs *pCfVfs, const char *zPath){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xDlOpen(pVfs, zPath); } static void cfDlError(sqlite3_vfs *pCfVfs, int nByte, char *zErrMsg){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; pVfs->xDlError(pVfs, nByte, zErrMsg); } static void (*cfDlSym(sqlite3_vfs *pCfVfs, void *pH, const char *zSym))(void){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xDlSym(pVfs, pH, zSym); } static void cfDlClose(sqlite3_vfs *pCfVfs, void *pHandle){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; pVfs->xDlClose(pVfs, pHandle); } static int cfRandomness(sqlite3_vfs *pCfVfs, int nByte, char *zBufOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xRandomness(pVfs, nByte, zBufOut); } static int cfSleep(sqlite3_vfs *pCfVfs, int nMicro){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xSleep(pVfs, nMicro); } static int cfCurrentTime(sqlite3_vfs *pCfVfs, double *pTimeOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xCurrentTime(pVfs, pTimeOut); } static int cfGetLastError(sqlite3_vfs *pCfVfs, int n, char *z){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xGetLastError(pVfs, n, z); } static int processDevSymArgs( Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int *piDeviceChar, int *piSectorSize ){ struct DeviceFlag { char *zName; int iValue; } aFlag[] = { { "atomic", SQLITE_IOCAP_ATOMIC }, { "atomic512", SQLITE_IOCAP_ATOMIC512 }, { "atomic1k", SQLITE_IOCAP_ATOMIC1K }, { "atomic2k", SQLITE_IOCAP_ATOMIC2K }, { "atomic4k", SQLITE_IOCAP_ATOMIC4K }, { "atomic8k", SQLITE_IOCAP_ATOMIC8K }, { "atomic16k", SQLITE_IOCAP_ATOMIC16K }, { "atomic32k", SQLITE_IOCAP_ATOMIC32K }, { "atomic64k", SQLITE_IOCAP_ATOMIC64K }, { "sequential", SQLITE_IOCAP_SEQUENTIAL }, { "safe_append", SQLITE_IOCAP_SAFE_APPEND }, { "powersafe_overwrite", SQLITE_IOCAP_POWERSAFE_OVERWRITE }, { "batch-atomic", SQLITE_IOCAP_BATCH_ATOMIC }, { 0, 0 } }; int i; int iDc = 0; int iSectorSize = 0; int setSectorsize = 0; int setDeviceChar = 0; for(i=0; i<objc; i+=2){ int nOpt; char *zOpt = Tcl_GetStringFromObj(objv[i], &nOpt); if( (nOpt>11 || nOpt<2 || strncmp("-sectorsize", zOpt, nOpt)) && (nOpt>16 || nOpt<2 || strncmp("-characteristics", zOpt, nOpt)) ){ Tcl_AppendResult(interp, "Bad option: \"", zOpt, "\" - must be \"-characteristics\" or \"-sectorsize\"", 0 ); return TCL_ERROR; } if( i==objc-1 ){ Tcl_AppendResult(interp, "Option requires an argument: \"", zOpt, "\"",0); return TCL_ERROR; } if( zOpt[1]=='s' ){ if( Tcl_GetIntFromObj(interp, objv[i+1], &iSectorSize) ){ return TCL_ERROR; } setSectorsize = 1; }else{ int j; Tcl_Obj **apObj; int nObj; if( Tcl_ListObjGetElements(interp, objv[i+1], &nObj, &apObj) ){ return TCL_ERROR; } for(j=0; j<nObj; j++){ int rc; int iChoice; Tcl_Obj *pFlag = Tcl_DuplicateObj(apObj[j]); Tcl_IncrRefCount(pFlag); Tcl_UtfToLower(Tcl_GetString(pFlag)); rc = Tcl_GetIndexFromObjStruct( interp, pFlag, aFlag, sizeof(aFlag[0]), "no such flag", 0, &iChoice ); Tcl_DecrRefCount(pFlag); if( rc ){ return TCL_ERROR; } iDc |= aFlag[iChoice].iValue; } setDeviceChar = 1; } } if( setDeviceChar ){ *piDeviceChar = iDc; } if( setSectorsize ){ *piSectorSize = iSectorSize; } return TCL_OK; } /* ** tclcmd: sqlite3_crash_now ** ** Simulate a crash immediately. This function does not return ** (writeListSync() calls exit(-1)). */ static int SQLITE_TCLAPI crashNowCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } writeListSync(0, 1); assert( 0 ); return TCL_OK; } /* ** tclcmd: sqlite_crash_enable ENABLE ?DEFAULT? ** ** Parameter ENABLE must be a boolean value. If true, then the "crash" ** vfs is added to the system. If false, it is removed. */ static int SQLITE_TCLAPI crashEnableCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int isEnable; int isDefault = 0; static sqlite3_vfs crashVfs = { 2, /* iVersion */ 0, /* szOsFile */ 0, /* mxPathname */ 0, /* pNext */ "crash", /* zName */ 0, /* pAppData */ cfOpen, /* xOpen */ cfDelete, /* xDelete */ cfAccess, /* xAccess */ cfFullPathname, /* xFullPathname */ cfDlOpen, /* xDlOpen */ cfDlError, /* xDlError */ cfDlSym, /* xDlSym */ cfDlClose, /* xDlClose */ cfRandomness, /* xRandomness */ cfSleep, /* xSleep */ cfCurrentTime, /* xCurrentTime */ cfGetLastError, /* xGetLastError */ 0, /* xCurrentTimeInt64 */ }; if( objc!=2 && objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "ENABLE ?DEFAULT?"); return TCL_ERROR; } if( Tcl_GetBooleanFromObj(interp, objv[1], &isEnable) ){ return TCL_ERROR; } if( objc==3 && Tcl_GetBooleanFromObj(interp, objv[2], &isDefault) ){ return TCL_ERROR; } if( (isEnable && crashVfs.pAppData) || (!isEnable && !crashVfs.pAppData) ){ return TCL_OK; } if( crashVfs.pAppData==0 ){ sqlite3_vfs *pOriginalVfs = sqlite3_vfs_find(0); crashVfs.mxPathname = pOriginalVfs->mxPathname; crashVfs.pAppData = (void *)pOriginalVfs; crashVfs.szOsFile = sizeof(CrashFile) + pOriginalVfs->szOsFile; sqlite3_vfs_register(&crashVfs, isDefault); }else{ crashVfs.pAppData = 0; sqlite3_vfs_unregister(&crashVfs); } return TCL_OK; } /* ** tclcmd: sqlite_crashparams ?OPTIONS? DELAY CRASHFILE ** ** This procedure implements a TCL command that enables crash testing ** in testfixture. Once enabled, crash testing cannot be disabled. ** ** Available options are "-characteristics" and "-sectorsize". Both require ** an argument. For -sectorsize, this is the simulated sector size in ** bytes. For -characteristics, the argument must be a list of io-capability ** flags to simulate. Valid flags are "atomic", "atomic512", "atomic1K", ** "atomic2K", "atomic4K", "atomic8K", "atomic16K", "atomic32K", ** "atomic64K", "sequential" and "safe_append". ** ** Example: ** ** sqlite_crashparams -sect 1024 -char {atomic sequential} ./test.db 1 ** */ static int SQLITE_TCLAPI crashParamsObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int iDelay; const char *zCrashFile; int nCrashFile, iDc, iSectorSize; iDc = -1; iSectorSize = -1; if( objc<3 ){ Tcl_WrongNumArgs(interp, 1, objv, "?OPTIONS? DELAY CRASHFILE"); goto error; } zCrashFile = Tcl_GetStringFromObj(objv[objc-1], &nCrashFile); if( nCrashFile>=sizeof(g.zCrashFile) ){ Tcl_AppendResult(interp, "Filename is too long: \"", zCrashFile, "\"", 0); goto error; } if( Tcl_GetIntFromObj(interp, objv[objc-2], &iDelay) ){ goto error; } if( processDevSymArgs(interp, objc-3, &objv[1], &iDc, &iSectorSize) ){ return TCL_ERROR; } if( iDc>=0 ){ g.iDeviceCharacteristics = iDc; } if( iSectorSize>=0 ){ g.iSectorSize = iSectorSize; } g.iCrash = iDelay; memcpy(g.zCrashFile, zCrashFile, nCrashFile+1); sqlite3CrashTestEnable = 1; return TCL_OK; error: return TCL_ERROR; } static int SQLITE_TCLAPI devSymObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ void devsym_register(int iDeviceChar, int iSectorSize); int iDc = -1; int iSectorSize = -1; if( processDevSymArgs(interp, objc-1, &objv[1], &iDc, &iSectorSize) ){ return TCL_ERROR; } devsym_register(iDc, iSectorSize); return TCL_OK; } /* ** tclcmd: sqlite3_crash_on_write N */ static int SQLITE_TCLAPI writeCrashObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ void devsym_crash_on_write(int); int nWrite = 0; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "NWRITE"); return TCL_ERROR; } if( Tcl_GetIntFromObj(interp, objv[1], &nWrite) ){ return TCL_ERROR; } devsym_crash_on_write(nWrite); return TCL_OK; } /* ** tclcmd: unregister_devsim */ static int SQLITE_TCLAPI dsUnregisterObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ void devsym_unregister(void); if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } devsym_unregister(); return TCL_OK; } /* ** tclcmd: register_jt_vfs ?-default? PARENT-VFS */ static int SQLITE_TCLAPI jtObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ int jt_register(char *, int); char *zParent = 0; if( objc!=2 && objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "?-default? PARENT-VFS"); return TCL_ERROR; } zParent = Tcl_GetString(objv[1]); if( objc==3 ){ if( strcmp(zParent, "-default") ){ Tcl_AppendResult(interp, "bad option \"", zParent, "\": must be -default", 0 ); return TCL_ERROR; } zParent = Tcl_GetString(objv[2]); } if( !(*zParent) ){ zParent = 0; } if( jt_register(zParent, objc==3) ){ Tcl_AppendResult(interp, "Error in jt_register", 0); return TCL_ERROR; } return TCL_OK; } /* ** tclcmd: unregister_jt_vfs */ static int SQLITE_TCLAPI jtUnregisterObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ void jt_unregister(void); if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } jt_unregister(); return TCL_OK; } #endif /* SQLITE_OMIT_DISKIO */ /* ** This procedure registers the TCL procedures defined in this file. */ int Sqlitetest6_Init(Tcl_Interp *interp){ #ifndef SQLITE_OMIT_DISKIO Tcl_CreateObjCommand(interp, "sqlite3_crash_enable", crashEnableCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_crashparams", crashParamsObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_crash_now", crashNowCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_simulate_device", devSymObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_crash_on_write", writeCrashObjCmd,0,0); Tcl_CreateObjCommand(interp, "unregister_devsim", dsUnregisterObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "register_jt_vfs", jtObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "unregister_jt_vfs", jtUnregisterObjCmd, 0, 0); #endif return TCL_OK; } #endif /* SQLITE_TEST */
endlessm/chromium-browser
third_party/sqlite/src/src/test6.c
C
bsd-3-clause
32,372
[ 30522, 1013, 1008, 1008, 1008, 2432, 2089, 2570, 1008, 1008, 1008, 1008, 1996, 3166, 5860, 19771, 5244, 9385, 2000, 2023, 3120, 3642, 1012, 1999, 2173, 1997, 1008, 1008, 1037, 3423, 5060, 1010, 2182, 2003, 1037, 13301, 1024, 1008, 1008, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- title: Lyric Link theme: light background-color: '#9d44b6' text-color: '#ffffff' hex-color: '#ffffff' hex-icon: 'lyric-link-icon.png' construction: false priority: 8 timeframe: Fall 2017 tags: - Java - Android categories: - Projects links: - android, Download on Google Play, https://play.google.com/store/apps/details?id=ninja.andrey.lyriclink - github, View on GitHub, https://github.com/andreybutenko/Lyric-Link --- A fast, seamless lyrics app. You can jump directly to lyrics for the currently-playing without typing or searching. This solves common difficulties in looking up song lyrics. <!-- more --> {% raw %} <div class="gallery"> <a data-fancybox="screenshots" href="/images/lyriclink/banner.png" target="_blank"><img src="/images/lyriclink/banner.png"></a> </div> {% endraw %} <script src="//code.jquery.com/jquery-3.2.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.0.47/jquery.fancybox.min.js"></script>
andreybutenko/ninja
source/_posts/lyric-link.md
Markdown
apache-2.0
959
[ 30522, 1011, 1011, 1011, 2516, 1024, 13677, 4957, 4323, 1024, 2422, 4281, 1011, 3609, 1024, 1005, 1001, 1023, 2094, 22932, 2497, 2575, 1005, 3793, 1011, 3609, 1024, 1005, 1001, 21461, 4246, 4246, 1005, 2002, 2595, 1011, 3609, 1024, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include<stdio.h> void swapValue(int arr[], int i, int j) { int t = arr[i]; arr[i] = arr[j]; arr[j] = t; } void bubbleSort(int arr[], int arrLength) { int indexOfLastUnsortedElement = arrLength; int swapped = 0; while (swapped == 0) { swapped = 1; for (int i = 0; i < indexOfLastUnsortedElement - 1; i++) { if (arr[i] > arr[i + 1]) { swapValue(arr, i, i + 1); swapped = 0; } } indexOfLastUnsortedElement--; } } void selectionSort(int arr[], int arrLength) { for (int i = 0; i < arrLength - 1; i++) { int minIdx = i; for (int j = i + 1; j < arrLength; j++) if (arr[j] < arr[minIdx]) minIdx = j; if (i < minIdx) swapValue(arr, i, minIdx); } } void insertionSort(int arr[], int arrLength) { int j = 0; for (int i = 1; i < arrLength; ++i) { int tempValue = arr[i]; for (j = i - 1; j >= 0 && arr[j] > tempValue; --j) { swapValue(arr, j, j + 1); } arr[j + 1] = tempValue; } } void quickSort(int arr[], int left, int right) { int pivotidx = (left + right) / 2; int i = left; int j = right; int pivot = arr[pivotidx]; while (i <= j) { while (arr[i] < pivot) i++; while (arr[j] > pivot) j--; if (i <= j) { if (arr[i] > arr[j] && i < j) swapValue(arr, i, j); i++; j--; } } if (left < j) quickSort(arr, left, j); if (i < right) quickSort(arr, i, right); } void mergeSort(int arr[], int left, int right) { if (right > left) { int mid = left + ((right - left) / 2); mergeSort(arr, left, mid); mergeSort(arr, mid + 1, right); int subLeft[100]; int subRight[100]; for (int i = left; i <= mid; i++) subLeft[i - left] = arr[i]; for (int i = mid + 1; i <= right; i++) subRight[i - mid - 1] = arr[i]; int leftIndex = 0; int rightIndex = 0; for (int i = left; i <= right; i++) if (left + leftIndex <= mid && (mid + 1 + rightIndex > right || subLeft[leftIndex] < subRight[rightIndex])) { arr[i] = subLeft[leftIndex]; leftIndex++; } else { arr[i] = subRight[rightIndex]; rightIndex++; } } } int main() { int arr[]={5,4,9,6,8,3,2,0,7,1}; int len = sizeof (arr) / sizeof (arr[0]); //bubbleSort(arr, len); //selectionSort(arr, len); //insertionSort(arr, len); //quickSort(arr, 0, len - 1); mergeSort(arr, 0, len - 1); for (int i = 0; i < len; i++) printf("%d ", arr[i]); return 0; }
HoanChan/HoanChan.github.io
live/sortviewer/code/Sort.c
C
mit
2,800
[ 30522, 1001, 2421, 1026, 2358, 20617, 1012, 1044, 1028, 11675, 19948, 10175, 5657, 1006, 20014, 12098, 2099, 1031, 1033, 1010, 20014, 1045, 1010, 20014, 1046, 1007, 1063, 20014, 1056, 1027, 12098, 2099, 1031, 1045, 1033, 1025, 12098, 2099, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*******************************************ÉêÃ÷*************************************** ±¾Ç¶Èëʽ²Ù×÷ϵͳδ¾­ÊÚȨ£¬½ûÖ¹Ó¦ÓÃÓÚÈκÎÉÌÒµÓÃ; °æÈ¨ËùÓУ¬ÇÖȨ±Ø¾¿ **************************************************************************************/ /** ****************************************************************************** * @file misc.h * @author MCD Application Team * @version V3.6.1 * @date 05-March-2012 * @brief This file contains all the functions prototypes for the miscellaneous * firmware library functions (add-on to CMSIS functions). ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MISC_H #define __MISC_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f10x.h" /** @addtogroup STM32F10x_StdPeriph_Driver * @{ */ /** @addtogroup MISC * @{ */ /** @defgroup MISC_Exported_Types * @{ */ /** * @brief NVIC Init Structure definition */ typedef struct { uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled. This parameter can be a value of @ref IRQn_Type (For the complete STM32 Devices IRQ Channels list, please refer to stm32f10x.h file) */ uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel specified in NVIC_IRQChannel. This parameter can be a value between 0 and 15 as described in the table @ref NVIC_Priority_Table */ uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified in NVIC_IRQChannel. This parameter can be a value between 0 and 15 as described in the table @ref NVIC_Priority_Table */ FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel will be enabled or disabled. This parameter can be set either to ENABLE or DISABLE */ } NVIC_InitTypeDef; /** * @} */ /** @defgroup NVIC_Priority_Table * @{ */ /** @code The table below gives the allowed values of the pre-emption priority and subpriority according to the Priority Grouping configuration performed by NVIC_PriorityGroupConfig function ============================================================================================================================ NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description ============================================================================================================================ NVIC_PriorityGroup_0 | 0 | 0-15 | 0 bits for pre-emption priority | | | 4 bits for subpriority ---------------------------------------------------------------------------------------------------------------------------- NVIC_PriorityGroup_1 | 0-1 | 0-7 | 1 bits for pre-emption priority | | | 3 bits for subpriority ---------------------------------------------------------------------------------------------------------------------------- NVIC_PriorityGroup_2 | 0-3 | 0-3 | 2 bits for pre-emption priority | | | 2 bits for subpriority ---------------------------------------------------------------------------------------------------------------------------- NVIC_PriorityGroup_3 | 0-7 | 0-1 | 3 bits for pre-emption priority | | | 1 bits for subpriority ---------------------------------------------------------------------------------------------------------------------------- NVIC_PriorityGroup_4 | 0-15 | 0 | 4 bits for pre-emption priority | | | 0 bits for subpriority ============================================================================================================================ @endcode */ /** * @} */ /** @defgroup MISC_Exported_Constants * @{ */ /** @defgroup Vector_Table_Base * @{ */ #define NVIC_VectTab_RAM ((uint32_t)0x20000000) #define NVIC_VectTab_FLASH ((uint32_t)0x08000000) #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \ ((VECTTAB) == NVIC_VectTab_FLASH)) /** * @} */ /** @defgroup System_Low_Power * @{ */ #define NVIC_LP_SEVONPEND ((uint8_t)0x10) #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04) #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02) #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \ ((LP) == NVIC_LP_SLEEPDEEP) || \ ((LP) == NVIC_LP_SLEEPONEXIT)) /** * @} */ /** @defgroup Preemption_Priority_Group * @{ */ #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority 4 bits for subpriority */ #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority 3 bits for subpriority */ #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority 2 bits for subpriority */ #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority 1 bits for subpriority */ #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority 0 bits for subpriority */ #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \ ((GROUP) == NVIC_PriorityGroup_1) || \ ((GROUP) == NVIC_PriorityGroup_2) || \ ((GROUP) == NVIC_PriorityGroup_3) || \ ((GROUP) == NVIC_PriorityGroup_4)) #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF) /** * @} */ /** @defgroup SysTick_clock_source * @{ */ #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \ ((SOURCE) == SysTick_CLKSource_HCLK_Div8)) /** * @} */ /** * @} */ /** @defgroup MISC_Exported_Macros * @{ */ /** * @} */ /** @defgroup MISC_Exported_Functions * @{ */ void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup); void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct); void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset); void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState); void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource); #ifdef __cplusplus } #endif #endif /* __MISC_H */ /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
tongjinlv/trtos
Libraries/STM32F10x_StdPeriph_Driver/inc/misc.h
C
apache-2.0
9,365
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. #import "../../ccMacros.h" #ifdef __CC_PLATFORM_IOS #import "../../CCDirector.h" #import "kazmath/mat4.h" @class CCTouchDispatcher; /** CCDirector extensions for iPhone */ @interface CCDirector (iOSExtension) /** sets the CCTouchDispatcher (iOS only) */ @property (nonatomic,readwrite,retain) CCTouchDispatcher * touchDispatcher; /** The size in pixels of the surface. It could be different than the screen size. High-res devices might have a higher surface size than the screen size. In non High-res device the contentScale will be emulated. The recommend way to enable Retina Display is by using the "enableRetinaDisplay:(BOOL)enabled" method. @since v0.99.4 */ -(void) setContentScaleFactor:(CGFloat)scaleFactor; /** Will enable Retina Display on devices that supports it. It will enable Retina Display on iPhone4 and iPod Touch 4. It will return YES, if it could enabled it, otherwise it will return NO. This is the recommended way to enable Retina Display. @since v0.99.5 */ -(BOOL) enableRetinaDisplay:(BOOL)enableRetina; /** returns the content scale factor */ -(CGFloat) contentScaleFactor; /** converts a UITouch to a GL point */ -(CGPoint)convertTouchToGL:(UITouch*)touch; @end #pragma mark - #pragma mark CCDirectorIOS /** CCDirectorIOS: Base class of iOS directors @since v0.99.5 */ @interface CCDirectorIOS : CCDirector { /* contentScaleFactor could be simulated */ BOOL _isContentScaleSupported; CCTouchDispatcher *_touchDispatcher; } // XXX: At least one method is needed for BridgeSupport - (void) drawScene; @end /** DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display. * * Features and Limitations: * - Only available on 3.1+ * - Scheduled timers & drawing are synchronizes with the refresh rate of the display * - Only supports animation intervals of 1/60 1/30 & 1/15 * * It is the recommended Director if the SDK is 3.1 or newer * * @since v0.8.2 */ @interface CCDirectorDisplayLink : CCDirectorIOS { CADisplayLink *_displayLink; CFTimeInterval _lastDisplayTime; } -(void) mainLoop:(id)sender; @end // optimization. Should only be used to read it. Never to write it. extern CGFloat __ccContentScaleFactor; #endif // __CC_PLATFORM_IOS
alloy/Joybox
vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCDirectorIOS.h
C
mit
3,608
[ 30522, 1013, 1008, 1008, 25033, 2015, 2475, 2094, 2005, 18059, 1024, 8299, 1024, 1013, 1013, 7479, 1012, 25033, 2015, 2475, 2094, 1011, 18059, 1012, 8917, 1008, 1008, 9385, 1006, 1039, 1007, 2263, 1011, 2230, 13559, 10861, 3736, 2850, 1008,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module.exports = require('../crud/list')({ view: 'users/manage', model: require('../../models/user'), sort: { name: 1 } });
phoenixmusical/membres
lib/routes/users/manage.js
JavaScript
mit
131
[ 30522, 11336, 1012, 14338, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 13675, 6784, 1013, 2862, 1005, 1007, 1006, 1063, 3193, 1024, 1005, 5198, 1013, 6133, 1005, 1010, 2944, 1024, 5478, 1006, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 4275, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
''' The `Filter` hierarchy contains Transformer classes that take a `Stim` of one type as input and return a `Stim` of the same type as output (but with some changes to its data). ''' from .audio import (AudioTrimmingFilter, AudioResamplingFilter) from .base import TemporalTrimmingFilter from .image import (ImageCroppingFilter, ImageResizingFilter, PillowImageFilter) from .text import (WordStemmingFilter, TokenizingFilter, TokenRemovalFilter, PunctuationRemovalFilter, LowerCasingFilter) from .video import (FrameSamplingFilter, VideoTrimmingFilter) __all__ = [ 'AudioTrimmingFilter', 'AudioResamplingFilter', 'TemporalTrimmingFilter', 'ImageCroppingFilter', 'ImageResizingFilter', 'PillowImageFilter', 'WordStemmingFilter', 'TokenizingFilter', 'TokenRemovalFilter', 'PunctuationRemovalFilter', 'LowerCasingFilter', 'FrameSamplingFilter', 'VideoTrimmingFilter' ]
tyarkoni/pliers
pliers/filters/__init__.py
Python
bsd-3-clause
1,079
[ 30522, 1005, 1005, 1005, 1996, 1036, 11307, 1036, 12571, 3397, 10938, 2121, 4280, 2008, 2202, 1037, 1036, 2358, 5714, 1036, 1997, 2028, 2828, 2004, 7953, 1998, 2709, 1037, 1036, 2358, 5714, 1036, 1997, 1996, 2168, 2828, 2004, 6434, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "ParticleData.h" #include <algorithm> #include <cassert> namespace { template<typename T> void ResizeVector(T& obj, size_t size) { obj.clear(); obj.resize(size); obj.shrink_to_fit(); } template<typename T> size_t STLMemory(T& obj) { using Type = typename T::value_type; return obj.capacity() * sizeof(Type); } } ParticleData::ParticleData() : size(0) , count(0) { } void ParticleData::Generate(size_t size) { this->size = size; count = 0; ResizeVector(position, size); ResizeVector(velocity, size); ResizeVector(acceleration, size); ResizeVector(color, size); ResizeVector(alive, size); } size_t ParticleData::Wake(size_t count) { size_t start = 0; size_t end = std::min(std::max(this->count + count, start), size); for (size_t i = start; i < end; ++i) { alive[i] = true; } this->count = end; return end; } void ParticleData::Kill(size_t id) { assert(id < size && id >= 0); if (alive[id]) { count--; alive[id] = false; Swap(id, count); } } void ParticleData::Swap(size_t left, size_t right) { std::swap(position[left], position[right]); std::swap(velocity[left], velocity[right]); std::swap(acceleration[left], acceleration[right]); std::swap(color[left], color[right]); std::swap(alive[left], alive[right]); } size_t ParticleData::GetMemory(const ParticleData& system) { size_t size = sizeof(system); size += STLMemory(system.position); size += STLMemory(system.velocity); size += STLMemory(system.acceleration); size += STLMemory(system.color); size += STLMemory(system.alive); return size; }
jedarnaude/particles
src/ParticleData.cpp
C++
mit
1,572
[ 30522, 1001, 2421, 1000, 10811, 2850, 2696, 1012, 1044, 1000, 1001, 2421, 1026, 9896, 1028, 1001, 2421, 1026, 16220, 8743, 1028, 3415, 15327, 1063, 23561, 1026, 2828, 18442, 1056, 1028, 11675, 24501, 4697, 3726, 16761, 1006, 1056, 1004, 278...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...