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
/* * Asqatasun - Automated webpage assessment * Copyright (C) 2008-2020 Asqatasun.org * * This file is part of Asqatasun. * * Asqatasun is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Contact us by mail: asqatasun AT asqatasun DOT org */ package org.asqatasun.entity.audit; import java.util.Date; import org.asqatasun.entity.Entity; /** * * @author jkowalczyk */ public interface Content extends Entity { /** * * @return the audit */ Audit getAudit(); /** * * @return the date of loading */ Date getDateOfLoading(); /** * * @return the URI */ String getURI(); /** * * @return the http Status Code */ int getHttpStatusCode(); /** * * @param audit * the audit to set */ void setAudit(Audit audit); /** * * @param dateOfLoading * the date of loading to set */ void setDateOfLoading(Date dateOfLoading); /** * * @param uri * the URI to set */ void setURI(String uri); /** * * @param httpStatusCode * the Http Status Code when fetched the content */ void setHttpStatusCode(int httpStatusCode); }
Asqatasun/Asqatasun
engine/asqatasun-api/src/main/java/org/asqatasun/entity/audit/Content.java
Java
agpl-3.0
1,871
[ 30522, 1013, 1008, 1008, 2004, 19062, 10230, 4609, 1011, 12978, 4773, 13704, 7667, 1008, 9385, 1006, 1039, 1007, 2263, 1011, 12609, 2004, 19062, 10230, 4609, 1012, 8917, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 2004, 19062, 10230, 4609, 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 (C) 2002-2010 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "dosbox.h" #include "inout.h" #include "mixer.h" #include "mem.h" #include "hardware.h" #include "setup.h" #include "support.h" #include "pic.h" #include <cstring> #include <math.h> #define LEFT 0x00 #define RIGHT 0x01 #define CMS_BUFFER_SIZE 128 #define CMS_RATE 22050 typedef Bit8u UINT8; typedef Bit16s INT16; /* this structure defines a channel */ struct saa1099_channel { int frequency; /* frequency (0x00..0xff) */ int freq_enable; /* frequency enable */ int noise_enable; /* noise enable */ int octave; /* octave (0x00..0x07) */ int amplitude[2]; /* amplitude (0x00..0x0f) */ int envelope[2]; /* envelope (0x00..0x0f or 0x10 == off) */ /* vars to simulate the square wave */ double counter; double freq; int level; }; /* this structure defines a noise channel */ struct saa1099_noise { /* vars to simulate the noise generator output */ double counter; double freq; int level; /* noise polynomal shifter */ }; /* this structure defines a SAA1099 chip */ struct SAA1099 { int stream; /* our stream */ int noise_params[2]; /* noise generators parameters */ int env_enable[2]; /* envelope generators enable */ int env_reverse_right[2]; /* envelope reversed for right channel */ int env_mode[2]; /* envelope generators mode */ int env_bits[2]; /* non zero = 3 bits resolution */ int env_clock[2]; /* envelope clock mode (non-zero external) */ int env_step[2]; /* current envelope step */ int all_ch_enable; /* all channels enable */ int sync_state; /* sync all channels */ int selected_reg; /* selected register */ struct saa1099_channel channels[6]; /* channels */ struct saa1099_noise noise[2]; /* noise generators */ }; static const UINT8 envelope[8][64] = { /* zero amplitude */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* maximum amplitude */ {15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, }, /* single decay */ {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 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 }, /* repetitive decay */ {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* single triangular */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 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 }, /* repetitive triangular */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* single attack */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* repetitive attack */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 } }; static const int amplitude_lookup[16] = { 0*32767/16, 1*32767/16, 2*32767/16, 3*32767/16, 4*32767/16, 5*32767/16, 6*32767/16, 7*32767/16, 8*32767/16, 9*32767/16, 10*32767/16, 11*32767/16, 12*32767/16, 13*32767/16, 14*32767/16, 15*32767/16 }; /* global parameters */ static double sample_rate; static SAA1099 saa1099[2]; static MixerChannel * cms_chan; static Bit16s cms_buffer[2][2][CMS_BUFFER_SIZE]; static Bit16s * cms_buf_point[4] = { cms_buffer[0][0],cms_buffer[0][1],cms_buffer[1][0],cms_buffer[1][1] }; static Bitu last_command; static Bitu base_port; static void saa1099_envelope(int chip, int ch) { struct SAA1099 *saa = &saa1099[chip]; if (saa->env_enable[ch]) { int step, mode, mask; mode = saa->env_mode[ch]; /* step from 0..63 and then loop in steps 32..63 */ step = saa->env_step[ch] = ((saa->env_step[ch] + 1) & 0x3f) | (saa->env_step[ch] & 0x20); mask = 15; if (saa->env_bits[ch]) mask &= ~1; /* 3 bit resolution, mask LSB */ saa->channels[ch*3+0].envelope[ LEFT] = saa->channels[ch*3+1].envelope[ LEFT] = saa->channels[ch*3+2].envelope[ LEFT] = envelope[mode][step] & mask; if (saa->env_reverse_right[ch] & 0x01) { saa->channels[ch*3+0].envelope[RIGHT] = saa->channels[ch*3+1].envelope[RIGHT] = saa->channels[ch*3+2].envelope[RIGHT] = (15 - envelope[mode][step]) & mask; } else { saa->channels[ch*3+0].envelope[RIGHT] = saa->channels[ch*3+1].envelope[RIGHT] = saa->channels[ch*3+2].envelope[RIGHT] = envelope[mode][step] & mask; } } else { /* envelope mode off, set all envelope factors to 16 */ saa->channels[ch*3+0].envelope[ LEFT] = saa->channels[ch*3+1].envelope[ LEFT] = saa->channels[ch*3+2].envelope[ LEFT] = saa->channels[ch*3+0].envelope[RIGHT] = saa->channels[ch*3+1].envelope[RIGHT] = saa->channels[ch*3+2].envelope[RIGHT] = 16; } } static void saa1099_update(int chip, INT16 **buffer, int length) { struct SAA1099 *saa = &saa1099[chip]; int j, ch; /* if the channels are disabled we're done */ if (!saa->all_ch_enable) { /* init output data */ memset(buffer[LEFT],0,length*sizeof(INT16)); memset(buffer[RIGHT],0,length*sizeof(INT16)); return; } for (ch = 0; ch < 2; ch++) { switch (saa->noise_params[ch]) { case 0: saa->noise[ch].freq = 31250.0 * 2; break; case 1: saa->noise[ch].freq = 15625.0 * 2; break; case 2: saa->noise[ch].freq = 7812.5 * 2; break; case 3: saa->noise[ch].freq = saa->channels[ch * 3].freq; break; } } /* fill all data needed */ for( j = 0; j < length; j++ ) { int output_l = 0, output_r = 0; /* for each channel */ for (ch = 0; ch < 6; ch++) { if (saa->channels[ch].freq == 0.0) saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / (511.0 - (double)saa->channels[ch].frequency); /* check the actual position in the square wave */ saa->channels[ch].counter -= saa->channels[ch].freq; while (saa->channels[ch].counter < 0) { /* calculate new frequency now after the half wave is updated */ saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / (511.0 - (double)saa->channels[ch].frequency); saa->channels[ch].counter += sample_rate; saa->channels[ch].level ^= 1; /* eventually clock the envelope counters */ if (ch == 1 && saa->env_clock[0] == 0) saa1099_envelope(chip, 0); if (ch == 4 && saa->env_clock[1] == 0) saa1099_envelope(chip, 1); } /* if the noise is enabled */ if (saa->channels[ch].noise_enable) { /* if the noise level is high (noise 0: chan 0-2, noise 1: chan 3-5) */ if (saa->noise[ch/3].level & 1) { /* subtract to avoid overflows, also use only half amplitude */ output_l -= saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16 / 2; output_r -= saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16 / 2; } } /* if the square wave is enabled */ if (saa->channels[ch].freq_enable) { /* if the channel level is high */ if (saa->channels[ch].level & 1) { output_l += saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16; output_r += saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16; } } } for (ch = 0; ch < 2; ch++) { /* check the actual position in noise generator */ saa->noise[ch].counter -= saa->noise[ch].freq; while (saa->noise[ch].counter < 0) { saa->noise[ch].counter += sample_rate; if( ((saa->noise[ch].level & 0x4000) == 0) == ((saa->noise[ch].level & 0x0040) == 0) ) saa->noise[ch].level = (saa->noise[ch].level << 1) | 1; else saa->noise[ch].level <<= 1; } } /* write sound data to the buffer */ buffer[LEFT][j] = output_l / 6; buffer[RIGHT][j] = output_r / 6; } } static void saa1099_write_port_w( int chip, int offset, int data ) { struct SAA1099 *saa = &saa1099[chip]; if(offset == 1) { // address port saa->selected_reg = data & 0x1f; if (saa->selected_reg == 0x18 || saa->selected_reg == 0x19) { /* clock the envelope channels */ if (saa->env_clock[0]) saa1099_envelope(chip,0); if (saa->env_clock[1]) saa1099_envelope(chip,1); } return; } int reg = saa->selected_reg; int ch; switch (reg) { /* channel i amplitude */ case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: ch = reg & 7; saa->channels[ch].amplitude[LEFT] = amplitude_lookup[data & 0x0f]; saa->channels[ch].amplitude[RIGHT] = amplitude_lookup[(data >> 4) & 0x0f]; break; /* channel i frequency */ case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: ch = reg & 7; saa->channels[ch].frequency = data & 0xff; break; /* channel i octave */ case 0x10: case 0x11: case 0x12: ch = (reg - 0x10) << 1; saa->channels[ch + 0].octave = data & 0x07; saa->channels[ch + 1].octave = (data >> 4) & 0x07; break; /* channel i frequency enable */ case 0x14: saa->channels[0].freq_enable = data & 0x01; saa->channels[1].freq_enable = data & 0x02; saa->channels[2].freq_enable = data & 0x04; saa->channels[3].freq_enable = data & 0x08; saa->channels[4].freq_enable = data & 0x10; saa->channels[5].freq_enable = data & 0x20; break; /* channel i noise enable */ case 0x15: saa->channels[0].noise_enable = data & 0x01; saa->channels[1].noise_enable = data & 0x02; saa->channels[2].noise_enable = data & 0x04; saa->channels[3].noise_enable = data & 0x08; saa->channels[4].noise_enable = data & 0x10; saa->channels[5].noise_enable = data & 0x20; break; /* noise generators parameters */ case 0x16: saa->noise_params[0] = data & 0x03; saa->noise_params[1] = (data >> 4) & 0x03; break; /* envelope generators parameters */ case 0x18: case 0x19: ch = reg - 0x18; saa->env_reverse_right[ch] = data & 0x01; saa->env_mode[ch] = (data >> 1) & 0x07; saa->env_bits[ch] = data & 0x10; saa->env_clock[ch] = data & 0x20; saa->env_enable[ch] = data & 0x80; /* reset the envelope */ saa->env_step[ch] = 0; break; /* channels enable & reset generators */ case 0x1c: saa->all_ch_enable = data & 0x01; saa->sync_state = data & 0x02; if (data & 0x02) { int i; // logerror("%04x: (SAA1099 #%d) -reg 0x1c- Chip reset\n",activecpu_get_pc(), chip); /* Synch & Reset generators */ for (i = 0; i < 6; i++) { saa->channels[i].level = 0; saa->channels[i].counter = 0.0; } } break; default: /* Error! */ // logerror("%04x: (SAA1099 #%d) Unknown operation (reg:%02x, data:%02x)\n",activecpu_get_pc(), chip, reg, data); LOG(LOG_MISC,LOG_ERROR)("CMS Unkown write to reg %x with %x",reg, data); } } static void write_cms(Bitu port, Bitu val, Bitu /* iolen */) { if(cms_chan && (!cms_chan->enabled)) cms_chan->Enable(true); last_command = PIC_Ticks; switch (port-base_port) { case 0: saa1099_write_port_w(0,0,val); break; case 1: saa1099_write_port_w(0,1,val); break; case 2: saa1099_write_port_w(1,0,val); break; case 3: saa1099_write_port_w(1,1,val); break; } } static void CMS_CallBack(Bitu len) { if (len > CMS_BUFFER_SIZE) return; saa1099_update(0, &cms_buf_point[0], (int)len); saa1099_update(1, &cms_buf_point[2], (int)len); Bit16s * stream=(Bit16s *) MixTemp; /* Mix chip outputs */ for (Bitu l=0;l<len;l++) { register Bits left, right; left = cms_buffer[0][LEFT][l] + cms_buffer[1][LEFT][l]; right = cms_buffer[0][RIGHT][l] + cms_buffer[1][RIGHT][l]; if (left>MAX_AUDIO) *stream=MAX_AUDIO; else if (left<MIN_AUDIO) *stream=MIN_AUDIO; else *stream=(Bit16s)left; stream++; if (right>MAX_AUDIO) *stream=MAX_AUDIO; else if (right<MIN_AUDIO) *stream=MIN_AUDIO; else *stream=(Bit16s)right; stream++; } if(cms_chan) cms_chan->AddSamples_s16(len,(Bit16s *)MixTemp); if (last_command + 10000 < PIC_Ticks) if(cms_chan) cms_chan->Enable(false); } // The Gameblaster detection static Bit8u cms_detect_register = 0xff; static void write_cms_detect(Bitu port, Bitu val, Bitu /* iolen */) { switch(port-base_port) { case 0x6: case 0x7: cms_detect_register = val; break; } } static Bitu read_cms_detect(Bitu port, Bitu /* iolen */) { Bit8u retval = 0xff; switch(port-base_port) { case 0x4: retval = 0x7f; break; case 0xa: case 0xb: retval = cms_detect_register; break; } return retval; } extern bool enableMixerHack; class CMS:public Module_base { private: IO_WriteHandleObject WriteHandler; IO_WriteHandleObject DetWriteHandler; IO_ReadHandleObject DetReadHandler; MixerObject MixerChan; public: CMS(Section* configuration):Module_base(configuration) { Section_prop * section = static_cast<Section_prop *>(configuration); Bitu sample_rate_temp; if (enableMixerHack) { if (section->Get_int("oplrate") > 16000) { sample_rate_temp = 16000; } else { sample_rate_temp = section->Get_int("oplrate"); } } else { sample_rate_temp = section->Get_int("oplrate"); } sample_rate = static_cast<double>(sample_rate_temp); base_port = section->Get_hex("sbbase"); WriteHandler.Install(base_port, write_cms, IO_MB,4); // A standalone Gameblaster has a magic chip on it which is // sometimes used for detection. const char * sbtype=section->Get_string("sbtype"); if (!strcasecmp(sbtype,"gb")) { DetWriteHandler.Install(base_port+4,write_cms_detect,IO_MB,12); DetReadHandler.Install(base_port,read_cms_detect,IO_MB,16); } /* Register the Mixer CallBack */ cms_chan = MixerChan.Install(CMS_CallBack,sample_rate_temp,"CMS"); last_command = PIC_Ticks; for (int s=0;s<2;s++) { struct SAA1099 *saa = &saa1099[s]; memset(saa, 0, sizeof(struct SAA1099)); } } ~CMS() { cms_chan = 0; } }; static CMS* test; void CMS_Init(Section* sec) { test = new CMS(sec); } void CMS_ShutDown(Section* sec) { delete test; }
atkio/dbsk
jni/dosbox/src/hardware/gameblaster.cpp
C++
gpl-2.0
15,381
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2526, 1011, 2230, 1996, 9998, 8758, 2136, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1996, 34...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 stat import ( "fmt" "time" // "encoding/json" ) type RevStat struct { RevId string `json:"RevId"` UserName string `json:"UserName"` WordCount int `json:"WordCount"` ModDate string `json:"ModDate"` WordFreq []WordPair `json:"WordFreq"` } type DocStat struct { FileId string `json:"FileId"` Title string `json:"Title"` LastMod string `json:"LastMod"` RevList []RevStat `json:"RevList"` } func (rev RevStat) GetTime() string { x, _ := time.Parse("2006-01-02T15:04:05.000Z", rev.ModDate) return x.Format("15:04") } func (rev RevStat) String() string { return fmt.Sprintf("[%s %s] %d words by %s. \n\t Words [%s]", rev.ModDate, rev.RevId, rev.WordCount, rev.UserName, rev.WordFreq) } func (doc DocStat) String() string { s := fmt.Sprintf("[%s] '%s' last mod on %s with revs\n", doc.FileId, doc.Title, doc.LastMod) for i, v := range doc.RevList { s += fmt.Sprintf("\t %d:%s\n", i, v) } return s }
Kimau/GoDriveTracker
stat/stat.go
GO
mit
964
[ 30522, 7427, 28093, 12324, 1006, 1000, 4718, 2102, 1000, 1000, 2051, 1000, 1013, 1013, 1000, 17181, 1013, 1046, 3385, 1000, 1007, 2828, 7065, 9153, 2102, 2358, 6820, 6593, 1063, 7065, 3593, 5164, 1036, 1046, 3385, 1024, 1000, 7065, 3593, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.8"/> <title>WCSLIB: Globals</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">WCSLIB &#160;<span id="projectnumber">4.23.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.8 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li class="current"><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li class="current"><a href="globals.html"><span>All</span></a></li> <li><a href="globals_func.html"><span>Functions</span></a></li> <li><a href="globals_vars.html"><span>Variables</span></a></li> <li><a href="globals_type.html"><span>Typedefs</span></a></li> <li><a href="globals_enum.html"><span>Enumerations</span></a></li> <li><a href="globals_eval.html"><span>Enumerator</span></a></li> <li><a href="globals_defs.html"><span>Macros</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="globals.html#index_a"><span>a</span></a></li> <li><a href="globals_b.html#index_b"><span>b</span></a></li> <li><a href="globals_c.html#index_c"><span>c</span></a></li> <li><a href="globals_d.html#index_d"><span>d</span></a></li> <li><a href="globals_e.html#index_e"><span>e</span></a></li> <li><a href="globals_f.html#index_f"><span>f</span></a></li> <li class="current"><a href="globals_h.html#index_h"><span>h</span></a></li> <li><a href="globals_i.html#index_i"><span>i</span></a></li> <li><a href="globals_k.html#index_k"><span>k</span></a></li> <li><a href="globals_l.html#index_l"><span>l</span></a></li> <li><a href="globals_m.html#index_m"><span>m</span></a></li> <li><a href="globals_n.html#index_n"><span>n</span></a></li> <li><a href="globals_p.html#index_p"><span>p</span></a></li> <li><a href="globals_q.html#index_q"><span>q</span></a></li> <li><a href="globals_r.html#index_r"><span>r</span></a></li> <li><a href="globals_s.html#index_s"><span>s</span></a></li> <li><a href="globals_t.html#index_t"><span>t</span></a></li> <li><a href="globals_u.html#index_u"><span>u</span></a></li> <li><a href="globals_v.html#index_v"><span>v</span></a></li> <li><a href="globals_w.html#index_w"><span>w</span></a></li> <li><a href="globals_x.html#index_x"><span>x</span></a></li> <li><a href="globals_z.html#index_z"><span>z</span></a></li> </ul> </div> </div><!-- top --> <div class="contents"> <div class="textblock">Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:</div> <h3><a class="anchor" id="index_h"></a>- h -</h3><ul> <li>HEALPIX : <a class="el" href="prj_8h.html#a6e2db45f219ba5732ddca43a9fc17408">prj.h</a> </li> <li>hpxs2x() : <a class="el" href="prj_8h.html#af44375ad9036898dd6d12d2cc58bf53b">prj.h</a> </li> <li>hpxset() : <a class="el" href="prj_8h.html#aa2167e62576d36eae341c2583cb5d678">prj.h</a> </li> <li>hpxx2s() : <a class="el" href="prj_8h.html#a4ff298fcdc6e7e23dfb4971fbd26ebe7">prj.h</a> </li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Sep 19 2014 01:26:06 for WCSLIB by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.8 </small></address> </body> </html>
kapteyn-astro/kapteyn
src/wcslib-4.24/html/globals_h.html
HTML
bsd-3-clause
4,704
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 30524, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, 19817, 1013, 1060, 11039, 19968, 2487, 1013, 26718, 2094, 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...
# waterford-tech-meetup-graph-intro Public Resources for Waterford Tech Meetup October 2017
johnrellis/waterford-tech-meetup-graph-intro
README.md
Markdown
apache-2.0
92
[ 30522, 1001, 17769, 1011, 6627, 1011, 3113, 6279, 1011, 10629, 1011, 17174, 2270, 4219, 2005, 17769, 6627, 3113, 6279, 2255, 2418, 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, 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 DogeNews.Web.Mvp.UserControls.ArticleComments.EventArguments; using WebFormsMvp; namespace DogeNews.Web.Mvp.UserControls.ArticleComments { public interface IArticleCommentsView : IView<ArticleCommentsViewModel> { event EventHandler<ArticleCommetnsPageLoadEventArgs> PageLoad; event EventHandler<AddCommentEventArguments> AddComment; } }
SuchTeam-NoJoro-MuchSad/Doge-News
DogeNews/Src/Web/DogeNews.Web.Mvp/UserControls/ArticleComments/IArticleCommentsView.cs
C#
mit
390
[ 30522, 2478, 2291, 1025, 2478, 3899, 8625, 9333, 1012, 4773, 1012, 12041, 1012, 5310, 8663, 13181, 4877, 1012, 3720, 9006, 8163, 1012, 2724, 2906, 22850, 11187, 1025, 2478, 4773, 22694, 2213, 2615, 2361, 1025, 3415, 15327, 3899, 8625, 9333,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>About</title> <style type="text/css"> html { vertical-align: baseline; font-family: Segoe UI; font-size: 14pt; font-weight: normal; font-style: normal; text-decoration: none; } .header { font-size: 18pt; } .small { font-size: 12pt; } </style> </head> <body> <div class="header">Dictionnaires Lexikon 2k pour Windows, ${version}</div> <br /> © Lexikon 2k, 2015 <br /><br /> Foires aux questions:<br /> <div class="small"><a href="http://slovoed.com/faq/" target="_blank">slovoed.com/faq/</a></div><br /> Assistance:<br /> <div class="small"><a href="mailto:911@penreader.com">911@penreader.com</a></div> </body> </html>
Vigelforts/TestProject
Win81App/bin/x64/Release/AppX/Resources/fr/ContainerAbout.html
HTML
apache-2.0
926
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 20950, 3619, 1027, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, 2639, 1013, 1060, 11039, 19968, 1000, 1028, 1026, 2132, 1028,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/******************************************************************************/ #ifdef JEMALLOC_H_TYPES #endif /* JEMALLOC_H_TYPES */ /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS #endif /* JEMALLOC_H_STRUCTS */ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS void *huge_malloc(arena_t *arena, size_t size, bool zero); void *huge_palloc(arena_t *arena, size_t size, size_t alignment, bool zero); bool huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra); void *huge_ralloc(arena_t *arena, void *ptr, size_t oldsize, size_t size, size_t extra, size_t alignment, bool zero, bool try_tcache_dalloc); #ifdef JEMALLOC_JET typedef void (huge_dalloc_junk_t)(void *, size_t); extern huge_dalloc_junk_t *huge_dalloc_junk; #endif void huge_dalloc(void *ptr); size_t huge_salloc(const void *ptr); prof_ctx_t *huge_prof_ctx_get(const void *ptr); void huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); bool huge_boot(void); void huge_prefork(void); void huge_postfork_parent(void); void huge_postfork_child(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ #ifdef JEMALLOC_H_INLINES #endif /* JEMALLOC_H_INLINES */ /******************************************************************************/
linghegu/gsnetwork
thirdparty/jemalloc/include/jemalloc/internal/huge.h
C
gpl-3.0
1,411
[ 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...
# # 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 # # 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. """fix description field in connection to be text Revision ID: 64a7d6477aae Revises: f5b5ec089444 Create Date: 2020-11-25 08:56:11.866607 """ import sqlalchemy as sa # noqa from alembic import op # noqa # revision identifiers, used by Alembic. revision = '64a7d6477aae' down_revision = '61ec73d9401f' branch_labels = None depends_on = None def upgrade(): """Apply fix description field in connection to be text""" conn = op.get_bind() # pylint: disable=no-member if conn.dialect.name == "sqlite": # in sqlite TEXT and STRING column types are the same return if conn.dialect.name == "mysql": op.alter_column( 'connection', 'description', existing_type=sa.String(length=5000), type_=sa.Text(length=5000), existing_nullable=True, ) else: # postgres does not allow size modifier for text type op.alter_column('connection', 'description', existing_type=sa.String(length=5000), type_=sa.Text()) def downgrade(): """Unapply fix description field in connection to be text""" conn = op.get_bind() # pylint: disable=no-member if conn.dialect.name == "sqlite": # in sqlite TEXT and STRING column types are the same return if conn.dialect.name == "mysql": op.alter_column( 'connection', 'description', existing_type=sa.Text(5000), type_=sa.String(length=5000), existing_nullable=True, ) else: # postgres does not allow size modifier for text type op.alter_column( 'connection', 'description', existing_type=sa.Text(), type_=sa.String(length=5000), existing_nullable=True, )
nathanielvarona/airflow
airflow/migrations/versions/64a7d6477aae_fix_description_field_in_connection_to_.py
Python
apache-2.0
2,586
[ 30522, 1001, 1001, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 1001, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 1001, 5500, 2007, 2023, 2147, 2005, 3176, 2592, 30524, 1007, 1025, 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...
// Auto-generated with: android/scripts/gen-entries.py --mode=wrapper audio/wrappers/alsa.entries // DO NOT EDIT THIS FILE #include <dlfcn.h> #include <alsa/asoundlib.h> /// /// W R A P P E R P O I N T E R S /// static snd_pcm_sframes_t (*__dll_snd_pcm_avail_update)(snd_pcm_t * pcm) = 0; static int (*__dll_snd_pcm_close)(snd_pcm_t * pcm) = 0; static int (*__dll_snd_pcm_drop)(snd_pcm_t * pcm) = 0; static int (*__dll_snd_pcm_hw_params)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params) = 0; static int (*__dll_snd_pcm_hw_params_any)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params) = 0; static int (*__dll_snd_pcm_hw_params_get_buffer_size)(const snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val) = 0; static int (*__dll_snd_pcm_hw_params_get_format)(const snd_pcm_hw_params_t * params, snd_pcm_format_t * val) = 0; static int (*__dll_snd_pcm_hw_params_set_access)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_access_t _access) = 0; static int (*__dll_snd_pcm_hw_params_set_buffer_size_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val) = 0; static int (*__dll_snd_pcm_hw_params_set_buffer_time_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) = 0; static int (*__dll_snd_pcm_hw_params_set_channels_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val) = 0; static int (*__dll_snd_pcm_hw_params_set_format)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_format_t val) = 0; static int (*__dll_snd_pcm_hw_params_set_period_size_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val, int * dir) = 0; static int (*__dll_snd_pcm_hw_params_set_period_time_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) = 0; static int (*__dll_snd_pcm_hw_params_set_rate_near)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) = 0; static size_t (*__dll_snd_pcm_hw_params_sizeof)() = 0; static int (*__dll_snd_pcm_open)(snd_pcm_t ** pcm, const char * name, snd_pcm_stream_t stream, int mode) = 0; static int (*__dll_snd_pcm_poll_descriptors)(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int space) = 0; static int (*__dll_snd_pcm_poll_descriptors_count)(snd_pcm_t * pcm) = 0; static int (*__dll_snd_pcm_poll_descriptors_revents)(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int nfds, unsigned short * revents) = 0; static int (*__dll_snd_pcm_prepare)(snd_pcm_t * pcm) = 0; static snd_pcm_sframes_t (*__dll_snd_pcm_readi)(snd_pcm_t * pcm, void * buffer, snd_pcm_uframes_t size) = 0; static int (*__dll_snd_pcm_resume)(snd_pcm_t * pcm) = 0; static snd_pcm_state_t (*__dll_snd_pcm_state)(snd_pcm_t * pcm) = 0; static int (*__dll_snd_pcm_sw_params)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params) = 0; static int (*__dll_snd_pcm_sw_params_current)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params) = 0; static int (*__dll_snd_pcm_sw_params_set_start_threshold)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params, snd_pcm_uframes_t val) = 0; static size_t (*__dll_snd_pcm_sw_params_sizeof)() = 0; static snd_pcm_sframes_t (*__dll_snd_pcm_writei)(snd_pcm_t * pcm, const void * buffer, snd_pcm_uframes_t size) = 0; static const char * (*__dll_snd_strerror)(int errnum) = 0; /// /// W R A P P E R F U N C T I O N S /// snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t * pcm) { return __dll_snd_pcm_avail_update(pcm); } int snd_pcm_close(snd_pcm_t * pcm) { return __dll_snd_pcm_close(pcm); } int snd_pcm_drop(snd_pcm_t * pcm) { return __dll_snd_pcm_drop(pcm); } int snd_pcm_hw_params(snd_pcm_t * pcm, snd_pcm_hw_params_t * params) { return __dll_snd_pcm_hw_params(pcm, params); } int snd_pcm_hw_params_any(snd_pcm_t * pcm, snd_pcm_hw_params_t * params) { return __dll_snd_pcm_hw_params_any(pcm, params); } int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val) { return __dll_snd_pcm_hw_params_get_buffer_size(params, val); } int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t * params, snd_pcm_format_t * val) { return __dll_snd_pcm_hw_params_get_format(params, val); } int snd_pcm_hw_params_set_access(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_access_t _access) { return __dll_snd_pcm_hw_params_set_access(pcm, params, _access); } int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val) { return __dll_snd_pcm_hw_params_set_buffer_size_near(pcm, params, val); } int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) { return __dll_snd_pcm_hw_params_set_buffer_time_near(pcm, params, val, dir); } int snd_pcm_hw_params_set_channels_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val) { return __dll_snd_pcm_hw_params_set_channels_near(pcm, params, val); } int snd_pcm_hw_params_set_format(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_format_t val) { return __dll_snd_pcm_hw_params_set_format(pcm, params, val); } int snd_pcm_hw_params_set_period_size_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val, int * dir) { return __dll_snd_pcm_hw_params_set_period_size_near(pcm, params, val, dir); } int snd_pcm_hw_params_set_period_time_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) { return __dll_snd_pcm_hw_params_set_period_time_near(pcm, params, val, dir); } int snd_pcm_hw_params_set_rate_near(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir) { return __dll_snd_pcm_hw_params_set_rate_near(pcm, params, val, dir); } size_t snd_pcm_hw_params_sizeof() { return __dll_snd_pcm_hw_params_sizeof(); } int snd_pcm_open(snd_pcm_t ** pcm, const char * name, snd_pcm_stream_t stream, int mode) { return __dll_snd_pcm_open(pcm, name, stream, mode); } int snd_pcm_poll_descriptors(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int space) { return __dll_snd_pcm_poll_descriptors(pcm, pfds, space); } int snd_pcm_poll_descriptors_count(snd_pcm_t * pcm) { return __dll_snd_pcm_poll_descriptors_count(pcm); } int snd_pcm_poll_descriptors_revents(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int nfds, unsigned short * revents) { return __dll_snd_pcm_poll_descriptors_revents(pcm, pfds, nfds, revents); } int snd_pcm_prepare(snd_pcm_t * pcm) { return __dll_snd_pcm_prepare(pcm); } snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t * pcm, void * buffer, snd_pcm_uframes_t size) { return __dll_snd_pcm_readi(pcm, buffer, size); } int snd_pcm_resume(snd_pcm_t * pcm) { return __dll_snd_pcm_resume(pcm); } snd_pcm_state_t snd_pcm_state(snd_pcm_t * pcm) { return __dll_snd_pcm_state(pcm); } int snd_pcm_sw_params(snd_pcm_t * pcm, snd_pcm_sw_params_t * params) { return __dll_snd_pcm_sw_params(pcm, params); } int snd_pcm_sw_params_current(snd_pcm_t * pcm, snd_pcm_sw_params_t * params) { return __dll_snd_pcm_sw_params_current(pcm, params); } int snd_pcm_sw_params_set_start_threshold(snd_pcm_t * pcm, snd_pcm_sw_params_t * params, snd_pcm_uframes_t val) { return __dll_snd_pcm_sw_params_set_start_threshold(pcm, params, val); } size_t snd_pcm_sw_params_sizeof() { return __dll_snd_pcm_sw_params_sizeof(); } snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t * pcm, const void * buffer, snd_pcm_uframes_t size) { return __dll_snd_pcm_writei(pcm, buffer, size); } const char * snd_strerror(int errnum) { return __dll_snd_strerror(errnum); } /// /// I N I T I A L I Z A T I O N F U N C T I O N /// int alsa_dynlink_init(void* lib) { __dll_snd_pcm_avail_update = (snd_pcm_sframes_t(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_avail_update"); if (!__dll_snd_pcm_avail_update) return -1; __dll_snd_pcm_close = (int(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_close"); if (!__dll_snd_pcm_close) return -1; __dll_snd_pcm_drop = (int(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_drop"); if (!__dll_snd_pcm_drop) return -1; __dll_snd_pcm_hw_params = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params))dlsym(lib, "snd_pcm_hw_params"); if (!__dll_snd_pcm_hw_params) return -1; __dll_snd_pcm_hw_params_any = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params))dlsym(lib, "snd_pcm_hw_params_any"); if (!__dll_snd_pcm_hw_params_any) return -1; __dll_snd_pcm_hw_params_get_buffer_size = (int(*)(const snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val))dlsym(lib, "snd_pcm_hw_params_get_buffer_size"); if (!__dll_snd_pcm_hw_params_get_buffer_size) return -1; __dll_snd_pcm_hw_params_get_format = (int(*)(const snd_pcm_hw_params_t * params, snd_pcm_format_t * val))dlsym(lib, "snd_pcm_hw_params_get_format"); if (!__dll_snd_pcm_hw_params_get_format) return -1; __dll_snd_pcm_hw_params_set_access = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_access_t _access))dlsym(lib, "snd_pcm_hw_params_set_access"); if (!__dll_snd_pcm_hw_params_set_access) return -1; __dll_snd_pcm_hw_params_set_buffer_size_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val))dlsym(lib, "snd_pcm_hw_params_set_buffer_size_near"); if (!__dll_snd_pcm_hw_params_set_buffer_size_near) return -1; __dll_snd_pcm_hw_params_set_buffer_time_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir))dlsym(lib, "snd_pcm_hw_params_set_buffer_time_near"); if (!__dll_snd_pcm_hw_params_set_buffer_time_near) return -1; __dll_snd_pcm_hw_params_set_channels_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val))dlsym(lib, "snd_pcm_hw_params_set_channels_near"); if (!__dll_snd_pcm_hw_params_set_channels_near) return -1; __dll_snd_pcm_hw_params_set_format = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_format_t val))dlsym(lib, "snd_pcm_hw_params_set_format"); if (!__dll_snd_pcm_hw_params_set_format) return -1; __dll_snd_pcm_hw_params_set_period_size_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, snd_pcm_uframes_t * val, int * dir))dlsym(lib, "snd_pcm_hw_params_set_period_size_near"); if (!__dll_snd_pcm_hw_params_set_period_size_near) return -1; __dll_snd_pcm_hw_params_set_period_time_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir))dlsym(lib, "snd_pcm_hw_params_set_period_time_near"); if (!__dll_snd_pcm_hw_params_set_period_time_near) return -1; __dll_snd_pcm_hw_params_set_rate_near = (int(*)(snd_pcm_t * pcm, snd_pcm_hw_params_t * params, unsigned int * val, int * dir))dlsym(lib, "snd_pcm_hw_params_set_rate_near"); if (!__dll_snd_pcm_hw_params_set_rate_near) return -1; __dll_snd_pcm_hw_params_sizeof = (size_t(*)())dlsym(lib, "snd_pcm_hw_params_sizeof"); if (!__dll_snd_pcm_hw_params_sizeof) return -1; __dll_snd_pcm_open = (int(*)(snd_pcm_t ** pcm, const char * name, snd_pcm_stream_t stream, int mode))dlsym(lib, "snd_pcm_open"); if (!__dll_snd_pcm_open) return -1; __dll_snd_pcm_poll_descriptors = (int(*)(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int space))dlsym(lib, "snd_pcm_poll_descriptors"); if (!__dll_snd_pcm_poll_descriptors) return -1; __dll_snd_pcm_poll_descriptors_count = (int(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_poll_descriptors_count"); if (!__dll_snd_pcm_poll_descriptors_count) return -1; __dll_snd_pcm_poll_descriptors_revents = (int(*)(snd_pcm_t * pcm, struct pollfd * pfds, unsigned int nfds, unsigned short * revents))dlsym(lib, "snd_pcm_poll_descriptors_revents"); if (!__dll_snd_pcm_poll_descriptors_revents) return -1; __dll_snd_pcm_prepare = (int(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_prepare"); if (!__dll_snd_pcm_prepare) return -1; __dll_snd_pcm_readi = (snd_pcm_sframes_t(*)(snd_pcm_t * pcm, void * buffer, snd_pcm_uframes_t size))dlsym(lib, "snd_pcm_readi"); if (!__dll_snd_pcm_readi) return -1; __dll_snd_pcm_resume = (int(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_resume"); if (!__dll_snd_pcm_resume) return -1; __dll_snd_pcm_state = (snd_pcm_state_t(*)(snd_pcm_t * pcm))dlsym(lib, "snd_pcm_state"); if (!__dll_snd_pcm_state) return -1; __dll_snd_pcm_sw_params = (int(*)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params))dlsym(lib, "snd_pcm_sw_params"); if (!__dll_snd_pcm_sw_params) return -1; __dll_snd_pcm_sw_params_current = (int(*)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params))dlsym(lib, "snd_pcm_sw_params_current"); if (!__dll_snd_pcm_sw_params_current) return -1; __dll_snd_pcm_sw_params_set_start_threshold = (int(*)(snd_pcm_t * pcm, snd_pcm_sw_params_t * params, snd_pcm_uframes_t val))dlsym(lib, "snd_pcm_sw_params_set_start_threshold"); if (!__dll_snd_pcm_sw_params_set_start_threshold) return -1; __dll_snd_pcm_sw_params_sizeof = (size_t(*)())dlsym(lib, "snd_pcm_sw_params_sizeof"); if (!__dll_snd_pcm_sw_params_sizeof) return -1; __dll_snd_pcm_writei = (snd_pcm_sframes_t(*)(snd_pcm_t * pcm, const void * buffer, snd_pcm_uframes_t size))dlsym(lib, "snd_pcm_writei"); if (!__dll_snd_pcm_writei) return -1; __dll_snd_strerror = (const char *(*)(int errnum))dlsym(lib, "snd_strerror"); if (!__dll_snd_strerror) return -1; return 0; }
zeldin/platform_external_qemu
audio/wrappers/alsa.c
C
gpl-2.0
13,101
[ 30522, 1013, 1013, 8285, 1011, 7013, 2007, 1024, 11924, 1013, 14546, 1013, 8991, 1011, 10445, 1012, 1052, 2100, 1011, 1011, 5549, 1027, 10236, 4842, 5746, 1013, 10236, 7347, 1013, 25520, 2050, 1012, 10445, 1013, 1013, 2079, 2025, 10086, 202...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 Poedit (http://poedit.net) * * Copyright (C) 2010-2015 Vaclav Slavik * * 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. * */ #include "concurrency.h" #include "errors.h" #include <wx/log.h> #if defined(HAVE_DISPATCH) #include <dispatch/dispatch.h> void call_on_main_thread_impl(std::function<void()>&& f) { std::function<void()> func(std::move(f)); dispatch_async(dispatch_get_main_queue(), [func]{ try { func(); } catch (...) { // FIXME: This is gross. Should be reported better and properly, but this // is consistent with pplx/ConcurrencyRT/futures, so do it for now. wxLogDebug("uncaught exception: %s", DescribeCurrentException()); } }); } void concurrency_queue::enqueue(std::function<void()>&& f) { std::function<void()> func(std::move(f)); dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(q, [func]{ try { func(); } catch (...) { // FIXME: This is gross. Should be reported better and properly, but this // is consistent with pplx/ConcurrencyRT/futures, so do it for now. wxLogDebug("uncaught exception: %s", DescribeCurrentException()); } }); } void concurrency_queue::cleanup() { } #elif !defined(HAVE_PPL) // generic implementation #include "ThreadPool.h" #include <thread> namespace { std::unique_ptr<ThreadPool> gs_pool; static std::once_flag initializationFlag; ThreadPool& pool() { std::call_once(initializationFlag, []{ gs_pool.reset(new ThreadPool(std::thread::hardware_concurrency() + 1)); }); return *gs_pool; } } // anonymous namespace void concurrency_queue::enqueue(std::function<void()>&& f) { pool().enqueue_func(std::move(f)); } void concurrency_queue::cleanup() { gs_pool.reset(); } #endif // !HAVE_DISPATCH
egoitzro/poedit
src/concurrency.cpp
C++
mit
3,039
[ 30522, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 18922, 23194, 1006, 8299, 1024, 1013, 1013, 18922, 23194, 1012, 5658, 1007, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1011, 2325, 12436, 20464, 11431, 22889, 18891, 2243, 1008, 1008, 66...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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) 2011-2015 The Gtacoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "sendcoinsentry.h" #include "ui_sendcoinsentry.h" #include "addressbookpage.h" #include "addresstablemodel.h" #include "guiutil.h" #include "optionsmodel.h" #include "platformstyle.h" #include "walletmodel.h" #include <QApplication> #include <QClipboard> SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) : QStackedWidget(parent), ui(new Ui::SendCoinsEntry), model(0), platformStyle(_platformStyle) { ui->setupUi(this); // GTACOIN QString theme = GUIUtil::getThemeName(); ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/address-book")); ui->pasteButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/editpaste")); ui->deleteButton->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/remove")); ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/remove")); ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(":/icons/" + theme + "/remove")); setCurrentWidget(ui->SendCoins); if (platformStyle->getUseExtraSpacing()) ui->payToLayout->setSpacing(4); #if QT_VERSION >= 0x040700 ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book")); #endif // normal gtacoin address field GUIUtil::setupAddressWidget(ui->payTo, this); // just a label for displaying gtacoin address(es) ui->payTo_is->setFont(GUIUtil::fixedPitchFont()); // Connect signals connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged())); connect(ui->checkboxSubtractFeeFromAmount, SIGNAL(toggled(bool)), this, SIGNAL(subtractFeeFromAmountChanged())); connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked())); connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); } SendCoinsEntry::~SendCoinsEntry() { delete ui; } void SendCoinsEntry::on_pasteButton_clicked() { // Paste text from clipboard into recipient field ui->payTo->setText(QApplication::clipboard()->text()); } void SendCoinsEntry::on_addressBookButton_clicked() { if(!model) return; AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::SendingTab, this); dlg.setModel(model->getAddressTableModel()); if(dlg.exec()) { ui->payTo->setText(dlg.getReturnValue()); ui->payAmount->setFocus(); } } void SendCoinsEntry::on_payTo_textChanged(const QString &address) { updateLabel(address); } void SendCoinsEntry::setModel(WalletModel *_model) { this->model = _model; if (_model && _model->getOptionsModel()) connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); clear(); } void SendCoinsEntry::clear() { // clear UI elements for normal payment ui->payTo->clear(); ui->addAsLabel->clear(); ui->payAmount->clear(); ui->checkboxSubtractFeeFromAmount->setCheckState(Qt::Unchecked); ui->messageTextLabel->clear(); ui->messageTextLabel->hide(); ui->messageLabel->hide(); // clear UI elements for unauthenticated payment request ui->payTo_is->clear(); ui->memoTextLabel_is->clear(); ui->payAmount_is->clear(); // clear UI elements for authenticated payment request ui->payTo_s->clear(); ui->memoTextLabel_s->clear(); ui->payAmount_s->clear(); // update the display unit, to not use the default ("GTA") updateDisplayUnit(); } void SendCoinsEntry::deleteClicked() { Q_EMIT removeEntry(this); } bool SendCoinsEntry::validate() { if (!model) return false; // Check input validity bool retval = true; // Skip checks for payment request if (recipient.paymentRequest.IsInitialized()) return retval; if (!model->validateAddress(ui->payTo->text())) { ui->payTo->setValid(false); retval = false; } if (!ui->payAmount->validate()) { retval = false; } // Sending a zero amount is invalid if (ui->payAmount->value(0) <= 0) { ui->payAmount->setValid(false); retval = false; } // Reject dust outputs: if (retval && GUIUtil::isDust(ui->payTo->text(), ui->payAmount->value())) { ui->payAmount->setValid(false); retval = false; } return retval; } SendCoinsRecipient SendCoinsEntry::getValue() { // Payment request if (recipient.paymentRequest.IsInitialized()) return recipient; // Normal payment recipient.address = ui->payTo->text(); recipient.label = ui->addAsLabel->text(); recipient.amount = ui->payAmount->value(); recipient.message = ui->messageTextLabel->text(); recipient.fSubtractFeeFromAmount = (ui->checkboxSubtractFeeFromAmount->checkState() == Qt::Checked); return recipient; } QWidget *SendCoinsEntry::setupTabChain(QWidget *prev) { QWidget::setTabOrder(prev, ui->payTo); QWidget::setTabOrder(ui->payTo, ui->addAsLabel); QWidget *w = ui->payAmount->setupTabChain(ui->addAsLabel); QWidget::setTabOrder(w, ui->checkboxSubtractFeeFromAmount); QWidget::setTabOrder(ui->checkboxSubtractFeeFromAmount, ui->addressBookButton); QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton); QWidget::setTabOrder(ui->pasteButton, ui->deleteButton); return ui->deleteButton; } void SendCoinsEntry::setValue(const SendCoinsRecipient &value) { recipient = value; if (recipient.paymentRequest.IsInitialized()) // payment request { if (recipient.authenticatedMerchant.isEmpty()) // unauthenticated { ui->payTo_is->setText(recipient.address); ui->memoTextLabel_is->setText(recipient.message); ui->payAmount_is->setValue(recipient.amount); ui->payAmount_is->setReadOnly(true); setCurrentWidget(ui->SendCoins_UnauthenticatedPaymentRequest); } else // authenticated { ui->payTo_s->setText(recipient.authenticatedMerchant); ui->memoTextLabel_s->setText(recipient.message); ui->payAmount_s->setValue(recipient.amount); ui->payAmount_s->setReadOnly(true); setCurrentWidget(ui->SendCoins_AuthenticatedPaymentRequest); } } else // normal payment { // message ui->messageTextLabel->setText(recipient.message); ui->messageTextLabel->setVisible(!recipient.message.isEmpty()); ui->messageLabel->setVisible(!recipient.message.isEmpty()); ui->addAsLabel->clear(); ui->payTo->setText(recipient.address); // this may set a label from addressbook if (!recipient.label.isEmpty()) // if a label had been set from the addressbook, don't overwrite with an empty label ui->addAsLabel->setText(recipient.label); ui->payAmount->setValue(recipient.amount); } } void SendCoinsEntry::setAddress(const QString &address) { ui->payTo->setText(address); ui->payAmount->setFocus(); } bool SendCoinsEntry::isClear() { return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && ui->payTo_s->text().isEmpty(); } void SendCoinsEntry::setFocus() { ui->payTo->setFocus(); } void SendCoinsEntry::updateDisplayUnit() { if(model && model->getOptionsModel()) { // Update payAmount with the current unit ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); ui->payAmount_is->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); ui->payAmount_s->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); } } bool SendCoinsEntry::updateLabel(const QString &address) { if(!model) return false; // Fill in label from address book, if address has an associated label QString associatedLabel = model->getAddressTableModel()->labelForAddress(address); if(!associatedLabel.isEmpty()) { ui->addAsLabel->setText(associatedLabel); return true; } return false; }
gtacoin-dev/gtacoin
src/qt/sendcoinsentry.cpp
C++
mit
8,351
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2249, 1011, 2325, 1996, 14181, 22684, 2378, 4563, 9797, 1013, 1013, 5500, 2104, 1996, 10210, 4007, 6105, 1010, 2156, 1996, 10860, 1013, 1013, 5371, 24731, 2030, 8299, 1024, 1013, 1013, 7479, 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...
/* Copyright (c) 2013 The WebRTC 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. */ #include <string.h> #include <list> #include <memory> #include <queue> #include <vector> #include "modules/video_coding/encoded_frame.h" #include "modules/video_coding/packet.h" #include "modules/video_coding/receiver.h" #include "modules/video_coding/test/stream_generator.h" #include "modules/video_coding/test/test_util.h" #include "modules/video_coding/timing.h" #include BOSS_WEBRTC_U_rtc_base__checks_h //original-code:"rtc_base/checks.h" #include BOSS_WEBRTC_U_system_wrappers__include__clock_h //original-code:"system_wrappers/include/clock.h" #include BOSS_WEBRTC_U_test__gtest_h //original-code:"test/gtest.h" namespace webrtc { class TestVCMReceiver : public ::testing::Test { protected: TestVCMReceiver() : clock_(new SimulatedClock(0)), timing_(clock_.get()), receiver_(&timing_, clock_.get(), &event_factory_) { stream_generator_.reset( new StreamGenerator(0, clock_->TimeInMilliseconds())); } virtual void SetUp() { receiver_.Reset(); } int32_t InsertPacket(int index) { VCMPacket packet; bool packet_available = stream_generator_->GetPacket(&packet, index); EXPECT_TRUE(packet_available); if (!packet_available) return kGeneralError; // Return here to avoid crashes below. return receiver_.InsertPacket(packet); } int32_t InsertPacketAndPop(int index) { VCMPacket packet; bool packet_available = stream_generator_->PopPacket(&packet, index); EXPECT_TRUE(packet_available); if (!packet_available) return kGeneralError; // Return here to avoid crashes below. return receiver_.InsertPacket(packet); } int32_t InsertFrame(FrameType frame_type, bool complete) { int num_of_packets = complete ? 1 : 2; stream_generator_->GenerateFrame( frame_type, (frame_type != kEmptyFrame) ? num_of_packets : 0, (frame_type == kEmptyFrame) ? 1 : 0, clock_->TimeInMilliseconds()); int32_t ret = InsertPacketAndPop(0); if (!complete) { // Drop the second packet. VCMPacket packet; stream_generator_->PopPacket(&packet, 0); } clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); return ret; } bool DecodeNextFrame() { VCMEncodedFrame* frame = receiver_.FrameForDecoding(0, false); if (!frame) return false; receiver_.ReleaseFrame(frame); return true; } std::unique_ptr<SimulatedClock> clock_; VCMTiming timing_; NullEventFactory event_factory_; VCMReceiver receiver_; std::unique_ptr<StreamGenerator> stream_generator_; }; TEST_F(TestVCMReceiver, NonDecodableDuration_Empty) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs); EXPECT_TRUE(DecodeNextFrame()); bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoKeyFrame) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); const int kNumFrames = kDefaultFrameRate * kMaxNonDecodableDuration / 1000; for (int i = 0; i < kNumFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_TRUE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_OneIncomplete) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert enough frames to have too long non-decodable sequence. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we get a key frame request. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_TRUE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoTrigger) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert all but one frame to not trigger a key frame request due to // too long duration of non-decodable frames. for (int i = 0; i < kMaxNonDecodableDurationFrames - 1; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since we haven't generated // enough frames. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_NoTrigger2) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert enough frames to have too long non-decodable sequence, except that // we don't have any losses. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since the non-decodable duration // is only one frame. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } TEST_F(TestVCMReceiver, NonDecodableDuration_KeyFrameAfterIncompleteFrames) { // Enable NACK and with no RTT thresholds for disabling retransmission delay. receiver_.SetNackMode(kNack, -1, -1); const size_t kMaxNackListSize = 1000; const int kMaxPacketAgeToNack = 1000; const int kMaxNonDecodableDuration = 500; const int kMaxNonDecodableDurationFrames = (kDefaultFrameRate * kMaxNonDecodableDuration + 500) / 1000; const int kMinDelayMs = 500; receiver_.SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, kMaxNonDecodableDuration); receiver_.SetMinReceiverDelay(kMinDelayMs); int64_t key_frame_inserted = clock_->TimeInMilliseconds(); EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Insert an incomplete frame. EXPECT_GE(InsertFrame(kVideoFrameDelta, false), kNoError); // Insert enough frames to have too long non-decodable sequence. for (int i = 0; i < kMaxNonDecodableDurationFrames; ++i) { EXPECT_GE(InsertFrame(kVideoFrameDelta, true), kNoError); } EXPECT_GE(InsertFrame(kVideoFrameKey, true), kNoError); // Advance time until it's time to decode the key frame. clock_->AdvanceTimeMilliseconds(kMinDelayMs - clock_->TimeInMilliseconds() - key_frame_inserted); EXPECT_TRUE(DecodeNextFrame()); // Make sure we don't get a key frame request since we have a key frame // in the list. bool request_key_frame = false; std::vector<uint16_t> nack_list = receiver_.NackList(&request_key_frame); EXPECT_FALSE(request_key_frame); } // A simulated clock, when time elapses, will insert frames into the jitter // buffer, based on initial settings. class SimulatedClockWithFrames : public SimulatedClock { public: SimulatedClockWithFrames(StreamGenerator* stream_generator, VCMReceiver* receiver) : SimulatedClock(0), stream_generator_(stream_generator), receiver_(receiver) {} virtual ~SimulatedClockWithFrames() {} // If |stop_on_frame| is true and next frame arrives between now and // now+|milliseconds|, the clock will be advanced to the arrival time of next // frame. // Otherwise, the clock will be advanced by |milliseconds|. // // For both cases, a frame will be inserted into the jitter buffer at the // instant when the clock time is timestamps_.front().arrive_time. // // Return true if some frame arrives between now and now+|milliseconds|. bool AdvanceTimeMilliseconds(int64_t milliseconds, bool stop_on_frame) { return AdvanceTimeMicroseconds(milliseconds * 1000, stop_on_frame); } bool AdvanceTimeMicroseconds(int64_t microseconds, bool stop_on_frame) { int64_t start_time = TimeInMicroseconds(); int64_t end_time = start_time + microseconds; bool frame_injected = false; while (!timestamps_.empty() && timestamps_.front().arrive_time <= end_time) { RTC_DCHECK(timestamps_.front().arrive_time >= start_time); SimulatedClock::AdvanceTimeMicroseconds(timestamps_.front().arrive_time - TimeInMicroseconds()); GenerateAndInsertFrame((timestamps_.front().render_time + 500) / 1000); timestamps_.pop(); frame_injected = true; if (stop_on_frame) return frame_injected; } if (TimeInMicroseconds() < end_time) { SimulatedClock::AdvanceTimeMicroseconds(end_time - TimeInMicroseconds()); } return frame_injected; } // Input timestamps are in unit Milliseconds. // And |arrive_timestamps| must be positive and in increasing order. // |arrive_timestamps| determine when we are going to insert frames into the // jitter buffer. // |render_timestamps| are the timestamps on the frame. void SetFrames(const int64_t* arrive_timestamps, const int64_t* render_timestamps, size_t size) { int64_t previous_arrive_timestamp = 0; for (size_t i = 0; i < size; i++) { RTC_CHECK(arrive_timestamps[i] >= previous_arrive_timestamp); timestamps_.push(TimestampPair(arrive_timestamps[i] * 1000, render_timestamps[i] * 1000)); previous_arrive_timestamp = arrive_timestamps[i]; } } private: struct TimestampPair { TimestampPair(int64_t arrive_timestamp, int64_t render_timestamp) : arrive_time(arrive_timestamp), render_time(render_timestamp) {} int64_t arrive_time; int64_t render_time; }; void GenerateAndInsertFrame(int64_t render_timestamp_ms) { VCMPacket packet; stream_generator_->GenerateFrame(FrameType::kVideoFrameKey, 1, // media packets 0, // empty packets render_timestamp_ms); bool packet_available = stream_generator_->PopPacket(&packet, 0); EXPECT_TRUE(packet_available); if (!packet_available) return; // Return here to avoid crashes below. receiver_->InsertPacket(packet); } std::queue<TimestampPair> timestamps_; StreamGenerator* stream_generator_; VCMReceiver* receiver_; }; // Use a SimulatedClockWithFrames // Wait call will do either of these: // 1. If |stop_on_frame| is true, the clock will be turned to the exact instant // that the first frame comes and the frame will be inserted into the jitter // buffer, or the clock will be turned to now + |max_time| if no frame comes in // the window. // 2. If |stop_on_frame| is false, the clock will be turn to now + |max_time|, // and all the frames arriving between now and now + |max_time| will be // inserted into the jitter buffer. // // This is used to simulate the JitterBuffer getting packets from internet as // time elapses. class FrameInjectEvent : public EventWrapper { public: FrameInjectEvent(SimulatedClockWithFrames* clock, bool stop_on_frame) : clock_(clock), stop_on_frame_(stop_on_frame) {} bool Set() override { return true; } EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT if (clock_->AdvanceTimeMilliseconds(max_time, stop_on_frame_) && stop_on_frame_) { return EventTypeWrapper::kEventSignaled; } else { return EventTypeWrapper::kEventTimeout; } } private: SimulatedClockWithFrames* clock_; bool stop_on_frame_; }; class VCMReceiverTimingTest : public ::testing::Test { protected: VCMReceiverTimingTest() : clock_(&stream_generator_, &receiver_), stream_generator_(0, clock_.TimeInMilliseconds()), timing_(&clock_), receiver_( &timing_, &clock_, std::unique_ptr<EventWrapper>(new FrameInjectEvent(&clock_, false)), std::unique_ptr<EventWrapper>( new FrameInjectEvent(&clock_, true))) {} virtual void SetUp() { receiver_.Reset(); } SimulatedClockWithFrames clock_; StreamGenerator stream_generator_; VCMTiming timing_; VCMReceiver receiver_; }; // Test whether VCMReceiver::FrameForDecoding handles parameter // |max_wait_time_ms| correctly: // 1. The function execution should never take more than |max_wait_time_ms|. // 2. If the function exit before now + |max_wait_time_ms|, a frame must be // returned. TEST_F(VCMReceiverTimingTest, FrameForDecoding) { const size_t kNumFrames = 100; const int kFramePeriod = 40; int64_t arrive_timestamps[kNumFrames]; int64_t render_timestamps[kNumFrames]; // Construct test samples. // render_timestamps are the timestamps stored in the Frame; // arrive_timestamps controls when the Frame packet got received. for (size_t i = 0; i < kNumFrames; i++) { // Preset frame rate to 25Hz. // But we add a reasonable deviation to arrive_timestamps to mimic Internet // fluctuation. arrive_timestamps[i] = (i + 1) * kFramePeriod + (i % 10) * ((i % 2) ? 1 : -1); render_timestamps[i] = (i + 1) * kFramePeriod; } clock_.SetFrames(arrive_timestamps, render_timestamps, kNumFrames); // Record how many frames we finally get out of the receiver. size_t num_frames_return = 0; const int64_t kMaxWaitTime = 30; // Ideally, we should get all frames that we input in InitializeFrames. // In the case that FrameForDecoding kills frames by error, we rely on the // build bot to kill the test. while (num_frames_return < kNumFrames) { int64_t start_time = clock_.TimeInMilliseconds(); VCMEncodedFrame* frame = receiver_.FrameForDecoding(kMaxWaitTime, false); int64_t end_time = clock_.TimeInMilliseconds(); // In any case the FrameForDecoding should not wait longer than // max_wait_time. // In the case that we did not get a frame, it should have been waiting for // exactly max_wait_time. (By the testing samples we constructed above, we // are sure there is no timing error, so the only case it returns with NULL // is that it runs out of time.) if (frame) { receiver_.ReleaseFrame(frame); ++num_frames_return; EXPECT_GE(kMaxWaitTime, end_time - start_time); } else { EXPECT_EQ(kMaxWaitTime, end_time - start_time); } } } // Test whether VCMReceiver::FrameForDecoding handles parameter // |prefer_late_decoding| and |max_wait_time_ms| correctly: // 1. The function execution should never take more than |max_wait_time_ms|. // 2. If the function exit before now + |max_wait_time_ms|, a frame must be // returned and the end time must be equal to the render timestamp - delay // for decoding and rendering. TEST_F(VCMReceiverTimingTest, FrameForDecodingPreferLateDecoding) { const size_t kNumFrames = 100; const int kFramePeriod = 40; int64_t arrive_timestamps[kNumFrames]; int64_t render_timestamps[kNumFrames]; int render_delay_ms; int max_decode_ms; int dummy; timing_.GetTimings(&dummy, &max_decode_ms, &dummy, &dummy, &dummy, &dummy, &render_delay_ms); // Construct test samples. // render_timestamps are the timestamps stored in the Frame; // arrive_timestamps controls when the Frame packet got received. for (size_t i = 0; i < kNumFrames; i++) { // Preset frame rate to 25Hz. // But we add a reasonable deviation to arrive_timestamps to mimic Internet // fluctuation. arrive_timestamps[i] = (i + 1) * kFramePeriod + (i % 10) * ((i % 2) ? 1 : -1); render_timestamps[i] = (i + 1) * kFramePeriod; } clock_.SetFrames(arrive_timestamps, render_timestamps, kNumFrames); // Record how many frames we finally get out of the receiver. size_t num_frames_return = 0; const int64_t kMaxWaitTime = 30; bool prefer_late_decoding = true; while (num_frames_return < kNumFrames) { int64_t start_time = clock_.TimeInMilliseconds(); VCMEncodedFrame* frame = receiver_.FrameForDecoding(kMaxWaitTime, prefer_late_decoding); int64_t end_time = clock_.TimeInMilliseconds(); if (frame) { EXPECT_EQ(frame->RenderTimeMs() - max_decode_ms - render_delay_ms, end_time); receiver_.ReleaseFrame(frame); ++num_frames_return; } else { EXPECT_EQ(kMaxWaitTime, end_time - start_time); } } } } // namespace webrtc
koobonil/Boss2D
Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/modules/video_coding/receiver_unittest.cc
C++
mit
20,183
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2286, 1996, 4773, 5339, 2278, 2622, 6048, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 1008, 2008, 2064, 2022, 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...
/* First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant space. */ #include <iostream> using namespace std; class Solution { public: int firstMissingPositive(int A[], int n) { // swap A[i] to the appropriate position in the array if sorted // ignore zero and negative numbers for (int i = 0; i < n; i++) { // A[i] != i + 1 means A[i] is not in the right position // as array start from 0, so A[0] = 1 // A[i] != A[A[i] - 1], this is for duplicate numbers // if it is in the right place, exit while while (A[i] > 0 && A[i] <= n && A[i] != i + 1 && A[i] != A[A[i] - 1]) { swap(A[i], A[A[i] - 1]); } } // find the first miss match: A[i] != i + 1 int i; for (i = 0; i < n; i++) { if (A[i] != i + 1) break; } return i + 1; } }; int main(int argc, char *argv[]) { Solution sol; int a1[] = { 1, 2, 0 }; int a2[] = { 3, 4, -1, 1 }; int a3[] = { 1, 1 }; // bug, duplicate numbers cout << sol.firstMissingPositive(a1, sizeof(a1) / sizeof(int)) << endl; cout << sol.firstMissingPositive(a2, sizeof(a2) / sizeof(int)) << endl; cout << sol.firstMissingPositive(a3, sizeof(a3) / sizeof(int)) << endl; return 0; }
wjin/algorithm
leetcode/first_missing_positive.cpp
C++
gpl-2.0
1,515
[ 30522, 1013, 1008, 2034, 4394, 3893, 2445, 2019, 4895, 21748, 3064, 16109, 9140, 1010, 2424, 1996, 2034, 4394, 3893, 16109, 1012, 2005, 2742, 1010, 2445, 1031, 1015, 1010, 1016, 1010, 1014, 1033, 2709, 1017, 1010, 1998, 1031, 1017, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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":"33913260","logradouro":"Rua Amap\u00e1","bairro":"Menezes (Justin\u00f3polis)","cidade":"Ribeir\u00e3o das Neves","uf":"MG","estado":"Minas Gerais"});
lfreneda/cepdb
api/v1/33913260.jsonp.js
JavaScript
cc0-1.0
165
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 28977, 17134, 23833, 2692, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 21766, 2050, 25933, 2361, 1032, 1057, 8889, 2063, 2487, 1000, 1010, 1000, 21790...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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) <2015> <IMS MAXIMS> # //# # //# This program is free software: you can redistribute it and/or modify # //# it under the terms of the GNU Affero 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 Affero General Public License for more details. # //# # //# You should have received a copy of the GNU Affero General Public License # //# along with this program. If not, see <http://www.gnu.org/licenses/>. # //# # //# IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of # //# this program. Users of this software do so entirely at their own risk. # //# IMS MAXIMS only ensures the Clinical Safety of unaltered run-time # //# software that it builds, deploys and maintains. # //# # //############################################################################# //#EOH // This code was generated by Peter Martin using IMS Development Environment (version 1.70 build 3545.21176) // Copyright (C) 1995-2009 IMS MAXIMS. All rights reserved. package ims.RefMan.domain.impl; import java.util.ArrayList; import java.util.List; import ims.admin.domain.HcpAdmin; import ims.admin.domain.impl.HcpAdminImpl; import ims.RefMan.domain.base.impl.BaseClinicalNotesComponentImpl; import ims.RefMan.domain.objects.ConsultationClinicalNotes; import ims.domain.DomainFactory; import ims.domain.exceptions.StaleObjectException; import ims.domain.exceptions.UniqueKeyViolationException; import ims.framework.enumerations.SortOrder; import ims.framework.exceptions.CodingRuntimeException; import ims.RefMan.vo.ConsultationClinicalNotesRefVo; import ims.RefMan.vo.ConsultationClinicalNotesVoCollection; import ims.RefMan.vo.domain.ConsultationClinicalNotesVoAssembler; import ims.clinical.domain.Allergies; import ims.clinical.domain.impl.AllergiesImpl; import ims.core.patient.vo.PatientRefVo; import ims.core.vo.HcpLiteVoCollection; import ims.core.vo.PatientAllergyCollection; import ims.core.vo.PatientNoAllergyInfoVo; import ims.core.vo.PatientShort; import ims.core.vo.domain.PatientShortAssembler; public class ClinicalNotesComponentImpl extends BaseClinicalNotesComponentImpl { private static final long serialVersionUID = 1L; public ims.RefMan.vo.ConsultationClinicalNotesVo getConsultationClinicalNotesVo(ims.RefMan.vo.CatsReferralRefVo refVoCatsReferral) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from ConsultationClinicalNotes ccn"); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Integer> values = new ArrayList<Integer>(); hql.append(" where ccn.catsReferral.id = :crId "); markers.add("crId"); values.add(refVoCatsReferral.getID_CatsReferral()); List listNotes = factory.find(hql.toString(), markers,values); if(listNotes != null && listNotes.size() > 0) { ConsultationClinicalNotesVoCollection voColl = ConsultationClinicalNotesVoAssembler.createConsultationClinicalNotesVoCollectionFromConsultationClinicalNotes(listNotes); if(voColl != null && voColl.size() > 0) { voColl.sort(SortOrder.DESCENDING); return voColl.get(0); } } return null; } public ims.RefMan.vo.ConsultationClinicalNotesVo getNote(ConsultationClinicalNotesRefVo note) { if (note == null) throw new RuntimeException("Cannot get ConsultationClinicalNotesVo for null ConsultationClinicalNotesRefVo"); ConsultationClinicalNotes doConsultationClinicalNotes = (ConsultationClinicalNotes) getDomainFactory().getDomainObject(ConsultationClinicalNotes.class, note.getID_ConsultationClinicalNotes()); return ConsultationClinicalNotesVoAssembler.create(doConsultationClinicalNotes); } public ims.RefMan.vo.ConsultationClinicalNotesVo saveConsultationClinicalNotesVo(ims.RefMan.vo.ConsultationClinicalNotesVo voConsultationClinicalNotes) throws ims.domain.exceptions.StaleObjectException { if(voConsultationClinicalNotes == null) throw new CodingRuntimeException("ConsultationClinicalNotesVo is null"); if(!voConsultationClinicalNotes.isValidated()) throw new CodingRuntimeException("ConsultationClinicalNotesVo has not been validated"); DomainFactory factory = getDomainFactory(); ConsultationClinicalNotes doConsultationClinicalNotes = ConsultationClinicalNotesVoAssembler.extractConsultationClinicalNotes(factory, voConsultationClinicalNotes); factory.save(doConsultationClinicalNotes); return ConsultationClinicalNotesVoAssembler.create(doConsultationClinicalNotes); } public HcpLiteVoCollection listHcpLiteByName(String hcpName) { HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class); return hcpAdmin.listHcpLiteByName(hcpName); } public PatientAllergyCollection listPatientAllergies(PatientShort patient) { Allergies allergies = (Allergies)getDomainImpl(AllergiesImpl.class); return allergies.listPatientAllergies(patient, true); } public PatientNoAllergyInfoVo getPatientNoAllergyInfo(PatientRefVo patientRefVo) { Allergies allergies = (Allergies)getDomainImpl(AllergiesImpl.class); return allergies.getPatientNoAllergyInfo(patientRefVo); } public PatientNoAllergyInfoVo savePatientNoAllergyInfo(PatientNoAllergyInfoVo patientNoAllergyInfo) throws StaleObjectException, UniqueKeyViolationException { Allergies allergies = (Allergies)getDomainImpl(AllergiesImpl.class); return allergies.savePatientNoAllergyInfo(patientNoAllergyInfo); } //wdev-10534 public PatientShort getPatientShort(PatientRefVo patientRefVo) { DomainFactory factory = getDomainFactory(); ims.core.patient.domain.objects.Patient patBo = (ims.core.patient.domain.objects.Patient) factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patientRefVo.getID_Patient().intValue()); return PatientShortAssembler.create(patBo); } }
IMS-MAXIMS/openMAXIMS
Source Library/openmaxims_workspace/RefMan/src/ims/RefMan/domain/impl/ClinicalNotesComponentImpl.java
Java
agpl-3.0
6,912
[ 30522, 1013, 1013, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 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...
/* * Copyright 2010-2020 Alfresco Software, Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti.standalone.history; import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.JavaDelegate; /** */ public class VariableUpdateDelegate implements JavaDelegate { public void execute(DelegateExecution execution) { execution.setVariable("zzz", 123456789L); } }
Activiti/Activiti
activiti-core/activiti-engine/src/test/java/org/activiti/standalone/history/VariableUpdateDelegate.java
Java
apache-2.0
940
[ 30522, 1013, 1008, 1008, 9385, 2230, 1011, 12609, 24493, 6072, 3597, 4007, 1010, 5183, 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, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* * jquant1.c * * Copyright (C) 1991-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains 1-pass color quantization (color mapping) routines. * These routines provide mapping to a fixed color map using equally spaced * color values. Optional Floyd-Steinberg or ordered dithering is available. */ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" #ifdef QUANT_1PASS_SUPPORTED /* * The main purpose of 1-pass quantization is to provide a fast, if not very * high quality, colormapped output capability. A 2-pass quantizer usually * gives better visual quality; however, for quantized grayscale output this * quantizer is perfectly adequate. Dithering is highly recommended with this * quantizer, though you can turn it off if you really want to. * * In 1-pass quantization the colormap must be chosen in advance of seeing the * image. We use a map consisting of all combinations of Ncolors[i] color * values for the i'th component. The Ncolors[] values are chosen so that * their product, the total number of colors, is no more than that requested. * (In most cases, the product will be somewhat less.) * * Since the colormap is orthogonal, the representative value for each color * component can be determined without considering the other components; * then these indexes can be combined into a colormap index by a standard * N-dimensional-array-subscript calculation. Most of the arithmetic involved * can be precalculated and stored in the lookup table colorindex[]. * colorindex[i][j] maps pixel value j in component i to the nearest * representative value (grid plane) for that component; this index is * multiplied by the array stride for component i, so that the * index of the colormap entry closest to a given pixel value is just * sum( colorindex[component-number][pixel-component-value] ) * Aside from being fast, this scheme allows for variable spacing between * representative values with no additional lookup cost. * * If gamma correction has been applied in color conversion, it might be wise * to adjust the color grid spacing so that the representative colors are * equidistant in linear space. At this writing, gamma correction is not * implemented by jdcolor, so nothing is done here. */ /* Declarations for ordered dithering. * * We use a standard 16x16 ordered dither array. The basic concept of ordered * dithering is described in many references, for instance Dale Schumacher's * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). * In place of Schumacher's comparisons against a "threshold" value, we add a * "dither" value to the input pixel and then round the result to the nearest * output value. The dither value is equivalent to (0.5 - threshold) times * the distance between output values. For ordered dithering, we assume that * the output colors are equally spaced; if not, results will probably be * worse, since the dither may be too much or too little at a given point. * * The normal calculation would be to form pixel value + dither, range-limit * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. * We can skip the separate range-limiting step by extending the colorindex * table in both directions. */ #define ODITHER_SIZE 16 /* dimension of dither matrix */ /* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ #define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ #define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { /* Bayer's order-4 dither array. Generated by the code given in * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. * The values in this array must range from 0 to ODITHER_CELLS-1. */ { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } }; /* Declarations for Floyd-Steinberg dithering. * * Errors are accumulated into the array fserrors[], at a resolution of * 1/16th of a pixel count. The error at a given pixel is propagated * to its not-yet-processed neighbors using the standard F-S fractions, * ... (here) 7/16 * 3/16 5/16 1/16 * We work left-to-right on even rows, right-to-left on odd rows. * * We can get away with a single array (holding one row's worth of errors) * by using it to store the current row's errors at pixel columns not yet * processed, but the next row's errors at columns already processed. We * need only a few extra variables to hold the errors immediately around the * current column. (If we are lucky, those variables are in registers, but * even if not, they're probably cheaper to access than array elements are.) * * The fserrors[] array is indexed [component#][position]. * We provide (#columns + 2) entries per component; the extra entry at each * end saves us from special-casing the first and last pixels. * * Note: on a wide image, we might not have enough room in a PC's near data * segment to hold the error array; so it is allocated with alloc_large. */ #if BITS_IN_JSAMPLE == 8 typedef INT16 FSERROR; /* 16 bits should be enough */ typedef int LOCFSERROR; /* use 'int' for calculation temps */ #else typedef JPEG_INT32 FSERROR; /* may need more than 16 bits */ typedef JPEG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */ #endif typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ /* Private subobject */ #define MAX_Q_COMPS 4 /* max components I can handle */ typedef struct { struct jpeg_color_quantizer pub; /* public fields */ /* Initially allocated colormap is saved here */ JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ int sv_actual; /* number of entries in use */ JSAMPARRAY colorindex; /* Precomputed mapping for speed */ /* colorindex[i][j] = index of color closest to pixel value j in component i, * premultiplied as described above. Since colormap indexes must fit into * JSAMPLEs, the entries of this array will too. */ wxjpeg_boolean is_padded; /* is the colorindex padded for odither? */ int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ /* Variables for ordered dithering */ int row_index; /* cur row's vertical index in dither matrix */ ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ /* Variables for Floyd-Steinberg dithering */ FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ wxjpeg_boolean on_odd_row; /* flag to remember which row we are on */ } my_cquantizer; typedef my_cquantizer * my_cquantize_ptr; /* * Policy-making subroutines for create_colormap and create_colorindex. * These routines determine the colormap to be used. The rest of the module * only assumes that the colormap is orthogonal. * * * select_ncolors decides how to divvy up the available colors * among the components. * * output_value defines the set of representative values for a component. * * largest_input_value defines the mapping from input values to * representative values for a component. * Note that the latter two routines may impose different policies for * different components, though this is not currently done. */ LOCAL(int) select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) /* Determine allocation of desired colors to components, */ /* and fill in Ncolors[] array to indicate choice. */ /* Return value is total number of colors (product of Ncolors[] values). */ { int nc = cinfo->out_color_components; /* number of color components */ int max_colors = cinfo->desired_number_of_colors; int total_colors, iroot, i, j; wxjpeg_boolean changed; long temp; static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; /* We can allocate at least the nc'th root of max_colors per component. */ /* Compute floor(nc'th root of max_colors). */ iroot = 1; do { iroot++; temp = iroot; /* set temp = iroot ** nc */ for (i = 1; i < nc; i++) temp *= iroot; } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ iroot--; /* now iroot = floor(root) */ /* Must have at least 2 color values per component */ if (iroot < 2) ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); /* Initialize to iroot color values for each component */ total_colors = 1; for (i = 0; i < nc; i++) { Ncolors[i] = iroot; total_colors *= iroot; } /* We may be able to increment the count for one or more components without * exceeding max_colors, though we know not all can be incremented. * Sometimes, the first component can be incremented more than once! * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) * In RGB colorspace, try to increment G first, then R, then B. */ do { changed = FALSE; for (i = 0; i < nc; i++) { j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); /* calculate new total_colors if Ncolors[j] is incremented */ temp = total_colors / Ncolors[j]; temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ if (temp > (long) max_colors) break; /* won't fit, done with this pass */ Ncolors[j]++; /* OK, apply the increment */ total_colors = (int) temp; changed = TRUE; } } while (changed); return total_colors; } LOCAL(int) output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) /* Return j'th output value, where j will range from 0 to maxj */ /* The output values must fall in 0..MAXJSAMPLE in increasing order */ { /* We always provide values 0 and MAXJSAMPLE for each component; * any additional values are equally spaced between these limits. * (Forcing the upper and lower values to the limits ensures that * dithering can't produce a color outside the selected gamut.) */ return (int) (((JPEG_INT32) j * MAXJSAMPLE + maxj/2) / maxj); } LOCAL(int) largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) /* Return largest input value that should map to j'th output value */ /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ { /* Breakpoints are halfway between values returned by output_value */ return (int) (((JPEG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); } /* * Create the colormap. */ LOCAL(void) create_colormap (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; JSAMPARRAY colormap; /* Created colormap */ int total_colors; /* Number of distinct output colors */ int i,j,k, nci, blksize, blkdist, ptr, val; /* Select number of colors for each component */ total_colors = select_ncolors(cinfo, cquantize->Ncolors); /* Report selected color counts */ if (cinfo->out_color_components == 3) TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, total_colors, cquantize->Ncolors[0], cquantize->Ncolors[1], cquantize->Ncolors[2]); else TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); /* Allocate and fill in the colormap. */ /* The colors are ordered in the map in standard row-major order, */ /* i.e. rightmost (highest-indexed) color changes most rapidly. */ colormap = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); /* blksize is number of adjacent repeated entries for a component */ /* blkdist is distance between groups of identical entries for a component */ blkdist = total_colors; for (i = 0; i < cinfo->out_color_components; i++) { /* fill in colormap entries for i'th color component */ nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ blksize = blkdist / nci; for (j = 0; j < nci; j++) { /* Compute j'th output value (out of nci) for component */ val = output_value(cinfo, i, j, nci-1); /* Fill in all colormap entries that have this value of this component */ for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { /* fill in blksize entries beginning at ptr */ for (k = 0; k < blksize; k++) colormap[i][ptr+k] = (JSAMPLE) val; } } blkdist = blksize; /* blksize of this color is blkdist of next */ } /* Save the colormap in private storage, * where it will survive color quantization mode changes. */ cquantize->sv_colormap = colormap; cquantize->sv_actual = total_colors; } /* * Create the color index table. */ LOCAL(void) create_colorindex (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; JSAMPROW indexptr; int i,j,k, nci, blksize, val, pad; /* For ordered dither, we pad the color index tables by MAXJSAMPLE in * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). * This is not necessary in the other dithering modes. However, we * flag whether it was done in case user changes dithering mode. */ if (cinfo->dither_mode == JDITHER_ORDERED) { pad = MAXJSAMPLE*2; cquantize->is_padded = TRUE; } else { pad = 0; cquantize->is_padded = FALSE; } cquantize->colorindex = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) (MAXJSAMPLE+1 + pad), (JDIMENSION) cinfo->out_color_components); /* blksize is number of adjacent repeated entries for a component */ blksize = cquantize->sv_actual; for (i = 0; i < cinfo->out_color_components; i++) { /* fill in colorindex entries for i'th color component */ nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ blksize = blksize / nci; /* adjust colorindex pointers to provide padding at negative indexes. */ if (pad) cquantize->colorindex[i] += MAXJSAMPLE; /* in loop, val = index of current output value, */ /* and k = largest j that maps to current val */ indexptr = cquantize->colorindex[i]; val = 0; k = largest_input_value(cinfo, i, 0, nci-1); for (j = 0; j <= MAXJSAMPLE; j++) { while (j > k) /* advance val if past boundary */ k = largest_input_value(cinfo, i, ++val, nci-1); /* premultiply so that no multiplication needed in main processing */ indexptr[j] = (JSAMPLE) (val * blksize); } /* Pad at both ends if necessary */ if (pad) for (j = 1; j <= MAXJSAMPLE; j++) { indexptr[-j] = indexptr[0]; indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; } } } /* * Create an ordered-dither array for a component having ncolors * distinct output values. */ LOCAL(ODITHER_MATRIX_PTR) make_odither_array (j_decompress_ptr cinfo, int ncolors) { ODITHER_MATRIX_PTR odither; int j,k; JPEG_INT32 num,den; odither = (ODITHER_MATRIX_PTR) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(ODITHER_MATRIX)); /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). * Hence the dither value for the matrix cell with fill order f * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). * On 16-bit-int machine, be careful to avoid overflow. */ den = 2 * ODITHER_CELLS * ((JPEG_INT32) (ncolors - 1)); for (j = 0; j < ODITHER_SIZE; j++) { for (k = 0; k < ODITHER_SIZE; k++) { num = ((JPEG_INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) * MAXJSAMPLE; /* Ensure round towards zero despite C's lack of consistency * about rounding negative values in integer division... */ odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); } } return odither; } /* * Create the ordered-dither tables. * Components having the same number of representative colors may * share a dither table. */ LOCAL(void) create_odither_tables (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; ODITHER_MATRIX_PTR odither; int i, j, nci; for (i = 0; i < cinfo->out_color_components; i++) { nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ odither = NULL; /* search for matching prior component */ for (j = 0; j < i; j++) { if (nci == cquantize->Ncolors[j]) { odither = cquantize->odither[j]; break; } } if (odither == NULL) /* need a new table? */ odither = make_odither_array(cinfo, nci); cquantize->odither[i] = odither; } } /* * Map some rows of pixels to the output colormapped representation. */ METHODDEF(void) color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* General case, no dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; JSAMPARRAY colorindex = cquantize->colorindex; register int pixcode, ci; register JSAMPROW ptrin, ptrout; int row; JDIMENSION col; JDIMENSION width = cinfo->output_width; register int nc = cinfo->out_color_components; for (row = 0; row < num_rows; row++) { ptrin = input_buf[row]; ptrout = output_buf[row]; for (col = width; col > 0; col--) { pixcode = 0; for (ci = 0; ci < nc; ci++) { pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); } *ptrout++ = (JSAMPLE) pixcode; } } } METHODDEF(void) color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* Fast path for out_color_components==3, no dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register int pixcode; register JSAMPROW ptrin, ptrout; JSAMPROW colorindex0 = cquantize->colorindex[0]; JSAMPROW colorindex1 = cquantize->colorindex[1]; JSAMPROW colorindex2 = cquantize->colorindex[2]; int row; JDIMENSION col; JDIMENSION width = cinfo->output_width; for (row = 0; row < num_rows; row++) { ptrin = input_buf[row]; ptrout = output_buf[row]; for (col = width; col > 0; col--) { pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); *ptrout++ = (JSAMPLE) pixcode; } } } METHODDEF(void) quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* General case, with ordered dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register JSAMPROW input_ptr; register JSAMPROW output_ptr; JSAMPROW colorindex_ci; int * dither; /* points to active row of dither matrix */ int row_index, col_index; /* current indexes into dither matrix */ int nc = cinfo->out_color_components; int ci; int row; JDIMENSION col; JDIMENSION width = cinfo->output_width; for (row = 0; row < num_rows; row++) { /* Initialize output values to 0 so can process components separately */ jzero_far((void FAR *) output_buf[row], (size_t) (width * SIZEOF(JSAMPLE))); row_index = cquantize->row_index; for (ci = 0; ci < nc; ci++) { input_ptr = input_buf[row] + ci; output_ptr = output_buf[row]; colorindex_ci = cquantize->colorindex[ci]; dither = cquantize->odither[ci][row_index]; col_index = 0; for (col = width; col > 0; col--) { /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, * select output value, accumulate into output code for this pixel. * Range-limiting need not be done explicitly, as we have extended * the colorindex table to produce the right answers for out-of-range * inputs. The maximum dither is +- MAXJSAMPLE; this sets the * required amount of padding. */ *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]; input_ptr += nc; output_ptr++; col_index = (col_index + 1) & ODITHER_MASK; } } /* Advance row index for next row */ row_index = (row_index + 1) & ODITHER_MASK; cquantize->row_index = row_index; } } METHODDEF(void) quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* Fast path for out_color_components==3, with ordered dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register int pixcode; register JSAMPROW input_ptr; register JSAMPROW output_ptr; JSAMPROW colorindex0 = cquantize->colorindex[0]; JSAMPROW colorindex1 = cquantize->colorindex[1]; JSAMPROW colorindex2 = cquantize->colorindex[2]; int * dither0; /* points to active row of dither matrix */ int * dither1; int * dither2; int row_index, col_index; /* current indexes into dither matrix */ int row; JDIMENSION col; JDIMENSION width = cinfo->output_width; for (row = 0; row < num_rows; row++) { row_index = cquantize->row_index; input_ptr = input_buf[row]; output_ptr = output_buf[row]; dither0 = cquantize->odither[0][row_index]; dither1 = cquantize->odither[1][row_index]; dither2 = cquantize->odither[2][row_index]; col_index = 0; for (col = width; col > 0; col--) { pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + dither0[col_index]]); pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + dither1[col_index]]); pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + dither2[col_index]]); *output_ptr++ = (JSAMPLE) pixcode; col_index = (col_index + 1) & ODITHER_MASK; } row_index = (row_index + 1) & ODITHER_MASK; cquantize->row_index = row_index; } } METHODDEF(void) quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* General case, with Floyd-Steinberg dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register LOCFSERROR cur; /* current error or pixel value */ LOCFSERROR belowerr; /* error for pixel below cur */ LOCFSERROR bpreverr; /* error for below/prev col */ LOCFSERROR bnexterr; /* error for below/next col */ LOCFSERROR delta; register FSERRPTR errorptr; /* => fserrors[] at column before current */ register JSAMPROW input_ptr; register JSAMPROW output_ptr; JSAMPROW colorindex_ci; JSAMPROW colormap_ci; int pixcode; int nc = cinfo->out_color_components; int dir; /* 1 for left-to-right, -1 for right-to-left */ int dirnc; /* dir * nc */ int ci; int row; JDIMENSION col; JDIMENSION width = cinfo->output_width; JSAMPLE *range_limit = cinfo->sample_range_limit; SHIFT_TEMPS for (row = 0; row < num_rows; row++) { /* Initialize output values to 0 so can process components separately */ jzero_far((void FAR *) output_buf[row], (size_t) (width * SIZEOF(JSAMPLE))); for (ci = 0; ci < nc; ci++) { input_ptr = input_buf[row] + ci; output_ptr = output_buf[row]; if (cquantize->on_odd_row) { /* work right to left in this row */ input_ptr += (width-1) * nc; /* so point to rightmost pixel */ output_ptr += width-1; dir = -1; dirnc = -nc; errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ } else { /* work left to right in this row */ dir = 1; dirnc = nc; errorptr = cquantize->fserrors[ci]; /* => entry before first column */ } colorindex_ci = cquantize->colorindex[ci]; colormap_ci = cquantize->sv_colormap[ci]; /* Preset error values: no error propagated to first pixel from left */ cur = 0; /* and no error propagated to row below yet */ belowerr = bpreverr = 0; for (col = width; col > 0; col--) { /* cur holds the error propagated from the previous pixel on the * current line. Add the error propagated from the previous line * to form the complete error correction term for this pixel, and * round the error term (which is expressed * 16) to an integer. * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct * for either sign of the error value. * Note: errorptr points to *previous* column's array entry. */ cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. * The maximum error is +- MAXJSAMPLE; this sets the required size * of the range_limit array. */ cur += GETJSAMPLE(*input_ptr); cur = GETJSAMPLE(range_limit[cur]); /* Select output value, accumulate into output code for this pixel */ pixcode = GETJSAMPLE(colorindex_ci[cur]); *output_ptr += (JSAMPLE) pixcode; /* Compute actual representation error at this pixel */ /* Note: we can do this even though we don't have the final */ /* pixel code, because the colormap is orthogonal. */ cur -= GETJSAMPLE(colormap_ci[pixcode]); /* Compute error fractions to be propagated to adjacent pixels. * Add these into the running sums, and simultaneously shift the * next-line error sums left by 1 column. */ bnexterr = cur; delta = cur * 2; cur += delta; /* form error * 3 */ errorptr[0] = (FSERROR) (bpreverr + cur); cur += delta; /* form error * 5 */ bpreverr = belowerr + cur; belowerr = bnexterr; cur += delta; /* form error * 7 */ /* At this point cur contains the 7/16 error value to be propagated * to the next pixel on the current line, and all the errors for the * next line have been shifted over. We are therefore ready to move on. */ input_ptr += dirnc; /* advance input ptr to next column */ output_ptr += dir; /* advance output ptr to next column */ errorptr += dir; /* advance errorptr to current column */ } /* Post-loop cleanup: we must unload the final error value into the * final fserrors[] entry. Note we need not unload belowerr because * it is for the dummy column before or after the actual array. */ errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ } cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); } } /* * Allocate workspace for Floyd-Steinberg errors. */ LOCAL(void) alloc_fs_workspace (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; size_t arraysize; int i; arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); for (i = 0; i < cinfo->out_color_components; i++) { cquantize->fserrors[i] = (FSERRPTR) (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); } } /* * Initialize for one-pass color quantization. */ METHODDEF(void) start_pass_1_quant (j_decompress_ptr cinfo, wxjpeg_boolean is_pre_scan) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; size_t arraysize; int i; /* Install my colormap. */ cinfo->colormap = cquantize->sv_colormap; cinfo->actual_number_of_colors = cquantize->sv_actual; /* Initialize for desired dithering mode. */ switch (cinfo->dither_mode) { case JDITHER_NONE: if (cinfo->out_color_components == 3) cquantize->pub.color_quantize = color_quantize3; else cquantize->pub.color_quantize = color_quantize; break; case JDITHER_ORDERED: if (cinfo->out_color_components == 3) cquantize->pub.color_quantize = quantize3_ord_dither; else cquantize->pub.color_quantize = quantize_ord_dither; cquantize->row_index = 0; /* initialize state for ordered dither */ /* If user changed to ordered dither from another mode, * we must recreate the color index table with padding. * This will cost extra space, but probably isn't very likely. */ if (! cquantize->is_padded) create_colorindex(cinfo); /* Create ordered-dither tables if we didn't already. */ if (cquantize->odither[0] == NULL) create_odither_tables(cinfo); break; case JDITHER_FS: cquantize->pub.color_quantize = quantize_fs_dither; cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ /* Allocate Floyd-Steinberg workspace if didn't already. */ if (cquantize->fserrors[0] == NULL) alloc_fs_workspace(cinfo); /* Initialize the propagated errors to zero. */ arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); for (i = 0; i < cinfo->out_color_components; i++) jzero_far((void FAR *) cquantize->fserrors[i], arraysize); break; default: ERREXIT(cinfo, JERR_NOT_COMPILED); break; } } /* * Finish up at the end of the pass. */ METHODDEF(void) finish_pass_1_quant (j_decompress_ptr cinfo) { /* no work in 1-pass case */ } /* * Switch to a new external colormap between output passes. * Shouldn't get to this module! */ METHODDEF(void) new_color_map_1_quant (j_decompress_ptr cinfo) { ERREXIT(cinfo, JERR_MODE_CHANGE); } /* * Module initialization routine for 1-pass color quantization. */ GLOBAL(void) jinit_1pass_quantizer (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize; cquantize = (my_cquantize_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_cquantizer)); cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; cquantize->pub.start_pass = start_pass_1_quant; cquantize->pub.finish_pass = finish_pass_1_quant; cquantize->pub.new_color_map = new_color_map_1_quant; cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ /* Make sure my internal arrays won't overflow */ if (cinfo->out_color_components > MAX_Q_COMPS) ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); /* Make sure colormap indexes can be represented by JSAMPLEs */ if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); /* Create the colormap and color index table. */ create_colormap(cinfo); create_colorindex(cinfo); /* Allocate Floyd-Steinberg workspace now if requested. * We do this now since it is FAR storage and may affect the memory * manager's space calculations. If the user changes to FS dither * mode in a later pass, we will allocate the space then, and will * possibly overrun the max_memory_to_use setting. */ if (cinfo->dither_mode == JDITHER_FS) alloc_fs_workspace(cinfo); } #endif /* QUANT_1PASS_SUPPORTED */
dariusliep/LogViewer
thirdparty/wxWidgets-3.0.0/src/jpeg/jquant1.c
C
lgpl-3.0
32,213
[ 30522, 1013, 1008, 1008, 1046, 16211, 3372, 2487, 1012, 1039, 1008, 1008, 9385, 1006, 1039, 1007, 2889, 1011, 2727, 1010, 2726, 1043, 1012, 4644, 1012, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 2981, 16545, 13910, 2177, 1005, 1055, 4007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP #define OPENCV_CORE_ALLOCATOR_STATS_HPP #include "../cvdef.h" namespace cv { namespace utils { class AllocatorStatisticsInterface { protected: AllocatorStatisticsInterface() {} virtual ~AllocatorStatisticsInterface() {} public: virtual uint64_t getCurrentUsage() const = 0; virtual uint64_t getTotalUsage() const = 0; virtual uint64_t getNumberOfAllocations() const = 0; virtual uint64_t getPeakUsage() const = 0; /** set peak usage = current usage */ virtual void resetPeakUsage() = 0; }; }} // namespace #endif // OPENCV_CORE_ALLOCATOR_STATS_HPP
HuTianQi/QQ
app/src/main/cpp/third_part/opencv/include/opencv2/core/utils/allocator_stats.hpp
C++
mit
821
[ 30522, 1013, 1013, 2023, 5371, 2003, 2112, 1997, 2330, 2278, 2615, 2622, 1012, 1013, 1013, 2009, 2003, 3395, 2000, 1996, 6105, 3408, 1999, 1996, 6105, 5371, 2179, 1999, 1996, 2327, 1011, 2504, 14176, 1013, 1013, 1997, 2023, 4353, 1998, 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...
/* * Application.java * * Copyright (C) 2009-11 by RStudio, Inc. * * This program is licensed to you under the terms of version 3 of the * GNU Affero General Public License. This program is distributed WITHOUT * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. * */ package org.rstudio.studio.client.application; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.RunAsyncCallback; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.logical.shared.CloseEvent; import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.RootLayoutPanel; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; import org.rstudio.core.client.Debug; import org.rstudio.core.client.command.CommandBinder; import org.rstudio.core.client.command.Handler; import org.rstudio.core.client.dom.DomUtils; import org.rstudio.core.client.widget.Operation; import org.rstudio.studio.client.application.events.*; import org.rstudio.studio.client.application.model.SessionSerializationAction; import org.rstudio.studio.client.application.ui.RequestLogVisualization; import org.rstudio.studio.client.common.GlobalDisplay; import org.rstudio.studio.client.common.SimpleRequestCallback; import org.rstudio.studio.client.common.satellite.SatelliteManager; import org.rstudio.studio.client.projects.Projects; import org.rstudio.studio.client.server.*; import org.rstudio.studio.client.server.Void; import org.rstudio.studio.client.workbench.ClientStateUpdater; import org.rstudio.studio.client.workbench.Workbench; import org.rstudio.studio.client.workbench.commands.Commands; import org.rstudio.studio.client.workbench.events.SessionInitEvent; import org.rstudio.studio.client.workbench.model.Agreement; import org.rstudio.studio.client.workbench.model.Session; import org.rstudio.studio.client.workbench.model.SessionInfo; import org.rstudio.studio.client.workbench.prefs.model.UIPrefs; import org.rstudio.studio.client.workbench.views.source.editors.text.themes.AceThemes; @Singleton public class Application implements ApplicationEventHandlers { public interface Binder extends CommandBinder<Commands, Application> {} @Inject public Application(ApplicationView view, GlobalDisplay globalDisplay, EventBus events, Binder binder, Commands commands, Server server, Session session, Projects projects, SatelliteManager satelliteManager, ApplicationUncaughtExceptionHandler uncaughtExHandler, Provider<UIPrefs> uiPrefs, Provider<Workbench> workbench, Provider<EventBus> eventBusProvider, Provider<ClientStateUpdater> clientStateUpdater, Provider<ApplicationClientInit> pClientInit, Provider<AceThemes> pAceThemes) { // save references view_ = view ; globalDisplay_ = globalDisplay; events_ = events; session_ = session; commands_ = commands; satelliteManager_ = satelliteManager; clientStateUpdater_ = clientStateUpdater; server_ = server; uiPrefs_ = uiPrefs; workbench_ = workbench; eventBusProvider_ = eventBusProvider; pClientInit_ = pClientInit; pAceThemes_ = pAceThemes; // bind to commands binder.bind(commands_, this); // register as main window satelliteManager.initialize(); // subscribe to events events.addHandler(LogoutRequestedEvent.TYPE, this); events.addHandler(UnauthorizedEvent.TYPE, this); events.addHandler(ReloadEvent.TYPE, this); events.addHandler(QuitEvent.TYPE, this); events.addHandler(SuicideEvent.TYPE, this); events.addHandler(SessionAbendWarningEvent.TYPE, this); events.addHandler(SessionSerializationEvent.TYPE, this); events.addHandler(ServerUnavailableEvent.TYPE, this); events.addHandler(InvalidClientVersionEvent.TYPE, this); events.addHandler(ServerOfflineEvent.TYPE, this); // register for uncaught exceptions uncaughtExHandler.register(); } public void go(RootLayoutPanel rootPanel, final Command dismissLoadingProgress) { Widget w = view_.getWidget(); rootPanel.add(w); rootPanel.setWidgetTopBottom(w, 0, Style.Unit.PX, 0, Style.Unit.PX); rootPanel.setWidgetLeftRight(w, 0, Style.Unit.PX, 0, Style.Unit.PX); // attempt init pClientInit_.get().execute( new ServerRequestCallback<SessionInfo>() { public void onResponseReceived(final SessionInfo sessionInfo) { // initialize workbench after verifying agreement verifyAgreement(sessionInfo, new Operation() { public void execute() { dismissLoadingProgress.execute(); session_.setSessionInfo(sessionInfo); // configure workbench initializeWorkbench(); } }); } public void onError(ServerError error) { Debug.logError(error); dismissLoadingProgress.execute(); globalDisplay_.showErrorMessage("RStudio Initialization Error", error.getUserMessage()); } }) ; } @Handler public void onShowToolbar() { setToolbarPref(true); } @Handler public void onHideToolbar() { setToolbarPref(false); } @Handler public void onGoToFileFunction() { view_.performGoToFunction(); } public void onUnauthorized(UnauthorizedEvent event) { navigateToSignIn(); } public void onServerOffline(ServerOfflineEvent event) { cleanupWorkbench(); view_.showApplicationOffline(); } public void onLogoutRequested(LogoutRequestedEvent event) { navigateWindowTo("auth-sign-out"); } @Handler public void onHelpUsingRStudio() { String customDocsURL = session_.getSessionInfo().docsURL(); if (customDocsURL.length() > 0) globalDisplay_.openWindow(customDocsURL); else globalDisplay_.openRStudioLink("docs"); } @Handler public void onHelpKeyboardShortcuts() { openApplicationURL("docs/keyboard.htm"); } private void showAgreement() { globalDisplay_.openWindow(server_.getApplicationURL("agreement")); } @Handler public void onRstudioSupport() { globalDisplay_.openRStudioLink("support"); } @Handler public void onRstudioLicense() { showAgreement(); } @Handler public void onRstudioAgreement() { showAgreement(); } @Handler public void onUpdateCredentials() { server_.updateCredentials(); } @Handler public void onRaiseException() { throw new RuntimeException("foo"); } @Handler public final native void onRaiseException2() /*-{ $wnd.welfkjweg(); }-*/; @Handler public void onShowRequestLog() { GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable reason) { Window.alert(reason.toString()); } public void onSuccess() { final RequestLogVisualization viz = new RequestLogVisualization( server_); final RootLayoutPanel root = RootLayoutPanel.get(); root.add(viz); root.setWidgetTopBottom(viz, 10, Unit.PX, 10, Unit.PX); root.setWidgetLeftRight(viz, 10, Unit.PX, 10, Unit.PX); viz.addCloseHandler(new CloseHandler<RequestLogVisualization>() { public void onClose(CloseEvent<RequestLogVisualization> event) { root.remove(viz); } }); } }); } @Handler public void onLogFocusedElement() { Element el = DomUtils.getActiveElement(); DomUtils.dump(el, "Focused Element: "); } public void onSessionSerialization(SessionSerializationEvent event) { switch(event.getAction().getType()) { case SessionSerializationAction.LOAD_DEFAULT_WORKSPACE: view_.showSerializationProgress( "Loading workspace" + getSuffix(event), false, // non-modal, appears to user as std latency 500, // willing to show progress earlier since // this will always be at workbench startup 0); // no timeout break; case SessionSerializationAction.SAVE_DEFAULT_WORKSPACE: view_.showSerializationProgress( "Saving workspace image" + getSuffix(event), true, // modal, inputs will fall dead anyway 0, // show immediately 0); // no timeout break; case SessionSerializationAction.SUSPEND_SESSION: view_.showSerializationProgress( "Backing up R session...", true, // modal, inputs will fall dead anyway 0, // show immediately 60000); // timeout after 60 seconds. this is done // in case the user suspends or loses // connectivity during the backup (in which // case the 'completed' event dies with // server and is never received by the client break; case SessionSerializationAction.RESUME_SESSION: view_.showSerializationProgress( "Resuming R session...", false, // non-modal, appears to user as std latency 2000, // don't show this for reasonable restore time // (happens inline while using a running // workbench so be more conservative) 0); // no timeout break; case SessionSerializationAction.COMPLETED: view_.hideSerializationProgress(); break; } } private String getSuffix(SessionSerializationEvent event) { SessionSerializationAction action = event.getAction(); String targetPath = action.getTargetPath(); if (targetPath != null) { String verb = " from "; if (action.getType() == SessionSerializationAction.SAVE_DEFAULT_WORKSPACE) verb = " to "; return verb + targetPath + "..."; } else { return "..."; } } public void onServerUnavailable(ServerUnavailableEvent event) { view_.hideSerializationProgress(); } public void onReload(ReloadEvent event) { cleanupWorkbench(); Window.Location.reload(); } public void onQuit(QuitEvent event) { cleanupWorkbench(); // only show the quit state in server mode (desktop mode has its // own handling triggered to process exit) if (!Desktop.isDesktop()) { // if we are switching projects then reload after a delay (to allow // the R session to fully exit on the server) if (event.getSwitchProjects()) { new Timer() { @Override public void run() { Window.Location.reload(); } }.schedule(100); } else { view_.showApplicationQuit(); } } } public void onSuicide(SuicideEvent event) { cleanupWorkbench(); view_.showApplicationSuicide(event.getMessage()); } public void onClientDisconnected(ClientDisconnectedEvent event) { cleanupWorkbench(); view_.showApplicationDisconnected(); } public void onInvalidClientVersion(InvalidClientVersionEvent event) { cleanupWorkbench(); view_.showApplicationUpdateRequired(); } public void onSessionAbendWarning(SessionAbendWarningEvent event) { view_.showSessionAbendWarning(); } private void verifyAgreement(SessionInfo sessionInfo, final Operation verifiedOperation) { // get the agreeeent (if any) final Agreement agreement = sessionInfo.pendingAgreement(); // if there is an agreement then prompt user for agreement (otherwise just // execute the verifiedOperation immediately) if (agreement != null) { // append updated to the title if necessary String title = agreement.getTitle(); if (agreement.getUpdated()) title += " (Updated)"; view_.showApplicationAgreement( // title and contents title, agreement.getContents(), // bail to sign in page if the user doesn't confirm new Operation() { public void execute() { if (Desktop.isDesktop()) { server_.quitSession(false, null, new SimpleRequestCallback<Void>()); } else navigateToSignIn(); } }, // user confirmed new Operation() { public void execute() { // call verified operation verifiedOperation.execute(); // record agreement on server server_.acceptAgreement(agreement, new VoidServerRequestCallback()); } } ); } else { // no agreement pending verifiedOperation.execute(); } } private void navigateWindowTo(String relativeUrl) { cleanupWorkbench(); String url = GWT.getHostPageBaseURL() + relativeUrl; Window.Location.replace(url); } private void openApplicationURL(String relativeURL) { String url = GWT.getHostPageBaseURL() + relativeURL; globalDisplay_.openWindow(url); } private void initializeWorkbench() { pAceThemes_.get(); // subscribe to ClientDisconnected event (wait to do this until here // because there were spurious ClientDisconnected events occuring // after a session interrupt sequence. we couldn't figure out why, // and since this is a temporary hack why not add another temporary // hack to go with it here :-) // TOOD: move this back tot he constructor after we revise the // interrupt hack(s) events_.addHandler(ClientDisconnectedEvent.TYPE, this); // create workbench Workbench wb = workbench_.get(); eventBusProvider_.get().fireEvent(new SessionInitEvent()) ; // hide the agreement menu item if we don't have one if (!session_.getSessionInfo().hasAgreement()) commands_.rstudioAgreement().setVisible(false); // show workbench view_.showWorkbenchView(wb.getMainView().asWidget()); // toolbar (must be after call to showWorkbenchView because // showing the toolbar repositions the workbench view widget) showToolbar( uiPrefs_.get().toolbarVisible().getValue()); // sync to changes in the toolbar visibility state uiPrefs_.get().toolbarVisible().addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { showToolbar(event.getValue()); } }); clientStateUpdaterInstance_ = clientStateUpdater_.get(); } private void setToolbarPref(boolean showToolbar) { uiPrefs_.get().toolbarVisible().setGlobalValue(showToolbar); uiPrefs_.get().writeUIPrefs(); } private void showToolbar(boolean showToolbar) { // show or hide the toolbar view_.showToolbar(showToolbar); // manage commands commands_.showToolbar().setVisible(!showToolbar); commands_.hideToolbar().setVisible(showToolbar); } private void cleanupWorkbench() { server_.disconnect(); satelliteManager_.closeAllSatellites(); if (clientStateUpdaterInstance_ != null) { clientStateUpdaterInstance_.suspend(); clientStateUpdaterInstance_ = null; } } private void navigateToSignIn() { navigateWindowTo("auth-sign-in"); } private final ApplicationView view_ ; private final GlobalDisplay globalDisplay_ ; private final EventBus events_; private final Session session_; private final Commands commands_; private final SatelliteManager satelliteManager_; private final Provider<ClientStateUpdater> clientStateUpdater_; private final Server server_; private final Provider<UIPrefs> uiPrefs_; private final Provider<Workbench> workbench_; private final Provider<EventBus> eventBusProvider_; private final Provider<ApplicationClientInit> pClientInit_; private final Provider<AceThemes> pAceThemes_; private ClientStateUpdater clientStateUpdaterInstance_; }
Sage-Bionetworks/rstudio
src/gwt/src/org/rstudio/studio/client/application/Application.java
Java
agpl-3.0
18,455
[ 30522, 1013, 1008, 1008, 4646, 1012, 9262, 1008, 1008, 9385, 1006, 1039, 1007, 2268, 1011, 2340, 2011, 12667, 8525, 20617, 1010, 4297, 1012, 1008, 1008, 2023, 2565, 2003, 7000, 2000, 2017, 2104, 1996, 3408, 1997, 2544, 1017, 1997, 1996, 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...
/*++ /* NAME /* cleanup_map11 3 /* SUMMARY /* one-to-one mapping /* SYNOPSIS /* #include <cleanup.h> /* /* int cleanup_map11_external(state, addr, maps, propagate) /* CLEANUP_STATE *state; /* VSTRING *addr; /* MAPS *maps; /* int propagate; /* /* int cleanup_map11_internal(state, addr, maps, propagate) /* CLEANUP_STATE *state; /* VSTRING *addr; /* MAPS *maps; /* int propagate; /* /* int cleanup_map11_tree(state, tree, maps, propagate) /* CLEANUP_STATE *state; /* TOK822 *tree; /* MAPS *maps; /* int propagate; /* DESCRIPTION /* This module performs one-to-one map lookups. /* /* If an address has a mapping, the lookup result is /* subjected to another iteration of rewriting and mapping. /* Recursion continues until an address maps onto itself, /* or until an unreasonable recursion level is reached. /* An unmatched address extension is propagated when /* \fIpropagate\fR is non-zero. /* These functions return non-zero when the address was changed. /* /* cleanup_map11_external() looks up the external (quoted) string /* form of an address in the maps specified via the \fImaps\fR argument. /* /* cleanup_map11_internal() is a wrapper around the /* cleanup_map11_external() routine that transforms from /* internal (quoted) string form to external form and back. /* /* cleanup_map11_tree() is a wrapper around the /* cleanup_map11_external() routine that transforms from /* internal parse tree form to external form and back. /* DIAGNOSTICS /* Recoverable errors: the global \fIcleanup_errs\fR flag is updated. /* SEE ALSO /* mail_addr_find(3) address lookups /* mail_addr_map(3) address mappings /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ /* System library. */ #include <sys_defs.h> #include <string.h> #ifdef STRCASECMP_IN_STRINGS_H #include <strings.h> #endif /* Utility library. */ #include <msg.h> #include <vstring.h> #include <dict.h> #include <mymalloc.h> /* Global library. */ #include <cleanup_user.h> #include <mail_addr_map.h> #include <quote_822_local.h> /* Application-specific. */ #include "cleanup.h" #define STR vstring_str #define MAX_RECURSION 10 /* cleanup_map11_external - one-to-one table lookups */ int cleanup_map11_external(CLEANUP_STATE *state, VSTRING *addr, MAPS *maps, int propagate) { int count; int expand_to_self; ARGV *new_addr; char *saved_addr; int did_rewrite = 0; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ for (count = 0; count < MAX_RECURSION; count++) { if ((new_addr = mail_addr_map(maps, STR(addr), propagate)) != 0) { if (new_addr->argc > 1) msg_warn("%s: multi-valued %s entry for %s", state->queue_id, maps->title, STR(addr)); saved_addr = mystrdup(STR(addr)); did_rewrite |= strcmp(new_addr->argv[0], STR(addr)); vstring_strcpy(addr, new_addr->argv[0]); expand_to_self = !strcasecmp(saved_addr, STR(addr)); myfree(saved_addr); argv_free(new_addr); if (expand_to_self) return (did_rewrite); } else if (maps->error != 0) { msg_warn("%s: %s map lookup problem for %s -- " "message not accepted, try again later", state->queue_id, maps->title, STR(addr)); state->errs |= CLEANUP_STAT_WRITE; return (did_rewrite); } else { return (did_rewrite); } } msg_warn("%s: unreasonable %s map nesting for %s -- " "message not accepted, try again later", state->queue_id, maps->title, STR(addr)); return (did_rewrite); } /* cleanup_map11_tree - rewrite address node */ int cleanup_map11_tree(CLEANUP_STATE *state, TOK822 *tree, MAPS *maps, int propagate) { VSTRING *temp = vstring_alloc(100); int did_rewrite; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ tok822_externalize(temp, tree->head, TOK822_STR_DEFL); did_rewrite = cleanup_map11_external(state, temp, maps, propagate); tok822_free_tree(tree->head); tree->head = tok822_scan(STR(temp), &tree->tail); vstring_free(temp); return (did_rewrite); } /* cleanup_map11_internal - rewrite address internal form */ int cleanup_map11_internal(CLEANUP_STATE *state, VSTRING *addr, MAPS *maps, int propagate) { VSTRING *temp = vstring_alloc(100); int did_rewrite; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ quote_822_local(temp, STR(addr)); did_rewrite = cleanup_map11_external(state, temp, maps, propagate); unquote_822_local(addr, STR(temp)); vstring_free(temp); return (did_rewrite); }
pyk/whiteoak
src/cleanup/cleanup_map11.c
C
epl-1.0
5,302
[ 30522, 1013, 1008, 1009, 1009, 1013, 1008, 2171, 1013, 1008, 27686, 1035, 4949, 14526, 1017, 1013, 1008, 12654, 1013, 1008, 2028, 1011, 2000, 1011, 2028, 12375, 1013, 1008, 19962, 22599, 1013, 1008, 1001, 2421, 1026, 27686, 1012, 1044, 1028...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
-- -- Table structure for table `querylog` -- CREATE TABLE `query_log` ( query_id int(10) unsigned NOT NULL auto_increment, ref_query_id int(10) unsigned, last_result_id int(10) unsigned, created datetime NOT NULL, raw varchar(1000) NOT NULL, sorted_terms varchar(1000) NOT NULL, sorted_terms_hash char(32) NOT NULL, parsed varchar(2000), user_id int(10) unsigned NOT NULL, result_count int(8) unsigned NOT NULL, PRIMARY KEY(query_id), KEY created (created), KEY sorted_terms (sorted_terms(100)), KEY last_result (last_result_id), KEY sorted_terms_hash (sorted_terms_hash) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci; -- -- Table structure for table `query_result_popularity` -- CREATE TABLE `query_result_popularity` ( sorted_terms_hash char(32) NOT NULL, type tinyint unsigned NOT NULL, type_id int(8) unsigned NOT NULL, selection_count int(8) unsigned, PRIMARY KEY(sorted_terms_hash,type,type_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci; -- -- Table structure for table `query_result_log` -- CREATE TABLE `query_result_log` ( query_result_id int(10) unsigned NOT NULL auto_increment, query_id int(10) unsigned NOT NULL, created datetime NOT NULL, result_position int(2) unsigned NOT NULL, result_rank double unsigned not NULL, page_id int(8) unsigned NOT NULL, type tinyint unsigned NOT NULL, type_id int(8) unsigned NOT NULL, PRIMARY KEY(query_result_id), KEY query_id (query_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci; -- -- Table structure for table `query_terms` -- CREATE TABLE `query_terms` ( query_term_id int(10) unsigned NOT NULL auto_increment primary key, query_term varchar(100) NOT NULL UNIQUE ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci; -- -- Table structure for table `query_term_map` -- CREATE TABLE `query_term_map` ( query_term_id int(10) unsigned NOT NULL, query_id int(10) unsigned NOT NULL, UNIQUE KEY term_query (query_term_id, query_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
StackableRegiments/metl2011
ThumbService/ThumbService/lib/MindTouch_Core_10.0.1_Source/web/maintenance/archives/patch-search-analytics.sql
SQL
apache-2.0
2,150
[ 30522, 1011, 1011, 1011, 1011, 2795, 3252, 2005, 2795, 1036, 23032, 21197, 1036, 1011, 1011, 3443, 2795, 1036, 23032, 1035, 8833, 1036, 1006, 23032, 1035, 8909, 20014, 1006, 2184, 1007, 27121, 2025, 19701, 8285, 1035, 4297, 28578, 4765, 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...
% !TeX spellcheck = en_GB % !TeX encoding = UTF-8 \documentclass{ldbc} \input{packages} \input{commands} \input{query-card-definitions} \input{listings} \input{main-doc-settings} \bibliography{bib/references,bib/graphalytics,bib/graphalytics-specification,bib/snb-interactive,bib/snb-bi,bib/spb,bib/datagen-deletes,bib/acid,bib/specification} \setboolean{standalone}{false} \input{abstract} \input{executive-summary} \begin{document} \maketitle \chapter*{Acknowledgments} \input{special-thanks} \input{defs} \input{introduction} \input{benchmark-specification} \input{data} \input{workloads} \input{interactive} \input{bi} \input{auditing} \input{acid} \input{related-work} \printbibliography \appendix \input{choke-points} \input{sf-statistics} \input{benchmark-checklist} \input{legacy-data-sets} \input{example-graph} \end{document}
ldbc/ldbc_snb_docs
ldbc-snb-specification.tex
TeX
apache-2.0
861
[ 30522, 1003, 999, 16060, 6297, 5403, 3600, 1027, 4372, 1035, 16351, 1003, 999, 16060, 17181, 1027, 21183, 2546, 1011, 1022, 1032, 6254, 26266, 1063, 25510, 9818, 1065, 1032, 7953, 1063, 14555, 1065, 1032, 7953, 1063, 10954, 1065, 1032, 7953...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/** * Model that represents our form template. * * @package Ninja Forms client * @copyright (c) 2017 WP Ninjas * @since 3.0 */ define( [], function() { var model = Backbone.Model.extend( { defaults: { objectType: 'template', id: 'none', title: 'unknown' }, initialize: function() { this.set( 'desc', this.get( 'template-desc' ) ); } } ); return model; } );
dexxtr/osbb-web-manager
www/wp-content/plugins/ninja-forms/client/dashboard/models/formTemplateModel.js
JavaScript
gpl-3.0
441
[ 30522, 1013, 1008, 1008, 1008, 2944, 2008, 5836, 2256, 2433, 23561, 1012, 1008, 1008, 1030, 7427, 14104, 3596, 7396, 1008, 1030, 9385, 1006, 1039, 1007, 2418, 1059, 2361, 14104, 2015, 1008, 1030, 2144, 1017, 1012, 1014, 1008, 1013, 9375, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 'logger' require 'srt_subtitle_validator/srt_block' module SrtSubtitleValidator class SrtFile attr_reader :blocks, :length attr_accessor :errors # @param [String] source content of SRT file # @param [Logger] logger object, optionally - by default log to STDOUT def initialize(source, logger = nil) @logger = logger || Logger.new(STDOUT) @errors = [] @srt_dialog_blocks = {} @source = source.dup.encode(Encoding::UTF_8).gsub(/\r/, '') end def valid? @blocks = @source.split(/^\r?\n+/m).map do |n| i = SrtBlock.new(n) @srt_dialog_blocks[i.dialog_number] = i i end @length = !@blocks.empty? && @blocks.last.dialog_number || 0 @errors << 'File is zero size' if @length.zero? @errors << 'Numbers sequence is corrupted' unless @blocks.count == @length @errors.empty? end def inspect "<SrtSubtitleValidator::SrtFile ...>" end end end
luk4s/srt-subtitle-validator
lib/srt_subtitle_validator/srt_file.rb
Ruby
mit
975
[ 30522, 5478, 1005, 8833, 4590, 1005, 5478, 1005, 5034, 2102, 1035, 4942, 3775, 9286, 1035, 9398, 8844, 1013, 5034, 2102, 1035, 3796, 1005, 11336, 5034, 10422, 19279, 4183, 20414, 11475, 2850, 4263, 2465, 5034, 24475, 9463, 2012, 16344, 1035...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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) 2003-2014, Jodd Team (jodd.org). All Rights Reserved. package jodd.petite.tst; import jodd.petite.meta.PetiteBean; @PetiteBean public class Foo { public static int instanceCounter; int counter; public Foo() { instanceCounter++; counter = 0; } public int hello() { return instanceCounter; } public int getCounter() { return counter; } private String name; public String getName() { return name; } }
Artemish/jodd
jodd-petite/src/test/java/jodd/petite/tst/Foo.java
Java
bsd-3-clause
447
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2494, 1011, 2297, 1010, 8183, 14141, 2136, 1006, 8183, 14141, 1012, 8917, 1007, 1012, 2035, 2916, 9235, 1012, 7427, 8183, 14141, 1012, 20146, 1012, 24529, 2102, 1025, 12324, 8183, 14141, 1012, 2014...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.core.database; import org.pentaho.di.core.Const; import org.pentaho.di.core.row.ValueMetaInterface; /** * Contains Firebird specific information through static final members * * @author jjchu * @since 21-03-2008 */ public class KingbaseESDatabaseMeta extends BaseDatabaseMeta implements DatabaseInterface { /** * @return The extra option separator in database URL for this platform */ @Override public String getExtraOptionSeparator() { return "&"; } /** * @return This indicator separates the normal URL from the options */ @Override public String getExtraOptionIndicator() { return "?"; } @Override public int[] getAccessTypeList() { return new int[] { DatabaseMeta.TYPE_ACCESS_NATIVE, DatabaseMeta.TYPE_ACCESS_ODBC }; } @Override public int getDefaultDatabasePort() { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_NATIVE ) { return 54321; } return -1; } @Override public String getDriverClass() { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "sun.jdbc.odbc.JdbcOdbcDriver"; } else { return "com.kingbase.Driver"; } } @Override public String getURL( String hostname, String port, String databaseName ) { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "jdbc:odbc:" + getDatabaseName(); } else { return "jdbc:kingbase://" + hostname + ":" + port + "/" + databaseName; } } /** * Checks whether or not the command setFetchSize() is supported by the JDBC driver... * * @return true is setFetchSize() is supported! */ @Override public boolean isFetchSizeSupported() { return true; } /** * @return true if the database supports bitmap indexes */ @Override public boolean supportsBitmapIndex() { return false; } /** * @return true if the database supports synonyms */ @Override public boolean supportsSynonyms() { return false; } @Override public boolean supportsSequences() { return true; } /** * Kingbase only support the data type: serial, it is not a real autoInc */ @Override public boolean supportsAutoInc() { return false; } @Override public String getLimitClause( int nrRows ) { return " limit " + nrRows; } /** * Get the SQL to get the next value of a sequence. * * @param sequenceName * The sequence name * @return the SQL to get the next value of a sequence. */ @Override public String getSQLNextSequenceValue( String sequenceName ) { return "SELECT nextval('" + sequenceName + "')"; } /** * Get the SQL to get the next value of a sequence. * * @param sequenceName * The sequence name * @return the SQL to get the next value of a sequence. */ @Override public String getSQLCurrentSequenceValue( String sequenceName ) { return "SELECT currval('" + sequenceName + "')"; } /** * Check if a sequence exists. * * @param sequenceName * The sequence to check * @return The SQL to get the name of the sequence back from the databases data dictionary */ @Override public String getSQLSequenceExists( String sequenceName ) { return "SELECT relname AS sequence_name FROM sys_class WHERE relname = '" + sequenceName.toLowerCase() + "'"; } /** * Generates the SQL statement to add a column to the specified table * * @param tablename * The table to add * @param v * The column defined as a value * @param tk * the name of the technical key field * @param use_autoinc * whether or not this field uses auto increment * @param pk * the name of the primary key field * @param semicolon * whether or not to add a semi-colon behind the statement. * @return the SQL statement to add a column to the specified table */ @Override public String getAddColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return "ALTER TABLE " + tablename + " ADD COLUMN " + getFieldDefinition( v, tk, pk, use_autoinc, true, false ); } /** * Generates the SQL statement to drop a column from the specified table * * @param tablename * The table to add * @param v * The column defined as a value * @param tk * the name of the technical key field * @param use_autoinc * whether or not this field uses auto increment * @param pk * the name of the primary key field * @param semicolon * whether or not to add a semi-colon behind the statement. * @return the SQL statement to drop a column from the specified table */ @Override public String getDropColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return "ALTER TABLE " + tablename + " DROP COLUMN " + v.getName() + Const.CR; } /** * Generates the SQL statement to modify a column in the specified table * * @param tablename * The table to add * @param v * The column defined as a value * @param tk * the name of the technical key field * @param use_autoinc * whether or not this field uses auto increment * @param pk * the name of the primary key field * @param semicolon * whether or not to add a semi-colon behind the statement. * @return the SQL statement to modify a column in the specified table */ @Override public String getModifyColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { String retval = ""; retval += "ALTER TABLE " + tablename + " DROP COLUMN " + v.getName() + Const.CR + ";" + Const.CR; retval += "ALTER TABLE " + tablename + " ADD COLUMN " + getFieldDefinition( v, tk, pk, use_autoinc, true, false ); return retval; } @Override public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr ) { String retval = ""; String fieldname = v.getName(); int length = v.getLength(); int precision = v.getPrecision(); if ( add_fieldname ) { retval += fieldname + " "; } int type = v.getType(); switch ( type ) { case ValueMetaInterface.TYPE_DATE: retval += "TIMESTAMP"; break; case ValueMetaInterface.TYPE_BOOLEAN: if ( supportsBooleanDataType() ) { retval += "BOOLEAN"; } else { retval += "CHAR(1)"; } break; case ValueMetaInterface.TYPE_NUMBER: case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: if ( fieldname.equalsIgnoreCase( tk ) || // Technical key fieldname.equalsIgnoreCase( pk ) // Primary key ) { retval += "BIGSERIAL"; } else { if ( length > 0 ) { if ( precision > 0 || length > 18 ) { retval += "NUMERIC(" + length + ", " + precision + ")"; } else { if ( length > 9 ) { retval += "BIGINT"; } else { if ( length < 5 ) { retval += "SMALLINT"; } else { retval += "INTEGER"; } } } } else { retval += "DOUBLE PRECISION"; } } break; case ValueMetaInterface.TYPE_STRING: if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) { retval += "TEXT"; } else { retval += "VARCHAR(" + length + ")"; } break; default: retval += " UNKNOWN"; break; } if ( add_cr ) { retval += Const.CR; } return retval; } /** * @param the * schema name to search in or null if you want to search the whole DB * @return The SQL on this database to get a list of stored procedures. */ public String getSQLListOfProcedures( String schemaName ) { return "select proname " + "from sys_proc, sys_user " + "where sys_user.usesysid = sys_proc.proowner " + "and upper(sys_user.usename) = '" + getUsername().toUpperCase() + "'"; } /* * (non-Javadoc) * * @see com.kingbase.ketl.core.database.DatabaseInterface#getReservedWords() */ @Override public String[] getReservedWords() { return new String[] { // http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html // added also non-reserved key words because there is progress from the Postgre developers to add them "A", "ABORT", "ABS", "ABSOLUTE", "ACCESS", "ACTION", "ADA", "ADD", "ADMIN", "AFTER", "AGGREGATE", "ALIAS", "ALL", "ALLOCATE", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANY", "ARE", "ARRAY", "AS", "ASC", "ASENSITIVE", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "AT", "ATOMIC", "ATTRIBUTE", "ATTRIBUTES", "AUTHORIZATION", "AVG", "BACKWARD", "BEFORE", "BEGIN", "BERNOULLI", "BETWEEN", "BIGINT", "BINARY", "BIT", "BITVAR", "BIT_LENGTH", "BLOB", "BOOLEAN", "BOTH", "BREADTH", "BY", "C", "CACHE", "CALL", "CALLED", "CARDINALITY", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CATALOG_NAME", "CEIL", "CEILING", "CHAIN", "CHAR", "CHARACTER", "CHARACTERISTICS", "CHARACTERS", "CHARACTER_LENGTH", "CHARACTER_SET_CATALOG", "CHARACTER_SET_NAME", "CHARACTER_SET_SCHEMA", "CHAR_LENGTH", "CHECK", "CHECKED", "CHECKPOINT", "CLASS", "CLASS_ORIGIN", "CLOB", "CLOSE", "CLUSTER", "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLLATION_CATALOG", "COLLATION_NAME", "COLLATION_SCHEMA", "COLLECT", "COLUMN", "COLUMN_NAME", "COMMAND_FUNCTION", "COMMAND_FUNCTION_CODE", "COMMENT", "COMMIT", "COMMITTED", "COMPLETION", "CONDITION", "CONDITION_NUMBER", "CONNECT", "CONNECTION", "CONNECTION_NAME", "CONSTRAINT", "CONSTRAINTS", "CONSTRAINT_CATALOG", "CONSTRAINT_NAME", "CONSTRAINT_SCHEMA", "CONSTRUCTOR", "CONTAINS", "CONTINUE", "CONVERSION", "CONVERT", "COPY", "CORR", "CORRESPONDING", "COUNT", "COVAR_POP", "COVAR_SAMP", "CREATE", "CREATEDB", "CREATEROLE", "CREATEUSER", "CROSS", "CSV", "CUBE", "CUME_DIST", "CURRENT", "CURRENT_DATE", "CURRENT_DEFAULT_TRANSFORM_GROUP", "CURRENT_PATH", "CURRENT_ROLE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_TRANSFORM_GROUP_FOR_TYPE", "CURRENT_USER", "CURSOR", "CURSOR_NAME", "CYCLE", "DATA", "DATABASE", "DATE", "DATETIME_INTERVAL_CODE", "DATETIME_INTERVAL_PRECISION", "DAY", "DEALLOCATE", "DEC", "DECIMAL", "DECLARE", "DEFAULT", "DEFAULTS", "DEFERRABLE", "DEFERRED", "DEFINED", "DEFINER", "DEGREE", "DELETE", "DELIMITER", "DELIMITERS", "DENSE_RANK", "DEPTH", "DEREF", "DERIVED", "DESC", "DESCRIBE", "DESCRIPTOR", "DESTROY", "DESTRUCTOR", "DETERMINISTIC", "DIAGNOSTICS", "DICTIONARY", "DISABLE", "DISCONNECT", "DISPATCH", "DISTINCT", "DO", "DOMAIN", "DOUBLE", "DROP", "DYNAMIC", "DYNAMIC_FUNCTION", "DYNAMIC_FUNCTION_CODE", "EACH", "ELEMENT", "ELSE", "ENABLE", "ENCODING", "ENCRYPTED", "END", "END-EXEC", "EQUALS", "ESCAPE", "EVERY", "EXCEPT", "EXCEPTION", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXEC", "EXECUTE", "EXISTING", "EXISTS", "EXP", "EXPLAIN", "EXTERNAL", "EXTRACT", "FALSE", "FETCH", "FILTER", "FINAL", "FIRST", "FLOAT", "FLOOR", "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORTRAN", "FORWARD", "FOUND", "FREE", "FREEZE", "FROM", "FULL", "FUNCTION", "FUSION", "G", "GENERAL", "GENERATED", "GET", "GLOBAL", "GO", "GOTO", "GRANT", "GRANTED", "GREATEST", "GROUP", "GROUPING", "HANDLER", "HAVING", "HEADER", "HIERARCHY", "HOLD", "HOST", "HOUR", "IDENTITY", "IGNORE", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLEMENTATION", "IMPLICIT", "IN", "INCLUDING", "INCREMENT", "INDEX", "INDICATOR", "INFIX", "INHERIT", "INHERITS", "INITIALIZE", "INITIALLY", "INNER", "INOUT", "INPUT", "INSENSITIVE", "INSERT", "INSTANCE", "INSTANTIABLE", "INSTEAD", "INT", "INTEGER", "INTERSECT", "INTERSECTION", "INTERVAL", "INTO", "INVOKER", "IS", "ISNULL", "ISOLATION", "ITERATE", "JOIN", "K", "KEY", "KEY_MEMBER", "KEY_TYPE", "LANCOMPILER", "LANGUAGE", "LARGE", "LAST", "LATERAL", "LEADING", "LEAST", "LEFT", "LENGTH", "LESS", "LEVEL", "LIKE", "LIMIT", "LISTEN", "LN", "LOAD", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOCATION", "LOCATOR", "LOCK", "LOGIN", "LOWER", "M", "MAP", "MATCH", "MATCHED", "MAX", "MAXVALUE", "MEMBER", "MERGE", "MESSAGE_LENGTH", "MESSAGE_OCTET_LENGTH", "MESSAGE_TEXT", "METHOD", "MIN", "MINUTE", "MINVALUE", "MOD", "MODE", "MODIFIES", "MODIFY", "MODULE", "MONTH", "MORE", "MOVE", "MULTISET", "MUMPS", "NAME", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NCLOB", "NESTING", "NEW", "NEXT", "NO", "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NONE", "NORMALIZE", "NORMALIZED", "NOSUPERUSER", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL", "NULLABLE", "NULLIF", "NULLS", "NUMBER", "NUMERIC", "OBJECT", "OCTETS", "OCTET_LENGTH", "OF", "OFF", "OFFSET", "OIDS", "OLD", "ON", "ONLY", "OPEN", "OPERATION", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDERING", "ORDINALITY", "OTHERS", "OUT", "OUTER", "OUTPUT", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNER", "PAD", "PARAMETER", "PARAMETERS", "PARAMETER_MODE", "PARAMETER_NAME", "PARAMETER_ORDINAL_POSITION", "PARAMETER_SPECIFIC_CATALOG", "PARAMETER_SPECIFIC_NAME", "PARAMETER_SPECIFIC_SCHEMA", "PARTIAL", "PARTITION", "PASCAL", "PASSWORD", "PATH", "PERCENTILE_CONT", "PERCENTILE_DISC", "PERCENT_RANK", "PLACING", "PLI", "POSITION", "POSTFIX", "POWER", "PRECEDING", "PRECISION", "PREFIX", "PREORDER", "PREPARE", "PREPARED", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PUBLIC", "QUOTE", "RANGE", "RANK", "READ", "READS", "REAL", "RECHECK", "RECURSIVE", "REF", "REFERENCES", "REFERENCING", "REGR_AVGX", "REGR_AVGY", "REGR_COUNT", "REGR_INTERCEPT", "REGR_R2", "REGR_SLOPE", "REGR_SXX", "REGR_SXY", "REGR_SYY", "REINDEX", "RELATIVE", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "RESET", "RESTART", "RESTRICT", "RESULT", "RETURN", "RETURNED_CARDINALITY", "RETURNED_LENGTH", "RETURNED_OCTET_LENGTH", "RETURNED_SQLSTATE", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINE_CATALOG", "ROUTINE_NAME", "ROUTINE_SCHEMA", "ROW", "ROWS", "ROW_COUNT", "ROW_NUMBER", "RULE", "SAVEPOINT", "SCALE", "SCHEMA", "SCHEMA_NAME", "SCOPE", "SCOPE_CATALOG", "SCOPE_NAME", "SCOPE_SCHEMA", "SCROLL", "SEARCH", "SECOND", "SECTION", "SECURITY", "SELECT", "SELF", "SENSITIVE", "SEQUENCE", "SERIALIZABLE", "SERVER_NAME", "SESSION", "SESSION_USER", "SET", "SETOF", "SETS", "SHARE", "SHOW", "SIMILAR", "SIMPLE", "SIZE", "SMALLINT", "SOME", "SOURCE", "SPACE", "SPECIFIC", "SPECIFICTYPE", "SPECIFIC_NAME", "SQL", "SQLCODE", "SQLERROR", "SQLEXCEPTION", "SQLSTATE", "SQLWARNING", "SQRT", "STABLE", "START", "STATE", "STATEMENT", "STATIC", "STATISTICS", "STDDEV_POP", "STDDEV_SAMP", "STDIN", "STDOUT", "STORAGE", "STRICT", "STRUCTURE", "STYLE", "SUBCLASS_ORIGIN", "SUBLIST", "SUBMULTISET", "SUBSTRING", "SUM", "SUPERUSER", "SYMMETRIC", "SYSID", "SYSTEM", "SYSTEM_USER", "TABLE", "TABLESAMPLE", "TABLESPACE", "TABLE_NAME", "TEMP", "TEMPLATE", "TEMPORARY", "TERMINATE", "THAN", "THEN", "TIES", "TIME", "TIMESTAMP", "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TO", "TOAST", "TOP_LEVEL_COUNT", "TRAILING", "TRANSACTION", "TRANSACTIONS_COMMITTED", "TRANSACTIONS_ROLLED_BACK", "TRANSACTION_ACTIVE", "TRANSFORM", "TRANSFORMS", "TRANSLATE", "TRANSLATION", "TREAT", "TRIGGER", "TRIGGER_CATALOG", "TRIGGER_NAME", "TRIGGER_SCHEMA", "TRIM", "TRUE", "TRUNCATE", "TRUSTED", "TYPE", "UESCAPE", "UNBOUNDED", "UNCOMMITTED", "UNDER", "UNENCRYPTED", "UNION", "UNIQUE", "UNKNOWN", "UNLISTEN", "UNNAMED", "UNNEST", "UNTIL", "UPDATE", "UPPER", "USAGE", "USER", "USER_DEFINED_TYPE_CATALOG", "USER_DEFINED_TYPE_CODE", "USER_DEFINED_TYPE_NAME", "USER_DEFINED_TYPE_SCHEMA", "USING", "VACUUM", "VALID", "VALIDATOR", "VALUE", "VALUES", "VARCHAR", "VARIABLE", "VARYING", "VAR_POP", "VAR_SAMP", "VERBOSE", "VIEW", "VOLATILE", "WHEN", "WHENEVER", "WHERE", "WIDTH_BUCKET", "WINDOW", "WITH", "WITHIN", "WITHOUT", "WORK", "WRITE", "YEAR", "ZONE" }; } /** * @param tableNames * The names of the tables to lock * @return The SQL commands to lock database tables for write purposes. */ @Override public String getSQLLockTables( String[] tableNames ) { String sql = "LOCK TABLE "; for ( int i = 0; i < tableNames.length; i++ ) { if ( i > 0 ) { sql += ", "; } sql += tableNames[i] + " "; } sql += "IN ACCESS EXCLUSIVE MODE;" + Const.CR; return sql; } /** * @param tableName * The name of the table to unlock * @return The SQL command to unlock a database table. */ @Override public String getSQLUnlockTables( String[] tableName ) { return null; // commit unlocks everything! } /** * @return true if the database defaults to naming tables and fields in uppercase. True for most databases except for * stuborn stuff like Postgres ;-) */ @Override public boolean isDefaultingToUppercase() { return false; } @Override public String[] getUsedLibraries() { return new String[] { "kingbasejdbc4.jar" }; } /** * @return true if the database supports timestamp to date conversion. Kingbase doesn't support this! */ @Override public boolean supportsTimeStampToDateConversion() { return false; } }
apratkin/pentaho-kettle
core/src/org/pentaho/di/core/database/KingbaseESDatabaseMeta.java
Java
apache-2.0
18,815
[ 30522, 1013, 1008, 999, 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...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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.emulinker.kaillera.controller.v086.action; import java.util.*; import org.apache.commons.logging.*; import org.emulinker.kaillera.access.AccessManager; import org.emulinker.kaillera.controller.messaging.MessageFormatException; import org.emulinker.kaillera.controller.v086.V086Controller; import org.emulinker.kaillera.controller.v086.protocol.*; import org.emulinker.kaillera.model.exception.ActionException; import org.emulinker.kaillera.model.impl.*; import org.emulinker.kaillera.model.*; import org.emulinker.util.EmuLang; import org.emulinker.util.WildcardStringPattern; public class GameOwnerCommandAction implements V086Action { public static final String COMMAND_HELP = "/help"; //$NON-NLS-1$ public static final String COMMAND_DETECTAUTOFIRE = "/detectautofire"; //$NON-NLS-1$ private static Log log = LogFactory.getLog(GameOwnerCommandAction.class); private static final String desc = "GameOwnerCommandAction"; //$NON-NLS-1$ private static GameOwnerCommandAction singleton = new GameOwnerCommandAction(); public static GameOwnerCommandAction getInstance() { return singleton; } private int actionCount = 0; private GameOwnerCommandAction() { } public int getActionPerformedCount() { return actionCount; } public String toString() { return desc; } public void performAction(V086Message message, V086Controller.V086ClientHandler clientHandler) throws FatalActionException { GameChat chatMessage = (GameChat) message; String chat = chatMessage.getMessage(); KailleraUserImpl user = (KailleraUserImpl) clientHandler.getUser(); KailleraGameImpl game = user.getGame(); if(game == null) { throw new FatalActionException("GameOwner Command Failed: Not in a game: " + chat); //$NON-NLS-1$ } if(!user.equals(game.getOwner())) { log.warn("GameOwner Command Denied: Not game owner: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return; } try { if (chat.startsWith(COMMAND_HELP)) { processHelp(chat, game, user, clientHandler); } else if (chat.startsWith(COMMAND_DETECTAUTOFIRE)) { processDetectAutoFire(chat, game, user, clientHandler); } else { log.info("Unknown GameOwner Command: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } catch (ActionException e) { log.info("GameOwner Command Failed: " + game + ": " + user + ": " + chat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ game.announce(EmuLang.getString("GameOwnerCommandAction.CommandFailed", e.getMessage())); //$NON-NLS-1$ } catch (MessageFormatException e) { log.error("Failed to contruct message: " + e.getMessage(), e); //$NON-NLS-1$ } } private void processHelp(String message, KailleraGameImpl game, KailleraUserImpl admin, V086Controller.V086ClientHandler clientHandler) throws ActionException, MessageFormatException { game.announce(EmuLang.getString("GameOwnerCommandAction.AvailableCommands")); //$NON-NLS-1$ game.announce(EmuLang.getString("GameOwnerCommandAction.SetAutofireDetection")); //$NON-NLS-1$ } private void autoFireHelp(KailleraGameImpl game) { int cur = game.getAutoFireDetector().getSensitivity(); game.announce(EmuLang.getString("GameOwnerCommandAction.HelpSensitivity")); //$NON-NLS-1$ game.announce(EmuLang.getString("GameOwnerCommandAction.HelpDisable")); //$NON-NLS-1$ game.announce(EmuLang.getString("GameOwnerCommandAction.HelpCurrentSensitivity", cur) + (cur == 0 ? (EmuLang.getString("GameOwnerCommandAction.HelpDisabled")) : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } private void processDetectAutoFire(String message, KailleraGameImpl game, KailleraUserImpl admin, V086Controller.V086ClientHandler clientHandler) throws ActionException, MessageFormatException { if(game.getStatus() != KailleraGame.STATUS_WAITING) { game.announce(EmuLang.getString("GameOwnerCommandAction.AutoFireChangeDeniedInGame")); //$NON-NLS-1$ return; } StringTokenizer st = new StringTokenizer(message, " "); //$NON-NLS-1$ if(st.countTokens() != 2) { autoFireHelp(game); return; } String command = st.nextToken(); String sensitivityStr = st.nextToken(); int sensitivity = -1; try { sensitivity = Integer.parseInt(sensitivityStr); } catch(NumberFormatException e) {} if(sensitivity > 5 || sensitivity < 0) { autoFireHelp(game); return; } game.getAutoFireDetector().setSensitivity(sensitivity); game.announce(EmuLang.getString("GameOwnerCommandAction.HelpCurrentSensitivity", sensitivity) + (sensitivity == 0 ? (EmuLang.getString("GameOwnerCommandAction.HelpDisabled")) : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
monospacesoftware/emulinker
src/org/emulinker/kaillera/controller/v086/action/GameOwnerCommandAction.java
Java
gpl-2.0
4,749
[ 30522, 7427, 8917, 1012, 7861, 18639, 5484, 1012, 11928, 10820, 2050, 1012, 11486, 1012, 1058, 2692, 20842, 1012, 2895, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 1008, 1025, 12324, 8917, 1012, 15895, 1012, 7674, 1012, 15899, 1012, 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...
/* * Responsive Slideshow - jQuery plugin * * Copyright (c) 2010-2012 Roland Baldovino * * Project home: * https://github.com/junebaldovino/jquery.resss.plugin * * Version: 0.1 * */ (function($){ var _this,settings; var methods = { init : function( options ) { return this.each(function(){ settings = $.extend( { interval: 3000, animspeed: 1000, easing: 'easeOutBack', valign: 'middle', controls: false, cc: null, autoplay: false, controlsCont: null, total: null, allimgs: null, idletime: null, idlemode: false, details: false, curPg: 0, imgLoadCount: 0, waitLoad: true }, options); _this = $(this); var $this = $(this), data = $this.data('resss'); // initial settings settings.allimgs = _this.find('li'); settings.total = settings.allimgs.length; if(settings.controls) methods.initControls(); methods.preloadImages(); if(!settings.waitLoad){ methods.resetImages(); methods.addListeners(); methods.initTimers(); } if (!data) { $(this).data('resss', { target : $this }); } }); }, initControls : function(){ cc = $('<div class="controls" />'); _this.append(cc); for (var i = 0; i < settings.total; i++ ){ var d = i==0 ? $('<div class="active" />') : $('<div />'); cc.append(d); } }, resetCtrls : function(){ cc.find('div').each(function(i){ var li = $(this); i == settings.curPg ? li.addClass('active') : li.removeClass('active'); }); }, addListeners : function(){ // add swipe listeners _this.swipe({swipe:function(event, direction, distance, duration, fingerCount) {methods.swipe(event, direction, distance, duration, fingerCount)} }); // add window resize listeners $(window).bind({ 'resize.resss': function(e){methods.onresize();} }); // add controls listener if(settings.controls){ cc.find('div').each(function(i){ $(this).bind({ 'click' : function(e){ if(!$(this).hasClass('active')){ methods.gotoSlide(i); methods.resetCtrls(); } } }); }); } }, preloadImages : function(){ imgLoadDone = 0; imgCounter = 0; imgsLoaded = false; var c = settings.total; while(c--){ $.ajax({ url: settings.allimgs.find('img').eq(c).attr('src'), type: 'HEAD', success: function(data) { ++settings.imgLoadCount; if(settings.waitLoad){ if(settings.imgLoadCount==settings.total){ methods.finLoad(); } } /* else{ methods.showLoadedImg(this['url']); } */ } }); } methods.gotoSlide(settings.curPg); }, showLoadedImg : function(url){ settings.allimgs.find('img').each(function(){if($(this).attr('src')==url)$(this).css({display:'block'});}); }, finLoad : function(){ if(settings.waitLoad){ methods.resetImages(); methods.addListeners(); methods.initTimers(); } }, initTimers : function(){ if(settings.autoplay) { methods.ssplay(); }else{ $.idleTimer(settings.interval); $(document).bind("idle.idleTimer", function(){ settings.idlemode = true; settings.idletime = setInterval(function(){methods.onIdle()},settings.interval); }); $(document).bind("active.idleTimer", function(){ settings.idlemode = false; clearInterval(settings.idletime); }); } }, ssplay : function(){ if(settings.idletime != null) clearInterval(settings.idletime); settings.idletime = setInterval(function(){methods.ssplay()},settings.interval); methods.slideNext(); }, onIdle : function() { methods.slideNext(); }, onresize : function() { if($('.backstretch').length > 1){ $('.backstretch').eq(0).remove(); } if(settings.autoplay) methods.ssplay(); }, swipe : function(event, direction, distance, duration, fingerCount){ if(direction=='left') methods.slideNext(); if(direction=='right') methods.slidePrev(); }, slideNext : function(){ ++settings.curPg; if(settings.curPg > settings.total-1) settings.curPg = 0; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } _this.backstretch(src, {fade: settings.animspeed }); if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } methods.resetCtrls(); if(settings.details) methods.resetDetails(); }, slidePrev : function(){ --settings.curPg; if(settings.curPg < 0) settings.curPg = settings.total-1; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } _this.backstretch(src, {fade: settings.animspeed}); if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } methods.resetCtrls(); if(settings.details) methods.resetDetails(); }, gotoSlide : function(i){ settings.curPg = i; var src = $(settings.allimgs[settings.curPg]).find('img').attr('src'); if($('.backstretch').length > 1){ $('.backstretch').eq(0).animate({opacity:0}, settings.animspeed, settings.easing, function(){$(this).remove();}); } if(settings.details) { $(settings.allimgs[settings.curPg]).find('.details').css({display:'block', opacity:0}).animate({opacity:1}, settings.animspeed, settings.easing); } _this.backstretch(src, {fade: settings.animspeed}); if(settings.details) methods.resetDetails(); }, resetDetails : function(){ $(settings.allimgs).each(function(i){ if(i != settings.curPg) $(settings.allimgs[i]).find('.details').css({opacity:0,display:'none'}); }); }, resetImages : function(){ $(settings.allimgs).each(function(i){ $(settings.allimgs[i]).find('img').css({opacity:0,display:'none'}); }); if(settings.details) methods.resetDetails(); }, destroy : function( ) { return this.each(function(){ var $this = $(this), data = $this.data('resss'); $(window).unbind({ 'resize.resss': function(e){methods.onresize()}}); $(window).unbind('.resss'); data.resss.remove(); $this.removeData('resss'); }); } }; $.fn.resss = function(method) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if (typeof method === 'object' || ! method) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exist on jQuery.resss'); } }; })( jQuery );
wtfroland/jquery.resss.plugin
js/jquery.resss.js
JavaScript
mit
7,122
[ 30522, 1013, 1008, 1008, 26651, 14816, 14406, 1011, 1046, 4226, 2854, 13354, 2378, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1011, 2262, 8262, 13852, 4492, 5740, 1008, 1008, 2622, 2188, 1024, 1008, 16770, 1024, 1013, 1013, 21025, 2705, 1208...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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.0 Transitional//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> <meta name="keywords" content="TEMU, dynamic analysis, binary analysis, dynamic taint analysis"/> <meta name="description" content="C/C++/OCaml Source Code Documentation for the TEMU Project."/> <title>TEMU: xed-encoder-hl.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head><body> <p class="title">TEMU: Dynamic Binary Analysis Platform</p> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File&nbsp;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_4f22f3fd3d3cce94a331ff7cdf0bf085.html">temu-1.0</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_3b6767f6be6ef802b0654406f3e74d86.html">shared</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_0277bd4601ee6c31034924754cae7495.html">xed2</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_05e0ad34a2706acb4f73624c38c2a107.html">xed2-ia32</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_f86fba19af9dbb3e8d51a2bdea785276.html">include</a> </div> </div> <div class="contents"> <h1>xed2-ia32/include/xed-encoder-hl.h</h1><a href="xed2-ia32_2include_2xed-encoder-hl_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*BEGIN_LEGAL </span> <a name="l00002"></a>00002 <span class="comment">Intel Open Source License </span> <a name="l00003"></a>00003 <span class="comment"></span> <a name="l00004"></a>00004 <span class="comment">Copyright (c) 2002-2008 Intel Corporation </span> <a name="l00005"></a>00005 <span class="comment">All rights reserved. </span> <a name="l00006"></a>00006 <span class="comment">Redistribution and use in source and binary forms, with or without</span> <a name="l00007"></a>00007 <span class="comment">modification, are permitted provided that the following conditions are</span> <a name="l00008"></a>00008 <span class="comment">met:</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment">Redistributions of source code must retain the above copyright notice,</span> <a name="l00011"></a>00011 <span class="comment">this list of conditions and the following disclaimer. Redistributions</span> <a name="l00012"></a>00012 <span class="comment">in binary form must reproduce the above copyright notice, this list of</span> <a name="l00013"></a>00013 <span class="comment">conditions and the following disclaimer in the documentation and/or</span> <a name="l00014"></a>00014 <span class="comment">other materials provided with the distribution. Neither the name of</span> <a name="l00015"></a>00015 <span class="comment">the Intel Corporation nor the names of its contributors may be used to</span> <a name="l00016"></a>00016 <span class="comment">endorse or promote products derived from this software without</span> <a name="l00017"></a>00017 <span class="comment">specific prior written permission.</span> <a name="l00018"></a>00018 <span class="comment"> </span> <a name="l00019"></a>00019 <span class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span> <a name="l00020"></a>00020 <span class="comment">``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span> <a name="l00021"></a>00021 <span class="comment">LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span> <a name="l00022"></a>00022 <span class="comment">A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR</span> <a name="l00023"></a>00023 <span class="comment">ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span> <a name="l00024"></a>00024 <span class="comment">SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span> <a name="l00025"></a>00025 <span class="comment">LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span> <a name="l00026"></a>00026 <span class="comment">DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span> <a name="l00027"></a>00027 <span class="comment">THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span> <a name="l00028"></a>00028 <span class="comment">(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span> <a name="l00029"></a>00029 <span class="comment">OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span> <a name="l00030"></a>00030 <span class="comment">END_LEGAL */</span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="preprocessor">#ifndef _XED_ENCODER_HL_H_</span> <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor"># define _XED_ENCODER_HL_H_</span> <a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#include "xed-types.h"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "xed-reg-enum.h"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "xed-state.h"</span> <a name="l00037"></a>00037 <span class="preprocessor">#include "xed-iclass-enum.h"</span> <a name="l00038"></a>00038 <span class="preprocessor">#include "xed-portability.h"</span> <a name="l00039"></a>00039 <span class="preprocessor">#include "xed-encode.h"</span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <a name="l00042"></a><a class="code" href="structxed__enc__displacement__t.html">00042</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00043"></a><a class="code" href="structxed__enc__displacement__t.html#c983d8e2ceacd11fce421ac110c65bd8">00043</a> xed_uint64_t displacement; <a name="l00044"></a><a class="code" href="structxed__enc__displacement__t.html#3fd0ffc7c9929f49bfc795fe01bf1798">00044</a> xed_uint32_t displacement_width; <a name="l00045"></a>00045 } <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a>; <span class="comment">/* fixme bad name */</span> <a name="l00046"></a>00046 <span class="comment"></span> <a name="l00047"></a>00047 <span class="comment">/// @name Memory Displacement</span> <a name="l00048"></a>00048 <span class="comment"></span><span class="comment">//@{</span> <a name="l00049"></a>00049 <span class="comment"></span><span class="comment">/// @ingroup ENCHL</span> <a name="l00050"></a>00050 <span class="comment"></span><span class="comment">/// a memory displacement (not for branches)</span> <a name="l00051"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#c8a806e9c0ba578adcb5aa2ee7cdb394">00051</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#c8a806e9c0ba578adcb5aa2ee7cdb394">xdisp</a>(xed_uint64_t displacement, <a name="l00052"></a>00052 xed_uint32_t displacement_width ) { <a name="l00053"></a>00053 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> x; <a name="l00054"></a>00054 x.<a class="code" href="structxed__enc__displacement__t.html#c983d8e2ceacd11fce421ac110c65bd8">displacement</a> = displacement; <a name="l00055"></a>00055 x.<a class="code" href="structxed__enc__displacement__t.html#3fd0ffc7c9929f49bfc795fe01bf1798">displacement_width</a> = displacement_width; <a name="l00056"></a>00056 <span class="keywordflow">return</span> x; <a name="l00057"></a>00057 }<span class="comment"></span> <a name="l00058"></a>00058 <span class="comment">//@}</span> <a name="l00059"></a>00059 <span class="comment"></span> <a name="l00060"></a><a class="code" href="structxed__memop__t.html">00060</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00061"></a><a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">00061</a> <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg; <a name="l00062"></a><a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">00062</a> <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base; <a name="l00063"></a><a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">00063</a> <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> index; <a name="l00064"></a><a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">00064</a> xed_uint32_t scale; <a name="l00065"></a><a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">00065</a> <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp; <a name="l00066"></a>00066 } <a class="code" href="structxed__memop__t.html">xed_memop_t</a>; <a name="l00067"></a>00067 <a name="l00068"></a>00068 <a name="l00069"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638">00069</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00070"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638cbc8d93653c02e76eac8d019f449d88b">00070</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638cbc8d93653c02e76eac8d019f449d88b">XED_ENCODER_OPERAND_TYPE_INVALID</a>, <a name="l00071"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126383bea84e3495457e582cd5533b3b67b43">00071</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126383bea84e3495457e582cd5533b3b67b43">XED_ENCODER_OPERAND_TYPE_BRDISP</a>, <a name="l00072"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638c7e137bec55ec1ebaf1b3269cbf8d35b">00072</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638c7e137bec55ec1ebaf1b3269cbf8d35b">XED_ENCODER_OPERAND_TYPE_REG</a>, <a name="l00073"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638ec1aab94e9a39cad7281722d72f4c074">00073</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638ec1aab94e9a39cad7281722d72f4c074">XED_ENCODER_OPERAND_TYPE_IMM0</a>, <a name="l00074"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126386010b70490d8deb87248988db4851991">00074</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126386010b70490d8deb87248988db4851991">XED_ENCODER_OPERAND_TYPE_SIMM0</a>, <a name="l00075"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d1263839d2ecbd06732c86c9be27e5697513e4">00075</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d1263839d2ecbd06732c86c9be27e5697513e4">XED_ENCODER_OPERAND_TYPE_IMM1</a>, <a name="l00076"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">00076</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>, <a name="l00077"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638617ca23d3a043d05c07435199e768b88">00077</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638617ca23d3a043d05c07435199e768b88">XED_ENCODER_OPERAND_TYPE_PTR</a>, <a name="l00078"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126385a7a43348b1552de102211c4d76ca72d">00078</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126385a7a43348b1552de102211c4d76ca72d">XED_ENCODER_OPERAND_TYPE_SEG0</a>, <span class="comment">/* special for things with suppressed implicit memops */</span> <a name="l00079"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638acd0df30646ec7115ac403e2dc7bf2ff">00079</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638acd0df30646ec7115ac403e2dc7bf2ff">XED_ENCODER_OPERAND_TYPE_SEG1</a>, <span class="comment">/* special for things with suppressed implicit memops */</span> <a name="l00080"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638263eeedf98d73a93dd619bc0b2359d79">00080</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638263eeedf98d73a93dd619bc0b2359d79">XED_ENCODER_OPERAND_TYPE_OTHER</a> <span class="comment">/* specific operand storage fields -- must supply a name */</span> <a name="l00081"></a>00081 } <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638">xed_encoder_operand_type_t</a>; <a name="l00082"></a>00082 <a name="l00083"></a><a class="code" href="structxed__encoder__operand__t.html">00083</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00084"></a><a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">00084</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638">xed_encoder_operand_type_t</a> type; <a name="l00085"></a>00085 <span class="keyword">union </span>{ <a name="l00086"></a><a class="code" href="structxed__encoder__operand__t.html#e5eeb0d5e528568c4335f3e1232b1c74">00086</a> <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> reg; <a name="l00087"></a><a class="code" href="structxed__encoder__operand__t.html#248b7401faf495144a60aed3e033de28">00087</a> xed_int32_t brdisp; <a name="l00088"></a><a class="code" href="structxed__encoder__operand__t.html#5dce7d3756139b85189dad3a9156c082">00088</a> xed_uint64_t <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#e90462df43d77847591b28317121a7f0">imm0</a>; <a name="l00089"></a><a class="code" href="structxed__encoder__operand__t.html#14f433f92d67d3bed1e912dfaec7478c">00089</a> xed_uint8_t <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#c6d077d7c8bd6d603c46554caf4eac8b">imm1</a>; <a name="l00090"></a>00090 <span class="keyword">struct </span>{ <a name="l00091"></a><a class="code" href="structxed__encoder__operand__t.html#82618f4d775f0f34a11ff4374bcb8ce7">00091</a> <a class="code" href="xed2-ia32_2include_2xed-operand-enum_8h.html#09c2a35d8bb7bfe68bb3d34b0a5e011a">xed_operand_enum_t</a> operand_name; <a name="l00092"></a><a class="code" href="structxed__encoder__operand__t.html#676f6026a5ba7d95e2dd4ce2b730a48d">00092</a> xed_uint32_t value; <a name="l00093"></a>00093 } s; <a name="l00094"></a><a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">00094</a> <a class="code" href="structxed__memop__t.html">xed_memop_t</a> mem; <a name="l00095"></a>00095 } u; <a name="l00096"></a><a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">00096</a> xed_uint32_t width; <a name="l00097"></a>00097 } <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a>; <a name="l00098"></a>00098 <span class="comment"></span> <a name="l00099"></a>00099 <span class="comment">/// @name Branch Displacement</span> <a name="l00100"></a>00100 <span class="comment"></span><span class="comment">//@{</span> <a name="l00101"></a>00101 <span class="comment"></span><span class="comment">/// @ingroup ENCHL</span> <a name="l00102"></a>00102 <span class="comment"></span><span class="comment">/// a relative branch displacement operand</span> <a name="l00103"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#cdb37097d0759178bb58ed9a09def08d">00103</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#cdb37097d0759178bb58ed9a09def08d">xrelbr</a>(xed_int32_t brdisp, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00104"></a>00104 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00105"></a>00105 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126383bea84e3495457e582cd5533b3b67b43">XED_ENCODER_OPERAND_TYPE_BRDISP</a>; <a name="l00106"></a>00106 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#248b7401faf495144a60aed3e033de28">brdisp</a> = brdisp; <a name="l00107"></a>00107 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00108"></a>00108 <span class="keywordflow">return</span> o; <a name="l00109"></a>00109 }<span class="comment"></span> <a name="l00110"></a>00110 <span class="comment">//@}</span> <a name="l00111"></a>00111 <span class="comment"></span><span class="comment"></span> <a name="l00112"></a>00112 <span class="comment">/// @name Pointer Displacement</span> <a name="l00113"></a>00113 <span class="comment"></span><span class="comment">//@{</span> <a name="l00114"></a>00114 <span class="comment"></span><span class="comment">/// @ingroup ENCHL</span> <a name="l00115"></a>00115 <span class="comment"></span><span class="comment">/// a relative displacement for a PTR operand -- the subsequent imm0 holds the 16b selector</span> <a name="l00116"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#ba429e1d2123dacf780e53c57b743ff6">00116</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#ba429e1d2123dacf780e53c57b743ff6">xptr</a>(xed_int32_t brdisp, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00117"></a>00117 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00118"></a>00118 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638617ca23d3a043d05c07435199e768b88">XED_ENCODER_OPERAND_TYPE_PTR</a>; <a name="l00119"></a>00119 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#248b7401faf495144a60aed3e033de28">brdisp</a> = brdisp; <a name="l00120"></a>00120 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00121"></a>00121 <span class="keywordflow">return</span> o; <a name="l00122"></a>00122 }<span class="comment"></span> <a name="l00123"></a>00123 <span class="comment">//@}</span> <a name="l00124"></a>00124 <span class="comment"></span><span class="comment"></span> <a name="l00125"></a>00125 <span class="comment">/// @name Register and Immmediate Operands</span> <a name="l00126"></a>00126 <span class="comment"></span><span class="comment">//@{</span> <a name="l00127"></a>00127 <span class="comment"></span><span class="comment">/// @ingroup ENCHL</span> <a name="l00128"></a>00128 <span class="comment"></span><span class="comment">/// a register operand</span> <a name="l00129"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3ebdabca7dc139c49b31bcc86635298e">00129</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3ebdabca7dc139c49b31bcc86635298e">xreg</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> reg) { <a name="l00130"></a>00130 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00131"></a>00131 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638c7e137bec55ec1ebaf1b3269cbf8d35b">XED_ENCODER_OPERAND_TYPE_REG</a>; <a name="l00132"></a>00132 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#e5eeb0d5e528568c4335f3e1232b1c74">reg</a> = reg; <a name="l00133"></a>00133 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = 0; <a name="l00134"></a>00134 <span class="keywordflow">return</span> o; <a name="l00135"></a>00135 } <a name="l00136"></a>00136 <span class="comment"></span> <a name="l00137"></a>00137 <span class="comment">/// @ingroup ENCHL</span> <a name="l00138"></a>00138 <span class="comment">/// a first immediate operand (known as IMM0)</span> <a name="l00139"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#e90462df43d77847591b28317121a7f0">00139</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#e90462df43d77847591b28317121a7f0">imm0</a>(xed_uint64_t v, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00140"></a>00140 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00141"></a>00141 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638ec1aab94e9a39cad7281722d72f4c074">XED_ENCODER_OPERAND_TYPE_IMM0</a>; <a name="l00142"></a>00142 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#5dce7d3756139b85189dad3a9156c082">imm0</a> = v; <a name="l00143"></a>00143 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00144"></a>00144 <span class="keywordflow">return</span> o; <a name="l00145"></a>00145 }<span class="comment"></span> <a name="l00146"></a>00146 <span class="comment">/// @ingroup ENCHL</span> <a name="l00147"></a>00147 <span class="comment">/// an 32b signed immediate operand</span> <a name="l00148"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#224148173f630a050658a41d82e1806f">00148</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#224148173f630a050658a41d82e1806f">simm0</a>(xed_int32_t v, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00149"></a>00149 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00150"></a>00150 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126386010b70490d8deb87248988db4851991">XED_ENCODER_OPERAND_TYPE_SIMM0</a>; <a name="l00151"></a>00151 <span class="comment">/* sign conversion: we store the int32 in an uint64. It gets sign</span> <a name="l00152"></a>00152 <span class="comment"> extended. Later we convert it to the right width for the</span> <a name="l00153"></a>00153 <span class="comment"> instruction. The maximum width of a signed immediate is currently</span> <a name="l00154"></a>00154 <span class="comment"> 32b. */</span> <a name="l00155"></a>00155 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#5dce7d3756139b85189dad3a9156c082">imm0</a> = v; <a name="l00156"></a>00156 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00157"></a>00157 <span class="keywordflow">return</span> o; <a name="l00158"></a>00158 } <a name="l00159"></a>00159 <span class="comment"></span> <a name="l00160"></a>00160 <span class="comment">/// @ingroup ENCHL</span> <a name="l00161"></a>00161 <span class="comment">/// an second immediate operand (known as IMM1)</span> <a name="l00162"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#c6d077d7c8bd6d603c46554caf4eac8b">00162</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#c6d077d7c8bd6d603c46554caf4eac8b">imm1</a>(xed_uint8_t v) { <a name="l00163"></a>00163 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00164"></a>00164 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d1263839d2ecbd06732c86c9be27e5697513e4">XED_ENCODER_OPERAND_TYPE_IMM1</a>; <a name="l00165"></a>00165 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#14f433f92d67d3bed1e912dfaec7478c">imm1</a> = v; <a name="l00166"></a>00166 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = 8; <a name="l00167"></a>00167 <span class="keywordflow">return</span> o; <a name="l00168"></a>00168 } <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="comment"></span> <a name="l00171"></a>00171 <span class="comment">/// @ingroup ENCHL</span> <a name="l00172"></a>00172 <span class="comment">/// an operand storage field name and value</span> <a name="l00173"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#6e3a5790c41207ef4b7c1f2fb1153b46">00173</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#6e3a5790c41207ef4b7c1f2fb1153b46">xother</a>(<a class="code" href="xed2-ia32_2include_2xed-operand-enum_8h.html#09c2a35d8bb7bfe68bb3d34b0a5e011a">xed_operand_enum_t</a> operand_name, <a name="l00174"></a>00174 xed_int32_t value) { <a name="l00175"></a>00175 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00176"></a>00176 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638263eeedf98d73a93dd619bc0b2359d79">XED_ENCODER_OPERAND_TYPE_OTHER</a>; <a name="l00177"></a>00177 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#e0848586a721bdf0be7381053b9e9925">s</a>.operand_name = operand_name; <a name="l00178"></a>00178 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#e0848586a721bdf0be7381053b9e9925">s</a>.value = value; <a name="l00179"></a>00179 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = 0; <a name="l00180"></a>00180 <span class="keywordflow">return</span> o; <a name="l00181"></a>00181 }<span class="comment"></span> <a name="l00182"></a>00182 <span class="comment">//@}</span> <a name="l00183"></a>00183 <span class="comment"></span> <a name="l00184"></a>00184 <span class="comment"></span> <a name="l00185"></a>00185 <span class="comment">//@}</span> <a name="l00186"></a>00186 <span class="comment"></span><span class="comment"></span> <a name="l00187"></a>00187 <span class="comment">/// @name Memory and Segment-releated Operands</span> <a name="l00188"></a>00188 <span class="comment"></span><span class="comment">//@{</span> <a name="l00189"></a>00189 <span class="comment"></span><span class="comment"></span> <a name="l00190"></a>00190 <span class="comment">/// @ingroup ENCHL</span> <a name="l00191"></a>00191 <span class="comment">/// seg reg override for implicit suppressed memory ops</span> <a name="l00192"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#793653db3198f72eb18d140e25dde653">00192</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#793653db3198f72eb18d140e25dde653">xseg0</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg0) { <a name="l00193"></a>00193 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00194"></a>00194 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d126385a7a43348b1552de102211c4d76ca72d">XED_ENCODER_OPERAND_TYPE_SEG0</a>; <a name="l00195"></a>00195 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#e5eeb0d5e528568c4335f3e1232b1c74">reg</a> = seg0; <a name="l00196"></a>00196 <span class="keywordflow">return</span> o; <a name="l00197"></a>00197 } <a name="l00198"></a>00198 <span class="comment"></span> <a name="l00199"></a>00199 <span class="comment">/// @ingroup ENCHL</span> <a name="l00200"></a>00200 <span class="comment">/// seg reg override for implicit suppressed memory ops</span> <a name="l00201"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#b67610fd9da5d421558105f820cbd27b">00201</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#b67610fd9da5d421558105f820cbd27b">xseg1</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg1) { <a name="l00202"></a>00202 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00203"></a>00203 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638acd0df30646ec7115ac403e2dc7bf2ff">XED_ENCODER_OPERAND_TYPE_SEG1</a>; <a name="l00204"></a>00204 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#e5eeb0d5e528568c4335f3e1232b1c74">reg</a> = seg1; <a name="l00205"></a>00205 <span class="keywordflow">return</span> o; <a name="l00206"></a>00206 } <a name="l00207"></a>00207 <span class="comment"></span> <a name="l00208"></a>00208 <span class="comment">/// @ingroup ENCHL</span> <a name="l00209"></a>00209 <span class="comment">/// memory operand - base only </span> <a name="l00210"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7a36b028c6ec7d4e1dc84011cc6787d0">00210</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7a36b028c6ec7d4e1dc84011cc6787d0">xmem_b</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00211"></a>00211 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00212"></a>00212 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00213"></a>00213 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00214"></a>00214 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00215"></a>00215 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00216"></a>00216 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = 0; <a name="l00217"></a>00217 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a>.<a class="code" href="structxed__enc__displacement__t.html#c983d8e2ceacd11fce421ac110c65bd8">displacement</a> = 0; <a name="l00218"></a>00218 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a>.<a class="code" href="structxed__enc__displacement__t.html#3fd0ffc7c9929f49bfc795fe01bf1798">displacement_width</a> = 0; <a name="l00219"></a>00219 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00220"></a>00220 <span class="keywordflow">return</span> o; <a name="l00221"></a>00221 } <a name="l00222"></a>00222 <span class="comment"></span> <a name="l00223"></a>00223 <span class="comment">/// @ingroup ENCHL</span> <a name="l00224"></a>00224 <span class="comment">/// memory operand - base and displacement only </span> <a name="l00225"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#6a7e5ee43079588be0649fc0af9f317e">00225</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#6a7e5ee43079588be0649fc0af9f317e">xmem_bd</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a name="l00226"></a>00226 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp, <a name="l00227"></a>00227 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00228"></a>00228 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00229"></a>00229 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00230"></a>00230 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00231"></a>00231 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00232"></a>00232 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00233"></a>00233 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = 0; <a name="l00234"></a>00234 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a> =disp; <a name="l00235"></a>00235 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00236"></a>00236 <span class="keywordflow">return</span> o; <a name="l00237"></a>00237 } <a name="l00238"></a>00238 <span class="comment"></span> <a name="l00239"></a>00239 <span class="comment">/// @ingroup ENCHL</span> <a name="l00240"></a>00240 <span class="comment">/// memory operand - base, index, scale, displacement</span> <a name="l00241"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#59d7b50dfd23d11b89be56686d6bdd63">00241</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#59d7b50dfd23d11b89be56686d6bdd63">xmem_bisd</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a name="l00242"></a>00242 <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> index, <a name="l00243"></a>00243 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> scale, <a name="l00244"></a>00244 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp, <a name="l00245"></a>00245 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00246"></a>00246 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00247"></a>00247 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00248"></a>00248 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00249"></a>00249 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00250"></a>00250 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= index; <a name="l00251"></a>00251 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = scale; <a name="l00252"></a>00252 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a> = disp; <a name="l00253"></a>00253 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00254"></a>00254 <span class="keywordflow">return</span> o; <a name="l00255"></a>00255 } <a name="l00256"></a>00256 <a name="l00257"></a>00257 <span class="comment"></span> <a name="l00258"></a>00258 <span class="comment">/// @ingroup ENCHL</span> <a name="l00259"></a>00259 <span class="comment">/// memory operand - segment and base only</span> <a name="l00260"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#03dcdbf44f52401301bf7e1f037a4ba0">00260</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#03dcdbf44f52401301bf7e1f037a4ba0">xmem_gb</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg, <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00261"></a>00261 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00262"></a>00262 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00263"></a>00263 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00264"></a>00264 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = seg; <a name="l00265"></a>00265 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00266"></a>00266 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = 0; <a name="l00267"></a>00267 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a>.<a class="code" href="structxed__enc__displacement__t.html#c983d8e2ceacd11fce421ac110c65bd8">displacement</a> = 0; <a name="l00268"></a>00268 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a>.<a class="code" href="structxed__enc__displacement__t.html#3fd0ffc7c9929f49bfc795fe01bf1798">displacement_width</a> = 0; <a name="l00269"></a>00269 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00270"></a>00270 <span class="keywordflow">return</span> o; <a name="l00271"></a>00271 } <a name="l00272"></a>00272 <span class="comment"></span> <a name="l00273"></a>00273 <span class="comment">/// @ingroup ENCHL</span> <a name="l00274"></a>00274 <span class="comment">/// memory operand - segment, base and displacement only</span> <a name="l00275"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#1ec05f0acc4469fe82b3c2824c4a366d">00275</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#1ec05f0acc4469fe82b3c2824c4a366d">xmem_gbd</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg, <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a name="l00276"></a>00276 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp, <a name="l00277"></a>00277 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00278"></a>00278 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00279"></a>00279 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00280"></a>00280 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00281"></a>00281 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = seg; <a name="l00282"></a>00282 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00283"></a>00283 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = 0; <a name="l00284"></a>00284 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a> = disp; <a name="l00285"></a>00285 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00286"></a>00286 <span class="keywordflow">return</span> o; <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <span class="comment"></span> <a name="l00289"></a>00289 <span class="comment">/// @ingroup ENCHL</span> <a name="l00290"></a>00290 <span class="comment">/// memory operand - segment and displacement only</span> <a name="l00291"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#1515d8567dd24b840528e94ef45d5cd1">00291</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#1515d8567dd24b840528e94ef45d5cd1">xmem_gd</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg, <a name="l00292"></a>00292 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp, <a name="l00293"></a>00293 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00294"></a>00294 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00295"></a>00295 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00296"></a>00296 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00297"></a>00297 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = seg; <a name="l00298"></a>00298 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61fac474058f0819d415285511086bf219">XED_REG_INVALID</a>; <a name="l00299"></a>00299 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = 0; <a name="l00300"></a>00300 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a> = disp; <a name="l00301"></a>00301 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00302"></a>00302 <span class="keywordflow">return</span> o; <a name="l00303"></a>00303 } <a name="l00304"></a>00304 <span class="comment"></span> <a name="l00305"></a>00305 <span class="comment">/// @ingroup ENCHL</span> <a name="l00306"></a>00306 <span class="comment">/// memory operand - segment, base, index, scale, and displacement</span> <a name="l00307"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#00fc1e423b20d24b1843e502cc4d39a3">00307</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#00fc1e423b20d24b1843e502cc4d39a3">xmem_gbisd</a>(<a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> seg, <a name="l00308"></a>00308 <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> base, <a name="l00309"></a>00309 <a class="code" href="xed2-ia32_2include_2xed-reg-enum_8h.html#f05c33c5a68e9304d1d8ac0408ae3f61">xed_reg_enum_t</a> index, <a name="l00310"></a>00310 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> scale, <a name="l00311"></a>00311 <a class="code" href="structxed__enc__displacement__t.html">xed_enc_displacement_t</a> disp, <a name="l00312"></a>00312 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00313"></a>00313 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> o; <a name="l00314"></a>00314 o.<a class="code" href="structxed__encoder__operand__t.html#15b522f5fb9447f7bbea3ae6baf328a9">type</a> = <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#7621255aeac26b5e78f7a0dc72d12638fb6bee5a0fcf154e71397defed76ed88">XED_ENCODER_OPERAND_TYPE_MEM</a>; <a name="l00315"></a>00315 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#b33f5fd03ddbc01a1795e85978b32c61">base</a> = base; <a name="l00316"></a>00316 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d07ef1ac72ff572e65e78b3653c43c1d">seg</a> = seg; <a name="l00317"></a>00317 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#451ae2fcc3acdff8a10543b18f19f84e">index</a>= index; <a name="l00318"></a>00318 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#d801bcd3961aa78d30caaca98489dd36">scale</a> = scale; <a name="l00319"></a>00319 o.<a class="code" href="structxed__encoder__operand__t.html#01d174f19e13511270eefe522bc61248">u</a>.<a class="code" href="structxed__encoder__operand__t.html#7874f7a5284ff2064ba6b9bf032e25ff">mem</a>.<a class="code" href="structxed__memop__t.html#1fd26bd97ff3565101e7e79ccf1d5a53">disp</a> = disp; <a name="l00320"></a>00320 o.<a class="code" href="structxed__encoder__operand__t.html#ea2d8c884cca697c2dbc9807dfbdd139">width</a> = width; <a name="l00321"></a>00321 <span class="keywordflow">return</span> o; <a name="l00322"></a>00322 }<span class="comment"></span> <a name="l00323"></a>00323 <span class="comment">//@}</span> <a name="l00324"></a>00324 <span class="comment"></span> <a name="l00325"></a><a class="code" href="unionxed__encoder__prefixes__t.html">00325</a> <span class="keyword">typedef</span> <span class="keyword">union </span>{ <a name="l00326"></a>00326 <span class="keyword">struct </span>{ <a name="l00327"></a><a class="code" href="unionxed__encoder__prefixes__t.html#c8dc70af0c2333374574b71ee91d66aa">00327</a> xed_uint32_t rep :1; <a name="l00328"></a><a class="code" href="unionxed__encoder__prefixes__t.html#d6e7f53ef6fc3cdd9cb45089e7978c86">00328</a> xed_uint32_t repne :1; <a name="l00329"></a><a class="code" href="unionxed__encoder__prefixes__t.html#045a7a7fb9c564bb2d14a71f22356a47">00329</a> xed_uint32_t lock :1; <a name="l00330"></a><a class="code" href="unionxed__encoder__prefixes__t.html#1f154d5ebf743d7d2220705a7d554a89">00330</a> xed_uint32_t br_hint_taken :1; <a name="l00331"></a><a class="code" href="unionxed__encoder__prefixes__t.html#bd09ac7e3aa0de912b2150a3f2000396">00331</a> xed_uint32_t br_hint_not_taken :1; <a name="l00332"></a>00332 } s; <a name="l00333"></a><a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">00333</a> xed_uint32_t i; <a name="l00334"></a>00334 } <a class="code" href="unionxed__encoder__prefixes__t.html">xed_encoder_prefixes_t</a>; <a name="l00335"></a>00335 <a name="l00336"></a>00336 <span class="preprocessor">#define XED_ENCODER_OPERANDS_MAX 5 </span><span class="comment">/* FIXME */</span> <a name="l00337"></a><a class="code" href="structxed__encoder__instruction__t.html">00337</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00338"></a><a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">00338</a> <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode; <a name="l00339"></a><a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">00339</a> <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass; <span class="comment">/*FIXME: use iform instead? or allow either */</span> <a name="l00340"></a><a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">00340</a> xed_uint32_t effective_operand_width; <a name="l00341"></a>00341 <a name="l00342"></a>00342 <span class="comment">/* the effective_address_width is only requires to be set for</span> <a name="l00343"></a>00343 <span class="comment"> * instructions * with implicit suppressed memops or memops with no</span> <a name="l00344"></a>00344 <span class="comment"> * base or index regs. When base or index regs are present, XED pick</span> <a name="l00345"></a>00345 <span class="comment"> * this up automatically from the register names.</span> <a name="l00346"></a>00346 <span class="comment"></span> <a name="l00347"></a>00347 <span class="comment"> * FIXME: make effective_address_width required by all encodes for</span> <a name="l00348"></a>00348 <span class="comment"> * unifority. Add to xed_inst[0123]() APIs??? */</span> <a name="l00349"></a><a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">00349</a> xed_uint32_t effective_address_width; <a name="l00350"></a>00350 <a name="l00351"></a><a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">00351</a> <a class="code" href="unionxed__encoder__prefixes__t.html">xed_encoder_prefixes_t</a> prefixes; <a name="l00352"></a><a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">00352</a> xed_uint32_t noperands; <a name="l00353"></a><a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">00353</a> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> operands[XED_ENCODER_OPERANDS_MAX]; <a name="l00354"></a>00354 } <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>; <a name="l00355"></a>00355 <span class="comment"></span> <a name="l00356"></a>00356 <span class="comment">/// @name Instruction Properties and prefixes</span> <a name="l00357"></a>00357 <span class="comment"></span><span class="comment">//@{</span> <a name="l00358"></a>00358 <span class="comment"></span><span class="comment">/// @ingroup ENCHL</span> <a name="l00359"></a>00359 <span class="comment"></span><span class="comment">/// This is to specify effective address size different than the</span> <a name="l00360"></a>00360 <span class="comment"></span><span class="comment">/// default. For things with base or index regs, XED picks it up from the</span> <a name="l00361"></a>00361 <span class="comment"></span><span class="comment">/// registers. But for things that have implicit memops, or no base or index</span> <a name="l00362"></a>00362 <span class="comment"></span><span class="comment">/// reg, we must allow the user to set the address width directly.</span> <a name="l00363"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3dcef3e2652fa12f63eecd6fa29d2f48">00363</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3dcef3e2652fa12f63eecd6fa29d2f48">xaddr</a>(<a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* x, <a name="l00364"></a>00364 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> width) { <a name="l00365"></a>00365 x-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = width; <a name="l00366"></a>00366 } <a name="l00367"></a>00367 <a name="l00368"></a>00368 <span class="comment"></span> <a name="l00369"></a>00369 <span class="comment">/// @ingroup ENCHL</span> <a name="l00370"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#089c068bfc4e04fe9571d1af267af068">00370</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#089c068bfc4e04fe9571d1af267af068">xrep</a>(<a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* x) { <a name="l00371"></a>00371 x-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#2f01cb0ecd47fddfa9a0e4bc67d6f18c">s</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#c8dc70af0c2333374574b71ee91d66aa">rep</a>=1; <a name="l00372"></a>00372 } <a name="l00373"></a>00373 <span class="comment"></span> <a name="l00374"></a>00374 <span class="comment">/// @ingroup ENCHL</span> <a name="l00375"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#139f196ef758eabea56fc3c12bc04008">00375</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#139f196ef758eabea56fc3c12bc04008">xrepne</a>(<a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* x) { <a name="l00376"></a>00376 x-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#2f01cb0ecd47fddfa9a0e4bc67d6f18c">s</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#d6e7f53ef6fc3cdd9cb45089e7978c86">repne</a>=1; <a name="l00377"></a>00377 } <a name="l00378"></a>00378 <span class="comment"></span> <a name="l00379"></a>00379 <span class="comment">/// @ingroup ENCHL</span> <a name="l00380"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#2bddb61d7cc4980ad081933603a98bf4">00380</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#2bddb61d7cc4980ad081933603a98bf4">xlock</a>(<a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* x) { <a name="l00381"></a>00381 x-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#2f01cb0ecd47fddfa9a0e4bc67d6f18c">s</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#045a7a7fb9c564bb2d14a71f22356a47">lock</a>=1; <a name="l00382"></a>00382 } <a name="l00383"></a>00383 <a name="l00384"></a>00384 <a name="l00385"></a>00385 <a name="l00386"></a>00386 <span class="comment"></span> <a name="l00387"></a>00387 <span class="comment">/// @ingroup ENCHL</span> <a name="l00388"></a>00388 <span class="comment">/// convert a #xed_encoder_instruction_t to a #xed_encoder_request_t for encoding</span> <a name="l00389"></a>00389 <span class="comment"></span><a class="code" href="xed2-ia32_2include_2xed-types_8h.html#d355c921b747945a82d62233a599c7b5">xed_bool_t</a> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#22b6ec424e2b07c28f7094196c039172">xed_convert_to_encoder_request</a>(<a class="code" href="xed2-ia32_2include_2xed-encode_8h.html#6f914541ddfa1ffe609acebff72d0b5f">xed_encoder_request_t</a>* out, <a name="l00390"></a>00390 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* in); <a name="l00391"></a>00391 <span class="comment"></span> <a name="l00392"></a>00392 <span class="comment">//@}</span> <a name="l00393"></a>00393 <span class="comment"></span><span class="comment"></span> <a name="l00394"></a>00394 <span class="comment">////////////////////////////////////////////////////////////////////////////</span> <a name="l00395"></a>00395 <span class="comment"></span><span class="comment">/* FIXME: rather than return the xed_encoder_instruction_t I can make</span> <a name="l00396"></a>00396 <span class="comment"> * another version that returns a xed_encoder_request_t. Saves silly</span> <a name="l00397"></a>00397 <span class="comment"> * copying. Although the xed_encoder_instruction_t might be handy for</span> <a name="l00398"></a>00398 <span class="comment"> * having code templates that get customized &amp; passed to encoder later. */</span><span class="comment"></span> <a name="l00399"></a>00399 <span class="comment">////////////////////////////////////////////////////////////////////////////</span> <a name="l00400"></a>00400 <span class="comment">/// @name Creating instructions from operands</span> <a name="l00401"></a>00401 <span class="comment"></span><span class="comment">//@{</span> <a name="l00402"></a>00402 <span class="comment"></span><span class="comment"></span> <a name="l00403"></a>00403 <span class="comment">/// @ingroup ENCHL</span> <a name="l00404"></a>00404 <span class="comment">/// instruction with no operands</span> <a name="l00405"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#8d463fe5834dfc1dd4e4664fbf897528">00405</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#8d463fe5834dfc1dd4e4664fbf897528">xed_inst0</a>( <a name="l00406"></a>00406 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00407"></a>00407 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00408"></a>00408 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00409"></a>00409 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width) { <a name="l00410"></a>00410 <a name="l00411"></a>00411 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00412"></a>00412 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00413"></a>00413 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00414"></a>00414 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00415"></a>00415 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00416"></a>00416 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 0; <a name="l00417"></a>00417 } <a name="l00418"></a>00418 <span class="comment"></span> <a name="l00419"></a>00419 <span class="comment">/// @ingroup ENCHL</span> <a name="l00420"></a>00420 <span class="comment">/// instruction with one operand</span> <a name="l00421"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#605a860a788e8ba6d7342783be23a093">00421</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#605a860a788e8ba6d7342783be23a093">xed_inst1</a>( <a name="l00422"></a>00422 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00423"></a>00423 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00424"></a>00424 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00425"></a>00425 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00426"></a>00426 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op0) { <a name="l00427"></a>00427 <a name="l00428"></a>00428 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00429"></a>00429 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00430"></a>00430 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00431"></a>00431 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00432"></a>00432 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00433"></a>00433 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[0] = op0; <a name="l00434"></a>00434 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 1; <a name="l00435"></a>00435 } <a name="l00436"></a>00436 <span class="comment"></span> <a name="l00437"></a>00437 <span class="comment">/// @ingroup ENCHL</span> <a name="l00438"></a>00438 <span class="comment">/// instruction with two operands</span> <a name="l00439"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#d2669ef272ad5c97d0e5070b50cce5ec">00439</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#d2669ef272ad5c97d0e5070b50cce5ec">xed_inst2</a>( <a name="l00440"></a>00440 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00441"></a>00441 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00442"></a>00442 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00443"></a>00443 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00444"></a>00444 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op0, <a name="l00445"></a>00445 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op1) { <a name="l00446"></a>00446 <a name="l00447"></a>00447 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00448"></a>00448 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00449"></a>00449 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00450"></a>00450 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00451"></a>00451 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00452"></a>00452 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[0] = op0; <a name="l00453"></a>00453 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[1] = op1; <a name="l00454"></a>00454 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 2; <a name="l00455"></a>00455 } <a name="l00456"></a>00456 <span class="comment"></span> <a name="l00457"></a>00457 <span class="comment">/// @ingroup ENCHL</span> <a name="l00458"></a>00458 <span class="comment">/// instruction with three operands</span> <a name="l00459"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#5bf8b6ae6bb2bfd07725c1acfea2ac2b">00459</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#5bf8b6ae6bb2bfd07725c1acfea2ac2b">xed_inst3</a>( <a name="l00460"></a>00460 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00461"></a>00461 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00462"></a>00462 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00463"></a>00463 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00464"></a>00464 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op0, <a name="l00465"></a>00465 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op1, <a name="l00466"></a>00466 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op2) { <a name="l00467"></a>00467 <a name="l00468"></a>00468 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00469"></a>00469 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00470"></a>00470 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00471"></a>00471 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00472"></a>00472 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00473"></a>00473 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[0] = op0; <a name="l00474"></a>00474 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[1] = op1; <a name="l00475"></a>00475 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[2] = op2; <a name="l00476"></a>00476 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 3; <a name="l00477"></a>00477 } <a name="l00478"></a>00478 <a name="l00479"></a>00479 <span class="comment"></span> <a name="l00480"></a>00480 <span class="comment">/// @ingroup ENCHL</span> <a name="l00481"></a>00481 <span class="comment">/// instruction with four operands</span> <a name="l00482"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#49825c9af03114c82b10b61aefa8ce93">00482</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#49825c9af03114c82b10b61aefa8ce93">xed_inst4</a>( <a name="l00483"></a>00483 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00484"></a>00484 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00485"></a>00485 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00486"></a>00486 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00487"></a>00487 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op0, <a name="l00488"></a>00488 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op1, <a name="l00489"></a>00489 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op2, <a name="l00490"></a>00490 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op3) { <a name="l00491"></a>00491 <a name="l00492"></a>00492 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00493"></a>00493 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00494"></a>00494 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00495"></a>00495 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00496"></a>00496 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00497"></a>00497 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[0] = op0; <a name="l00498"></a>00498 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[1] = op1; <a name="l00499"></a>00499 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[2] = op2; <a name="l00500"></a>00500 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[3] = op3; <a name="l00501"></a>00501 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 4; <a name="l00502"></a>00502 } <a name="l00503"></a>00503 <span class="comment"></span> <a name="l00504"></a>00504 <span class="comment">/// @ingroup ENCHL</span> <a name="l00505"></a>00505 <span class="comment">/// instruction with five operands</span> <a name="l00506"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3a745d122221c6039c4aad0c2e61bc68">00506</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#3a745d122221c6039c4aad0c2e61bc68">xed_inst5</a>( <a name="l00507"></a>00507 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00508"></a>00508 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00509"></a>00509 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00510"></a>00510 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00511"></a>00511 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op0, <a name="l00512"></a>00512 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op1, <a name="l00513"></a>00513 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op2, <a name="l00514"></a>00514 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op3, <a name="l00515"></a>00515 <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a> op4) { <a name="l00516"></a>00516 <a name="l00517"></a>00517 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00518"></a>00518 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00519"></a>00519 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00520"></a>00520 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00521"></a>00521 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00522"></a>00522 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[0] = op0; <a name="l00523"></a>00523 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[1] = op1; <a name="l00524"></a>00524 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[2] = op2; <a name="l00525"></a>00525 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[3] = op3; <a name="l00526"></a>00526 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[4] = op4; <a name="l00527"></a>00527 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = 5; <a name="l00528"></a>00528 } <a name="l00529"></a>00529 <a name="l00530"></a>00530 <span class="comment"></span> <a name="l00531"></a>00531 <span class="comment">/// @ingroup ENCHL</span> <a name="l00532"></a>00532 <span class="comment">/// instruction with an array of operands. The maximum number is</span> <a name="l00533"></a>00533 <span class="comment">/// XED_ENCODER_OPERANDS_MAX. The array's contents are copied.</span> <a name="l00534"></a><a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#0b2f5d72a7c89397c9eb011280d4b001">00534</a> <span class="comment"></span>XED_INLINE <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="xed2-ia32_2include_2xed-encoder-hl_8h.html#0b2f5d72a7c89397c9eb011280d4b001">xed_inst</a>( <a name="l00535"></a>00535 <a class="code" href="structxed__encoder__instruction__t.html">xed_encoder_instruction_t</a>* inst, <a name="l00536"></a>00536 <a class="code" href="group__INIT.html#g58af142456a133c3df29c763216a85cf">xed_state_t</a> mode, <a name="l00537"></a>00537 <a class="code" href="xed2-ia32_2include_2xed-iclass-enum_8h.html#d318511ae9cc50f102251b3c91a1ab9f">xed_iclass_enum_t</a> iclass, <a name="l00538"></a>00538 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> effective_operand_width, <a name="l00539"></a>00539 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> number_of_operands, <a name="l00540"></a>00540 <span class="keyword">const</span> <a class="code" href="structxed__encoder__operand__t.html">xed_encoder_operand_t</a>* operand_array) { <a name="l00541"></a>00541 <a name="l00542"></a>00542 <a class="code" href="xed2-ia32_2include_2xed-types_8h.html#0c92e8263b7ca02d8e4826ae5b79bb30">xed_uint_t</a> i; <a name="l00543"></a>00543 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#1647966dc2ac0f213f9674e6c1e7e336">mode</a>=mode; <a name="l00544"></a>00544 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#bdc1758a5dc07d92701e95617d539909">iclass</a> = iclass; <a name="l00545"></a>00545 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#2b23c8d18171f9a4699744992b5cc026">effective_operand_width</a> = effective_operand_width; <a name="l00546"></a>00546 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#d829df66320029ad521451b2896b18f3">effective_address_width</a> = 0; <a name="l00547"></a>00547 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#76abfb9a09afa6474a8c673db06a3839">prefixes</a>.<a class="code" href="unionxed__encoder__prefixes__t.html#15762219ece938eca0db01a735121dbe">i</a> = 0; <a name="l00548"></a>00548 xed_assert(number_of_operands &lt; XED_ENCODER_OPERANDS_MAX); <a name="l00549"></a>00549 <span class="keywordflow">for</span>(i=0;i&lt;number_of_operands;i++) { <a name="l00550"></a>00550 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#0cc465ba90570b77abcc6e2833b43673">operands</a>[i] = operand_array[i]; <a name="l00551"></a>00551 } <a name="l00552"></a>00552 inst-&gt;<a class="code" href="structxed__encoder__instruction__t.html#10c44c5cf064364003d1d4f6f4bbb7da">noperands</a> = number_of_operands; <a name="l00553"></a>00553 } <a name="l00554"></a>00554 <span class="comment"></span> <a name="l00555"></a>00555 <span class="comment">//@}</span> <a name="l00556"></a>00556 <span class="comment"></span> <a name="l00557"></a>00557 <span class="comment">/*</span> <a name="l00558"></a>00558 <span class="comment"> xed_encoder_instruction_t x,y;</span> <a name="l00559"></a>00559 <span class="comment"></span> <a name="l00560"></a>00560 <span class="comment"> xed_inst2(&amp;x, state, XED_ICLASS_ADD, 32, </span> <a name="l00561"></a>00561 <span class="comment"> xreg(XED_REG_EAX), </span> <a name="l00562"></a>00562 <span class="comment"> xmem_bd(XED_REG_EDX, xdisp(0x11223344, 32), 32));</span> <a name="l00563"></a>00563 <span class="comment"> </span> <a name="l00564"></a>00564 <span class="comment"> xed_inst2(&amp;y, state, XED_ICLASS_ADD, 32, </span> <a name="l00565"></a>00565 <span class="comment"> xreg(XED_REG_EAX), </span> <a name="l00566"></a>00566 <span class="comment"> xmem_gbisd(XED_REG_FS, XED_REG_EAX, XED_REG_ESI,4, xdisp(0x11223344, 32), 32));</span> <a name="l00567"></a>00567 <span class="comment"></span> <a name="l00568"></a>00568 <span class="comment"> */</span> <a name="l00569"></a>00569 <a name="l00570"></a>00570 <span class="preprocessor">#endif</span> </pre></div></div> <hr> <p class="footer"> Generated on Fri Mar 30 16:18:24 2012 for <a href="http://bitblaze.cs.berkeley.edu/temu.html">TEMU</a> by <a href="http://www.doxygen.org"><img src="doxygen.png" alt="Doxygen" align="middle" border="0"/>1.5.8</a><br/> Copyright &copy; 2008-2009, BitBlaze Project. All Rights Reserved.</p> <hr> <!--#include virtual="/attrib.incl" --> </body> </html>
huydhn/Detector
docs/doxygen/html/xed2-ia32_2include_2xed-encoder-hl_8h-source.html
HTML
gpl-2.0
95,085
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 1014, 17459, 1013, 1013, 4372, 1000, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 Servinow\EntitiesBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class ServinowEntitiesBundle extends Bundle { }
Servinow/servinowServer
src/Servinow/EntitiesBundle/ServinowEntitiesBundle.php
PHP
mit
140
[ 30522, 1026, 1029, 25718, 3415, 15327, 14262, 26531, 2860, 1032, 11422, 27265, 2571, 1025, 2224, 25353, 2213, 14876, 4890, 1032, 6922, 1032, 8299, 5484, 11877, 1032, 14012, 1032, 14012, 1025, 2465, 14262, 26531, 12449, 3775, 7368, 27265, 2571...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 LiftKit\Tests\Unit\Document; use LiftKit\Document\Html as HtmlDocument; use LiftKit\Output\Html; use PHPUnit_Framework_TestCase as TestCase; class HtmlTest extends TestCase { /** * @var HtmlDocument */ protected $document; public function setUp () { $this->document = new HtmlDocument; } /** * Long test helps test ordering is proper */ public function testHeaders () { $scriptHeader = '<script>alert("hello");</script>'; $this->document->addHeader($scriptHeader); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($scriptHeader) ); $metaName = '&dks;<'; $metaContent = "&%/><"; $attr = '$<>&sl'; $attributes = array( 'attr' => $attr, ); $metaCompare = '<meta name="' . Html::sanitize($metaName) . '" content="' . Html::sanitize($metaContent) . '" attr="' . Html::sanitize($attr) . '" />'; $this->document->addMeta($metaName, $metaContent, $attributes); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($scriptHeader . ' ' . $metaCompare) ); $prepended = '<link rel="test" />'; $this->document->prependHeader($prepended); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($prepended . ' ' . $scriptHeader . ' ' . $metaCompare) ); $scriptSrc = '&adsd'; $scriptCompare = '<script type="text/javascript" src="' . Html::sanitize($scriptSrc) . '"></script>'; $this->document->addScript($scriptSrc); $this->document->addScript($scriptSrc, true); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($scriptCompare . ' ' . $prepended . ' ' . $scriptHeader . ' ' . $metaCompare . ' ' . $scriptCompare) ); $cssHref = '&?></'; $cssCompare = '<link rel="stylesheet" type="text/css" href="' . Html::sanitize($cssHref) . '" />'; $this->document->addStylesheet($cssHref); $this->document->addStylesheet($cssHref, true); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($cssCompare . ' ' . $scriptCompare . ' ' . $prepended . ' ' . $scriptHeader . ' ' . $metaCompare . ' ' . $scriptCompare . ' ' . $cssCompare) ); $title = '<&asdasd&;'; $titleCompare = '<title>' . Html::sanitize($title) . '</title>'; $this->document->setTitle($title); $this->assertEquals( $this->normalizeHtml($this->document->getHeaders()), $this->normalizeHtml($cssCompare . ' ' . $scriptCompare . ' ' . $prepended . ' ' . $scriptHeader . ' ' . $metaCompare . ' ' . $scriptCompare . ' ' . $cssCompare . ' ' . $titleCompare) ); $this->document->removeHeaders(); $this->assertEquals( $this->document->getHeaders(), '' ); } public function testPrependedElements () { $element1 = '<div class="elem1"></div>'; $element2 = '<div class="elem2"></div>'; $this->document->prependToBody($element1); $this->document->prependToBody($element2); $this->assertEquals( $this->normalizeHtml($this->document->getPrependedElements()), $this->normalizeHtml($element1 . ' ' . $element2) ); } public function testAppendedElements () { $element1 = '<div class="elem1"></div>'; $element2 = '<div class="elem2"></div>'; $this->document->appendToBody($element1); $this->document->appendToBody($element2); $this->assertEquals( $this->normalizeHtml($this->document->getAppendedElements()), $this->normalizeHtml($element1 . ' ' . $element2) ); } public function testGetScriptUrls () { $script1 = 'sample1'; $script2 = 'sample2'; $this->document->addScript($script1); $this->document->addScript($script2, true); $this->assertEquals( array( $script2, $script1, ), $this->document->getScriptUrls() ); } public function testGetStylesheetUrls () { $stylesheet1 = 'sample1'; $stylesheet2 = 'sample2'; $this->document->addStylesheet($stylesheet1); $this->document->addStylesheet($stylesheet2, true); $this->assertEquals( array( $stylesheet2, $stylesheet1, ), $this->document->getStylesheetUrls() ); } protected function normalizeHtml ($htmlString) { return trim(preg_replace('#\s+#', ' ', $htmlString)); } }
liftkit/document
tests/unit/Document/HtmlTest.php
PHP
lgpl-2.1
4,390
[ 30522, 1026, 1029, 25718, 3415, 15327, 6336, 23615, 1032, 5852, 1032, 3131, 1032, 6254, 1025, 2224, 6336, 23615, 1032, 6254, 1032, 16129, 2004, 16129, 3527, 24894, 4765, 1025, 2224, 6336, 23615, 1032, 6434, 1032, 16129, 1025, 2224, 25718, 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) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. // Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and University of // of Connecticut School of Medicine. // All rights reserved. // Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., EML Research, gGmbH, University of Heidelberg, // and The University of Manchester. // All rights reserved. // Copyright (C) 2006 - 2007 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc. and EML Research, gGmbH. // All rights reserved. /** * COptMethodLevenbergMarquardt class */ #ifndef COPASI_COptMethodLevenbergMarquardt #define COPASI_COptMethodLevenbergMarquardt #include <vector> #include "copasi/core/CMatrix.h" #include "copasi/optimization/COptMethod.h" class CRandom; class COptMethodLevenbergMarquardt : public COptMethod { // Operations public: /** * Specific constructor * @param const CDataContainer * pParent * @param const CTaskEnum::Method & methodType (default: LevenbergMarquardt) * @param const CTaskEnum::Task & taskType (default: optimization) */ COptMethodLevenbergMarquardt(const CDataContainer * pParent, const CTaskEnum::Method & methodType = CTaskEnum::Method::LevenbergMarquardt, const CTaskEnum::Task & taskType = CTaskEnum::Task::optimization); /** * Copy Constructor * @param const COptMethodLevenbergMarquardt & src * @param const CDataContainer * pParent (default: NULL) */ COptMethodLevenbergMarquardt(const COptMethodLevenbergMarquardt & src, const CDataContainer * pParent); /** * Destructor */ virtual ~COptMethodLevenbergMarquardt(); /** * Execute the optimization algorithm calling simulation routine * when needed. It is noted that this procedure can give feedback * of its progress by the callback function set with SetCallback. * @ return success; */ virtual bool optimise(); /** * Returns the maximum verbosity at which the method can log. */ virtual unsigned C_INT32 getMaxLogVerbosity() const; private: /** * Default Constructor */ COptMethodLevenbergMarquardt(); /** * Initialize contained objects. */ void initObjects(); /** * Initialize arrays and pointer. * @return bool success */ virtual bool initialize(); /** * Cleanup arrays and pointers. * @return bool success */ virtual bool cleanup(); /** * Evaluate the objective function * @return bool continue */ const C_FLOAT64 & evaluate(); /** * Calculate the gradient of the objective at the current parameters */ void gradient(); /** * Calculate the Hessian of the objective at the current point */ void hessian(); // Attributes private: /** * The maximum number of iterations */ unsigned C_INT32 mIterationLimit; /** * The tolerance */ C_FLOAT64 mTolerance; /** * The modulation factor */ C_FLOAT64 mModulation; /** * The number of iterations */ unsigned C_INT32 mIteration; /** * Count of algorithm leaving parameter space */ unsigned C_INT32 mParameterOutOfBounds; /** * Handle to the process report item "Current Iteration" */ size_t mhIteration; /** * number of parameters */ size_t mVariableSize; /** * The current solution guess */ CVector< C_FLOAT64 > mCurrent; /** * The last individual */ CVector< C_FLOAT64 > mBest; /** * The gradient */ CVector< C_FLOAT64 > mGradient; /** * The step taken */ CVector< C_FLOAT64 > mStep; /** * The Hessian matrix */ CMatrix<C_FLOAT64> mHessian; /** * The Hessian matrix modified according to Levenberg-Marquardt */ CMatrix<C_FLOAT64> mHessianLM; /** * Vector for temporary values */ CVector< C_FLOAT64 > mTemp; /** * The best value found so far */ C_FLOAT64 mBestValue; /** * The result of a function evaluation */ C_FLOAT64 mEvaluationValue; /** * if no improvement was made after # stalled iterations * stop */ unsigned C_INT32 mStopAfterStalledIterations; /** * Flag indicating whether the computation shall continue */ bool mContinue; /** * Indicate whether we have access to the residuals, i.e., it is a * fitting problem we are working on. */ bool mHaveResiduals; /** * The transpose jacobian of the residuals. */ CMatrix< C_FLOAT64 > mResidualJacobianT; C_FLOAT64 mInitialLamda; C_FLOAT64 mLambdaUp; C_FLOAT64 mLambdaDown; }; #endif // COPASI_COptMethodLevenbergMarquardt
jonasfoe/COPASI
copasi/optimization/COptMethodLevenbergMarquardt.h
C
artistic-2.0
5,030
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 10476, 1011, 12609, 2011, 7707, 27916, 1010, 10935, 1998, 5731, 1997, 1996, 1013, 1013, 2118, 1997, 3448, 1010, 2118, 1997, 16793, 1010, 1998, 2118, 1013, 1013, 1997, 6117, 2082, 1997, 4200, 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...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ package org.tensorflow.op.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation used by classes to make TensorFlow operations conveniently accessible via {@code * org.tensorflow.op.Ops}. * * <p>An annotation processor (TODO: not yet implemented) builds the {@code Ops} class by * aggregating all classes annotated as {@code @Operator}s. Each annotated class <b>must</b> have at * least one public static factory method named {@code create} that accepts a {@link * org.tensorflow.op.Scope} as its first argument. The processor then adds a convenience method in * the {@code Ops} class. For example: * * <pre>{@code * @Operator * public final class MyOp implements Op { * public static MyOp create(Scope scope, Operand operand) { * ... * } * } * }</pre> * * <p>results in a method in the {@code Ops} class * * <pre>{@code * import org.tensorflow.op.Ops; * ... * Ops ops = new Ops(graph); * ... * ops.myOp(operand); * // and has exactly the same effect as calling * // MyOp.create(ops.getScope(), operand); * }</pre> */ @Documented @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface Operator { /** * Specify an optional group within the {@code Ops} class. * * <p>By default, an annotation processor will create convenience methods directly in the {@code * Ops} class. An annotated operator may optionally choose to place the method within a group. For * example: * * <pre>{@code * @Operator(group="math") * public final class Add extends PrimitiveOp implements Operand { * ... * } * }</pre> * * <p>results in the {@code add} method placed within a {@code math} group within the {@code Ops} * class. * * <pre>{@code * ops.math().add(...); * }</pre> * * <p>The group name must be a <a * href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8">valid Java * identifier</a>. */ String group() default ""; /** * Name for the wrapper method used in the {@code Ops} class. * * <p>By default, a processor derives the method name in the {@code Ops} class from the class name * of the operator. This attribute allow you to provide a different name instead. For example: * * <pre>{@code * @Operator(name="myOperation") * public final class MyRealOperation implements Operand { * public static MyRealOperation create(...) * } * }</pre> * * <p>results in this method added to the {@code Ops} class * * <pre>{@code * ops.myOperation(...); * // and is the same as calling * // MyRealOperation.create(...) * }</pre> * * <p>The name must be a <a * href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8">valid Java * identifier</a>. */ String name() default ""; }
nburn42/tensorflow
tensorflow/java/src/main/java/org/tensorflow/op/annotation/Operator.java
Java
apache-2.0
3,654
[ 30522, 1013, 1008, 9385, 2418, 1996, 23435, 12314, 6048, 1012, 2035, 2916, 9235, 1012, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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":"71993695","logradouro":"Conjunto SHA Conjunto 3 Ch\u00e1cara 61A","bairro":"Setor Habitacional Arniqueiras (Taguatinga)","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
lfreneda/cepdb
api/v1/71993695.jsonp.js
JavaScript
cc0-1.0
201
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 6390, 2683, 2683, 21619, 2683, 2629, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 9530, 19792, 3406, 21146, 9530, 19792, 3406, 1017, 10381, 1032, 1057,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
# yteditorpro Pro Mode for YouTube Video Editor Chrome Extension ## Introduction Pro Mode for YouTube Video Editor is a Chrome extension which enhances the YouTube Video Editor with keyboard shortcuts and other usability improvements. It was born of many frustrations associating with editing lengthy videos using the video editor. I plan to continue improving this as needed and pull requests are welcome :) ## Installation This extension should be installed using the Chrome store. Alternatively, the extension can be loaded directly into Chrome by cloning the project locally, going to chrome://extensions/, clicking 'Load unpacked extension...' and selecting the cloned project folder. Make sure that the Developer mode option is checked. ## Usage The extension activates when you browse to the YouTube video editor url (https://www.youtube.com/editor). All of the keyboard shortcuts are documented on the help screen which can be opened by pressing the 'H' key. ### Start / Stop playback The spacebar will start and stop playback of the current clip or the entire video. This is useful as the editor will often immediately start playing back after *every* edit. ### Tab selection keys Keys 1-6 are used for selecting the various editing tabs (Video, Audio, Photos, etc). Pressing them will allow you to select another piece of content without losing the current selection. This is useful because when the current clip is unselected, the player preview will start from the beginning, causing you to lose your place in the video. ### Timeline navigation The 'P' key will scroll the timeline to the currently selected clip. This is convenient because often the timeline will automatically scroll to the start despite having a clip selected. The '[' and ']' keys allow scrolling to the start and end of the timeline. ### Sort photos When the Photos tab is open, the 'S' key will cause the current set of photos to be sorted alphabetically. This is useful when re-opening an existing project with photos causes them to be displayed out of order.
kldavis4/yteditorpro
README.md
Markdown
apache-2.0
2,057
[ 30522, 1001, 1061, 3064, 15660, 21572, 4013, 5549, 2005, 7858, 2678, 3559, 18546, 5331, 1001, 1001, 4955, 4013, 5549, 2005, 7858, 2678, 3559, 2003, 1037, 18546, 5331, 2029, 11598, 2015, 1996, 7858, 2678, 3559, 2007, 9019, 2460, 12690, 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...
// 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 "third_party/blink/public/common/page/content_to_visible_time_reporter.h" #include <utility> #include "base/bind.h" #include "base/callback_helpers.h" #include "base/debug/dump_without_crashing.h" #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/strings/strcat.h" #include "base/trace_event/trace_event.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/widget/record_content_to_visible_time_request.mojom.h" #include "ui/gfx/presentation_feedback.h" namespace blink { namespace { // Used to generate unique "TabSwitching::Latency" event ids. Note: The address // of ContentToVisibleTimeReporter can't be used as an id because a single // ContentToVisibleTimeReporter can generate multiple overlapping events. int g_num_trace_events_in_process = 0; const char* GetHistogramSuffix( bool has_saved_frames, const mojom::RecordContentToVisibleTimeRequest& start_state) { if (has_saved_frames) return "WithSavedFrames"; if (start_state.destination_is_loaded) { return "NoSavedFrames_Loaded"; } else { return "NoSavedFrames_NotLoaded"; } } void ReportUnOccludedMetric(const base::TimeTicks requested_time, const gfx::PresentationFeedback& feedback) { const base::TimeDelta delta = feedback.timestamp - requested_time; UMA_HISTOGRAM_TIMES("Aura.WebContentsWindowUnOccludedTime", delta); } void RecordBackForwardCacheRestoreMetric( const base::TimeTicks requested_time, const gfx::PresentationFeedback& feedback) { const base::TimeDelta delta = feedback.timestamp - requested_time; // Histogram to record the content to visible duration after restoring a page // from back-forward cache. Here min, max bucket size are same as the // "PageLoad.PaintTiming.NavigationToFirstContentfulPaint" metric. base::UmaHistogramCustomTimes( "BackForwardCache.Restore.NavigationToFirstPaint", delta, base::Milliseconds(10), base::Minutes(10), 100); } } // namespace void UpdateRecordContentToVisibleTimeRequest( mojom::RecordContentToVisibleTimeRequest const& from, mojom::RecordContentToVisibleTimeRequest& to) { to.event_start_time = std::min(to.event_start_time, from.event_start_time); to.destination_is_loaded |= from.destination_is_loaded; to.show_reason_tab_switching |= from.show_reason_tab_switching; to.show_reason_unoccluded |= from.show_reason_unoccluded; to.show_reason_bfcache_restore |= from.show_reason_bfcache_restore; } ContentToVisibleTimeReporter::ContentToVisibleTimeReporter() : is_tab_switch_metric2_feature_enabled_( base::FeatureList::IsEnabled(blink::features::kTabSwitchMetrics2)) {} ContentToVisibleTimeReporter::~ContentToVisibleTimeReporter() = default; base::OnceCallback<void(const gfx::PresentationFeedback&)> ContentToVisibleTimeReporter::TabWasShown( bool has_saved_frames, mojom::RecordContentToVisibleTimeRequestPtr start_state, base::TimeTicks widget_visibility_request_timestamp) { DCHECK(!start_state->event_start_time.is_null()); DCHECK(!widget_visibility_request_timestamp.is_null()); DCHECK(!tab_switch_start_state_); DCHECK(widget_visibility_request_timestamp_.is_null()); // Invalidate previously issued callbacks, to avoid accessing a null // |tab_switch_start_state_|. // // TODO(https://crbug.com/1121339): Make sure that TabWasShown() is never // called twice without a call to TabWasHidden() in-between, and remove this // mitigation. weak_ptr_factory_.InvalidateWeakPtrs(); has_saved_frames_ = has_saved_frames; tab_switch_start_state_ = std::move(start_state); widget_visibility_request_timestamp_ = widget_visibility_request_timestamp; // |tab_switch_start_state_| is only reset by RecordHistogramsAndTraceEvents // once the metrics have been emitted. return base::BindOnce( &ContentToVisibleTimeReporter::RecordHistogramsAndTraceEvents, weak_ptr_factory_.GetWeakPtr(), false /* is_incomplete */, tab_switch_start_state_->show_reason_tab_switching, tab_switch_start_state_->show_reason_unoccluded, tab_switch_start_state_->show_reason_bfcache_restore); } base::OnceCallback<void(const gfx::PresentationFeedback&)> ContentToVisibleTimeReporter::TabWasShown( bool has_saved_frames, base::TimeTicks event_start_time, bool destination_is_loaded, bool show_reason_tab_switching, bool show_reason_unoccluded, bool show_reason_bfcache_restore, base::TimeTicks widget_visibility_request_timestamp) { return TabWasShown( has_saved_frames, mojom::RecordContentToVisibleTimeRequest::New( event_start_time, destination_is_loaded, show_reason_tab_switching, show_reason_unoccluded, show_reason_bfcache_restore), widget_visibility_request_timestamp); } void ContentToVisibleTimeReporter::TabWasHidden() { if (tab_switch_start_state_) { RecordHistogramsAndTraceEvents(true /* is_incomplete */, true /* show_reason_tab_switching */, false /* show_reason_unoccluded */, false /* show_reason_bfcache_restore */, gfx::PresentationFeedback::Failure()); weak_ptr_factory_.InvalidateWeakPtrs(); } } void ContentToVisibleTimeReporter::RecordHistogramsAndTraceEvents( bool is_incomplete, bool show_reason_tab_switching, bool show_reason_unoccluded, bool show_reason_bfcache_restore, const gfx::PresentationFeedback& feedback) { DCHECK(tab_switch_start_state_); DCHECK(!widget_visibility_request_timestamp_.is_null()); // If the DCHECK fail, make sure RenderWidgetHostImpl::WasShown was triggered // for recording the event. DCHECK(show_reason_bfcache_restore || show_reason_unoccluded || show_reason_tab_switching); if (show_reason_bfcache_restore) { RecordBackForwardCacheRestoreMetric( tab_switch_start_state_->event_start_time, feedback); } if (show_reason_unoccluded) { ReportUnOccludedMetric(tab_switch_start_state_->event_start_time, feedback); } if (!show_reason_tab_switching) return; // Tab switching has occurred. auto tab_switch_result = TabSwitchResult::kSuccess; if (is_incomplete) tab_switch_result = TabSwitchResult::kIncomplete; else if (feedback.flags & gfx::PresentationFeedback::kFailure) tab_switch_result = TabSwitchResult::kPresentationFailure; const auto tab_switch_duration = feedback.timestamp - tab_switch_start_state_->event_start_time; // Record trace events. TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( "latency", "TabSwitching::Latency", TRACE_ID_LOCAL(g_num_trace_events_in_process), tab_switch_start_state_->event_start_time); TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP2( "latency", "TabSwitching::Latency", TRACE_ID_LOCAL(g_num_trace_events_in_process), feedback.timestamp, "result", tab_switch_result, "latency", tab_switch_duration.InMillisecondsF()); ++g_num_trace_events_in_process; const char* suffix = GetHistogramSuffix(has_saved_frames_, *tab_switch_start_state_); // Record result histogram. if (is_tab_switch_metric2_feature_enabled_) { base::UmaHistogramEnumeration( base::StrCat({"Browser.Tabs.TabSwitchResult2.", suffix}), tab_switch_result); } else { base::UmaHistogramEnumeration( base::StrCat({"Browser.Tabs.TabSwitchResult.", suffix}), tab_switch_result); } // Record latency histogram. switch (tab_switch_result) { case TabSwitchResult::kSuccess: { if (is_tab_switch_metric2_feature_enabled_) { base::UmaHistogramTimes( base::StrCat({"Browser.Tabs.TotalSwitchDuration2.", suffix}), tab_switch_duration); } else { base::UmaHistogramTimes( base::StrCat({"Browser.Tabs.TotalSwitchDuration.", suffix}), tab_switch_duration); } break; } case TabSwitchResult::kIncomplete: { if (is_tab_switch_metric2_feature_enabled_) { base::UmaHistogramTimes( base::StrCat( {"Browser.Tabs.TotalIncompleteSwitchDuration2.", suffix}), tab_switch_duration); } else { base::UmaHistogramTimes( base::StrCat( {"Browser.Tabs.TotalIncompleteSwitchDuration.", suffix}), tab_switch_duration); } break; } case TabSwitchResult::kPresentationFailure: { break; } } // Record legacy latency histogram. UMA_HISTOGRAM_TIMES( "MPArch.RWH_TabSwitchPaintDuration", feedback.timestamp - widget_visibility_request_timestamp_); // Reset tab switch information. has_saved_frames_ = false; tab_switch_start_state_.reset(); widget_visibility_request_timestamp_ = base::TimeTicks(); } } // namespace blink
nwjs/chromium.src
third_party/blink/common/page/content_to_visible_time_reporter.cc
C++
bsd-3-clause
9,156
[ 30522, 1013, 1013, 9385, 10476, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 30524, 3931, 1013, 4180, 1035, 2000, 1035, 5710, 1035, 2051, 1035, 6398, 1012, 1044, 1000, 1001, 2421, 1026, 9710, 1028, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* * net/core/ethtool.c - Ethtool ioctl handler * Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx> * * This file is where we call all the ethtool_ops commands to get * the information ethtool needs. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include <linux/module.h> #include <linux/types.h> #include <linux/capability.h> #include <linux/errno.h> #include <linux/ethtool.h> #include <linux/netdevice.h> #include <linux/bitops.h> #include <linux/uaccess.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/rtnetlink.h> #include <linux/sched.h> /* * Some useful ethtool_ops methods that're device independent. * If we find that all drivers want to do the same thing here, * we can turn these into dev_() function calls. */ u32 ethtool_op_get_link(struct net_device *dev) { return netif_carrier_ok(dev) ? 1 : 0; } EXPORT_SYMBOL(ethtool_op_get_link); u32 ethtool_op_get_tx_csum(struct net_device *dev) { return (dev->features & NETIF_F_ALL_CSUM) != 0; } EXPORT_SYMBOL(ethtool_op_get_tx_csum); int ethtool_op_set_tx_csum(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_IP_CSUM; else dev->features &= ~NETIF_F_IP_CSUM; return 0; } EXPORT_SYMBOL(ethtool_op_set_tx_csum); int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_HW_CSUM; else dev->features &= ~NETIF_F_HW_CSUM; return 0; } EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum); int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; else dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); return 0; } EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum); u32 ethtool_op_get_sg(struct net_device *dev) { return (dev->features & NETIF_F_SG) != 0; } EXPORT_SYMBOL(ethtool_op_get_sg); int ethtool_op_set_sg(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_SG; else dev->features &= ~NETIF_F_SG; return 0; } EXPORT_SYMBOL(ethtool_op_set_sg); u32 ethtool_op_get_tso(struct net_device *dev) { return (dev->features & NETIF_F_TSO) != 0; } EXPORT_SYMBOL(ethtool_op_get_tso); int ethtool_op_set_tso(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_TSO; else dev->features &= ~NETIF_F_TSO; return 0; } EXPORT_SYMBOL(ethtool_op_set_tso); u32 ethtool_op_get_ufo(struct net_device *dev) { return (dev->features & NETIF_F_UFO) != 0; } EXPORT_SYMBOL(ethtool_op_get_ufo); int ethtool_op_set_ufo(struct net_device *dev, u32 data) { if (data) dev->features |= NETIF_F_UFO; else dev->features &= ~NETIF_F_UFO; return 0; } EXPORT_SYMBOL(ethtool_op_set_ufo); /* the following list of flags are the same as their associated * NETIF_F_xxx values in include/linux/netdevice.h */ static const u32 flags_dup_features = (ETH_FLAG_LRO | ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN | ETH_FLAG_NTUPLE | ETH_FLAG_RXHASH); u32 ethtool_op_get_flags(struct net_device *dev) { /* in the future, this function will probably contain additional * handling for flags which are not so easily handled * by a simple masking operation */ return dev->features & flags_dup_features; } EXPORT_SYMBOL(ethtool_op_get_flags); /* Check if device can enable (or disable) particular feature coded in "data" * argument. Flags "supported" describe features that can be toggled by device. * If feature can not be toggled, it state (enabled or disabled) must match * hardcoded device features state, otherwise flags are marked as invalid. */ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported) { u32 features = dev->features & flags_dup_features; /* "data" can contain only flags_dup_features bits, * see __ethtool_set_flags */ return (features & ~supported) != (data & ~supported); } EXPORT_SYMBOL(ethtool_invalid_flags); int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported) { if (ethtool_invalid_flags(dev, data, supported)) return -EINVAL; dev->features = ((dev->features & ~flags_dup_features) | (data & flags_dup_features)); return 0; } EXPORT_SYMBOL(ethtool_op_set_flags); /* Handlers for each ethtool command */ #define ETHTOOL_DEV_FEATURE_WORDS 1 static void ethtool_get_features_compat(struct net_device *dev, struct ethtool_get_features_block *features) { if (!dev->ethtool_ops) return; /* getting RX checksum */ if (dev->ethtool_ops->get_rx_csum) if (dev->ethtool_ops->get_rx_csum(dev)) features[0].active |= NETIF_F_RXCSUM; /* mark legacy-changeable features */ if (dev->ethtool_ops->set_sg) features[0].available |= NETIF_F_SG; if (dev->ethtool_ops->set_tx_csum) features[0].available |= NETIF_F_ALL_CSUM; if (dev->ethtool_ops->set_tso) features[0].available |= NETIF_F_ALL_TSO; if (dev->ethtool_ops->set_rx_csum) features[0].available |= NETIF_F_RXCSUM; if (dev->ethtool_ops->set_flags) features[0].available |= flags_dup_features; } static int ethtool_set_feature_compat(struct net_device *dev, int (*legacy_set)(struct net_device *, u32), struct ethtool_set_features_block *features, u32 mask) { u32 do_set; if (!legacy_set) return 0; if (!(features[0].valid & mask)) return 0; features[0].valid &= ~mask; do_set = !!(features[0].requested & mask); if (legacy_set(dev, do_set) < 0) netdev_info(dev, "Legacy feature change (%s) failed for 0x%08x\n", do_set ? "set" : "clear", mask); return 1; } static int ethtool_set_flags_compat(struct net_device *dev, int (*legacy_set)(struct net_device *, u32), struct ethtool_set_features_block *features, u32 mask) { u32 value; if (!legacy_set) return 0; if (!(features[0].valid & mask)) return 0; value = dev->features & ~features[0].valid; value |= features[0].requested; features[0].valid &= ~mask; if (legacy_set(dev, value & mask) < 0) netdev_info(dev, "Legacy flags change failed\n"); return 1; } static int ethtool_set_features_compat(struct net_device *dev, struct ethtool_set_features_block *features) { int compat; if (!dev->ethtool_ops) return 0; compat = ethtool_set_feature_compat(dev, dev->ethtool_ops->set_sg, features, NETIF_F_SG); compat |= ethtool_set_feature_compat(dev, dev->ethtool_ops->set_tx_csum, features, NETIF_F_ALL_CSUM); compat |= ethtool_set_feature_compat(dev, dev->ethtool_ops->set_tso, features, NETIF_F_ALL_TSO); compat |= ethtool_set_feature_compat(dev, dev->ethtool_ops->set_rx_csum, features, NETIF_F_RXCSUM); compat |= ethtool_set_flags_compat(dev, dev->ethtool_ops->set_flags, features, flags_dup_features); return compat; } static int ethtool_get_features(struct net_device *dev, void __user *useraddr) { struct ethtool_gfeatures cmd = { .cmd = ETHTOOL_GFEATURES, .size = ETHTOOL_DEV_FEATURE_WORDS, }; struct ethtool_get_features_block features[ETHTOOL_DEV_FEATURE_WORDS] = { { .available = dev->hw_features, .requested = dev->wanted_features, .active = dev->features, .never_changed = NETIF_F_NEVER_CHANGE, }, }; u32 __user *sizeaddr; u32 copy_size; ethtool_get_features_compat(dev, features); sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size); if (get_user(copy_size, sizeaddr)) return -EFAULT; if (copy_size > ETHTOOL_DEV_FEATURE_WORDS) copy_size = ETHTOOL_DEV_FEATURE_WORDS; if (copy_to_user(useraddr, &cmd, sizeof(cmd))) return -EFAULT; useraddr += sizeof(cmd); if (copy_to_user(useraddr, features, copy_size * sizeof(*features))) return -EFAULT; return 0; } static int ethtool_set_features(struct net_device *dev, void __user *useraddr) { struct ethtool_sfeatures cmd; struct ethtool_set_features_block features[ETHTOOL_DEV_FEATURE_WORDS]; int ret = 0; if (copy_from_user(&cmd, useraddr, sizeof(cmd))) return -EFAULT; useraddr += sizeof(cmd); if (cmd.size != ETHTOOL_DEV_FEATURE_WORDS) return -EINVAL; if (copy_from_user(features, useraddr, sizeof(features))) return -EFAULT; if (features[0].valid & ~NETIF_F_ETHTOOL_BITS) return -EINVAL; if (ethtool_set_features_compat(dev, features)) ret |= ETHTOOL_F_COMPAT; if (features[0].valid & ~dev->hw_features) { features[0].valid &= dev->hw_features; ret |= ETHTOOL_F_UNSUPPORTED; } dev->wanted_features &= ~features[0].valid; dev->wanted_features |= features[0].valid & features[0].requested; netdev_update_features(dev); if ((dev->wanted_features ^ dev->features) & features[0].valid) ret |= ETHTOOL_F_WISH; return ret; } static const char netdev_features_strings[ETHTOOL_DEV_FEATURE_WORDS * 32][ETH_GSTRING_LEN] = { /* NETIF_F_SG */ "tx-scatter-gather", /* NETIF_F_IP_CSUM */ "tx-checksum-ipv4", /* NETIF_F_NO_CSUM */ "tx-checksum-unneeded", /* NETIF_F_HW_CSUM */ "tx-checksum-ip-generic", /* NETIF_F_IPV6_CSUM */ "tx-checksum-ipv6", /* NETIF_F_HIGHDMA */ "highdma", /* NETIF_F_FRAGLIST */ "tx-scatter-gather-fraglist", /* NETIF_F_HW_VLAN_TX */ "tx-vlan-hw-insert", /* NETIF_F_HW_VLAN_RX */ "rx-vlan-hw-parse", /* NETIF_F_HW_VLAN_FILTER */ "rx-vlan-filter", /* NETIF_F_VLAN_CHALLENGED */ "vlan-challenged", /* NETIF_F_GSO */ "tx-generic-segmentation", /* NETIF_F_LLTX */ "tx-lockless", /* NETIF_F_NETNS_LOCAL */ "netns-local", /* NETIF_F_GRO */ "rx-gro", /* NETIF_F_LRO */ "rx-lro", /* NETIF_F_TSO */ "tx-tcp-segmentation", /* NETIF_F_UFO */ "tx-udp-fragmentation", /* NETIF_F_GSO_ROBUST */ "tx-gso-robust", /* NETIF_F_TSO_ECN */ "tx-tcp-ecn-segmentation", /* NETIF_F_TSO6 */ "tx-tcp6-segmentation", /* NETIF_F_FSO */ "tx-fcoe-segmentation", "", "", /* NETIF_F_FCOE_CRC */ "tx-checksum-fcoe-crc", /* NETIF_F_SCTP_CSUM */ "tx-checksum-sctp", /* NETIF_F_FCOE_MTU */ "fcoe-mtu", /* NETIF_F_NTUPLE */ "rx-ntuple-filter", /* NETIF_F_RXHASH */ "rx-hashing", /* NETIF_F_RXCSUM */ "rx-checksum", /* NETIF_F_NOCACHE_COPY */ "tx-nocache-copy" /* NETIF_F_LOOPBACK */ "loopback", }; static int __ethtool_get_sset_count(struct net_device *dev, int sset) { const struct ethtool_ops *ops = dev->ethtool_ops; if (sset == ETH_SS_FEATURES) return ARRAY_SIZE(netdev_features_strings); if (ops && ops->get_sset_count && ops->get_strings) return ops->get_sset_count(dev, sset); else return -EOPNOTSUPP; } static void __ethtool_get_strings(struct net_device *dev, u32 stringset, u8 *data) { const struct ethtool_ops *ops = dev->ethtool_ops; if (stringset == ETH_SS_FEATURES) memcpy(data, netdev_features_strings, sizeof(netdev_features_strings)); else /* ops->get_strings is valid because checked earlier */ ops->get_strings(dev, stringset, data); } static netdev_features_t ethtool_get_feature_mask(u32 eth_cmd) { /* feature masks of legacy discrete ethtool ops */ switch (eth_cmd) { case ETHTOOL_GTXCSUM: case ETHTOOL_STXCSUM: return NETIF_F_ALL_CSUM | NETIF_F_SCTP_CSUM; case ETHTOOL_GRXCSUM: case ETHTOOL_SRXCSUM: return NETIF_F_RXCSUM; case ETHTOOL_GSG: case ETHTOOL_SSG: return NETIF_F_SG; case ETHTOOL_GTSO: case ETHTOOL_STSO: return NETIF_F_ALL_TSO; case ETHTOOL_GUFO: case ETHTOOL_SUFO: return NETIF_F_UFO; case ETHTOOL_GGSO: case ETHTOOL_SGSO: return NETIF_F_GSO; case ETHTOOL_GGRO: case ETHTOOL_SGRO: return NETIF_F_GRO; default: BUG(); } } static void *__ethtool_get_one_feature_actor(struct net_device *dev, u32 ethcmd) { const struct ethtool_ops *ops = dev->ethtool_ops; if (!ops) return NULL; switch (ethcmd) { case ETHTOOL_GTXCSUM: return ops->get_tx_csum; case ETHTOOL_GRXCSUM: return ops->get_rx_csum; case ETHTOOL_SSG: return ops->get_sg; case ETHTOOL_STSO: return ops->get_tso; case ETHTOOL_SUFO: return ops->get_ufo; default: return NULL; } } static u32 __ethtool_get_rx_csum_oldbug(struct net_device *dev) { return !!(dev->features & NETIF_F_ALL_CSUM); } static int ethtool_get_one_feature(struct net_device *dev, char __user *useraddr, u32 ethcmd) { netdev_features_t mask = ethtool_get_feature_mask(ethcmd); struct ethtool_value edata = { .cmd = ethcmd, .data = !!(dev->features & mask), }; /* compatibility with discrete get_ ops */ if (!(dev->hw_features & mask)) { u32 (*actor)(struct net_device *); actor = __ethtool_get_one_feature_actor(dev, ethcmd); /* bug compatibility with old get_rx_csum */ if (ethcmd == ETHTOOL_GRXCSUM && !actor) actor = __ethtool_get_rx_csum_oldbug; if (actor) edata.data = actor(dev); } if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; } static int __ethtool_set_tx_csum(struct net_device *dev, u32 data); static int __ethtool_set_rx_csum(struct net_device *dev, u32 data); static int __ethtool_set_sg(struct net_device *dev, u32 data); static int __ethtool_set_tso(struct net_device *dev, u32 data); static int __ethtool_set_ufo(struct net_device *dev, u32 data); static int ethtool_set_one_feature(struct net_device *dev, void __user *useraddr, u32 ethcmd) { struct ethtool_value edata; netdev_features_t mask; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; mask = ethtool_get_feature_mask(ethcmd); mask &= dev->hw_features; if (mask) { if (edata.data) dev->wanted_features |= mask; else dev->wanted_features &= ~mask; netdev_update_features(dev); return 0; } /* Driver is not converted to ndo_fix_features or does not * support changing this offload. In the latter case it won't * have corresponding ethtool_ops field set. * * Following part is to be removed after all drivers advertise * their changeable features in netdev->hw_features and stop * using discrete offload setting ops. */ switch (ethcmd) { case ETHTOOL_STXCSUM: return __ethtool_set_tx_csum(dev, edata.data); case ETHTOOL_SRXCSUM: return __ethtool_set_rx_csum(dev, edata.data); case ETHTOOL_SSG: return __ethtool_set_sg(dev, edata.data); case ETHTOOL_STSO: return __ethtool_set_tso(dev, edata.data); case ETHTOOL_SUFO: return __ethtool_set_ufo(dev, edata.data); default: return -EOPNOTSUPP; } } int __ethtool_set_flags(struct net_device *dev, u32 data) { u32 changed; if (data & ~flags_dup_features) return -EINVAL; /* legacy set_flags() op */ if (dev->ethtool_ops->set_flags) { if (unlikely(dev->hw_features & flags_dup_features)) netdev_warn(dev, "driver BUG: mixed hw_features and set_flags()\n"); return dev->ethtool_ops->set_flags(dev, data); } /* allow changing only bits set in hw_features */ changed = (data ^ dev->wanted_features) & flags_dup_features; if (changed & ~dev->hw_features) return (changed & dev->hw_features) ? -EINVAL : -EOPNOTSUPP; dev->wanted_features = (dev->wanted_features & ~changed) | data; netdev_update_features(dev); return 0; } static int ethtool_get_settings(struct net_device *dev, void __user *useraddr) { struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET }; int err; if (!dev->ethtool_ops->get_settings) return -EOPNOTSUPP; err = dev->ethtool_ops->get_settings(dev, &cmd); if (err < 0) return err; if (copy_to_user(useraddr, &cmd, sizeof(cmd))) return -EFAULT; return 0; } static int ethtool_set_settings(struct net_device *dev, void __user *useraddr) { struct ethtool_cmd cmd; if (!dev->ethtool_ops->set_settings) return -EOPNOTSUPP; if (copy_from_user(&cmd, useraddr, sizeof(cmd))) return -EFAULT; return dev->ethtool_ops->set_settings(dev, &cmd); } static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr) { struct ethtool_drvinfo info; const struct ethtool_ops *ops = dev->ethtool_ops; memset(&info, 0, sizeof(info)); info.cmd = ETHTOOL_GDRVINFO; if (ops && ops->get_drvinfo) { ops->get_drvinfo(dev, &info); } else if (dev->dev.parent && dev->dev.parent->driver) { strlcpy(info.bus_info, dev_name(dev->dev.parent), sizeof(info.bus_info)); strlcpy(info.driver, dev->dev.parent->driver->name, sizeof(info.driver)); } else { return -EOPNOTSUPP; } /* * this method of obtaining string set info is deprecated; * Use ETHTOOL_GSSET_INFO instead. */ if (ops && ops->get_sset_count) { int rc; rc = ops->get_sset_count(dev, ETH_SS_TEST); if (rc >= 0) info.testinfo_len = rc; rc = ops->get_sset_count(dev, ETH_SS_STATS); if (rc >= 0) info.n_stats = rc; rc = ops->get_sset_count(dev, ETH_SS_PRIV_FLAGS); if (rc >= 0) info.n_priv_flags = rc; } if (ops && ops->get_regs_len) info.regdump_len = ops->get_regs_len(dev); if (ops && ops->get_eeprom_len) info.eedump_len = ops->get_eeprom_len(dev); if (copy_to_user(useraddr, &info, sizeof(info))) return -EFAULT; return 0; } static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, void __user *useraddr) { struct ethtool_sset_info info; u64 sset_mask; int i, idx = 0, n_bits = 0, ret, rc; u32 *info_buf = NULL; if (copy_from_user(&info, useraddr, sizeof(info))) return -EFAULT; /* store copy of mask, because we zero struct later on */ sset_mask = info.sset_mask; if (!sset_mask) return 0; /* calculate size of return buffer */ n_bits = hweight64(sset_mask); memset(&info, 0, sizeof(info)); info.cmd = ETHTOOL_GSSET_INFO; info_buf = kzalloc(n_bits * sizeof(u32), GFP_USER); if (!info_buf) return -ENOMEM; /* * fill return buffer based on input bitmask and successful * get_sset_count return */ for (i = 0; i < 64; i++) { if (!(sset_mask & (1ULL << i))) continue; rc = __ethtool_get_sset_count(dev, i); if (rc >= 0) { info.sset_mask |= (1ULL << i); info_buf[idx++] = rc; } } ret = -EFAULT; if (copy_to_user(useraddr, &info, sizeof(info))) goto out; useraddr += offsetof(struct ethtool_sset_info, data); if (copy_to_user(useraddr, info_buf, idx * sizeof(u32))) goto out; ret = 0; out: kfree(info_buf); return ret; } static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, u32 cmd, void __user *useraddr) { struct ethtool_rxnfc info; size_t info_size = sizeof(info); if (!dev->ethtool_ops->set_rxnfc) return -EOPNOTSUPP; /* struct ethtool_rxnfc was originally defined for * ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data * members. User-space might still be using that * definition. */ if (cmd == ETHTOOL_SRXFH) info_size = (offsetof(struct ethtool_rxnfc, data) + sizeof(info.data)); if (copy_from_user(&info, useraddr, info_size)) return -EFAULT; return dev->ethtool_ops->set_rxnfc(dev, &info); } static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, u32 cmd, void __user *useraddr) { struct ethtool_rxnfc info; size_t info_size = sizeof(info); const struct ethtool_ops *ops = dev->ethtool_ops; int ret; void *rule_buf = NULL; if (!ops->get_rxnfc) return -EOPNOTSUPP; /* struct ethtool_rxnfc was originally defined for * ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data * members. User-space might still be using that * definition. */ if (cmd == ETHTOOL_GRXFH) info_size = (offsetof(struct ethtool_rxnfc, data) + sizeof(info.data)); if (copy_from_user(&info, useraddr, info_size)) return -EFAULT; if (info.cmd == ETHTOOL_GRXCLSRLALL) { if (info.rule_cnt > 0) { if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) rule_buf = kzalloc(info.rule_cnt * sizeof(u32), GFP_USER); if (!rule_buf) return -ENOMEM; } } ret = ops->get_rxnfc(dev, &info, rule_buf); if (ret < 0) goto err_out; ret = -EFAULT; if (copy_to_user(useraddr, &info, info_size)) goto err_out; if (rule_buf) { useraddr += offsetof(struct ethtool_rxnfc, rule_locs); if (copy_to_user(useraddr, rule_buf, info.rule_cnt * sizeof(u32))) goto err_out; } ret = 0; err_out: kfree(rule_buf); return ret; } static noinline_for_stack int ethtool_get_rxfh_indir(struct net_device *dev, void __user *useraddr) { struct ethtool_rxfh_indir *indir; u32 table_size; size_t full_size; int ret; if (!dev->ethtool_ops->get_rxfh_indir) return -EOPNOTSUPP; if (copy_from_user(&table_size, useraddr + offsetof(struct ethtool_rxfh_indir, size), sizeof(table_size))) return -EFAULT; if (table_size > (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) return -ENOMEM; full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; indir = kzalloc(full_size, GFP_USER); if (!indir) return -ENOMEM; indir->cmd = ETHTOOL_GRXFHINDIR; indir->size = table_size; ret = dev->ethtool_ops->get_rxfh_indir(dev, indir); if (ret) goto out; if (copy_to_user(useraddr, indir, full_size)) ret = -EFAULT; out: kfree(indir); return ret; } static noinline_for_stack int ethtool_set_rxfh_indir(struct net_device *dev, void __user *useraddr) { struct ethtool_rxfh_indir *indir; u32 table_size; size_t full_size; int ret; if (!dev->ethtool_ops->set_rxfh_indir) return -EOPNOTSUPP; if (copy_from_user(&table_size, useraddr + offsetof(struct ethtool_rxfh_indir, size), sizeof(table_size))) return -EFAULT; if (table_size > (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) return -ENOMEM; full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; indir = kmalloc(full_size, GFP_USER); if (!indir) return -ENOMEM; if (copy_from_user(indir, useraddr, full_size)) { ret = -EFAULT; goto out; } ret = dev->ethtool_ops->set_rxfh_indir(dev, indir); out: kfree(indir); return ret; } /* * ethtool does not (or did not) set masks for flow parameters that are * not specified, so if both value and mask are 0 then this must be * treated as equivalent to a mask with all bits set. Implement that * here rather than in drivers. */ static void rx_ntuple_fix_masks(struct ethtool_rx_ntuple_flow_spec *fs) { struct ethtool_tcpip4_spec *entry = &fs->h_u.tcp_ip4_spec; struct ethtool_tcpip4_spec *mask = &fs->m_u.tcp_ip4_spec; if (fs->flow_type != TCP_V4_FLOW && fs->flow_type != UDP_V4_FLOW && fs->flow_type != SCTP_V4_FLOW) return; if (!(entry->ip4src | mask->ip4src)) mask->ip4src = htonl(0xffffffff); if (!(entry->ip4dst | mask->ip4dst)) mask->ip4dst = htonl(0xffffffff); if (!(entry->psrc | mask->psrc)) mask->psrc = htons(0xffff); if (!(entry->pdst | mask->pdst)) mask->pdst = htons(0xffff); if (!(entry->tos | mask->tos)) mask->tos = 0xff; if (!(fs->vlan_tag | fs->vlan_tag_mask)) fs->vlan_tag_mask = 0xffff; if (!(fs->data | fs->data_mask)) fs->data_mask = 0xffffffffffffffffULL; } static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, void __user *useraddr) { struct ethtool_rx_ntuple cmd; const struct ethtool_ops *ops = dev->ethtool_ops; if (!(dev->features & NETIF_F_NTUPLE)) return -EINVAL; if (copy_from_user(&cmd, useraddr, sizeof(cmd))) return -EFAULT; rx_ntuple_fix_masks(&cmd.fs); return ops->set_rx_ntuple(dev, &cmd); } static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) { struct ethtool_regs regs; const struct ethtool_ops *ops = dev->ethtool_ops; void *regbuf; int reglen, ret; if (!ops->get_regs || !ops->get_regs_len) return -EOPNOTSUPP; if (copy_from_user(&regs, useraddr, sizeof(regs))) return -EFAULT; reglen = ops->get_regs_len(dev); if (regs.len > reglen) regs.len = reglen; regbuf = vzalloc(reglen); /* HTC_WIFI_START */ if (reglen && !regbuf) /* HTC_WIFI_END */ return -ENOMEM; ops->get_regs(dev, &regs, regbuf); ret = -EFAULT; if (copy_to_user(useraddr, &regs, sizeof(regs))) goto out; useraddr += offsetof(struct ethtool_regs, data); /* HTC_WIFI_START */ if (regbuf && copy_to_user(useraddr, regbuf, regs.len)) /* HTC_WIFI_END */ goto out; ret = 0; out: vfree(regbuf); return ret; } static int ethtool_reset(struct net_device *dev, char __user *useraddr) { struct ethtool_value reset; int ret; if (!dev->ethtool_ops->reset) return -EOPNOTSUPP; if (copy_from_user(&reset, useraddr, sizeof(reset))) return -EFAULT; ret = dev->ethtool_ops->reset(dev, &reset.data); if (ret) return ret; if (copy_to_user(useraddr, &reset, sizeof(reset))) return -EFAULT; return 0; } static int ethtool_get_wol(struct net_device *dev, char __user *useraddr) { struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; if (!dev->ethtool_ops->get_wol) return -EOPNOTSUPP; dev->ethtool_ops->get_wol(dev, &wol); if (copy_to_user(useraddr, &wol, sizeof(wol))) return -EFAULT; return 0; } static int ethtool_set_wol(struct net_device *dev, char __user *useraddr) { struct ethtool_wolinfo wol; if (!dev->ethtool_ops->set_wol) return -EOPNOTSUPP; if (copy_from_user(&wol, useraddr, sizeof(wol))) return -EFAULT; return dev->ethtool_ops->set_wol(dev, &wol); } static int ethtool_nway_reset(struct net_device *dev) { if (!dev->ethtool_ops->nway_reset) return -EOPNOTSUPP; return dev->ethtool_ops->nway_reset(dev); } static int ethtool_get_link(struct net_device *dev, char __user *useraddr) { struct ethtool_value edata = { .cmd = ETHTOOL_GLINK }; if (!dev->ethtool_ops->get_link) return -EOPNOTSUPP; edata.data = netif_running(dev) && dev->ethtool_ops->get_link(dev); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; } static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr) { struct ethtool_eeprom eeprom; const struct ethtool_ops *ops = dev->ethtool_ops; void __user *userbuf = useraddr + sizeof(eeprom); u32 bytes_remaining; u8 *data; int ret = 0; if (!ops->get_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; /* Check for wrap and zero */ if (eeprom.offset + eeprom.len <= eeprom.offset) return -EINVAL; /* Check for exceeding total eeprom len */ if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; data = kmalloc(PAGE_SIZE, GFP_USER); if (!data) return -ENOMEM; bytes_remaining = eeprom.len; while (bytes_remaining > 0) { eeprom.len = min(bytes_remaining, (u32)PAGE_SIZE); ret = ops->get_eeprom(dev, &eeprom, data); if (ret) break; if (copy_to_user(userbuf, data, eeprom.len)) { ret = -EFAULT; break; } userbuf += eeprom.len; eeprom.offset += eeprom.len; bytes_remaining -= eeprom.len; } eeprom.len = userbuf - (useraddr + sizeof(eeprom)); eeprom.offset -= eeprom.len; if (copy_to_user(useraddr, &eeprom, sizeof(eeprom))) ret = -EFAULT; kfree(data); return ret; } static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) { struct ethtool_eeprom eeprom; const struct ethtool_ops *ops = dev->ethtool_ops; void __user *userbuf = useraddr + sizeof(eeprom); u32 bytes_remaining; u8 *data; int ret = 0; if (!ops->set_eeprom || !ops->get_eeprom_len) return -EOPNOTSUPP; if (copy_from_user(&eeprom, useraddr, sizeof(eeprom))) return -EFAULT; /* Check for wrap and zero */ if (eeprom.offset + eeprom.len <= eeprom.offset) return -EINVAL; /* Check for exceeding total eeprom len */ if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev)) return -EINVAL; data = kmalloc(PAGE_SIZE, GFP_USER); if (!data) return -ENOMEM; bytes_remaining = eeprom.len; while (bytes_remaining > 0) { eeprom.len = min(bytes_remaining, (u32)PAGE_SIZE); if (copy_from_user(data, userbuf, eeprom.len)) { ret = -EFAULT; break; } ret = ops->set_eeprom(dev, &eeprom, data); if (ret) break; userbuf += eeprom.len; eeprom.offset += eeprom.len; bytes_remaining -= eeprom.len; } kfree(data); return ret; } static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) { struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; if (!dev->ethtool_ops->get_coalesce) return -EOPNOTSUPP; dev->ethtool_ops->get_coalesce(dev, &coalesce); if (copy_to_user(useraddr, &coalesce, sizeof(coalesce))) return -EFAULT; return 0; } static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) { struct ethtool_coalesce coalesce; if (!dev->ethtool_ops->set_coalesce) return -EOPNOTSUPP; if (copy_from_user(&coalesce, useraddr, sizeof(coalesce))) return -EFAULT; return dev->ethtool_ops->set_coalesce(dev, &coalesce); } static int ethtool_get_ringparam(struct net_device *dev, void __user *useraddr) { struct ethtool_ringparam ringparam = { .cmd = ETHTOOL_GRINGPARAM }; if (!dev->ethtool_ops->get_ringparam) return -EOPNOTSUPP; dev->ethtool_ops->get_ringparam(dev, &ringparam); if (copy_to_user(useraddr, &ringparam, sizeof(ringparam))) return -EFAULT; return 0; } static int ethtool_set_ringparam(struct net_device *dev, void __user *useraddr) { struct ethtool_ringparam ringparam; if (!dev->ethtool_ops->set_ringparam) return -EOPNOTSUPP; if (copy_from_user(&ringparam, useraddr, sizeof(ringparam))) return -EFAULT; return dev->ethtool_ops->set_ringparam(dev, &ringparam); } static noinline_for_stack int ethtool_get_channels(struct net_device *dev, void __user *useraddr) { struct ethtool_channels channels = { .cmd = ETHTOOL_GCHANNELS }; if (!dev->ethtool_ops->get_channels) return -EOPNOTSUPP; dev->ethtool_ops->get_channels(dev, &channels); if (copy_to_user(useraddr, &channels, sizeof(channels))) return -EFAULT; return 0; } static noinline_for_stack int ethtool_set_channels(struct net_device *dev, void __user *useraddr) { struct ethtool_channels channels; if (!dev->ethtool_ops->set_channels) return -EOPNOTSUPP; if (copy_from_user(&channels, useraddr, sizeof(channels))) return -EFAULT; return dev->ethtool_ops->set_channels(dev, &channels); } static int ethtool_get_pauseparam(struct net_device *dev, void __user *useraddr) { struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM }; if (!dev->ethtool_ops->get_pauseparam) return -EOPNOTSUPP; dev->ethtool_ops->get_pauseparam(dev, &pauseparam); if (copy_to_user(useraddr, &pauseparam, sizeof(pauseparam))) return -EFAULT; return 0; } static int ethtool_set_pauseparam(struct net_device *dev, void __user *useraddr) { struct ethtool_pauseparam pauseparam; if (!dev->ethtool_ops->set_pauseparam) return -EOPNOTSUPP; if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam))) return -EFAULT; return dev->ethtool_ops->set_pauseparam(dev, &pauseparam); } static int __ethtool_set_sg(struct net_device *dev, u32 data) { int err; if (!dev->ethtool_ops->set_sg) return -EOPNOTSUPP; if (data && !(dev->features & NETIF_F_ALL_CSUM)) return -EINVAL; if (!data && dev->ethtool_ops->set_tso) { err = dev->ethtool_ops->set_tso(dev, 0); if (err) return err; } if (!data && dev->ethtool_ops->set_ufo) { err = dev->ethtool_ops->set_ufo(dev, 0); if (err) return err; } return dev->ethtool_ops->set_sg(dev, data); } static int __ethtool_set_tx_csum(struct net_device *dev, u32 data) { int err; if (!dev->ethtool_ops->set_tx_csum) return -EOPNOTSUPP; if (!data && dev->ethtool_ops->set_sg) { err = __ethtool_set_sg(dev, 0); if (err) return err; } return dev->ethtool_ops->set_tx_csum(dev, data); } static int __ethtool_set_rx_csum(struct net_device *dev, u32 data) { if (!dev->ethtool_ops->set_rx_csum) return -EOPNOTSUPP; if (!data) dev->features &= ~NETIF_F_GRO; return dev->ethtool_ops->set_rx_csum(dev, data); } static int __ethtool_set_tso(struct net_device *dev, u32 data) { if (!dev->ethtool_ops->set_tso) return -EOPNOTSUPP; if (data && !(dev->features & NETIF_F_SG)) return -EINVAL; return dev->ethtool_ops->set_tso(dev, data); } static int __ethtool_set_ufo(struct net_device *dev, u32 data) { if (!dev->ethtool_ops->set_ufo) return -EOPNOTSUPP; if (data && !(dev->features & NETIF_F_SG)) return -EINVAL; if (data && !((dev->features & NETIF_F_GEN_CSUM) || (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) return -EINVAL; return dev->ethtool_ops->set_ufo(dev, data); } static int ethtool_self_test(struct net_device *dev, char __user *useraddr) { struct ethtool_test test; const struct ethtool_ops *ops = dev->ethtool_ops; u64 *data; int ret, test_len; if (!ops->self_test || !ops->get_sset_count) return -EOPNOTSUPP; test_len = ops->get_sset_count(dev, ETH_SS_TEST); if (test_len < 0) return test_len; WARN_ON(test_len == 0); if (copy_from_user(&test, useraddr, sizeof(test))) return -EFAULT; test.len = test_len; data = kmalloc(test_len * sizeof(u64), GFP_USER); if (!data) return -ENOMEM; ops->self_test(dev, &test, data); ret = -EFAULT; if (copy_to_user(useraddr, &test, sizeof(test))) goto out; useraddr += sizeof(test); if (copy_to_user(useraddr, data, test.len * sizeof(u64))) goto out; ret = 0; out: kfree(data); return ret; } static int ethtool_get_strings(struct net_device *dev, void __user *useraddr) { struct ethtool_gstrings gstrings; u8 *data; int ret; if (copy_from_user(&gstrings, useraddr, sizeof(gstrings))) return -EFAULT; ret = __ethtool_get_sset_count(dev, gstrings.string_set); if (ret < 0) return ret; gstrings.len = ret; data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); if (!data) return -ENOMEM; __ethtool_get_strings(dev, gstrings.string_set, data); ret = -EFAULT; if (copy_to_user(useraddr, &gstrings, sizeof(gstrings))) goto out; useraddr += sizeof(gstrings); if (copy_to_user(useraddr, data, gstrings.len * ETH_GSTRING_LEN)) goto out; ret = 0; out: kfree(data); return ret; } static int ethtool_phys_id(struct net_device *dev, void __user *useraddr) { struct ethtool_value id; static bool busy; int rc; if (!dev->ethtool_ops->set_phys_id && !dev->ethtool_ops->phys_id) return -EOPNOTSUPP; if (busy) return -EBUSY; if (copy_from_user(&id, useraddr, sizeof(id))) return -EFAULT; if (!dev->ethtool_ops->set_phys_id) /* Do it the old way */ return dev->ethtool_ops->phys_id(dev, id.data); rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ACTIVE); if (rc && rc != -EINVAL) return rc; /* Drop the RTNL lock while waiting, but prevent reentry or * removal of the device. */ busy = true; dev_hold(dev); rtnl_unlock(); if (rc == 0) { /* Driver will handle this itself */ schedule_timeout_interruptible( id.data ? id.data : MAX_SCHEDULE_TIMEOUT); } else { /* Driver expects to be called periodically */ do { rtnl_lock(); rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ON); rtnl_unlock(); if (rc) break; schedule_timeout_interruptible(HZ / 2); rtnl_lock(); rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_OFF); rtnl_unlock(); if (rc) break; schedule_timeout_interruptible(HZ / 2); } while (!signal_pending(current) && (id.data == 0 || --id.data != 0)); } rtnl_lock(); dev_put(dev); busy = false; (void)dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_INACTIVE); return rc; } static int ethtool_get_stats(struct net_device *dev, void __user *useraddr) { struct ethtool_stats stats; const struct ethtool_ops *ops = dev->ethtool_ops; u64 *data; int ret, n_stats; if (!ops->get_ethtool_stats || !ops->get_sset_count) return -EOPNOTSUPP; n_stats = ops->get_sset_count(dev, ETH_SS_STATS); if (n_stats < 0) return n_stats; WARN_ON(n_stats == 0); if (copy_from_user(&stats, useraddr, sizeof(stats))) return -EFAULT; stats.n_stats = n_stats; data = kmalloc(n_stats * sizeof(u64), GFP_USER); if (!data) return -ENOMEM; ops->get_ethtool_stats(dev, &stats, data); ret = -EFAULT; if (copy_to_user(useraddr, &stats, sizeof(stats))) goto out; useraddr += sizeof(stats); if (copy_to_user(useraddr, data, stats.n_stats * sizeof(u64))) goto out; ret = 0; out: kfree(data); return ret; } static int ethtool_get_perm_addr(struct net_device *dev, void __user *useraddr) { struct ethtool_perm_addr epaddr; if (copy_from_user(&epaddr, useraddr, sizeof(epaddr))) return -EFAULT; if (epaddr.size < dev->addr_len) return -ETOOSMALL; epaddr.size = dev->addr_len; if (copy_to_user(useraddr, &epaddr, sizeof(epaddr))) return -EFAULT; useraddr += sizeof(epaddr); if (copy_to_user(useraddr, dev->perm_addr, epaddr.size)) return -EFAULT; return 0; } static int ethtool_get_value(struct net_device *dev, char __user *useraddr, u32 cmd, u32 (*actor)(struct net_device *)) { struct ethtool_value edata = { .cmd = cmd }; if (!actor) return -EOPNOTSUPP; edata.data = actor(dev); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; } static int ethtool_set_value_void(struct net_device *dev, char __user *useraddr, void (*actor)(struct net_device *, u32)) { struct ethtool_value edata; if (!actor) return -EOPNOTSUPP; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; actor(dev, edata.data); return 0; } static int ethtool_set_value(struct net_device *dev, char __user *useraddr, int (*actor)(struct net_device *, u32)) { struct ethtool_value edata; if (!actor) return -EOPNOTSUPP; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; return actor(dev, edata.data); } static noinline_for_stack int ethtool_flash_device(struct net_device *dev, char __user *useraddr) { struct ethtool_flash efl; if (copy_from_user(&efl, useraddr, sizeof(efl))) return -EFAULT; if (!dev->ethtool_ops->flash_device) return -EOPNOTSUPP; return dev->ethtool_ops->flash_device(dev, &efl); } /* The main entry point in this file. Called from net/core/dev.c */ int dev_ethtool(struct net *net, struct ifreq *ifr) { struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); void __user *useraddr = ifr->ifr_data; u32 ethcmd; int rc; u32 old_features; if (!dev || !netif_device_present(dev)) return -ENODEV; if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd))) return -EFAULT; if (!dev->ethtool_ops) { /* ETHTOOL_GDRVINFO does not require any driver support. * It is also unprivileged and does not change anything, * so we can take a shortcut to it. */ if (ethcmd == ETHTOOL_GDRVINFO) return ethtool_get_drvinfo(dev, useraddr); else return -EOPNOTSUPP; } /* Allow some commands to be done by anyone */ switch (ethcmd) { case ETHTOOL_GSET: case ETHTOOL_GDRVINFO: case ETHTOOL_GMSGLVL: case ETHTOOL_GCOALESCE: case ETHTOOL_GRINGPARAM: case ETHTOOL_GPAUSEPARAM: case ETHTOOL_GRXCSUM: case ETHTOOL_GTXCSUM: case ETHTOOL_GSG: case ETHTOOL_GSTRINGS: case ETHTOOL_GTSO: case ETHTOOL_GPERMADDR: case ETHTOOL_GUFO: case ETHTOOL_GGSO: case ETHTOOL_GGRO: case ETHTOOL_GFLAGS: case ETHTOOL_GPFLAGS: case ETHTOOL_GRXFH: case ETHTOOL_GRXRINGS: case ETHTOOL_GRXCLSRLCNT: case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRLALL: case ETHTOOL_GFEATURES: break; default: if (!capable(CAP_NET_ADMIN)) return -EPERM; } if (dev->ethtool_ops->begin) { rc = dev->ethtool_ops->begin(dev); if (rc < 0) return rc; } old_features = dev->features; switch (ethcmd) { case ETHTOOL_GSET: rc = ethtool_get_settings(dev, useraddr); break; case ETHTOOL_SSET: rc = ethtool_set_settings(dev, useraddr); break; case ETHTOOL_GDRVINFO: rc = ethtool_get_drvinfo(dev, useraddr); break; case ETHTOOL_GREGS: rc = ethtool_get_regs(dev, useraddr); break; case ETHTOOL_GWOL: rc = ethtool_get_wol(dev, useraddr); break; case ETHTOOL_SWOL: rc = ethtool_set_wol(dev, useraddr); break; case ETHTOOL_GMSGLVL: rc = ethtool_get_value(dev, useraddr, ethcmd, dev->ethtool_ops->get_msglevel); break; case ETHTOOL_SMSGLVL: rc = ethtool_set_value_void(dev, useraddr, dev->ethtool_ops->set_msglevel); break; case ETHTOOL_NWAY_RST: rc = ethtool_nway_reset(dev); break; case ETHTOOL_GLINK: rc = ethtool_get_link(dev, useraddr); break; case ETHTOOL_GEEPROM: rc = ethtool_get_eeprom(dev, useraddr); break; case ETHTOOL_SEEPROM: rc = ethtool_set_eeprom(dev, useraddr); break; case ETHTOOL_GCOALESCE: rc = ethtool_get_coalesce(dev, useraddr); break; case ETHTOOL_SCOALESCE: rc = ethtool_set_coalesce(dev, useraddr); break; case ETHTOOL_GRINGPARAM: rc = ethtool_get_ringparam(dev, useraddr); break; case ETHTOOL_SRINGPARAM: rc = ethtool_set_ringparam(dev, useraddr); break; case ETHTOOL_GPAUSEPARAM: rc = ethtool_get_pauseparam(dev, useraddr); break; case ETHTOOL_SPAUSEPARAM: rc = ethtool_set_pauseparam(dev, useraddr); break; case ETHTOOL_TEST: rc = ethtool_self_test(dev, useraddr); break; case ETHTOOL_GSTRINGS: rc = ethtool_get_strings(dev, useraddr); break; case ETHTOOL_PHYS_ID: rc = ethtool_phys_id(dev, useraddr); break; case ETHTOOL_GSTATS: rc = ethtool_get_stats(dev, useraddr); break; case ETHTOOL_GPERMADDR: rc = ethtool_get_perm_addr(dev, useraddr); break; case ETHTOOL_GFLAGS: rc = ethtool_get_value(dev, useraddr, ethcmd, (dev->ethtool_ops->get_flags ? dev->ethtool_ops->get_flags : ethtool_op_get_flags)); break; case ETHTOOL_SFLAGS: rc = ethtool_set_value(dev, useraddr, __ethtool_set_flags); break; case ETHTOOL_GPFLAGS: rc = ethtool_get_value(dev, useraddr, ethcmd, dev->ethtool_ops->get_priv_flags); break; case ETHTOOL_SPFLAGS: rc = ethtool_set_value(dev, useraddr, dev->ethtool_ops->set_priv_flags); break; case ETHTOOL_GRXFH: case ETHTOOL_GRXRINGS: case ETHTOOL_GRXCLSRLCNT: case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRLALL: rc = ethtool_get_rxnfc(dev, ethcmd, useraddr); break; case ETHTOOL_SRXFH: case ETHTOOL_SRXCLSRLDEL: case ETHTOOL_SRXCLSRLINS: rc = ethtool_set_rxnfc(dev, ethcmd, useraddr); break; case ETHTOOL_FLASHDEV: rc = ethtool_flash_device(dev, useraddr); break; case ETHTOOL_RESET: rc = ethtool_reset(dev, useraddr); break; case ETHTOOL_SRXNTUPLE: rc = ethtool_set_rx_ntuple(dev, useraddr); break; case ETHTOOL_GSSET_INFO: rc = ethtool_get_sset_info(dev, useraddr); break; case ETHTOOL_GRXFHINDIR: rc = ethtool_get_rxfh_indir(dev, useraddr); break; case ETHTOOL_SRXFHINDIR: rc = ethtool_set_rxfh_indir(dev, useraddr); break; case ETHTOOL_GFEATURES: rc = ethtool_get_features(dev, useraddr); break; case ETHTOOL_SFEATURES: rc = ethtool_set_features(dev, useraddr); break; case ETHTOOL_GTXCSUM: case ETHTOOL_GRXCSUM: case ETHTOOL_GSG: case ETHTOOL_GTSO: case ETHTOOL_GUFO: case ETHTOOL_GGSO: case ETHTOOL_GGRO: rc = ethtool_get_one_feature(dev, useraddr, ethcmd); break; case ETHTOOL_STXCSUM: case ETHTOOL_SRXCSUM: case ETHTOOL_SSG: case ETHTOOL_STSO: case ETHTOOL_SUFO: case ETHTOOL_SGSO: case ETHTOOL_SGRO: rc = ethtool_set_one_feature(dev, useraddr, ethcmd); break; case ETHTOOL_GCHANNELS: rc = ethtool_get_channels(dev, useraddr); break; case ETHTOOL_SCHANNELS: rc = ethtool_set_channels(dev, useraddr); break; default: rc = -EOPNOTSUPP; } if (dev->ethtool_ops->complete) dev->ethtool_ops->complete(dev); if (old_features != dev->features) netdev_features_change(dev); return rc; }
kozmikkick/eternityprj-kernel-endeavoru-128
net/core/ethtool.c
C
gpl-2.0
43,324
[ 30522, 1013, 1008, 1008, 5658, 1013, 4563, 1013, 3802, 11039, 13669, 1012, 1039, 1011, 3802, 11039, 13669, 25941, 19646, 28213, 1008, 9385, 1006, 1039, 1007, 2494, 5487, 23926, 1026, 5487, 1030, 19863, 1012, 1039, 2595, 1028, 1008, 1008, 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...
/* * APIC driver for "bigsmp" xAPIC machines with more than 8 virtual CPUs. * * Drives the local APIC in "clustered mode". */ #include <linux/threads.h> #include <linux/cpumask.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/dmi.h> #include <linux/smp.h> #include <asm/apicdef.h> #include <asm/fixmap.h> #include <asm/mpspec.h> #include <asm/apic.h> #include <asm/ipi.h> static unsigned bigsmp_get_apic_id(unsigned long x) { return (x >> 24) & 0xFF; } static int bigsmp_apic_id_registered(void) { return 1; } static const struct cpumask *bigsmp_target_cpus(void) { #ifdef CONFIG_SMP return cpu_online_mask; #else return cpumask_of(0); #endif } static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid) { return 0; } static unsigned long bigsmp_check_apicid_present(int bit) { return 1; } static int bigsmp_early_logical_apicid(int cpu) { /* on bigsmp, logical apicid is the same as physical */ return early_per_cpu(x86_cpu_to_apicid, cpu); } static inline unsigned long calculate_ldr(int cpu) { unsigned long val, id; val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; id = per_cpu(x86_bios_cpu_apicid, cpu); val |= SET_APIC_LOGICAL_ID(id); return val; } /* * Set up the logical destination ID. * * Intel recommends to set DFR, LDR and TPR before enabling * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ static void bigsmp_init_apic_ldr(void) { unsigned long val; int cpu = smp_processor_id(); apic_write(APIC_DFR, APIC_DFR_FLAT); val = calculate_ldr(cpu); apic_write(APIC_LDR, val); } static void bigsmp_setup_apic_routing(void) { printk(KERN_INFO "Enabling APIC mode: Physflat. Using %d I/O APICs\n", nr_ioapics); } static int bigsmp_cpu_present_to_apicid(int mps_cpu) { if (mps_cpu < nr_cpu_ids) return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu); return BAD_APICID; } static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) { /* For clustered we don't have a good way to do this yet - hack */ physids_promote(0xFFL, retmap); } static int bigsmp_check_phys_apicid_present(int phys_apicid) { return 1; } /* As we are using single CPU as destination, pick only one CPU here */ static unsigned int bigsmp_cpu_mask_to_apicid(const struct cpumask *cpumask) { int cpu = cpumask_first(cpumask); if (cpu < nr_cpu_ids) return cpu_physical_id(cpu); return BAD_APICID; } static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask, const struct cpumask *andmask) { int cpu; /* * We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ for_each_cpu_and(cpu, cpumask, andmask) { if (cpumask_test_cpu(cpu, cpu_online_mask)) return cpu_physical_id(cpu); } return BAD_APICID; } static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb) { return cpuid_apic >> index_msb; } static inline void bigsmp_send_IPI_mask(const struct cpumask *mask, int vector) { default_send_IPI_mask_sequence_phys(mask, vector); } static void bigsmp_send_IPI_allbutself(int vector) { default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector); } static void bigsmp_send_IPI_all(int vector) { bigsmp_send_IPI_mask(cpu_online_mask, vector); } static int dmi_bigsmp; /* can be set by dmi scanners */ static int force_bigsmp_apic(const struct dmi_system_id *d) { printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); dmi_bigsmp = 1; return 0; } static const struct dmi_system_id bigsmp_dmi_table[] = { { force_bigsmp_apic, "HP ProLiant DL760 G2", { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), DMI_MATCH(DMI_BIOS_VERSION, "P44-"), } }, { force_bigsmp_apic, "HP ProLiant DL740", { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), DMI_MATCH(DMI_BIOS_VERSION, "P47-"), } }, { force_bigsmp_apic, "IBM x260 / x366 / x460", { DMI_MATCH(DMI_BIOS_VENDOR, "IBM"), DMI_MATCH(DMI_BIOS_VERSION, "-[ZT"), } }, { force_bigsmp_apic, "IBM x3800 / x3850 / x3950", { DMI_MATCH(DMI_BIOS_VENDOR, "IBM"), DMI_MATCH(DMI_BIOS_VERSION, "-[ZU"), } }, { force_bigsmp_apic, "IBM x3800 / x3850 / x3950", { DMI_MATCH(DMI_BIOS_VENDOR, "IBM"), DMI_MATCH(DMI_BIOS_VERSION, "-[ZS"), } }, { force_bigsmp_apic, "IBM x3850 M2 / x3950 M2", { DMI_MATCH(DMI_BIOS_VENDOR, "IBM"), DMI_MATCH(DMI_BIOS_VERSION, "-[A3"), } }, { } /* NULL entry stops DMI scanning */ }; static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask) { cpumask_clear(retmask); cpumask_set_cpu(cpu, retmask); } static int probe_bigsmp(void) { if (def_to_bigsmp) dmi_bigsmp = 1; else dmi_check_system(bigsmp_dmi_table); return dmi_bigsmp; } static struct apic apic_bigsmp = { .name = "bigsmp", .probe = probe_bigsmp, .acpi_madt_oem_check = NULL, .apic_id_registered = bigsmp_apic_id_registered, .irq_delivery_mode = dest_Fixed, /* phys delivery to target CPU: */ .irq_dest_mode = 0, .target_cpus = bigsmp_target_cpus, .disable_esr = 1, .dest_logical = 0, .check_apicid_used = bigsmp_check_apicid_used, .check_apicid_present = bigsmp_check_apicid_present, .vector_allocation_domain = bigsmp_vector_allocation_domain, .init_apic_ldr = bigsmp_init_apic_ldr, .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, .setup_apic_routing = bigsmp_setup_apic_routing, .multi_timer_check = NULL, .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, .apicid_to_cpu_present = physid_set_mask_of_physid, .setup_portio_remap = NULL, .check_phys_apicid_present = bigsmp_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = bigsmp_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = bigsmp_get_apic_id, .set_apic_id = NULL, .apic_id_mask = 0xFF << 24, .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and, .send_IPI_mask = bigsmp_send_IPI_mask, .send_IPI_mask_allbutself = NULL, .send_IPI_allbutself = bigsmp_send_IPI_allbutself, .send_IPI_all = bigsmp_send_IPI_all, .send_IPI_self = default_send_IPI_self, .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = default_wait_for_init_deassert, .smp_callin_clear_local_apic = NULL, .inquire_remote_apic = default_inquire_remote_apic, .read = native_apic_mem_read, .write = native_apic_mem_write, .icr_read = native_apic_icr_read, .icr_write = native_apic_icr_write, .wait_icr_idle = native_apic_wait_icr_idle, .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, .x86_32_early_logical_apicid = bigsmp_early_logical_apicid, }; void __init generic_bigsmp_probe(void) { unsigned int cpu; if (!probe_bigsmp()) return; apic = &apic_bigsmp; for_each_possible_cpu(cpu) { if (early_per_cpu(x86_cpu_to_logical_apicid, cpu) == BAD_APICID) continue; early_per_cpu(x86_cpu_to_logical_apicid, cpu) = bigsmp_early_logical_apicid(cpu); } pr_info("Overriding APIC driver with %s\n", apic_bigsmp.name); } apic_driver(apic_bigsmp);
DirtyDev/DirtyKernel-ANDROID
arch/x86/kernel/apic/bigsmp_32.c
C
gpl-2.0
7,117
[ 30522, 1013, 1008, 1008, 17928, 2278, 4062, 2005, 1000, 2502, 6491, 2361, 1000, 1060, 9331, 2594, 6681, 2007, 2062, 2084, 1022, 7484, 17368, 2015, 1012, 1008, 1008, 9297, 1996, 2334, 17928, 2278, 1999, 1000, 25221, 5549, 1000, 1012, 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...
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using IFramework.Infrastructure; using Unity.Interception.InterceptionBehaviors; using Unity.Interception.PolicyInjection.Pipeline; using MethodInfo = System.Reflection.MethodInfo; namespace IFramework.DependencyInjection.Unity { public abstract class InterceptorBase : IInterceptionBehavior { protected readonly IObjectProvider ObjectProvider; protected InterceptorBase(IObjectProvider objectProvider) { ObjectProvider = objectProvider; } protected virtual IMethodReturn Process(IMethodInvocation invocation, GetNextInterceptionBehaviorDelegate getNext) { return getNext()(invocation, getNext); //在这里执行方法 } protected Type GetTaskResultType(IMethodInvocation invocation) { return (invocation.MethodBase as MethodInfo)?.ReturnType.GetGenericArguments().FirstOrDefault(); } protected static Task<T> ProcessTaskAsync<T>(IMethodInvocation invocation, GetNextInterceptionBehaviorDelegate getNext) { return (Task<T>) getNext()(invocation, getNext).ReturnValue; } protected static TAttribute GetMethodAttribute<TAttribute>(IMethodInvocation invocation, TAttribute defaultValue = null) where TAttribute : Attribute { var method = invocation.MethodBase as MethodInfo; return method.GetCustomAttribute<TAttribute>() ?? method?.DeclaringType?.GetCustomAttribute<TAttribute>() ?? defaultValue; } private static IEnumerable<InterceptorAttribute> GetInterceptorAttributes(MethodInfo methodInfo) { return methodInfo?.GetCustomAttributes(typeof(InterceptorAttribute), true).Cast<InterceptorAttribute>() ?? new InterceptorAttribute[0]; } private static IEnumerable<InterceptorAttribute> GetInterceptorAttributes(Type type) { return type?.GetCustomAttributes(typeof(InterceptorAttribute), true).Cast<InterceptorAttribute>() ?? new InterceptorAttribute[0]; } protected static InterceptorAttribute[] GetInterceptorAttributes(IMethodInvocation invocation) { var methodInfo = invocation.MethodBase as MethodInfo; if (methodInfo == null) { return null; } return GetInterceptorAttributes(methodInfo) .Union(GetInterceptorAttributes(methodInfo.DeclaringType)) .OrderBy(i => i.Order) .ToArray(); } public virtual IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext) { return getNext()(input, getNext); //在这里执行方法 } public IEnumerable<Type> GetRequiredInterfaces() { return Type.EmptyTypes; } public bool WillExecute => true; } public class DefaultInterceptor : InterceptorBase { public DefaultInterceptor(IObjectProvider objectProvider) : base(objectProvider) { } public virtual IMethodReturn InterceptAsync<T>(IMethodInvocation invocation, GetNextInterceptionBehaviorDelegate getNext, InterceptorAttribute[] interceptorAttributes) { Func<Task<T>> processAsyncFunc = () => { var methodReturn = getNext()(invocation, getNext); return methodReturn.ReturnValue as Task<T>; }; foreach (var interceptor in interceptorAttributes) { var func = processAsyncFunc; processAsyncFunc = () => interceptor.ProcessAsync(func, ObjectProvider, invocation.Target.GetType(), invocation.Target, invocation.MethodBase as MethodInfo, invocation.Arguments.Cast<object>().ToArray()); } var returnValue = processAsyncFunc(); return invocation.CreateMethodReturn(returnValue); } public virtual IMethodReturn InterceptAsync(IMethodInvocation invocation, GetNextInterceptionBehaviorDelegate getNext, InterceptorAttribute[] interceptorAttributes) { Func<Task> processAsyncFunc = () => { IMethodReturn methodReturn = getNext()(invocation, getNext); return methodReturn.ReturnValue as Task; }; foreach (var interceptor in interceptorAttributes) { var func = processAsyncFunc; processAsyncFunc = () => interceptor.ProcessAsync(func, ObjectProvider, invocation.Target.GetType(), invocation.Target, invocation.MethodBase as MethodInfo, invocation.Arguments.Cast<object>().ToArray()); } var returnValue = processAsyncFunc(); return invocation.CreateMethodReturn(returnValue); } public override IMethodReturn Invoke(IMethodInvocation invocation, GetNextInterceptionBehaviorDelegate getNext) { var method = invocation.MethodBase as MethodInfo; if (method == null) { throw new Exception($"{invocation.MethodBase} is not MethodInfo!"); } var isTaskResult = typeof(Task).IsAssignableFrom(method.ReturnType); var interceptorAttributes = GetInterceptorAttributes(invocation); if (interceptorAttributes.Length > 0) { if (isTaskResult) { var resultType = GetTaskResultType(invocation); if (resultType == null) { return InterceptAsync(invocation, getNext, interceptorAttributes); } else { return this.InvokeGenericMethod(nameof(InterceptAsync), new object[] {invocation, getNext, interceptorAttributes}, resultType) as IMethodReturn; } } else { if (method.ReturnType != typeof(void)) { Func<dynamic> processFunc = () => Process(invocation, getNext).ReturnValue; foreach (var interceptor in interceptorAttributes) { var func = processFunc; processFunc = () => interceptor.Process(func, ObjectProvider, invocation.Target.GetType(), invocation.Target, invocation.MethodBase as MethodInfo, invocation.Arguments.Cast<object>().ToArray()); } var returnValue = processFunc(); return invocation.CreateMethodReturn(returnValue); } else { IMethodReturn methodReturn = null; Action processFunc = () => { methodReturn = Process(invocation, getNext); }; foreach (var interceptor in interceptorAttributes) { var func = processFunc; processFunc = () => interceptor.Process(func, ObjectProvider, invocation.Target.GetType(), invocation.Target, invocation.MethodBase as MethodInfo, invocation.Arguments.Cast<object>().ToArray()); } processFunc(); return methodReturn ?? invocation.CreateMethodReturn(null); } } } else { return base.Invoke(invocation, getNext); } } } }
IvanZheng/IFramework
Src/iFramework.Plugins/IFramework.DependencyInjection.Unity/DefaultInterceptor.cs
C#
mit
9,369
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 11689, 2075, 1012, 8518, 1025, 2478, 2065, 6444, 7974, 2953, 2243, 1012, 6502, 1025, 2478, 8499, 1012, 17385, 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...
#include <stdlib.h> #include "tick.h" #include "hw_config.h" #include "typedef.h" static volatile U32 internalTicks; #define TICK__DisableInt() NVIC_Config(SysTick_IRQn, TICK_PRIORITY, DISABLE); #define TICK__EnableInt() NVIC_Config(SysTick_IRQn, TICK_PRIORITY, ENABLE); typedef struct _TICK{ struct _TICK* next; void (*pCallback)(U64 currentTimerValue); // function to be called U64 interval; // callback interval U64 currCnt; // current count value }TICK; U64 vtimerValue = 0; TICK* vtimerHead = 0; TICK* vtimerTail = 0; void TICK_Init(void) { SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK); SysTick_Config(SystemCoreClock/1000); //Tick every 1ms internalTicks = 0; vtimerHead = 0; vtimerTail = 0; NVIC_Config(SysTick_IRQn, TICK_PRIORITY, ENABLE); NVIC_SetPriority(SysTick_IRQn, TICK_PRIORITY); } /** * Create a Virtual timer object * @param vtimerCallback this function will be call when the timer expired * @param interval callback interval, base on the rate of VTIMER resolution. Set interval = 0 to disable * @return handle to the newly created VTIMER */ TICK_HANDLE TICK_Create(void (*vtimerCallback)(U64 currentTimerValue), U64 interval) { TICK* newNode = 0; if (vtimerCallback){ newNode = malloc(sizeof(TICK)); if(newNode){ newNode->pCallback = vtimerCallback; newNode->interval = newNode->currCnt = interval; newNode->next = 0; TICK__DisableInt(); if(vtimerTail == 0){ vtimerHead = vtimerTail = newNode; }else{ vtimerTail->next = newNode; vtimerTail = newNode; } TICK__EnableInt(); } } return (TICK_HANDLE) newNode; } /******************************************************************************* * Function Name : SysTick_Handler * Description : This function handles SysTick Handler. * Input : None * Output : None * Return : None *******************************************************************************/ /** * Delete a VTIMER object and release all allocated memory * @param vtimerHandle handle to a VTIMER object * @return 0 if OK */ I8 TICK_Delete(TICK_HANDLE vtimerHandle) { TICK *pTmr, *prev; if (vtimerHandle == 0) return -1; if (vtimerHead == 0) return -1; TICK__DisableInt(); if((pTmr = vtimerHead) == (TICK*) vtimerHandle){ // remove head if (vtimerHead == vtimerTail){ vtimerHead = vtimerTail = 0; }else{ vtimerHead = pTmr->next; } }else for (prev = vtimerHead, pTmr = vtimerHead->next; pTmr != 0; prev = pTmr, pTmr = pTmr->next){ // search within the list if (pTmr == (TICK*) vtimerHandle){ // found it prev->next = pTmr->next; if (vtimerTail == pTmr){ // adjust tail vtimerTail = prev; } break; } } TICK__EnableInt(); if(pTmr){ free(pTmr); } return pTmr != 0; } void SysTick_Handler() { TICK *pTmr; vtimerValue++; for(pTmr = vtimerHead; pTmr != 0; pTmr = pTmr->next){ if(pTmr->interval != 0){ if (--pTmr->currCnt == 0){ pTmr->currCnt = pTmr->interval; (*pTmr->pCallback)(vtimerValue); } } } }
tuanpmt/led-rgb-audio-spectrum
audio_spectrum-firmware/src/tick.c
C
mit
3,061
[ 30522, 1001, 2421, 1026, 2358, 19422, 12322, 1012, 1044, 1028, 1001, 2421, 1000, 16356, 1012, 1044, 1000, 1001, 2421, 1000, 1044, 2860, 1035, 9530, 8873, 2290, 1012, 1044, 1000, 1001, 2421, 1000, 21189, 12879, 1012, 1044, 1000, 10763, 20606...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
//# MatrixInverse.cc: The inverse of an expression returning a Jones matrix. //# //# Copyright (C) 2005 //# ASTRON (Netherlands Institute for Radio Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands //# //# This file is part of the LOFAR software suite. //# The LOFAR software suite 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. //# //# The LOFAR software suite is distributed in the hope that it will be useful, //# but WITHOUT ANY WARRANTY; without even the implied warranty of //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //# GNU General Public License for more details. //# //# You should have received a copy of the GNU General Public License along //# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. //# //# $Id$ #include <lofar_config.h> #include <BBSKernel/Expr/MatrixInverse.h> // Inverse of a 2x2 matrix: // // (a b) ( d -b) // If A = ( ) then inverse(A) = ( ) / (ad - bc) // (c d) (-c a) namespace LOFAR { namespace BBS { MatrixInverse::MatrixInverse(const Expr<JonesMatrix>::ConstPtr &expr) : BasicUnaryExpr<JonesMatrix, JonesMatrix>(expr) { } const JonesMatrix::View MatrixInverse::evaluateImpl(const Grid&, const JonesMatrix::View &arg0) const { JonesMatrix::View result; Matrix invDet(1.0 / (arg0(0, 0) * arg0(1, 1) - arg0(0, 1) * arg0(1, 0))); result.assign(0, 0, arg0(1, 1) * invDet); result.assign(0, 1, arg0(0, 1) * -invDet); result.assign(1, 0, arg0(1, 0) * -invDet); result.assign(1, 1, arg0(0, 0) * invDet); return result; } } // namespace BBS } // namespace LOFAR
kernsuite-debian/lofar
CEP/Calibration/BBSKernel/src/Expr/MatrixInverse.cc
C++
gpl-3.0
1,851
[ 30522, 1013, 1013, 1001, 8185, 2378, 16070, 1012, 10507, 1024, 1996, 19262, 1997, 2019, 3670, 4192, 1037, 3557, 8185, 1012, 1013, 1013, 1001, 1013, 1013, 1001, 9385, 1006, 1039, 1007, 2384, 1013, 1013, 1001, 28625, 2078, 1006, 4549, 2820, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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) 2018-2020 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from oauth2client import GOOGLE_TOKEN_URI from oauth2client.client import GoogleCredentials from .. import gcp from .. import constants class CloudResourcesBase(gcp.GoogleCloudApi): def __init__(self, config, logger, scope=constants.COMPUTE_SCOPE, discovery=constants.CLOUDRESOURCES_DISCOVERY, api_version=constants.API_V1): super(CloudResourcesBase, self).__init__( config, logger, scope, discovery, api_version) def get_credentials(self, scope): # check # run: gcloud beta auth application-default login # look to ~/.config/gcloud/application_default_credentials.json credentials = GoogleCredentials( access_token=None, client_id=self.auth['client_id'], client_secret=self.auth['client_secret'], refresh_token=self.auth['refresh_token'], token_expiry=None, token_uri=GOOGLE_TOKEN_URI, user_agent='Python client library' ) return credentials def get(self): raise NotImplementedError() def create(self): raise NotImplementedError() def delete(self): raise NotImplementedError()
cloudify-cosmo/cloudify-gcp-plugin
cloudify_gcp/admin/__init__.py
Python
apache-2.0
1,945
[ 30522, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 9385, 1006, 1039, 1007, 2760, 1011, 12609, 6112, 8757, 4132, 5183, 1012, 2035, 2916, 9235, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 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...
# Threading macros in clojure, the -> and ->> thingy A few days into learning clojure, I thought it would be a good idea to look at some actual clojure projects in github. I was feeling all confident and what not - you know getting used to lispy way of writing things. The puspose of going through some code, was to get a gist of what was going on in the code, if not understanding it fully. I guess you already know where this is going don't you ? Yep, I find myself reading through code and I find these two, `->` and `->>` (and a lot more *scary* stuff) staring at me, and I had no clue what to make of it. I guess there would at least be a few of you guys who felt the same. Apparently, they are called threading macros. `->` is the thread first and `->>` thread last macros, and they are syntactical sugar to your code. It makes reading/writing code easier. "Meh! Just that?" you ask. Let's see. The syntax goes something like this : [`(-> x & forms)`](http://clojuredocs.org/clojure.core/-%3E) and [`(->> x & forms)`](http://clojuredocs.org/clojure.core/-%3E%3E). The following examples might help you understand it. Let say you want to do this (divide 2 by 1 then subtract 3 then add 4 and multiply with 5). How would you write it in clojure? ## -> ```clojure user=> (* (+ (- (/ 2 1) 3) 4 )5) 15 ``` Boy! It can get difficult to read when you have a bunch of these strung together. Now lets see how we write it with `->` ```clojure user=> (-> 2 (/ 1) (- 3) (+ 4) (* 5)) 15 ``` Woh! This is a lot simpler to read (at least for me)! So what happens here is the thread first macro just takes the 2 and then pass it as the first argument to the next funtion and then the result of that as the first argument to the next and so on. ## ->> Thread last does something similar, insted of passing it as the first argument it would pass it as the last argument. So if you where to apply the `->>` to the previous example you would get ```clojure user=> (->> 2 (/ 1) (- 3) (+ 4) (* 5)) 65/2 ``` which is ```clojure user=> (* 5 (+ 4 (- 3 (/ 1 2)))) 65/2 ``` ## Objects and collections My favorite use of the threading macros has been when I have used them with java/clojure data structures. It makes handeling them a lot easier. ### Collections The thread-last macro `->>` is very usefull in dealing with collections. Where you have to transofrm them or apply functions to them, which is what you might be doing in a lot of your clojure code. For exmaple, if you have this collection: ```clojure (def x {:document {:paragraph {:text ["This is the first line" "This is the second line" "This is the third line"]}}}) ``` Say you want to add a new '\n' at the end of each line and then print them together as a single string. How would you do this? Well its easy, you just get the text and then apply map and reduce to it and then print. Let's write it shall we? ```clojure (println (reduce str (map #(str % "\n") (:text (:paragraph (:document x)))))) ``` Now lets take a look at this if we decide to write it using thread last macro ```clojure (->> x :document :paragraph :text (map #(str % "\n")) (reduce str) println) ``` It's a lot more cleaner, and you don't have to keep matching the parenthesis to actually figure out what is happening. This works even better when you want to do a lot more transformation on the collections. While at it, we can make use of this neat function `get-in` that helps you get values from deep inside a map, which is somewhat better to use at times. The advantage of useing `get-in` over the therading would be that it helps you supply a `not-found` value, the would be returned if the key you are looking for is not there in the collection. Pretty neat huh? Let's try that. ```clojure (->> (get-in x [:document :paragraph :text] ["No text found"]) (map #(str % "\n")) (reduce str) println) ``` ### Objects Now if you are working with java interop and you aren't using the thread-first macro, then this might change your mind. Let's take this example, where you have a java object and you apply a series of methods on the Java object or Java objects returned on applying these methods. This is how you would be doing it. ```clojure (.add (.getContent (.getBody (.getJaxbelement (.getMaindocumentpart (Wordprocessingmlpackage/createPackage)))) paragraph) ``` Now with thread first this becomes ```clojure (-> (WordprocessingMLPackage/createPackage) .getMainDocumentPart .getJaxbElement .getBody .getContent (.add paragraph) ``` Which is way more easier to read, and write. It is aligned with the original java representation, which aids in better understanding of the code. It feels less clunky than the previous case where you could get lost in all those parenthesis. Since we are at it, let's talk about another function: `doto`. This is very helpful when you have to apply multiple funtions on a single java object. We didn't use it in the previous example because, each of the functions were returing a different object. Consider you have a table-border object and you want to set border to it. This is how you would be writing with thread the `doto` funtion. ```clojure (defn set-table-border [table-border border] (doto table-border (.setBottom border) (.setTop border) (.setRight border) (.setLeft border) (.setInsideH border) (.setInsideV border))) ``` You could use the threading operator or even write it in a single line, but it would be messy. Reading clojure code, you will realise that a lot of peps out there use threading macro and are right in doing so, as code readability is very important. Use them when ever you can, but keep in mind why you are using them. It's not just the `how` that is important, `why` matters too.
krish8664/til
clojure/threading.md
Markdown
gpl-3.0
5,812
[ 30522, 1001, 11689, 2075, 26632, 2015, 1999, 18856, 29147, 5397, 1010, 1996, 1011, 1028, 1998, 1011, 1028, 1028, 2518, 2100, 1037, 2261, 2420, 2046, 4083, 18856, 29147, 5397, 1010, 1045, 2245, 2009, 2052, 2022, 1037, 2204, 2801, 2000, 2298,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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. DecimalToBinaryNumber")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("14. DecimalToBinaryNumber")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6330f0da-7a23-4460-9347-5e1348ce9efc")] // 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")]
g-yonchev/TelerikAcademy
Homeworks/C# 1/06.LoopsHW/14. DecimalToBinaryNumber/Properties/AssemblyInfo.cs
C#
mit
1,426
[ 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...
package handling.handlers; import java.awt.Point; import client.MapleClient; import handling.PacketHandler; import handling.RecvPacketOpcode; import server.MaplePortal; import tools.data.LittleEndianAccessor; public class UseInnerPortalHandler { @PacketHandler(opcode = RecvPacketOpcode.USE_INNER_PORTAL) public static void handle(MapleClient c, LittleEndianAccessor lea) { lea.skip(1); if (c.getPlayer() == null || c.getPlayer().getMap() == null) { return; } String portalName = lea.readMapleAsciiString(); MaplePortal portal = c.getPlayer().getMap().getPortal(portalName); if (portal == null) { return; } //That "22500" should not be hard coded in this manner if (portal.getPosition().distanceSq(c.getPlayer().getTruePosition()) > 22500.0D && !c.getPlayer().isGM()) { return; } int toX = lea.readShort(); int toY = lea.readShort(); //Are there not suppose to be checks here? Can players not just PE any x and y value they want? c.getPlayer().getMap().movePlayer(c.getPlayer(), new Point(toX, toY)); c.getPlayer().checkFollow(); } }
Maxcloud/Mushy
src/handling/handlers/UseInnerPortalHandler.java
Java
gpl-3.0
1,090
[ 30522, 7427, 8304, 1012, 28213, 2015, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 2391, 1025, 12324, 7396, 1012, 11035, 20464, 11638, 1025, 12324, 8304, 1012, 14771, 11774, 3917, 1025, 12324, 8304, 1012, 28667, 2615, 23947, 18903, 15042, 1024...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 yuku.alkitab.base.util; import android.app.Activity; import android.app.Dialog; import android.content.Intent; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.os.AsyncTask; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Xml; import com.afollestad.materialdialogs.MaterialDialog; import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; import gnu.trove.map.hash.TIntLongHashMap; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TObjectIntHashMap; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.ext.DefaultHandler2; import yuku.alkitab.base.App; import yuku.alkitab.base.IsiActivity; import yuku.alkitab.base.S; import yuku.alkitab.base.storage.Db; import yuku.alkitab.base.storage.InternalDb; import yuku.alkitab.debug.R; import yuku.alkitab.model.Label; import yuku.alkitab.model.Marker; import yuku.alkitab.model.Marker_Label; import java.io.InputStream; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import static yuku.alkitab.base.util.Literals.ToStringArray; // Imported from v3. Used for once-only migration from v3 to v4. public class BookmarkImporter { static final String TAG = BookmarkImporter.class.getSimpleName(); // constants static class Bookmark2_Label { // DO NOT CHANGE CONSTANT VALUES! public static final String XMLTAG_Bookmark2_Label = "Bukmak2_Label"; public static final String XMLATTR_bookmark2_relId = "bukmak2_relId"; public static final String XMLATTR_label_relId = "label_relId"; } // constants static class BackupManager { public static final String XMLTAG_Bukmak2 = "Bukmak2"; private static final String XMLATTR_ari = "ari"; private static final String XMLATTR_kind = "jenis"; private static final String XMLATTR_caption = "tulisan"; private static final String XMLATTR_addTime = "waktuTambah"; private static final String XMLATTR_modifyTime = "waktuUbah"; private static final String XMLATTR_relId = "relId"; private static final String XMLVAL_bookmark = "bukmak"; private static final String XMLVAL_note = "catatan"; private static final String XMLVAL_highlight = "stabilo"; public static final String XMLTAG_Label = "Label"; private static final String XMLATTR_title = "judul"; private static final String XMLATTR_bgColor = "warnaLatar"; @Nullable public static Marker markerFromAttributes(Attributes attributes) { int ari = Integer.parseInt(attributes.getValue("", XMLATTR_ari)); String kind_s = attributes.getValue("", XMLATTR_kind); Marker.Kind kind = kind_s.equals(XMLVAL_bookmark) ? Marker.Kind.bookmark : kind_s.equals(XMLVAL_note) ? Marker.Kind.note : kind_s.equals(XMLVAL_highlight) ? Marker.Kind.highlight : null; String caption = unescapeHighUnicode(attributes.getValue("", XMLATTR_caption)); Date addTime = Sqlitil.toDate(Integer.parseInt(attributes.getValue("", XMLATTR_addTime))); Date modifyTime = Sqlitil.toDate(Integer.parseInt(attributes.getValue("", XMLATTR_modifyTime))); if (kind == null) { // invalid return null; } return Marker.createNewMarker(ari, kind, caption, 1, addTime, modifyTime); } public static int getRelId(Attributes attributes) { String s = attributes.getValue("", XMLATTR_relId); return s == null ? 0 : Integer.parseInt(s); } public static Label labelFromAttributes(Attributes attributes) { String title = unescapeHighUnicode(attributes.getValue("", XMLATTR_title)); String bgColor = attributes.getValue("", XMLATTR_bgColor); return Label.createNewLabel(title, 0, bgColor); } static ThreadLocal<Matcher> highUnicodeMatcher = new ThreadLocal<Matcher>() { @Override protected Matcher initialValue() { return Pattern.compile("\\[\\[~U([0-9A-Fa-f]{6})~\\]\\]").matcher(""); } }; public static String unescapeHighUnicode(String input) { if (input == null) return null; final Matcher m = highUnicodeMatcher.get(); m.reset(input); StringBuffer res = new StringBuffer(); while (m.find()) { String s = m.group(1); final int cp = Integer.parseInt(s, 16); m.appendReplacement(res, new String(new int[]{cp}, 0, 1)); } m.appendTail(res); return res.toString(); } } public static void importBookmarks(final Activity activity, @NonNull final InputStream fis, final boolean finishActivityAfterwards, final Runnable runWhenDone) { final MaterialDialog pd = new MaterialDialog.Builder(activity) .content(R.string.mengimpor_titiktiga) .cancelable(false) .progress(true, 0) .show(); new AsyncTask<Boolean, Integer, Object>() { int count_bookmark = 0; int count_label = 0; @Override protected Object doInBackground(Boolean... params) { final List<Marker> markers = new ArrayList<>(); final TObjectIntHashMap<Marker> markerToRelIdMap = new TObjectIntHashMap<>(); final List<Label> labels = new ArrayList<>(); final TObjectIntHashMap<Label> labelToRelIdMap = new TObjectIntHashMap<>(); final TIntLongHashMap labelRelIdToAbsIdMap = new TIntLongHashMap(); final TIntObjectHashMap<TIntList> markerRelIdToLabelRelIdsMap = new TIntObjectHashMap<>(); try { Xml.parse(fis, Xml.Encoding.UTF_8, new DefaultHandler2() { @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { switch (localName) { case BackupManager.XMLTAG_Bukmak2: final Marker marker = BackupManager.markerFromAttributes(attributes); if (marker != null) { markers.add(marker); final int bookmark2_relId = BackupManager.getRelId(attributes); markerToRelIdMap.put(marker, bookmark2_relId); count_bookmark++; } break; case BackupManager.XMLTAG_Label: { final Label label = BackupManager.labelFromAttributes(attributes); int label_relId = BackupManager.getRelId(attributes); labels.add(label); labelToRelIdMap.put(label, label_relId); count_label++; break; } case Bookmark2_Label.XMLTAG_Bookmark2_Label: { final int bookmark2_relId = Integer.parseInt(attributes.getValue("", Bookmark2_Label.XMLATTR_bookmark2_relId)); final int label_relId = Integer.parseInt(attributes.getValue("", Bookmark2_Label.XMLATTR_label_relId)); TIntList labelRelIds = markerRelIdToLabelRelIdsMap.get(bookmark2_relId); if (labelRelIds == null) { labelRelIds = new TIntArrayList(); markerRelIdToLabelRelIdsMap.put(bookmark2_relId, labelRelIds); } labelRelIds.add(label_relId); break; } } } }); fis.close(); } catch (Exception e) { return e; } { // bikin label-label yang diperlukan, juga map relId dengan id dari label. final HashMap<String, Label> judulMap = new HashMap<>(); final List<Label> xlabelLama = S.getDb().listAllLabels(); for (Label labelLama : xlabelLama) { judulMap.put(labelLama.title, labelLama); } for (Label label : labels) { // cari apakah label yang judulnya persis sama udah ada Label labelLama = judulMap.get(label.title); final int labelRelId = labelToRelIdMap.get(label); if (labelLama != null) { // removed from v3: update warna label lama labelRelIdToAbsIdMap.put(labelRelId, labelLama._id); AppLog.d(TAG, "label (lama) r->a : " + labelRelId + "->" + labelLama._id); } else { // belum ada, harus bikin baru Label labelBaru = S.getDb().insertLabel(label.title, label.backgroundColor); labelRelIdToAbsIdMap.put(labelRelId, labelBaru._id); AppLog.d(TAG, "label (baru) r->a : " + labelRelId + "->" + labelBaru._id); } } } importBookmarks(markers, markerToRelIdMap, labelRelIdToAbsIdMap, markerRelIdToLabelRelIdsMap); return null; } @Override protected void onPostExecute(@NonNull Object result) { pd.dismiss(); if (result instanceof Exception) { AppLog.e(TAG, "Error when importing markers", (Throwable) result); new MaterialDialog.Builder(activity) .content(activity.getString(R.string.terjadi_kesalahan_ketika_mengimpor_pesan, ((Exception) result).getMessage())) .positiveText(R.string.ok) .show(); } else { final Dialog dialog = new MaterialDialog.Builder(activity) .content(activity.getString(R.string.impor_berhasil_angka_diproses, count_bookmark, count_label)) .positiveText(R.string.ok) .show(); if (finishActivityAfterwards) { dialog.setOnDismissListener(dialog1 -> activity.finish()); } } if (runWhenDone != null) runWhenDone.run(); } }.execute(); } public static void importBookmarks(List<Marker> markers, TObjectIntHashMap<Marker> markerToRelIdMap, TIntLongHashMap labelRelIdToAbsIdMap, TIntObjectHashMap<TIntList> markerRelIdToLabelRelIdsMap) { SQLiteDatabase db = S.getDb().getWritableDatabase(); db.beginTransaction(); try { final TIntObjectHashMap<Marker> markerRelIdToMarker = new TIntObjectHashMap<>(); { // write new markers (if not available yet) for (int i = 0; i < markers.size(); i++) { Marker marker = markers.get(i); final int marker_relId = markerToRelIdMap.get(marker); // migrate: look for existing marker with same kind, ari, and content try (Cursor cursor = db.query( Db.TABLE_Marker, null, Db.Marker.ari + "=? and " + Db.Marker.kind + "=? and " + Db.Marker.caption + "=?", ToStringArray(marker.ari, marker.kind.code, marker.caption), null, null, null )) { if (cursor.moveToNext()) { marker = InternalDb.markerFromCursor(cursor); markers.set(i, marker); } else { InternalDb.insertMarker(db, marker); } // map it markerRelIdToMarker.put(marker_relId, marker); } } } { // now is marker-label assignments for (final int marker_relId : markerRelIdToLabelRelIdsMap.keys()) { final TIntList label_relIds = markerRelIdToLabelRelIdsMap.get(marker_relId); final Marker marker = markerRelIdToMarker.get(marker_relId); if (marker != null) { // existing labels > 0: ignore // existing labels == 0: insert final int existing_label_count = (int) DatabaseUtils.queryNumEntries(db, Db.TABLE_Marker_Label, Db.Marker_Label.marker_gid + "=?", ToStringArray(marker.gid)); if (existing_label_count == 0) { for (int label_relId : label_relIds.toArray()) { final long label_id = labelRelIdToAbsIdMap.get(label_relId); if (label_id > 0) { final Label label = S.getDb().getLabelById(label_id); final Marker_Label marker_label = Marker_Label.createNewMarker_Label(marker.gid, label.gid); InternalDb.insertMarker_LabelIfNotExists(db, marker_label); } else { AppLog.w(TAG, "label_id is invalid!: " + label_id); } } } } else { AppLog.w(TAG, "wrong marker_relId: " + marker_relId); } } } db.setTransactionSuccessful(); } finally { db.endTransaction(); } App.getLbm().sendBroadcast(new Intent(IsiActivity.ACTION_ATTRIBUTE_MAP_CHANGED)); } }
infojulio/androidbible
Alkitab/src/main/java/yuku/alkitab/base/util/BookmarkImporter.java
Java
apache-2.0
11,461
[ 30522, 7427, 9805, 5283, 1012, 2632, 23615, 7875, 1012, 2918, 1012, 21183, 4014, 1025, 12324, 11924, 1012, 10439, 1012, 4023, 1025, 12324, 11924, 1012, 10439, 1012, 13764, 8649, 1025, 12324, 11924, 1012, 4180, 1012, 7848, 1025, 12324, 11924, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 SharedHelpers def session env['rack.session'] end def access_token env['rack.session'][:access_token] end def access_token? !!access_token end def access_token! error!( { error_message: "Invalid access token." } ,401) unless access_token? end def client @client ||= Strava::Api::V3::Client.new(:access_token => access_token) end end
tiagolnobre/strava_tfl
api/v1/helpers/shared_helpers.rb
Ruby
mit
385
[ 30522, 11336, 4207, 16001, 7347, 13366, 5219, 4372, 2615, 1031, 1005, 14513, 1012, 5219, 1005, 1033, 2203, 13366, 3229, 1035, 19204, 4372, 2615, 1031, 1005, 14513, 1012, 5219, 1005, 1033, 1031, 1024, 3229, 1035, 19204, 1033, 2203, 13366, 32...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* * ____ DAPHNE COPYRIGHT NOTICE ____ * * Copyright (C) 2005 Mark Broadhead * * This file is part of DAPHNE, a laserdisc arcade game emulator * * DAPHNE 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. * * DAPHNE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include <string.h> // for memset #include <stdio.h> // for sprintf (we shouldn't use sprintf anymore) #include "timetrav.h" #include "../ldp-out/ldp.h" #include "../io/conout.h" #include "../sound/sound.h" #include "../video/palette.h" #include "../video/video.h" // Time Traveler timetrav::timetrav() { m_shortgamename = "timetrav"; memset(m_cpumem, 0, cpu::MEM_SIZE); struct cpu::def cpu; memset(&cpu, 0, sizeof(struct cpu::def)); cpu.type = cpu::type::I88; cpu.hz = TIMETRAV_CPU_HZ; cpu.irq_period[0] = 0; cpu.irq_period[1] = 0; cpu.nmi_period = (1000.0 / 59.94); cpu.initial_pc = 0xFFFF0; cpu.must_copy_context = false; cpu.mem = m_cpumem; cpu::add(&cpu); // add this cpu to the list (it will be our only one) m_disc_fps = 29.97; // m_game_type = GAME_TIMETRAV; m_game_uses_video_overlay = true; m_video_overlay_width = 320; // default values we start with for video // overlay m_video_overlay_height = 240; m_palette_color_count = 256; m_video_overlay_count = 1; m_overlay_size_is_dynamic = true; // this game does dynamically change its // overlay size static struct rom_def g_timetrav_roms[] = {{"TT061891.BIN", NULL, &m_cpumem[0xc0000], 0x40000, 0x00000000}, {NULL}}; m_rom_list = g_timetrav_roms; } void timetrav::do_nmi() {} Uint8 timetrav::cpu_mem_read(Uint32 addr) { char s[80]; Uint8 result = m_cpumem[addr]; // Scratch ram if (addr < 0x10000) { } // ROM else if (addr >= 0xc0000) { } else { sprintf(s, "Unmapped read from %x", addr); printline(s); } return (result); } void timetrav::cpu_mem_write(Uint32 addr, Uint8 value) { char s[80]; m_cpumem[addr] = value; // Scratch ram if (addr < 0x10000) { } // ROM else if (addr >= 0xc0000) { sprintf(s, "Write to rom at %x with %x!", addr, value); printline(s); } else { sprintf(s, "Unmapped write to %x with %x", addr, value); printline(s); } } void timetrav::port_write(Uint16 port, Uint8 value) { char s[80]; //static char display_string[9] = {0}; switch (port) { case 0x1180: case 0x1181: case 0x1182: case 0x1183: case 0x1184: case 0x1185: case 0x1186: case 0x1187: m_video_overlay_needs_update = true; //display_string[port & 0x07] = value; //draw_string(display_string, 0, 0, get_active_video_overlay()); blit(); break; default: sprintf(s, "Unmapped write to port %x, value %x", port, value); printline(s); break; } } Uint8 timetrav::port_read(Uint16 port) { char s[80]; unsigned char result = 0; sprintf(s, "Unmapped read from port %x", port); printline(s); return (result); } // used to set dip switch values bool timetrav::set_bank(unsigned char which_bank, unsigned char value) { bool result = true; if (which_bank == 0) { } else { printline("ERROR: Bank specified is out of range!"); result = false; } return result; } void timetrav::input_disable(Uint8 move) {} void timetrav::input_enable(Uint8 move) {} void timetrav::palette_calculate() { SDL_Color temp_color; // fill color palette with schlop because we only use colors 0 and 0xFF for // now for (int i = 0; i < 256; i++) { temp_color.r = (unsigned char)i; temp_color.g = (unsigned char)i; temp_color.b = (unsigned char)i; palette::set_color(i, temp_color); } }
btolab/hypseus
src/game/timetrav.cpp
C++
gpl-3.0
4,667
[ 30522, 1013, 1008, 1008, 1035, 1035, 1035, 1035, 16847, 9385, 5060, 1035, 1035, 1035, 1035, 1008, 1008, 9385, 1006, 1039, 1007, 2384, 2928, 5041, 4974, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 16847, 1010, 1037, 9138, 10521, 2278, 10877, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
<style> ion-content{ background-color: #00091a; color:#e6eeff; } ion-card{ text-align: right; } /*global CSS*/ #gems{ background-color: inherit; } .more { float: none; } .menu{ transform: translate(-50%, 55%); } /*small devices*/ @media (min-width: 320px) and (max-width: 480px) { .more{ margin-top: 20vh; } .container{ margin-top: 20vh; } #avatar{ float: center; height:50px; width:50px; margin-left: 19vw; margin-top: 2vh; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; } .toggle + .style { width: 190px; height: 190px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background-size: 200px 200px; background-position: center; background-repeat: no-repeat; color: #fff; font-size: 2.5em; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 300; font-size: 1.5em; } .toggle { display: none; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:before, .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:before { width: 30px; height: 0px; left: 10px; top: 25px; } .toggle + .style:after { width: 0px; height: 30px; left: 25px; top: 10px; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 100px; height: 100px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -110px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -60px; left: 110px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 50px; left: 110px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 100px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 45px; left: -100px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -70px; left: -100px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float: right; color: black; font-size: 1.3em; } #conn_status{ margin-top:3vh; margin-left: 21vw; height: 5vh; width: 10vw; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:5vh; } } @media (min-width: 481px) and (max-width: 767px) { .more{ float: none; margin-top: 20vh; } .container{ margin-top: 20vh; } #avatar{ float: center; height:80px; width:80px; margin-left: 24vw; margin-top: 2vh; border-radius: 50%; } #style{ background-size: 100% 100%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 100px; background-position: center; color: #fff; font-size: 2.5em; padding-top: 40px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:before, .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:before { width: 30px; height: 0px; left: 10px; top: 25px; } .toggle + .style:after { width: 0px; height: 30px; left: 25px; top: 10px; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 100px; height: 100px; left: 0px; top: 10px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -110px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -60px; left: 110px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 50px; left: 110px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 100px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 45px; left: -100px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -70px; left: -100px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname { float: right; color: black; font-size: 3vh; } #conn_status{ margin-top:3vh; margin-left: 21vw; height: 5vh; width: 10vw; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:15vh; } } @media (min-width: 768px) and (max-width: 1024px) { .more{ float: none; margin-top: 30vh; } .container{ margin-top: 100px; } #avatar{ float: center; height:80px; width:80px; margin-left: 30vw; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background-size: cover; background-position: center; font-size: 2.5em; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 50px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 120px; height: 120px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -130px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -70px; left: 120px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 70px; left: 130px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 150px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 80px; left: -120px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -50px; left: -120px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float:right; margin-right: 1vw; color: black; font-size: 2vh; } #conn_status{ margin-top:3vh; margin-left: 220px; height: 50px; width: 50px; float: left; } #gems{ margin-top:2vh; font-size: 2vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:1vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:5vh; } #nickname{ float: right; } } @media (min-width: 1025px) and (max-width: 1280px){ .more{ float: none; margin-top: 30vh; } .container{ margin-top: 100px; } #avatar{ float: center; height:100px; width:100px; margin-left: 28vw; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background: #008DFF; color: #fff; font-size: 2.5em; background-size: 100% 100%; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 50px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 120px; height: 120px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -130px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -70px; left: 120px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 70px; left: 130px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 150px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 80px; left: -120px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -50px; left: -120px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float:right; margin-right: 1vw; color: black; font-size: 3vh; } #conn_status{ margin-top:3vh; margin-left: 220px; height: 50px; width: 50px; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 80px; width: 80px; } hr{ margin-top:5vh; } #nickname{ float: right; } } @media (min-width: 1281px) {/*Desktops*/ .container{ margin-top: 50px; } #avatar{ float: right; height:200px; width:300px; border-radius: 50%; } .menu { position: relative; margin-top: 200px; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 700px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 100px; margin-bottom: 0; background: #008DFF; color: #fff; font-size: 2.5em; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 500; font-size: 1.5em; } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:after { width: 100px; height: 30px; left: 25px; top: 10px; } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 150px; height: 150px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -180px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -90px; left: 150px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 80px; left: 160px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 200px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 100px; left: -150px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -80px; left: -150px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #conn_status{ margin-top:3vh; margin-left: 34vw; height: 10vh; width: 7vw; float: left; } #gems{ margin-top:5vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 10vh; width: 7vw; } hr{ margin-top:10vh; } #nickname{ margin-top: 10vh } } #game{ background-image: url("assets/static/icons/bazi.png"); background-size: 100% 100%; } #history{ background-image: url("assets/static/icons/eftekharat.png"); background-size: 100% 100%; } #about{ background-image: url("assets/static/icons/info.ico"); background-size: 100% 100%; } #news{ background-image: url("assets/static/icons/notif.png"); background-size: 100% 100%; } #store{ background-image: url("assets/static/icons/forushgah.png"); background-size: 100% 100%; } #cup{ background-image: url("assets/static/icons/jam.png"); background-size: 100% 100%; } #best_avatar{ float: left; display: inline; width: 18vw; height: 12vh; } #best_info{ font-size: 1.3em; } </style> <ion-content padding > <div id ="status"> <img id=avatar src='' (click)="myHistory()"><img id='gem-icon' src='assets/static/gem.png' (click)="Store()"><span id='gems'>{{score}}</span><p align=right id=nickname>{{nickname}}</p> </div> <hr> <button ion-button (click)="new_HOME()">new ui</button>> <div class="container"> <div class='menu'> <input id='toggle' class='toggle' type='checkbox' checked > <label id='style' class='style' for='menu' (click)="Avatar()"> <i class="fa fa-bars" aria-hidden="true"></i> </label> <a id="game" class='tab' (click)="Game()" > <p></p> </a> <a id="history" class='tab' (click)="myHistory()"> <p></p> </a> <a id="about" class='tab' (click)="AboutUs()"> <p> </p> </a> <a id="news" class='tab' (click)="News()"> <p></p> </a> <a id="store" class='tab' (click)="Store()"> <P></P> </a> <a id="cup" class='tab' (click)="Cups()"> <P></P> </a> </div> </div> <br><br> <br> <br> <br> <div> <ion-card> <ion-card-header> <img id="best_avatar" src="{{best_player_avatar}}"> <p id="best_info">{{best_player_name}}: {{best_player_gems}}</p> </ion-card-header> <ion-card-content> </ion-card-content> </ion-card> </div> </ion-content>
amirrezaask/Cartach_client
src/pages/home/home.html
HTML
gpl-3.0
25,783
[ 30522, 1026, 2806, 1028, 10163, 1011, 4180, 1063, 4281, 1011, 3609, 1024, 1001, 2199, 2683, 2487, 2050, 1025, 3609, 1024, 1001, 1041, 2575, 4402, 4246, 1025, 1065, 10163, 1011, 4003, 1063, 3793, 1011, 25705, 1024, 2157, 1025, 1065, 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...
/* * #%L * GwtMaterial * %% * Copyright (C) 2015 - 2017 GwtMaterialDesign * %% * 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. * #L% */ package gwt.material.design.addins.client; public class StartupState { public StartupState() { } public static class DebugState extends StartupState { public DebugState() { } } }
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/StartupState.java
Java
apache-2.0
866
[ 30522, 1013, 1008, 1008, 1001, 1003, 1048, 1008, 1043, 26677, 8585, 14482, 1008, 1003, 1003, 1008, 9385, 1006, 1039, 1007, 2325, 1011, 2418, 1043, 26677, 8585, 14482, 6155, 23773, 1008, 1003, 1003, 1008, 7000, 2104, 1996, 15895, 6105, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* Spassus2 is a free game (and powerfull engine) for Casio calculators Copyright (C) 2016 Hugo KUENY This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NETWORK_SOCKET_H #define _NETWORK_SOCKET_H #include "memory/Buffer.h" enum NETWORK_SOCKET_RESULT{ NETWORK_SOCKET_OK = 0, NETWORK_SOCKET_OUT_OF_BUFFER, NETWORK_SOCKET_ERROR, }; class NetworkSocket{ protected: bool isConnected = false; bool autoReconnect = true; public: virtual NETWORK_SOCKET_RESULT writeOut(Buffer * toSend) = 0; virtual NETWORK_SOCKET_RESULT readIn(Buffer * inputBuffer) = 0; virtual unsigned int getWaitingSize() = 0; virtual NETWORK_SOCKET_RESULT disconnect(bool doNotWaitForData) = 0; virtual NETWORK_SOCKET_RESULT connect() = 0; }; #endif
nessotrin/Spassus2
src/network/sockets/NetworkSocket.h
C
gpl-2.0
1,428
[ 30522, 1013, 1008, 12403, 4757, 2271, 2475, 2003, 1037, 2489, 2208, 1006, 1998, 3928, 2140, 3194, 1007, 2005, 25222, 3695, 10250, 19879, 6591, 9385, 1006, 1039, 1007, 2355, 9395, 13970, 2368, 2100, 2023, 2565, 2003, 2489, 4007, 1025, 2017, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
# Selago tysonii Rolfe SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Scrophulariaceae/Selago/Selago tysonii/README.md
Markdown
apache-2.0
170
[ 30522, 1001, 7367, 17802, 2080, 19356, 6137, 23381, 2063, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001, 1001, 2434, 2171, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 Drupal\webform; use Drupal\Core\Archiver\ArchiveTar; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\SubformState; use Drupal\Core\StreamWrapper\StreamWrapperInterface; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\webform\Entity\WebformSubmission; use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\Plugin\WebformExporterManagerInterface; /** * Webform submission exporter. */ class WebformSubmissionExporter implements WebformSubmissionExporterInterface { use StringTranslationTrait; /** * The configuration object factory. * * @var \Drupal\Core\Config\ConfigFactoryInterface */ protected $configFactory; /** * File system service. * * @var \Drupal\Core\File\FileSystemInterface */ protected $fileSystem; /** * Webform submission storage. * * @var \Drupal\webform\WebformSubmissionStorageInterface */ protected $entityStorage; /** * The stream wrapper manager. * * @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface */ protected $streamWrapperManager; /** * Webform element manager. * * @var \Drupal\webform\Plugin\WebformElementManagerInterface */ protected $elementManager; /** * Results exporter manager. * * @var \Drupal\webform\Plugin\WebformExporterManagerInterface */ protected $exporterManager; /** * The webform. * * @var \Drupal\webform\WebformInterface */ protected $webform; /** * The source entity. * * @var \Drupal\Core\Entity\EntityInterface */ protected $sourceEntity; /** * The results exporter. * * @var \Drupal\webform\Plugin\WebformExporterInterface */ protected $exporter; /** * Default export options. * * @var array */ protected $defaultOptions; /** * Webform element types. * * @var array */ protected $elementTypes; /** * Constructs a WebformSubmissionExporter object. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration object factory. * @param \Drupal\Core\File\FileSystemInterface $file_system * File system service. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager * The stream wrapper manager. * @param \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager * The webform element manager. * @param \Drupal\webform\Plugin\WebformExporterManagerInterface $exporter_manager * The results exporter manager. */ public function __construct(ConfigFactoryInterface $config_factory, FileSystemInterface $file_system, EntityTypeManagerInterface $entity_type_manager, StreamWrapperManagerInterface $stream_wrapper_manager, WebformElementManagerInterface $element_manager, WebformExporterManagerInterface $exporter_manager) { $this->configFactory = $config_factory; $this->fileSystem = $file_system; $this->entityStorage = $entity_type_manager->getStorage('webform_submission'); $this->streamWrapperManager = $stream_wrapper_manager; $this->elementManager = $element_manager; $this->exporterManager = $exporter_manager; } /** * {@inheritdoc} */ public function setWebform(WebformInterface $webform = NULL) { $this->webform = $webform; $this->defaultOptions = NULL; $this->elementTypes = NULL; } /** * {@inheritdoc} */ public function getWebform() { return $this->webform; } /** * {@inheritdoc} */ public function setSourceEntity(EntityInterface $entity = NULL) { $this->sourceEntity = $entity; } /** * {@inheritdoc} */ public function getSourceEntity() { return $this->sourceEntity; } /** * {@inheritdoc} */ public function getWebformOptions() { $name = $this->getWebformOptionsName(); return $this->getWebform()->getState($name, []); } /** * {@inheritdoc} */ public function setWebformOptions(array $options = []) { $name = $this->getWebformOptionsName(); $this->getWebform()->setState($name, $options); } /** * {@inheritdoc} */ public function deleteWebformOptions() { $name = $this->getWebformOptionsName(); $this->getWebform()->deleteState($name); } /** * Get options name for current webform and source entity. * * @return string * Settings name as 'webform.export.{entity_type}.{entity_id}'. */ protected function getWebformOptionsName() { if ($entity = $this->getSourceEntity()) { return 'results.export.' . $entity->getEntityTypeId() . '.' . $entity->id(); } else { return 'results.export'; } } /** * {@inheritdoc} */ public function setExporter(array $export_options = []) { $export_options += $this->getDefaultExportOptions(); $export_options['webform'] = $this->getWebform(); $export_options['source_entity'] = $this->getSourceEntity(); $this->exporter = $this->exporterManager->createInstance($export_options['exporter'], $export_options); return $this->exporter; } /** * {@inheritdoc} */ public function getExporter() { return $this->exporter; } /** * {@inheritdoc} */ public function getExportOptions() { return $this->getExporter()->getConfiguration(); } /****************************************************************************/ // Default options and webform. /****************************************************************************/ /** * {@inheritdoc} */ public function getDefaultExportOptions() { if (isset($this->defaultOptions)) { return $this->defaultOptions; } $this->defaultOptions = [ 'exporter' => 'delimited', 'delimiter' => ',', 'multiple_delimiter' => ';', 'excel' => FALSE, 'file_name' => 'submission-[webform_submission:serial]', 'header_format' => 'label', 'header_prefix' => TRUE, 'header_prefix_label_delimiter' => ': ', 'header_prefix_key_delimiter' => '__', 'excluded_columns' => [ 'uuid' => 'uuid', 'token' => 'token', 'webform_id' => 'webform_id', ], 'entity_type' => '', 'entity_id' => '', 'range_type' => 'all', 'range_latest' => '', 'range_start' => '', 'range_end' => '', 'state' => 'all', 'sticky' => '', 'download' => TRUE, 'files' => FALSE, ]; // Append element handler default options. $element_types = $this->getWebformElementTypes(); $element_handlers = $this->elementManager->getInstances(); foreach ($element_handlers as $element_type => $element_handler) { if (empty($element_types) || isset($element_types[$element_type])) { $this->defaultOptions += $element_handler->getExportDefaultOptions(); } } return $this->defaultOptions; } /** * {@inheritdoc} */ public function buildExportOptionsForm(array &$form, FormStateInterface $form_state, array $export_options = []) { $export_options += $this->getDefaultExportOptions(); $this->setExporter($export_options); $webform = $this->getWebform(); // Get exporter and build #states. $exporter_plugins = $this->exporterManager->getInstances($export_options); $states_archive = ['invisible' => []]; $states_options = ['invisible' => []]; foreach ($exporter_plugins as $plugin_id => $exporter_plugin) { if ($exporter_plugin->isArchive()) { if ($states_archive['invisible']) { $states_archive['invisible'][] = 'or'; } $states_archive['invisible'][] = [':input[name="exporter"]' => ['value' => $plugin_id]]; } if (!$exporter_plugin->hasOptions()) { if ($states_options['invisible']) { $states_options['invisible'][] = 'or'; } $states_options['invisible'][] = [':input[name="exporter"]' => ['value' => $plugin_id]]; } } $form['export']['format'] = [ '#type' => 'details', '#title' => $this->t('Format options'), '#open' => TRUE, ]; $form['export']['format']['exporter'] = [ '#type' => 'select', '#title' => $this->t('Export format'), '#options' => $this->exporterManager->getOptions(), '#default_value' => $export_options['exporter'], // Below .js-webform-exporter is used for exporter configuration form // #states. // @see \Drupal\webform\Plugin\WebformExporterBase::buildConfigurationForm '#attributes' => ['class' => ['js-webform-exporter']], ]; foreach ($exporter_plugins as $plugin_id => $exporter) { $subform_state = SubformState::createForSubform($form['export']['format'], $form, $form_state); $form['export']['format'] = $exporter->buildConfigurationForm($form['export']['format'], $subform_state); } // Element. $form['export']['element'] = [ '#type' => 'details', '#title' => $this->t('Element options'), '#open' => TRUE, '#states' => $states_options, ]; $form['export']['element']['multiple_delimiter'] = [ '#type' => 'select', '#title' => $this->t('Element multiple values delimiter'), '#description' => $this->t('This is the delimiter when an element has multiple values.'), '#required' => TRUE, '#options' => [ ';' => $this->t('Semicolon (;)'), ',' => $this->t('Comma (,)'), '|' => $this->t('Pipe (|)'), '.' => $this->t('Period (.)'), ' ' => $this->t('Space ()'), ], '#default_value' => $export_options['multiple_delimiter'], ]; // Header. $form['export']['header'] = [ '#type' => 'details', '#title' => $this->t('Header options'), '#open' => TRUE, '#states' => $states_options, ]; $form['export']['header']['header_format'] = [ '#type' => 'radios', '#title' => $this->t('Column header format'), '#description' => $this->t('Choose whether to show the element label or element key in each column header.'), '#required' => TRUE, '#options' => [ 'label' => $this->t('Element titles (label)'), 'key' => $this->t('Element keys (key)'), ], '#default_value' => $export_options['header_format'], ]; $form['export']['header']['header_prefix'] = [ '#type' => 'checkbox', '#title' => $this->t("Include an element's title with all sub elements and values in each column header."), '#return_value' => TRUE, '#default_value' => $export_options['header_prefix'], ]; $form['export']['header']['header_prefix_label_delimiter'] = [ '#type' => 'textfield', '#title' => $this->t('Column header label delimiter'), '#required' => TRUE, '#default_value' => $export_options['header_prefix_label_delimiter'], ]; $form['export']['header']['header_prefix_key_delimiter'] = [ '#type' => 'textfield', '#title' => $this->t('Column header key delimiter'), '#required' => TRUE, '#default_value' => $export_options['header_prefix_key_delimiter'], ]; if ($webform) { $form['export']['header']['header_prefix_label_delimiter']['#states'] = [ 'visible' => [ ':input[name="header_prefix"]' => ['checked' => TRUE], ':input[name="header_format"]' => ['value' => 'label'], ], ]; $form['export']['header']['header_prefix_key_delimiter']['#states'] = [ 'visible' => [ ':input[name="header_prefix"]' => ['checked' => TRUE], ':input[name="header_format"]' => ['value' => 'key'], ], ]; } // Build element specific export webforms. // Grouping everything in $form['export']['elements'] so that element handlers can // assign #weight to its export options webform. $form['export']['elements'] = [ '#type' => 'container', '#attributes' => ['class' => ['form-item']], '#states' => $states_options, ]; $element_types = $this->getWebformElementTypes(); $element_handlers = $this->elementManager->getInstances(); foreach ($element_handlers as $element_type => $element_handler) { if (empty($element_types) || isset($element_types[$element_type])) { $subform_state = SubformState::createForSubform($form['export']['elements'], $form, $form_state); $element_handler->buildExportOptionsForm($form['export']['elements'], $subform_state, $export_options); } } // All the remain options are only applicable to a webform's export. // @see Drupal\webform\Form\WebformResultsExportForm if (!$webform) { return; } // Elements. $form['export']['columns'] = [ '#type' => 'details', '#title' => $this->t('Column options'), '#description' => $this->t('The selected columns will be included in the export.'), '#states' => $states_options, ]; $form['export']['columns']['excluded_columns'] = [ '#type' => 'webform_excluded_columns', '#webform_id' => $webform->id(), '#default_value' => $export_options['excluded_columns'], ]; // Download options. $form['export']['download'] = [ '#type' => 'details', '#title' => $this->t('Download options'), '#open' => TRUE, ]; $form['export']['download']['download'] = [ '#type' => 'checkbox', '#title' => $this->t('Download export file'), '#description' => $this->t('If checked, the export file will be automatically download to your local machine. If unchecked, the export file will be displayed as plain text within your browser.'), '#return_value' => TRUE, '#default_value' => $export_options['download'], '#access' => !$this->requiresBatch(), '#states' => $states_archive, ]; $form['export']['download']['files'] = [ '#type' => 'checkbox', '#title' => $this->t('Download uploaded files'), '#description' => $this->t('If checked, the exported file and any submission file uploads will be download in a gzipped tar file.'), '#return_value' => TRUE, '#default_value' => ($webform->hasManagedFile()) ? $export_options['files'] : 0, '#access' => $webform->hasManagedFile(), '#states' => [ 'invisible' => [ ':input[name="download"]' => ['checked' => FALSE], ], ], ]; $source_entity = $this->getSourceEntity(); if (!$source_entity) { $entity_types = $this->entityStorage->getSourceEntityTypes($webform); if ($entity_types) { $form['export']['download']['submitted'] = [ '#type' => 'item', '#input' => FALSE, '#title' => $this->t('Submitted to'), '#description' => $this->t('Select the entity type and then enter the entity id.'), '#field_prefix' => '<div class="container-inline">', '#field_suffix' => '</div>', ]; $form['export']['download']['submitted']['entity_type'] = [ '#type' => 'select', '#title' => $this->t('Entity type'), '#title_display' => 'Invisible', '#options' => ['' => $this->t('All')] + $entity_types, '#default_value' => $export_options['entity_type'], ]; $form['export']['download']['submitted']['entity_id'] = [ '#type' => 'number', '#title' => $this->t('Entity id'), '#title_display' => 'Invisible', '#min' => 1, '#size' => 10, '#default_value' => $export_options['entity_id'], '#states' => [ 'invisible' => [ ':input[name="entity_type"]' => ['value' => ''], ], ], ]; } } $form['export']['download']['range_type'] = [ '#type' => 'select', '#title' => $this->t('Limit to'), '#options' => [ 'all' => $this->t('All'), 'latest' => $this->t('Latest'), 'serial' => $this->t('Submission number'), 'sid' => $this->t('Submission ID'), 'date' => $this->t('Date'), ], '#default_value' => $export_options['range_type'], ]; $form['export']['download']['latest'] = [ '#type' => 'container', '#attributes' => ['class' => ['container-inline']], '#states' => [ 'visible' => [ ':input[name="range_type"]' => ['value' => 'latest'], ], ], 'range_latest' => [ '#type' => 'number', '#title' => $this->t('Number of submissions'), '#min' => 1, '#default_value' => $export_options['range_latest'], ], ]; $ranges = [ 'serial' => ['#type' => 'number'], 'sid' => ['#type' => 'number'], 'date' => ['#type' => 'date'], ]; foreach ($ranges as $key => $range_element) { $form['export']['download'][$key] = [ '#type' => 'container', '#attributes' => ['class' => ['container-inline']], '#tree' => TRUE, '#states' => [ 'visible' => [ ':input[name="range_type"]' => ['value' => $key], ], ], ]; $form['export']['download'][$key]['range_start'] = $range_element + [ '#title' => $this->t('From'), '#parents' => [$key, 'range_start'], '#default_value' => $export_options['range_start'], ]; $form['export']['download'][$key]['range_end'] = $range_element + [ '#title' => $this->t('To'), '#parents' => [$key, 'range_end'], '#default_value' => $export_options['range_end'], ]; } $form['export']['download']['sticky'] = [ '#type' => 'checkbox', '#title' => $this->t('Starred/flagged submissions'), '#description' => $this->t('If checked, only starred/flagged submissions will be downloaded. If unchecked, all submissions will downloaded.'), '#return_value' => TRUE, '#default_value' => $export_options['sticky'], ]; // If drafts are allowed, provide options to filter download based on // submission state. $form['export']['download']['state'] = [ '#type' => 'radios', '#title' => $this->t('Submission state'), '#default_value' => $export_options['state'], '#options' => [ 'all' => $this->t('Completed and draft submissions'), 'completed' => $this->t('Completed submissions only'), 'draft' => $this->t('Drafts only'), ], '#access' => ($webform->getSetting('draft') != WebformInterface::DRAFT_NONE), ]; } /** * {@inheritdoc} */ public function getValuesFromInput(array $values) { if (isset($values['range_type'])) { $range_type = $values['range_type']; $values['range_type'] = $range_type; if (isset($values[$range_type])) { $values += $values[$range_type]; } } // Make sure only support options are returned. $values = array_intersect_key($values, $this->getDefaultExportOptions()); return $values; } /****************************************************************************/ // Generate and write. /****************************************************************************/ /** * {@inheritdoc} */ public function generate() { $entity_ids = $this->getQuery()->execute(); $webform_submissions = WebformSubmission::loadMultiple($entity_ids); $this->writeHeader(); $this->writeRecords($webform_submissions); $this->writeFooter(); } /** * {@inheritdoc} */ public function writeHeader() { // If building a new archive make sure to delete the exist archive. if ($this->isArchive()) { @unlink($this->getArchiveFilePath()); } $this->getExporter()->createExport(); $this->getExporter()->writeHeader(); $this->getExporter()->closeExport(); } /** * {@inheritdoc} */ public function writeRecords(array $webform_submissions) { $export_options = $this->getExportOptions(); $webform = $this->getWebform(); $is_archive = ($this->isArchive() && $export_options['files']); $files_directories = []; if ($is_archive) { $archiver = new ArchiveTar($this->getArchiveFilePath(), 'gz'); $stream_wrappers = array_keys($this->streamWrapperManager->getNames(StreamWrapperInterface::WRITE_VISIBLE)); foreach ($stream_wrappers as $stream_wrapper) { $files_directory = $this->fileSystem->realpath($stream_wrapper . '://webform/' . $webform->id()); $files_directories[] = $files_directory; } } $this->getExporter()->openExport(); foreach ($webform_submissions as $webform_submission) { if ($is_archive) { foreach ($files_directories as $files_directory) { $submission_directory = $files_directory . '/' . $webform_submission->id(); if (file_exists($submission_directory)) { $file_name = $this->getSubmissionBaseName($webform_submission); $archiver->addModify($submission_directory, $file_name, $submission_directory); } } } $this->getExporter()->writeSubmission($webform_submission); } $this->getExporter()->closeExport(); } /** * {@inheritdoc} */ public function writeFooter() { $this->getExporter()->openExport(); $this->getExporter()->writeFooter(); $this->getExporter()->closeExport(); } /** * {@inheritdoc} */ public function writeExportToArchive() { $export_file_path = $this->getExportFilePath(); if (file_exists($export_file_path)) { $archive_file_path = $this->getArchiveFilePath(); $archiver = new ArchiveTar($archive_file_path, 'gz'); $archiver->addModify($export_file_path, $this->getBaseFileName(), $this->getFileTempDirectory()); @unlink($export_file_path); } } /** * {@inheritdoc} */ public function getQuery() { $export_options = $this->getExportOptions(); $webform = $this->getWebform(); $source_entity = $this->getSourceEntity(); $query = $this->entityStorage->getQuery()->condition('webform_id', $webform->id()); // Filter by source entity or submitted to. if ($source_entity) { $query->condition('entity_type', $source_entity->getEntityTypeId()); $query->condition('entity_id', $source_entity->id()); } elseif ($export_options['entity_type']) { $query->condition('entity_type', $export_options['entity_type']); if ($export_options['entity_id']) { $query->condition('entity_id', $export_options['entity_id']); } } // Filter by sid or date range. switch ($export_options['range_type']) { case 'serial': if ($export_options['range_start']) { $query->condition('serial', $export_options['range_start'], '>='); } if ($export_options['range_end']) { $query->condition('serial', $export_options['range_end'], '<='); } break; case 'sid': if ($export_options['range_start']) { $query->condition('sid', $export_options['range_start'], '>='); } if ($export_options['range_end']) { $query->condition('sid', $export_options['range_end'], '<='); } break; case 'date': if ($export_options['range_start']) { $query->condition('created', strtotime($export_options['range_start']), '>='); } if ($export_options['range_end']) { $query->condition('created', strtotime('+1 day', strtotime($export_options['range_end'])), '<'); } break; } // Filter by (completion) state. switch ($export_options['state']) { case 'draft': $query->condition('in_draft', 1); break; case 'completed': $query->condition('in_draft', 0); break; } // Filter by sticky. if ($export_options['sticky']) { $query->condition('sticky', 1); } // Filter by latest. if ($export_options['range_type'] == 'latest' && $export_options['range_latest']) { // Clone the query and use it to get latest sid starting sid. $latest_query = clone $query; $latest_query->sort('sid', 'DESC'); $latest_query->range(0, (int) $export_options['range_latest']); if ($latest_query_entity_ids = $latest_query->execute()) { $query->condition('sid', end($latest_query_entity_ids), '>='); } } // Sort by sid with the oldest one first. $query->sort('sid', 'ASC'); return $query; } /** * Get element types from a webform. * * @return array * An array of element types from a webform. */ protected function getWebformElementTypes() { if (isset($this->elementTypes)) { return $this->elementTypes; } // If the webform is not set which only occurs on the admin settings webform, // return an empty array. if (!isset($this->webform)) { return []; } $this->elementTypes = []; $elements = $this->webform->getElementsDecodedAndFlattened(); // Always include 'entity_autocomplete' export settings which is used to // expand a webform submission's entity references. $this->elementTypes['entity_autocomplete'] = 'entity_autocomplete'; foreach ($elements as $element) { if (isset($element['#type'])) { $type = $this->elementManager->getElementPluginId($element); $this->elementTypes[$type] = $type; } } return $this->elementTypes; } /****************************************************************************/ // Summary and download. /****************************************************************************/ /** * {@inheritdoc} */ public function getTotal() { return $this->getQuery()->count()->execute(); } /** * {@inheritdoc} */ public function getBatchLimit() { return $this->configFactory->get('webform.settings')->get('batch.default_batch_export_size') ?: 500; } /** * {@inheritdoc} */ public function requiresBatch() { return ($this->getTotal() > $this->getBatchLimit()) ? TRUE : FALSE; } /** * {@inheritdoc} */ public function getFileTempDirectory() { return file_directory_temp(); } /** * {@inheritdoc} */ public function getSubmissionBaseName(WebformSubmissionInterface $webform_submission) { return $this->getExporter()->getSubmissionBaseName($webform_submission); } /** * {@inheritdoc} */ protected function getBaseFileName() { return $this->getExporter()->getBaseFileName(); } /** * {@inheritdoc} */ public function getExportFilePath() { return $this->getExporter()->getExportFilePath(); } /** * {@inheritdoc} */ public function getExportFileName() { return $this->getExporter()->getExportFileName(); } /** * {@inheritdoc} */ public function getArchiveFilePath() { return $this->getExporter()->getArchiveFilePath(); } /** * {@inheritdoc} */ public function getArchiveFileName() { return $this->getExporter()->getArchiveFileName(); } /** * {@inheritdoc} */ public function isArchive() { if ($this->getExporter()->isArchive()) { return TRUE; } else { $export_options = $this->getExportOptions(); return ($export_options['download'] && $export_options['files']); } } /** * {@inheritdoc} */ public function isBatch() { return ($this->isArchive() || ($this->getTotal() >= $this->getBatchLimit())); } }
msbtterswrth/mdspca-fosters
modules/webform/src/WebformSubmissionExporter.php
PHP
gpl-2.0
27,760
[ 30522, 1026, 1029, 25718, 3415, 15327, 2852, 6279, 2389, 1032, 4773, 14192, 1025, 2224, 2852, 6279, 2389, 1032, 4563, 1032, 8756, 2099, 1032, 8756, 7559, 1025, 2224, 2852, 6279, 2389, 1032, 4563, 1032, 9530, 8873, 2290, 1032, 9530, 8873, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* css Zen Garden submission 137 - 'DJ Style', by Ramon Bispo, http://ilhasol.com/bastidores.asp */ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ /* All associated graphics copyright 2004, Ramon Bispo */ /* Added: Nov. 29th, 2004 */ /* IMPORTANT */ /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. However, feel free to study the CSS and use techniques you learn from it elsewhere. */ /* ########################################################################################################## css Zen Garden style - 'Dj Style' by Ramon Bispo da Silva (Page) Rio de Janeiro, Brazil | September - November, 2004 | All Rights reserved ########################################################################################################### */ /* basic elements */ body { font: 12px/17px tahoma, arial; background: #155970; margin: auto auto; padding: 0; text-align: center; } p { font: 12px/17px tahoma, arial, sans-serif; margin: 0 0 17px 0; } a:link { font-weight: bold; text-decoration: none; color: #333399; } a:visited { font-weight: bold; text-decoration: none; color: #6699FF; } a.c:visited { font-weight: normal; text-decoration: none; color: #858686; } a:hover, a:active { text-decoration: underline; color: #3366CC; } ul { list-style-type: none; margin: 0; padding: 0; } /* specific divs */ #container { width: 762px; padding: 0; margin: auto; text-align: left; background: url(pageheader.gif) no-repeat top left; } #intro { vertical-align: bottom; } #pageHeader { padding: 0; margin: 0; height: 425px; border: 1px solid white; } #pageHeader h1 { width: 760px; height: 430px; margin: 0px 0px 0px 0px; padding: 0; } #pageHeader h1 span { display:none } #pageHeader h2 { padding: 0; margin: 0; } #pageHeader h2 span { display: none; } #quickSummary p.p1 { display:none; } #quickSummary p.p1 span{ display: none; } #quickSummary p.p2{ display: block; position: absolute; border: 1px solid #ffffff; top: 400px; margin-left: 250px; padding: 0 7px 0 7px; font-size: 10px; text-align: center; color: #ffffff; text-transform: uppercase; font-family:Arial, Helvetica, sans-serif; clear: both; } #quickSummary p.p2 a:link, a:active{ color:#33eeff; } #quickSummary p.p2 a:hover{ text-decoration: underline; } #quickSummary p.p2 a:visited{ color:#33eeff; text-decoration: line-through; } #preamble { width: 291px; float: left; background: url(bg_preamble.gif) no-repeat; } #preamble h3 { background: url(header_preamble.gif) no-repeat; width: 291px; height: 50px; margin: 0; padding: 0; border-top: 1px solid #ffffff; } #preamble h3 span { display: none; } #preamble p { font-family:Arial, Helvetica, sans-serif; padding: 5px; color: #155970; font-size:12px; text-transform:uppercase; font-weight:bold; width: 270px; } #preamble p.p1 { margin-top: 10px; } #supportingText { padding: 0; margin: -3px 0 40px 0; background: #33ccff; border: 1px solid #ffffff; width: 469px; float: right; } #supportingText p { margin: 9px 17px 17px 24px; color: #155970; } #explanation h3 { background: url(what_is.gif) no-repeat; width: 469px; height: 40px; margin: 0; padding: 0; } #explanation h3 span { display: none; } #participation h3 { background: url(participation.gif) no-repeat; width: 469px; height: 40px; margin: 0; padding: 0; } #participation h3 span { display: none; } #benefits h3 { background: url(benefits.gif) no-repeat; width: 469px; height: 40px; margin: 0; padding: 0; } #benefits h3 span { display: none; } #requirements h3 { background: url(requirements.gif) no-repeat; width: 469px; height: 40px; margin: 0; padding: 0; } #requirements h3 span { display: none; } #footer { background: #155970; border: 1px solid #ffffff; padding: 0 0 2px 24px; font-size: 12px; font-weight:bold; text-align: center; text-transform:uppercase; font-family:Arial, Helvetica, sans-serif; } #footer a:link, a:active{ color: #ffffff; } #footer a:hover{ color: #33eeff; text-decoration:underline; } #footer a:visited{ color: #ffffff; text-decoration: line-through; } a.c { font-weight: normal; } #lselect, #larchives, #lresources { width: 278px; clear: left; padding: 0; margin: 0; } #lselect { background: url(select.gif) no-repeat; border: 1px solid #ffffff; margin-top: 20px; padding: 50px 0 0 5px; } #lselect li a:link, a:active{ text-decoration:none; text-transform:uppercase; font-size:12px; color:#FFFFFF; } #lselect li a:hover { text-decoration:underline; color: #e9e9e9; } #lselect a:visited { color: #155970; text-decoration:line-through; text-transform:uppercase; } #larchives { background: url(archives.gif) no-repeat; border: 1px solid #ffffff; margin-top: 20px; padding: 50px 0 0 5px; } #larchives li a:link, a:active{ text-decoration:none; text-transform:uppercase; font-size:12px; color:#FFFFFF; } #larchives li a:hover { text-decoration:underline; color: #e9e9e9; } #larchives a:visited { color: #155970; text-decoration:line-through; text-transform:uppercase; } #lresources { background: url(resources.gif) no-repeat; border: 1px solid #ffffff; margin-top: 20px; padding: 50px 0 0 5px; } #lresources li a:link, a:active{ text-decoration:none; text-transform:uppercase; font-size:12px; color:#FFFFFF; } #lresources li a:hover { text-decoration:underline; color: #e9e9e9; } #lresources a:visited { color: #155970; text-decoration:line-through; text-transform:uppercase; } #lselect h3 span, #larchives h3 span, #lresources h3 span { display: none; } #linklist { position: absolute; top: 48em; } #linkList #linkList2 ul { padding: 20px 10px 10px 10px; display:block; } #linklist li { margin: 2px 0; }
codenothing/css-compressor
unit/benchmark/src/csszengarden.com.137.css
CSS
mit
6,234
[ 30522, 1013, 1008, 20116, 2015, 16729, 3871, 12339, 14989, 1011, 1005, 6520, 2806, 1005, 1010, 2011, 12716, 20377, 6873, 1010, 8299, 1024, 1013, 1013, 6335, 14949, 4747, 1012, 4012, 1013, 19021, 3775, 7983, 2229, 1012, 2004, 2361, 1008, 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...
/* Copyright (c) 2012, The Linux Foundation. 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/init.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/memory_alloc.h> #include <mach/memory.h> #include <mach/scm.h> #include <mach/msm_dcvs_scm.h> #define DCVS_CMD_REGISTER_CORE 2 #define DCVS_CMD_SET_ALGO_PARAM 3 #define DCVS_CMD_EVENT 4 #define DCVS_CMD_INIT 5 #define DCVS_CMD_SET_POWER_PARAM 6 struct scm_register_core { uint32_t core_id; phys_addr_t core_param_phy; }; struct scm_algo { uint32_t core_id; phys_addr_t algo_phy; }; struct scm_init { uint32_t phy; uint32_t size; }; struct scm_pwr_param { uint32_t core_id; phys_addr_t pwr_param_phy; phys_addr_t freq_phy; phys_addr_t coeffs_phy; }; int msm_dcvs_scm_init(size_t size) { int ret = 0; struct scm_init init; uint32_t p = 0; /* Allocate word aligned non-cacheable memory */ p = allocate_contiguous_ebi_nomap(size, 4); if (!p) return -ENOMEM; init.phy = p; init.size = size; ret = scm_call(SCM_SVC_DCVS, DCVS_CMD_INIT, &init, sizeof(init), NULL, 0); /* Not freed if the initialization succeeds */ if (ret) free_contiguous_memory_by_paddr(p); return ret; } EXPORT_SYMBOL(msm_dcvs_scm_init); int msm_dcvs_scm_register_core(uint32_t core_id, struct msm_dcvs_core_param *param) { int ret = 0; struct scm_register_core reg_data; struct msm_dcvs_core_param *p = NULL; p = kzalloc(PAGE_ALIGN(sizeof(struct msm_dcvs_core_param)), GFP_KERNEL); if (!p) return -ENOMEM; memcpy(p, param, sizeof(struct msm_dcvs_core_param)); reg_data.core_id = core_id; reg_data.core_param_phy = virt_to_phys(p); ret = scm_call(SCM_SVC_DCVS, DCVS_CMD_REGISTER_CORE, &reg_data, sizeof(reg_data), NULL, 0); kfree(p); return ret; } EXPORT_SYMBOL(msm_dcvs_scm_register_core); int msm_dcvs_scm_set_algo_params(uint32_t core_id, struct msm_dcvs_algo_param *param) { int ret = 0; struct scm_algo algo; struct msm_dcvs_algo_param *p = NULL; p = kzalloc(PAGE_ALIGN(sizeof(struct msm_dcvs_algo_param)), GFP_KERNEL); if (!p) return -ENOMEM; memcpy(p, param, sizeof(struct msm_dcvs_algo_param)); algo.core_id = core_id; algo.algo_phy = virt_to_phys(p); ret = scm_call(SCM_SVC_DCVS, DCVS_CMD_SET_ALGO_PARAM, &algo, sizeof(algo), NULL, 0); kfree(p); return ret; } EXPORT_SYMBOL(msm_dcvs_scm_set_algo_params); int msm_dcvs_scm_set_power_params(uint32_t core_id, struct msm_dcvs_power_params *pwr_param, struct msm_dcvs_freq_entry *freq_entry, struct msm_dcvs_energy_curve_coeffs *coeffs) { int ret = 0; struct scm_pwr_param pwr; struct msm_dcvs_power_params *pwrt = NULL; struct msm_dcvs_freq_entry *freqt = NULL; struct msm_dcvs_energy_curve_coeffs *coefft = NULL; pwrt = kzalloc(PAGE_ALIGN(sizeof(struct msm_dcvs_power_params)), GFP_KERNEL); if (!pwrt) return -ENOMEM; freqt = kzalloc(PAGE_ALIGN(sizeof(struct msm_dcvs_freq_entry) * pwr_param->num_freq), GFP_KERNEL); if (!freqt) { kfree(pwrt); return -ENOMEM; } coefft = kzalloc(PAGE_ALIGN( sizeof(struct msm_dcvs_energy_curve_coeffs)), GFP_KERNEL); if (!coefft) { kfree(pwrt); kfree(freqt); return -ENOMEM; } memcpy(pwrt, pwr_param, sizeof(struct msm_dcvs_power_params)); memcpy(freqt, freq_entry, sizeof(struct msm_dcvs_freq_entry)*pwr_param->num_freq); memcpy(coefft, coeffs, sizeof(struct msm_dcvs_energy_curve_coeffs)); pwr.core_id = core_id; pwr.pwr_param_phy = virt_to_phys(pwrt); pwr.freq_phy = virt_to_phys(freqt); pwr.coeffs_phy = virt_to_phys(coefft); ret = scm_call(SCM_SVC_DCVS, DCVS_CMD_SET_POWER_PARAM, &pwr, sizeof(pwr), NULL, 0); kfree(pwrt); kfree(freqt); kfree(coefft); return ret; } EXPORT_SYMBOL(msm_dcvs_scm_set_power_params); int msm_dcvs_scm_event(uint32_t core_id, enum msm_dcvs_scm_event event_id, uint32_t param0, uint32_t param1, uint32_t *ret0, uint32_t *ret1) { int ret = -EINVAL; if (!ret0 || !ret1) return ret; ret = scm_call_atomic4_3(SCM_SVC_DCVS, DCVS_CMD_EVENT, core_id, event_id, param0, param1, ret0, ret1); #if 0 trace_msm_dcvs_scm_event(core_id, (int)event_id, param0, param1, *ret0, *ret1); #endif return ret; } EXPORT_SYMBOL(msm_dcvs_scm_event);
TeamPlaceholder/android_kernel_lge_gee
arch/arm/mach-msm/msm_dcvs_scm.c
C
gpl-2.0
4,675
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2262, 1010, 1996, 11603, 3192, 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, 1008, 2009, 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...
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/xr19rel/WINNT_5.2_Depend/mozilla/netwerk/cache/public/nsICache.idl */ #ifndef __gen_nsICache_h__ #define __gen_nsICache_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif typedef PRInt32 nsCacheStoragePolicy; typedef PRInt32 nsCacheAccessMode; /* starting interface: nsICache */ #define NS_ICACHE_IID_STR "ec1c0063-197d-44bb-84ba-7525d50fc937" #define NS_ICACHE_IID \ {0xec1c0063, 0x197d, 0x44bb, \ { 0x84, 0xba, 0x75, 0x25, 0xd5, 0x0f, 0xc9, 0x37 }} /** * nsICache is a namespace for various cache constants. It does not represent * an actual object. */ class NS_NO_VTABLE NS_SCRIPTABLE nsICache { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICACHE_IID) /** * Access Modes * * * Mode Requested | Not Cached | Cached * ------------------------------------------------------------------------ * READ | KEY_NOT_FOUND | NS_OK * | Mode = NONE | Mode = READ * | No Descriptor | Descriptor * ------------------------------------------------------------------------ * WRITE | NS_OK | NS_OK (Cache service * | Mode = WRITE | Mode = WRITE dooms existing * | Descriptor | Descriptor cache entry) * ------------------------------------------------------------------------ * READ_WRITE | NS_OK | NS_OK * (1st req.) | Mode = WRITE | Mode = READ_WRITE * | Descriptor | Descriptor * ------------------------------------------------------------------------ * READ_WRITE | N/A | NS_OK * (Nth req.) | | Mode = READ * | | Descriptor * ------------------------------------------------------------------------ * * * Access Requested: * * READ - I only want to READ, if there isn't an entry just fail * WRITE - I have something new I want to write into the cache, make * me a new entry and doom the old one, if any. * READ_WRITE - I want to READ, but I'm willing to update an existing * entry if necessary, or create a new one if none exists. * * * Access Granted: * * NONE - No descriptor is provided. You get zilch. Nada. Nothing. * READ - You can READ from this descriptor. * WRITE - You must WRITE to this descriptor because the cache entry * was just created for you. * READ_WRITE - You can READ the descriptor to determine if it's valid, * you may WRITE if it needs updating. * * * Comments: * * If you think that you might need to modify cached data or meta data, * then you must open a cache entry requesting WRITE access. Only one * cache entry descriptor, per cache entry, will be granted WRITE access. * * Usually, you will request READ_WRITE access in order to first test the * meta data and informational fields to determine if a write (ie. going * to the net) may actually be necessary. If you determine that it is * not, then you would mark the cache entry as valid (using MarkValid) and * then simply read the data from the cache. * * A descriptor granted WRITE access has exclusive access to the cache * entry up to the point at which it marks it as valid. Once the cache * entry has been "validated", other descriptors with READ access may be * opened to the cache entry. * * If you make a request for READ_WRITE access to a cache entry, the cache * service will downgrade your access to READ if there is already a * cache entry descriptor open with WRITE access. * * If you make a request for only WRITE access to a cache entry and another * descriptor with WRITE access is currently open, then the existing cache * entry will be 'doomed', and you will be given a descriptor (with WRITE * access only) to a new cache entry. * */ enum { ACCESS_NONE = 0 }; enum { ACCESS_READ = 1 }; enum { ACCESS_WRITE = 2 }; enum { ACCESS_READ_WRITE = 3 }; /** * Storage Policy * * The storage policy of a cache entry determines the device(s) to which * it belongs. See nsICacheSession and nsICacheEntryDescriptor for more * details. * * STORE_ANYWHERE - Allows the cache entry to be stored in any device. * The cache service decides which cache device to use * based on "some resource management calculation." * STORE_IN_MEMORY - Requires the cache entry to reside in non-persistent * storage (ie. typically in system RAM). * STORE_ON_DISK - Requires the cache entry to reside in persistent * storage (ie. typically on a system's hard disk). * STORE_ON_DISK_AS_FILE - Requires the cache entry to reside in persistent * storage, and in a separate file. * STORE_OFFLINE - Requires the cache entry to reside in persistent, * reliable storage for offline use. */ enum { STORE_ANYWHERE = 0 }; enum { STORE_IN_MEMORY = 1 }; enum { STORE_ON_DISK = 2 }; enum { STORE_ON_DISK_AS_FILE = 3 }; enum { STORE_OFFLINE = 4 }; /** * All entries for a cache session are stored as streams of data or * as objects. These constant my be used to specify the type of entries * when calling nsICacheService::CreateSession(). */ enum { NOT_STREAM_BASED = 0 }; enum { STREAM_BASED = 1 }; /** * The synchronous OpenCacheEntry() may be blocking or non-blocking. If a cache entry is * waiting to be validated by another cache descriptor (so no new cache descriptors for that * key can be created, OpenCacheEntry() will return NS_ERROR_CACHE_WAIT_FOR_VALIDATION in * non-blocking mode. In blocking mode, it will wait until the cache entry for the key has * been validated or doomed. If the cache entry is validated, then a descriptor for that * entry will be created and returned. If the cache entry was doomed, then a descriptor * will be created for a new cache entry for the key. */ enum { NON_BLOCKING = 0 }; enum { BLOCKING = 1 }; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsICache, NS_ICACHE_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICACHE \ /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICACHE(_to) \ /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICACHE(_to) \ #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCache : public nsICache { public: NS_DECL_ISUPPORTS NS_DECL_NSICACHE nsCache(); private: ~nsCache(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCache, nsICache) nsCache::nsCache() { /* member initializers and constructor code */ } nsCache::~nsCache() { /* destructor code */ } /* End of implementation class template. */ #endif #include "nsNetError.h" #endif /* __gen_nsICache_h__ */
nikgoodley-ibboost/forklabs-javaxpcom
tools/xulrunner-1.9.0.13-sdk/include/nkcache/nsICache.h
C
gpl-2.0
7,951
[ 30522, 1013, 1008, 1008, 2079, 2025, 10086, 1012, 2023, 5371, 2003, 7013, 2013, 1041, 1024, 1013, 1060, 2099, 16147, 16570, 1013, 2663, 3372, 1035, 1019, 1012, 1016, 1035, 12530, 1013, 9587, 5831, 4571, 1013, 5658, 29548, 1013, 17053, 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...
<?php /** * @package Make */ /** * Class MAKE_Error_Collector * * A tool for collecting Make-related error messages and outputting them all in one place. * * @since 1.7.0. */ final class MAKE_Error_Collector extends MAKE_Util_Modules implements MAKE_Error_CollectorInterface { /** * An associative array of required modules. * * @since 1.7.0. * * @var array */ protected $dependencies = array( 'errors' => 'WP_Error', 'error_display' => 'MAKE_Error_DisplayInterface' ); /** * Switch for showing errors. * * @since 1.7.0. * * @var bool */ private $show_errors = true; /** * MAKE_Error_Collector constructor. * * @since 1.7.0. * * @param MAKE_APIInterface|null $api * @param array $modules */ public function __construct( MAKE_APIInterface $api = null, array $modules = array() ) { /** * Filter: Toggle for showing Make errors. * * @since 1.7.0. * * @param bool $show_errors True to show errors. */ $this->show_errors = apply_filters( 'make_show_errors', current_user_can( 'install_themes' ) ); // Module defaults. $modules = wp_parse_args( $modules, array( 'errors' => 'WP_Error', ) ); // Only load the display module if errors should be shown. if ( true === $this->show_errors ) { $modules['error_display'] = new MAKE_Error_Display( $api, array( 'error' => $this ) ); } else { unset( $this->dependencies['error_display'] ); } // Load dependencies. parent::__construct( $api, $modules ); } /** * Wrapper to add an error to the injected instance of WP_Error. * * @since 1.7.0. * * @param string $code * @param string $message * @param string $data */ public function add_error( $code, $message, $data = '' ) { $this->errors()->add( $code, $message, $data ); } /** * Check if a particular error code has been added. * * @since 1.7.0. * * @param string $code * * @return bool */ public function has_code( $code ) { return in_array( $code, $this->get_codes() ); } /** * Check if any errors have been added. * * @since 1.7.0. * * @return bool */ public function has_errors() { return ! empty( $this->errors()->errors ); } /** * Wrapper to get the list of error codes from the WP_Error object. * * @since 1.7.0. * * @return array */ public function get_codes() { return $this->errors()->get_error_codes(); } /** * Wrapper to get the list of error messages for a particular code from the WP_Error object. * * @since 1.7.0. * * @param string $code * * @return array */ public function get_messages( $code = '' ) { return $this->errors()->get_error_messages( $code ); } /** * Generate a backtrace and return either as an ordered list or a raw array. * * Based on wp_debug_backtrace_summary() in Core. * * @since 1.7.0. * * @param array $ignore_class An array of class names to ignore in the call stack. * @param string $output 'list' outputs an HTML ordered list. Otherwise an array. * * @return array|string */ public function generate_backtrace( array $ignore_class = array(), $output = 'list' ) { if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) { $trace = debug_backtrace( false ); } else { $trace = debug_backtrace(); } // Add the error collector to the ignore class list. $ignore_class[] = get_class( $this ); /** * Filter: Change the number of steps shown in a Make Error backtrace. * * @since 1.7.0. * * @param int $limit The number of backtrace steps to show. */ $limit = absint( apply_filters( 'make_error_backtrace_limit', 1 ) ); // Start the stack $stack = array(); $count = 0; foreach ( $trace as $call ) { if ( $count >= $limit ) { break; } if ( isset( $call['class'] ) ) { // Skip calls from classes in the ignore class array. if ( in_array( $call['class'], $ignore_class ) ) { continue; } $caller = "{$call['class']}{$call['type']}{$call['function']}"; } else { if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) { $caller = "{$call['function']}( '{$call['args'][0]}' )"; } else if ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) { $caller = $call['function'] . "( '" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "' )"; } else { $caller = $call['function']; } } if ( isset( $call['file'] ) && isset( $call['line'] ) ) { $caller .= " in <strong>{$call['file']}</strong> on line <strong>{$call['line']}</strong>"; } $stack[] = $caller; $count++; } if ( 'list' === $output ) { if ( ! empty( $stack ) ) { return '<ol><li>' . implode( '</li><li>', $stack ) . '</li></ol>'; } else { return ''; } } else { return $stack; } } }
AudreyGuilbaud/portfoliowp
wp-content/themes/make/inc/error/collector.php
PHP
gpl-2.0
4,890
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1030, 7427, 2191, 1008, 1013, 1013, 1008, 1008, 1008, 2465, 2191, 1035, 7561, 1035, 10018, 1008, 1008, 1037, 6994, 2005, 9334, 2191, 1011, 3141, 7561, 7696, 1998, 6434, 3436, 2068, 2035, 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...
""" accounts.test_views =================== Tests the REST API calls. Add more specific social registration tests """ import responses from django.core.urlresolvers import reverse from django.core import mail from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.test.utils import override_settings from rest_framework import status from rest_framework.test import APIClient, APITestCase from allauth.account import app_settings from allauth.socialaccount.models import SocialApp from allauth.socialaccount.providers.facebook.provider import GRAPH_API_URL from .serializers import LoginSerializer class TestAccounts(APITestCase): """ Tests normal use - non social login. """ def setUp(self): self.login_url = reverse('accounts:rest_login') self.logout_url = reverse('accounts:rest_logout') self.register_url = reverse('accounts:rest_register') self.password_reset_url = reverse('accounts:rest_password_reset') self.rest_password_reset_confirm_url = reverse('accounts:rest_password_reset_confirm') self.password_change_url = reverse('accounts:rest_password_change') self.verify_url = reverse('accounts:rest_verify_email') self.user_url = reverse('accounts:rest_user_details') self.client = APIClient() self.reusable_user_data = {'username': 'admin', 'email': 'admin@email.com', 'password': 'password12'} self.reusable_user_data_change_password = {'username': 'admin', 'email': 'admin@email.com', 'password': 'password_same'} self.reusable_register_user_data = {'username': 'admin', 'email': 'admin@email.com', 'password1': 'password12', 'password2': 'password12'} self.reusable_register_user_data1 = {'username': 'admin1', 'email': 'admin1@email.com', 'password1': 'password12', 'password2': 'password12'} self.reusable_register_user_data_no_username = {'email': 'admin@email.com', 'password1': 'password12', 'password2': 'password12'} self.reusable_register_user_data_no_email = {'username': 'admin', 'password1': 'password12', 'password2': 'password12'} self.change_password_data_incorrect = {"new_password1": "password_not_same", "new_password2": "password_same"} self.change_password_data = {"new_password1": "password_same", "new_password2": "password_same"} self.change_password_data_old_password_field_enabled = {"old_password": "password12", "new_password1": "password_same", "new_password2": "password_same"} def create_user_and_login(self): """ Helper function to create a basic user, login and assign token credentials. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK, "Snap! Basic Login has failed with a helper function 'create_user_and_login'. Something is really wrong here.") self.client.credentials(HTTP_AUTHORIZATION='Token ' + response.data['key']) def _generate_uid_and_token(self, user): result = {} from django.utils.encoding import force_bytes from django.contrib.auth.tokens import default_token_generator from django import VERSION if VERSION[1] == 5: from django.utils.http import int_to_base36 result['uid'] = int_to_base36(user.pk) else: from django.utils.http import urlsafe_base64_encode result['uid'] = urlsafe_base64_encode(force_bytes(user.pk)) result['token'] = default_token_generator.make_token(user) return result def cleanUp(self): pass @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_login_basic_username_auth_method(self): """ Tests basic functionality of login with authentication method of username. """ # Assumes you provide username,password and returns a token get_user_model().objects.create_user('admin3', '', 'password12') data = {"username": 'admin3', "email": "", "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.content) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL, ACCOUNT_EMAIL_REQUIRED=True) def test_login_basic_email_auth_method(self): """ Tests basic functionality of login with authentication method of email. """ # Assumes you provide username,password and returns a token get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') data = {"username": '', "email": "email.login@gmail.com", "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.content) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_login_basic_username_email_auth_method(self): """ Tests basic functionality of login with authentication method of username or email. """ # Assumes you provide username,password and returns a token get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') # Check email data = {"username": '', "email": "email.login@gmail.com", "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) # Check username data = {"username": 'admin', "email": '', "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.content) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_login_auth_method_username_fail_no_users_in_db(self): """ Tests login fails with a 400 when no users in db for login auth method of 'username'. """ serializer = LoginSerializer({'username': 'admin', 'password': 'password12'}) response = self.client.post(self.login_url, serializer.data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_login_email_auth_method_fail_no_users_in_db(self): """ Tests login fails with a 400 when no users in db for login auth method of 'email'. """ serializer = LoginSerializer({'username': 'admin', 'password': 'password12'}) response = self.client.post(self.login_url, serializer.data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_login_username_email_auth_method_fail_no_users_in_db(self): """ Tests login fails with a 400 when no users in db for login auth method of 'username_email'. """ serializer = LoginSerializer({'username': 'admin', 'password': 'password12'}) response = self.client.post(self.login_url, serializer.data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) def common_test_login_fail_incorrect_change(self): # Create user, login and try and change password INCORRECTLY self.create_user_and_login() self.client.post(self.password_change_url, data=self.change_password_data_incorrect, format='json') # Remove credentials self.client.credentials() response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.content) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_login_username_auth_method_fail_incorrect_password_change(self): """ Tests login fails with an incorrect/invalid password change (login auth username). """ self.common_test_login_fail_incorrect_change() @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_login_email_auth_method_fail_incorrect_password_change(self): """ Tests login fails with an incorrect/invalid password change (login auth email). """ self.common_test_login_fail_incorrect_change() @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_login_username_email_auth_method_fail_incorrect_password_change(self): """ Tests login fails with an incorrect/invalid password change (login auth username_email). """ self.common_test_login_fail_incorrect_change() def common_test_login_correct_password_change(self): # Create user, login and try and change password successfully self.create_user_and_login() response = self.client.post(self.password_change_url, data=self.change_password_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) # Remove credentials self.client.credentials() response = self.client.post(self.login_url, self.reusable_user_data_change_password, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.content) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_login_username_auth_method_correct_password_change(self): """ Tests login is succesful with a correct password change (login auth username). """ self.common_test_login_correct_password_change() @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_login_email_auth_method_correct_password_change(self): """ Tests login is succesful with a correct password change (login auth email). """ self.common_test_login_correct_password_change() @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_login_username_email_auth_method_correct_password_change(self): """ Tests login is succesful with a correct password change (login auth username_email). """ self.common_test_login_correct_password_change() def test_login_fail_no_input(self): """ Tests login fails when you provide no username and no email (login auth username_email). """ get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') data = {"username": '', "email": '', "password": ''} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_login_username_auth_method_fail_no_input(self): """ Tests login fails when you provide no username (login auth username). """ get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') data = {"username": '', "email": "email.login@gmail.com", "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_login_email_auth_method_fail_no_input(self): """ Tests login fails when you provide no username (login auth email). """ get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') data = {"username": "admin", "email": '', "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_login_username_email_auth_method_fail_no_input(self): """ Tests login fails when you provide no username and no email (login auth username_email). """ get_user_model().objects.create_user('admin', 'email.login@gmail.com', 'password12') data = {"username": '', "email": '', "password": 'password12'} response = self.client.post(self.login_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) # need to check for token # test login with password change # test login with wrong password chaneg if fails def test_logout(self): """ Tests basic logout functionality. """ self.create_user_and_login() response = self.client.post(self.logout_url, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"Successfully logged out."}') def test_logout_but_already_logged_out(self): """ Tests logout when already logged out. """ self.create_user_and_login() response = self.client.post(self.logout_url, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"Successfully logged out."}') self.client.credentials() # remember to remove manual token credential response = self.client.post(self.logout_url, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK, response.content) self.assertEquals(response.content, '{"success":"Successfully logged out."}') def test_change_password_basic(self): """ Tests basic functionality of 'change of password'. """ self.create_user_and_login() response = self.client.post(self.password_change_url, data=self.change_password_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"New password has been saved."}') def test_change_password_basic_fails_not_authorised(self): """ Tests basic functionality of 'change of password' fails if not authorised. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.post(self.password_change_url, data=self.change_password_data, format='json') self.assertEquals(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEquals(response.content, '{"detail":"Authentication credentials were not provided."}') def common_change_password_login_fail_with_old_password(self, password_change_data): self.create_user_and_login() response = self.client.post(self.password_change_url, data=password_change_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.client.credentials() # Remove credentials response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) def common_change_password_login_pass_with_new_password(self, password_change_data): self.create_user_and_login() response = self.client.post(self.password_change_url, password_change_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.client.credentials() # Remove credentials response = self.client.post(self.login_url, self.reusable_user_data_change_password, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) def common_change_password_login_fail_with_old_password_pass_with_new_password(self, password_change_data): """ Tests change of password with old password fails but new password successes. """ self.create_user_and_login() response = self.client.post(self.password_change_url, password_change_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK, response.content) self.client.credentials() # Remove credentials response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) response = self.client.post(self.login_url, self.reusable_user_data_change_password, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK, response.content) def test_change_password_login_fail_with_old_password(self): """ Tests change of password with old password. """ self.common_change_password_login_fail_with_old_password(self.change_password_data) def test_change_password_login_pass_with_new_password(self): """ Tests change of password with new password. """ self.common_change_password_login_pass_with_new_password(self.change_password_data) def test_change_password_login_fail_with_old_password_pass_with_new_password(self): """ Tests change of password with old password fails but new password successes. """ self.common_change_password_login_fail_with_old_password_pass_with_new_password(self.change_password_data) @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_old_password_field_required_old_password_field_enabled(self): """ Tests basic functionality of 'change of password' fails if old password not given as part of input (old password field enabled). """ self.create_user_and_login() response = self.client.post(self.password_change_url, data=self.change_password_data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEquals(response.content, '{"old_password":["This field is required."]}') @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_basic_old_password_field_enabled(self): """ Tests basic functionality of 'change of password' (old password enabled). """ self.create_user_and_login() response = self.client.post(self.password_change_url, data=self.change_password_data_old_password_field_enabled, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"New password has been saved."}') @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_basic_fails_not_authorised_old_password_field_enabled(self): """ Tests basic functionality of 'change of password' fails if not authorised (old password field enabled). """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.post(self.password_change_url, data=self.change_password_data_old_password_field_enabled, format='json') self.assertEquals(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEquals(response.content, '{"detail":"Authentication credentials were not provided."}') @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_login_fail_with_old_password_old_password_field_enabled(self): """ Tests change of password with old password (old password field enabled). """ self.common_change_password_login_fail_with_old_password(self.change_password_data_old_password_field_enabled) @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_login_pass_with_new_password_old_password_field_enabled(self): """ Tests change of password with new password (old password field enabled). """ self.common_change_password_login_pass_with_new_password(self.change_password_data_old_password_field_enabled) @override_settings(OLD_PASSWORD_FIELD_ENABLED=True) def test_change_password_login_fail_with_old_password_pass_with_new_password_old_password_field_enabled(self): """ Tests change of password with old password fails but new password successes (old password field enabled). """ self.common_change_password_login_fail_with_old_password_pass_with_new_password(self.change_password_data_old_password_field_enabled) """ Registrations Tests =================== """ def common_test_registration_basic(self, data): response = self.client.post(self.register_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_201_CREATED, response.content) return response @override_settings(ACCOUNT_EMAIL_REQUIRED=True, ACCOUNT_USERNAME_REQUIRED=True) def test_registration_basic(self): """ Tests basic functionality of registration. """ self.common_test_registration_basic(self.reusable_register_user_data) @override_settings(ACCOUNT_EMAIL_REQUIRED=True, ACCOUNT_USERNAME_REQUIRED=False) def test_registration_basic_no_username(self): """ Tests basic functionality of registration (no username required). """ self.common_test_registration_basic(self.reusable_register_user_data_no_username) @override_settings(ACCOUNT_EMAIL_REQUIRED=False, ACCOUNT_USERNAME_REQUIRED=True) def test_registration_basic_no_email(self): """ Tests basic functionality of registration (no username required). """ self.common_test_registration_basic(self.reusable_register_user_data_no_email) @override_settings(ACCOUNTS_REGISTRATION_OPEN=False) def test_registration_basic_registration_not_open(self): """ Tests basic registration fails if registration is closed. """ response = self.client.post(self.register_url, self.reusable_register_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST, response.content) @override_settings(ACCOUNT_EMAIL_VERIFICATION="none") def test_registration_email_verification_not_necessary(self): """ Tests you can log in without email verification """ self.common_test_registration_basic(self.reusable_register_user_data) response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) @override_settings(ACCOUNT_EMAIL_VERIFICATION="optional") def test_registration_email_verification_neccessary(self): """ Tests you can log in without email verification """ self.common_test_registration_basic(self.reusable_register_user_data) response = self.client.post(self.login_url, self.reusable_user_data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) def common_test_registration(self): self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'email': 'admin1@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) def common_test_registration_email_verification_not_necessary_email(self): self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'email': 'admin1@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) def common_test_registration_email_verification_not_necessary_username(self): self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'username': 'admin1', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) @override_settings(ACCOUNT_EMAIL_VERIFICATION="none", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_registration_email_verification_neccessary_email(self): """ Tests you can log in without email verification """ self.common_test_registration_email_verification_not_necessary_email() @override_settings(ACCOUNT_EMAIL_VERIFICATION="optional", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_registration_email_verification_neccessary_optional_email(self): """ Tests you can log in without email verification """ self.common_test_registration_email_verification_not_necessary_email() @override_settings(ACCOUNT_EMAIL_VERIFICATION="none", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_registration_email_verification_neccessary_username(self): """ Tests you can log in without email verification """ self.common_test_registration_email_verification_not_necessary_username() @override_settings(ACCOUNT_EMAIL_VERIFICATION="optional", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_registration_email_verification_neccessary_optional_username(self): """ Tests you can log in without email verification """ self.common_test_registration_email_verification_not_necessary_username() @override_settings(ACCOUNT_EMAIL_VERIFICATION="none", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_registration_email_verification_neccessary_username_email(self): """ Tests you canT log in without email verification for username & email auth. """ self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'username': 'admin1', 'email': 'admin1@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) @override_settings(ACCOUNT_EMAIL_VERIFICATION="optional", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_registration_email_verification_neccessary_optional_username_email(self): """ Tests you canT log in without email verification for username & email auth. """ self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'username': 'admin1', 'email': 'admin1@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_registration_email_verification_necessary_login_fail_username(self): """ Tests you can log in without email verification """ self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'username': 'admin1', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST, response.content) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_registration_email_verification_necessary_login_fail_email(self): """ Tests you can log in without email verification """ self.common_test_registration_basic(self.reusable_register_user_data1) response = self.client.post(self.login_url, {'email': 'admin1@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST, response.content) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_registration_email_verification_necessary_login_fail_username_email(self): """ Tests you can log in without email verification """ self.common_test_registration_basic({'username': 'admin_man', 'email': 'admin1@email.com', 'password1': 'password12', 'password2': 'password12'}) response = self.client.post(self.login_url, {'username': 'admin_man', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) def common_registration_email_verification_neccessary_verified_login(self, login_data): mail_count = len(mail.outbox) reg_response = self.common_test_registration_basic(self.reusable_register_user_data1) self.assertEquals(len(mail.outbox), mail_count + 1) new_user = get_user_model().objects.latest('id') login_response = self.client.post(self.login_url, login_data, format='json') self.assertEquals(login_response.status_code, status.HTTP_400_BAD_REQUEST) # verify email email_confirmation = new_user.emailaddress_set.get(email=self.reusable_register_user_data1['email']).emailconfirmation_set.order_by('-created')[0] verify_response = self.client.post(self.verify_url, {'key': email_confirmation.key}, format='json') self.assertEquals(verify_response.status_code, status.HTTP_200_OK) login_response = self.client.post(self.login_url, login_data, format='json') self.assertEquals(login_response.status_code, status.HTTP_200_OK) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME) def test_registration_email_verification_neccessary_verified_login_username(self): """ Tests you can log in without email verification """ self.common_registration_email_verification_neccessary_verified_login({'username': 'admin1', 'password': 'password12'}) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.EMAIL) def test_registration_email_verification_neccessary_verified_login_email(self): """ Tests you can log in without email verification """ self.common_registration_email_verification_neccessary_verified_login({'email': 'admin1@email.com', 'password': 'password12'}) @override_settings(ACCOUNT_EMAIL_VERIFICATION="mandatory", ACCOUNT_AUTHENTICATION_METHOD=app_settings.AuthenticationMethod.USERNAME_EMAIL) def test_registration_email_verification_neccessary_verified_login_username_email(self): """ Tests you can log in without email verification """ self.common_registration_email_verification_neccessary_verified_login({'username': 'admin1', 'password': 'password12'}) """ Password Reset Tests ==================== """ def test_password_reset(self): """ Test basic functionality of password reset. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') payload = {'email': 'admin@email.com'} response = self.client.post(self.password_reset_url, payload, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"Password reset e-mail has been sent."}') @override_settings(ACCOUNTS_PASSWORD_RESET_NOTIFY_EMAIL_NOT_IN_SYSTEM=True) def test_password_reset_fail_no_user_with_email_no_notify_not_in_system(self): """ Test basic functionality of password reset fails when there is no email on record (notify email not in system). """ payload = {'email': 'admin@email.com'} response = self.client.post(self.password_reset_url, payload, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEquals(response.content, '{"error":"User with email doesn\'t exist. Did not send reset email."}') @override_settings(ACCOUNTS_PASSWORD_RESET_NOTIFY_EMAIL_NOT_IN_SYSTEM=False) def test_password_reset_no_user_with_email_no_notify_not_in_system(self): """ Test basic functionality of password reset fails when there is no email on record. """ payload = {'email': 'admin@email.com'} response = self.client.post(self.password_reset_url, payload, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"success":"Password reset e-mail has been sent."}') def test_password_reset_confirm_fail_invalid_token(self): """ Test password reset confirm fails if token is invalid. """ user = get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') url_kwargs = self._generate_uid_and_token(user) data = { 'new_password1': 'new_password', 'new_password2': 'new_password', 'uid': url_kwargs['uid'], 'token': '-wrong-token-' } response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEquals(response.content, '{"token":["Invalid value"]}') def test_password_reset_confirm_fail_invalid_uid(self): """ Test password reset confirm fails if uid is invalid. """ user = get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') url_kwargs = self._generate_uid_and_token(user) data = { 'new_password1': 'new_password', 'new_password2': 'new_password', 'uid': 0, 'token': url_kwargs['token'] } response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEquals(response.content, '{"uid":["Invalid value"]}') def test_password_reset_confirm_fail_passwords_not_the_same(self): """ Test password reset confirm fails if uid is invalid. """ user = get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') url_kwargs = self._generate_uid_and_token(user) data = { 'new_password1': 'new_password', 'new_password2': 'new_not_the_same_password', 'uid': url_kwargs['uid'], 'token': url_kwargs['token'] } response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEquals(response.content, '{"new_password2":["The two password fields didn\'t match."]}') def test_password_reset_confirm_login(self): """ Tests password reset confirm works -> can login afterwards. """ user = get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') url_kwargs = self._generate_uid_and_token(user) data = { 'new_password1': 'new_password', 'new_password2': 'new_password', 'uid': url_kwargs['uid'], 'token': url_kwargs['token'] } response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) response = self.client.post(self.login_url, {'username': 'admin', 'email': 'admin@email.com', 'password': 'new_password'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) def test_password_reset_confirm_login_fails_with_old_password(self): """ Tests password reset confirm fails with old password. """ user = get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') url_kwargs = self._generate_uid_and_token(user) data = { 'new_password1': 'new_password', 'new_password2': 'new_password', 'uid': url_kwargs['uid'], 'token': url_kwargs['token'] } response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) response = self.client.post(self.login_url, {'username': 'admin', 'email': 'admin@email.com', 'password': 'password12'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST) """ User Detail Tests ================= """ def test_user_details_get(self): """ Test to retrieve user details. """ self.create_user_and_login() response = self.client.get(self.user_url, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"username":"admin","email":"admin@email.com","first_name":"","last_name":""}') def test_user_details_put(self): """ Test to put update user details. """ self.create_user_and_login() response = self.client.put(self.user_url, {"username":"changed","email":"changed@email.com","first_name":"changed","last_name":"name"}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"username":"changed","email":"changed@email.com","first_name":"changed","last_name":"name"}') def test_user_details_patch(self): """ Test to patch update user details. """ self.create_user_and_login() response = self.client.patch(self.user_url, {'username': 'changed_username', 'email': 'changed@email.com'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertEquals(response.content, '{"username":"changed_username","email":"changed@email.com","first_name":"","last_name":""}') def test_user_details_put_not_authenticated(self): """ Test to put update user details. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.put(self.user_url, {"username":"changed","email":"changed@email.com","first_name":"changed","last_name":"name"}, format='json') self.assertEquals(response.status_code, status.HTTP_401_UNAUTHORIZED) def test_user_details_patch_not_authenticated(self): """ Test to patch update user details. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.patch(self.user_url, {'username': 'changed_username', 'email': 'changed@email.com'}, format='json') self.assertEquals(response.status_code, status.HTTP_401_UNAUTHORIZED) def test_user_details_get_not_authenticated(self): """ Test to retrieve user details. """ get_user_model().objects.create_user('admin', 'admin@email.com', 'password12') response = self.client.get(self.user_url, format='json') self.assertEquals(response.status_code, status.HTTP_401_UNAUTHORIZED) class TestAccountsSocial(APITestCase): """ Tests normal for social login. """ urls = 'accounts.test_social_urls' def setUp(self): self.fb_login_url = reverse('fb_login') social_app = SocialApp.objects.create( provider='facebook', name='Facebook', client_id='123123123', secret='321321321', ) site = Site.objects.get_current() social_app.sites.add(site) self.graph_api_url = GRAPH_API_URL + '/me' @responses.activate def test_social_auth(self): """ Tests Social Login. """ resp_body = '{"id":"123123123123","first_name":"John","gender":"male","last_name":"Smith","link":"https:\\/\\/www.facebook.com\\/john.smith","locale":"en_US","name":"John Smith","timezone":2,"updated_time":"2014-08-13T10:14:38+0000","username":"john.smith","verified":true}' # noqa responses.add( responses.GET, self.graph_api_url, body=resp_body, status=200, content_type='application/json' ) users_count = get_user_model().objects.all().count() response = self.client.post(self.fb_login_url, {'access_token': 'abc123'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.data) self.assertEqual(get_user_model().objects.all().count(), users_count + 1) @responses.activate def test_social_auth_only_one_user_created(self): """ Tests Social Login. """ resp_body = '{"id":"123123123123","first_name":"John","gender":"male","last_name":"Smith","link":"https:\\/\\/www.facebook.com\\/john.smith","locale":"en_US","name":"John Smith","timezone":2,"updated_time":"2014-08-13T10:14:38+0000","username":"john.smith","verified":true}' # noqa responses.add( responses.GET, self.graph_api_url, body=resp_body, status=200, content_type='application/json' ) users_count = get_user_model().objects.all().count() response = self.client.post(self.fb_login_url, {'access_token': 'abc123'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.data) self.assertEqual(get_user_model().objects.all().count(), users_count + 1) # make sure that second request will not create a new user response = self.client.post(self.fb_login_url, {'access_token': 'abc123'}, format='json') self.assertEquals(response.status_code, status.HTTP_200_OK) self.assertIn('key', response.data) self.assertEqual(get_user_model().objects.all().count(), users_count + 1) @responses.activate def test_failed_social_auth(self): # fake response responses.add( responses.GET, self.graph_api_url, body='', status=400, content_type='application/json' ) response = self.client.post(self.fb_login_url, {'access_token': 'abc123'}, format='json') self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST)
JTarball/docker-django-polymer
docker/app/app/backend/apps/accounts/test_views.py
Python
gpl-2.0
42,275
[ 30522, 1000, 1000, 1000, 6115, 1012, 3231, 1035, 5328, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 5852, 1996, 2717, 17928, 4455, 1012, 5587, 2062, 3563, 2591, 8819, 58...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 #Test data $a_tablename = "Herberg Liste"; $location = "Mændenes hjem"; $road = "Mandevej"; $number = "1"; $floor = "1st"; $door = "tv"; $city = "Copenhagen"; $country = "Denmark"; $phone = "11223344"; $website = "www.awebsite.dk"; ?> <?php #Test data $hlocation = "Navn"; $hroad = "Vej"; $hnumber = "Nummer"; $hfloor = "Etage"; $hdoor = "Dør"; $hcity = "By"; $hcountry = "Land"; $hphone = "Telefon"; $hwebsite = "Hjemmeside"; $hm_array = array( array($hlocation, $hroad, $hnumber, $hfloor, $hdoor, $hcity, $hcountry,$hphone, $hwebsite) ); ?> <?php $m_array = array( array($location, $road, $number, $floor, $door, $city, $country, $phone, $website), array($location, $road, $number, $floor, $door, $city, $country, $phone, $website) ); ?>
Gaffax/Myshelter
TestData/indexTestData.php
PHP
apache-2.0
758
[ 30522, 1026, 1029, 25718, 1001, 3231, 2951, 1002, 1037, 1035, 2795, 18442, 1027, 1000, 12810, 2121, 2290, 2862, 2063, 1000, 1025, 1002, 3295, 1027, 1000, 1049, 29667, 25915, 2229, 1044, 6460, 2213, 1000, 1025, 1002, 2346, 1027, 1000, 2158, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
@echo off copy ..\usersguide\build\html\objects.inv . tinker --build
AlexisEidelman/liam2_mahdi
doc/website/buildall.bat
Batchfile
gpl-3.0
69
[ 30522, 1030, 9052, 2125, 6100, 1012, 1012, 1032, 5198, 28582, 1032, 3857, 1032, 16129, 1032, 5200, 1012, 1999, 2615, 1012, 9543, 5484, 1011, 1011, 3857, 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, 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...
nav { color: #fff; background-color: black; } footer.page-footer { margin-top: 20px; padding-top: 20px; background-color: #DEB7C2 ; } body { font-family: "Open Sans", sans-serif; } p { line-height: 1.6; font-size: 20px; font-family: serif; } .row { margin-bottom: 100px; } @media screen and (max-width: 600px) { header { height: 250px; } } .firstword { font-size: 30pt; } h1 { font-family: 'Righteous', cursive; } h5 { font-family: 'Droid Serif', serif; } blockquote { font-family: 'Changa One', cursive; font-size: 15pt; } .video-container { max-height:inherit; max-width: inherit; }
newschool-webfundamentals/newschool-webfundamentals.github.io
projects/hunter/main.css
CSS
mit
636
[ 30522, 6583, 2615, 1063, 3609, 1024, 1001, 21461, 2546, 1025, 4281, 1011, 3609, 1024, 2304, 1025, 1065, 3329, 2121, 1012, 3931, 1011, 3329, 2121, 1063, 7785, 1011, 2327, 1024, 2322, 2361, 2595, 1025, 11687, 4667, 1011, 2327, 1024, 2322, 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 Dominik Schürmann <dominik@dominikschuermann.de> * Copyright (C) 2014 Vincent Breitmoser <v.breitmoser@mugenguild.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.sufficientlysecure.keychain.operations.results; import android.os.Parcel; public class GetKeyResult extends OperationResult { public int mNonPgpPartsCount; public int getNonPgpPartsCount() { return mNonPgpPartsCount; } public void setNonPgpPartsCount(int nonPgpPartsCount) { mNonPgpPartsCount = nonPgpPartsCount; } public GetKeyResult(int result, OperationLog log) { super(result, log); } public static final int RESULT_ERROR_NO_VALID_KEYS = RESULT_ERROR + 8; public static final int RESULT_ERROR_NO_PGP_PARTS = RESULT_ERROR + 16; public static final int RESULT_ERROR_QUERY_TOO_SHORT = RESULT_ERROR + 32; public static final int RESULT_ERROR_TOO_MANY_RESPONSES = RESULT_ERROR + 64; public static final int RESULT_ERROR_TOO_SHORT_OR_TOO_MANY_RESPONSES = RESULT_ERROR + 128; public static final int RESULT_ERROR_QUERY_FAILED = RESULT_ERROR + 256; public GetKeyResult(Parcel source) { super(source); } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); } public static Creator<GetKeyResult> CREATOR = new Creator<GetKeyResult>() { public GetKeyResult createFromParcel(final Parcel source) { return new GetKeyResult(source); } public GetKeyResult[] newArray(final int size) { return new GetKeyResult[size]; } }; }
thialfihar/apg
OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/GetKeyResult.java
Java
gpl-3.0
2,254
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 14383, 5498, 2243, 8040, 24572, 5804, 1026, 14383, 5498, 2243, 1030, 14383, 5498, 5705, 20760, 18689, 2078, 1012, 2139, 1028, 1008, 9385, 1006, 1039, 1007, 2297, 6320, 7987, 20175, 1553...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/* { dg-do compile } */ /* { dg-require-effective-target label_values } */ void foo (void); void bar (void *); extern int t; static void kmalloc_large (int size, int flags) { (void) size; (void) flags; foo (); bar (({__here:&&__here;})); } static void kmalloc (int size, int flags) { if (size) { if ((unsigned long) size > 0x1000) kmalloc_large (size, flags); if (flags) bar (({__here:&&__here;})); } } void compress_file_range (int i, int j, int k) { int nr_pages = ({j < k;}); if (i || t) kmalloc (0x1000UL * nr_pages, 0x40UL); }
Gurgel100/gcc
gcc/testsuite/gcc.dg/torture/pr51071.c
C
gpl-2.0
578
[ 30522, 1013, 1008, 1063, 1040, 2290, 1011, 2079, 4012, 22090, 1065, 1008, 1013, 1013, 1008, 1063, 1040, 2290, 1011, 5478, 1011, 4621, 1011, 4539, 3830, 1035, 5300, 1065, 1008, 1013, 11675, 29379, 1006, 11675, 1007, 1025, 11675, 3347, 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...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/bind.h" #include "base/debug/trace_event.h" #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/synchronization/waitable_event.h" #include "base/threading/non_thread_safe.h" #include "content/common/gpu/gpu_channel.h" #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" #include "media/base/bind_to_current_loop.h" #include "media/video/picture.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/scoped_binders.h" static void ReportToUMA( content::VaapiH264Decoder::VAVDAH264DecoderFailure failure) { UMA_HISTOGRAM_ENUMERATION( "Media.VAVDAH264.DecoderFailure", failure, content::VaapiH264Decoder::VAVDA_H264_DECODER_FAILURES_MAX); } namespace content { #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \ do { \ if (!(result)) { \ DVLOG(1) << log; \ NotifyError(error_code); \ return ret; \ } \ } while (0) VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { } VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { } void VaapiVideoDecodeAccelerator::NotifyError(Error error) { if (message_loop_ != base::MessageLoop::current()) { DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); return; } // Post Cleanup() as a task so we don't recursively acquire lock_. message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::Cleanup, weak_this_)); DVLOG(1) << "Notifying of error " << error; if (client_) { client_->NotifyError(error); client_ptr_factory_.reset(); } } // TFPPicture allocates X Pixmaps and binds them to textures passed // in PictureBuffers from clients to them. TFPPictures are created as // a consequence of receiving a set of PictureBuffers from clients and released // at the end of decode (or when a new set of PictureBuffers is required). // // TFPPictures are used for output, contents of VASurfaces passed from decoder // are put into the associated pixmap memory and sent to client. class VaapiVideoDecodeAccelerator::TFPPicture : public base::NonThreadSafe { public: ~TFPPicture(); static linked_ptr<TFPPicture> Create( const base::Callback<bool(void)>& make_context_current, const GLXFBConfig& fb_config, Display* x_display, int32 picture_buffer_id, uint32 texture_id, gfx::Size size); int32 picture_buffer_id() { return picture_buffer_id_; } gfx::Size size() { return size_; } int x_pixmap() { return x_pixmap_; } // Bind texture to pixmap. Needs to be called every frame. bool Bind(); private: TFPPicture(const base::Callback<bool(void)>& make_context_current, Display* x_display, int32 picture_buffer_id, uint32 texture_id, gfx::Size size); bool Initialize(const GLXFBConfig& fb_config); base::Callback<bool(void)> make_context_current_; Display* x_display_; // Output id for the client. int32 picture_buffer_id_; uint32 texture_id_; gfx::Size size_; // Pixmaps bound to this texture. Pixmap x_pixmap_; GLXPixmap glx_pixmap_; DISALLOW_COPY_AND_ASSIGN(TFPPicture); }; VaapiVideoDecodeAccelerator::TFPPicture::TFPPicture( const base::Callback<bool(void)>& make_context_current, Display* x_display, int32 picture_buffer_id, uint32 texture_id, gfx::Size size) : make_context_current_(make_context_current), x_display_(x_display), picture_buffer_id_(picture_buffer_id), texture_id_(texture_id), size_(size), x_pixmap_(0), glx_pixmap_(0) { DCHECK(!make_context_current_.is_null()); }; linked_ptr<VaapiVideoDecodeAccelerator::TFPPicture> VaapiVideoDecodeAccelerator::TFPPicture::Create( const base::Callback<bool(void)>& make_context_current, const GLXFBConfig& fb_config, Display* x_display, int32 picture_buffer_id, uint32 texture_id, gfx::Size size) { linked_ptr<TFPPicture> tfp_picture( new TFPPicture(make_context_current, x_display, picture_buffer_id, texture_id, size)); if (!tfp_picture->Initialize(fb_config)) tfp_picture.reset(); return tfp_picture; } bool VaapiVideoDecodeAccelerator::TFPPicture::Initialize( const GLXFBConfig& fb_config) { DCHECK(CalledOnValidThread()); if (!make_context_current_.Run()) return false; XWindowAttributes win_attr; int screen = DefaultScreen(x_display_); XGetWindowAttributes(x_display_, RootWindow(x_display_, screen), &win_attr); //TODO(posciak): pass the depth required by libva, not the RootWindow's depth x_pixmap_ = XCreatePixmap(x_display_, RootWindow(x_display_, screen), size_.width(), size_.height(), win_attr.depth); if (!x_pixmap_) { DVLOG(1) << "Failed creating an X Pixmap for TFP"; return false; } static const int pixmap_attr[] = { GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT, GLX_TEXTURE_FORMAT_EXT, GLX_TEXTURE_FORMAT_RGB_EXT, GL_NONE, }; glx_pixmap_ = glXCreatePixmap(x_display_, fb_config, x_pixmap_, pixmap_attr); if (!glx_pixmap_) { // x_pixmap_ will be freed in the destructor. DVLOG(1) << "Failed creating a GLX Pixmap for TFP"; return false; } return true; } VaapiVideoDecodeAccelerator::TFPPicture::~TFPPicture() { DCHECK(CalledOnValidThread()); // Unbind surface from texture and deallocate resources. if (glx_pixmap_ && make_context_current_.Run()) { glXReleaseTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT); glXDestroyPixmap(x_display_, glx_pixmap_); } if (x_pixmap_) XFreePixmap(x_display_, x_pixmap_); XSync(x_display_, False); // Needed to work around buggy vdpau-driver. } bool VaapiVideoDecodeAccelerator::TFPPicture::Bind() { DCHECK(CalledOnValidThread()); DCHECK(x_pixmap_); DCHECK(glx_pixmap_); if (!make_context_current_.Run()) return false; gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); glXBindTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL); return true; } VaapiVideoDecodeAccelerator::TFPPicture* VaapiVideoDecodeAccelerator::TFPPictureById(int32 picture_buffer_id) { TFPPictures::iterator it = tfp_pictures_.find(picture_buffer_id); if (it == tfp_pictures_.end()) { DVLOG(1) << "Picture id " << picture_buffer_id << " does not exist"; return NULL; } return it->second.get(); } VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( Display* x_display, const base::Callback<bool(void)>& make_context_current) : x_display_(x_display), make_context_current_(make_context_current), state_(kUninitialized), input_ready_(&lock_), surfaces_available_(&lock_), message_loop_(base::MessageLoop::current()), decoder_thread_("VaapiDecoderThread"), num_frames_at_client_(0), num_stream_bufs_at_decoder_(0), finish_flush_pending_(false), awaiting_va_surfaces_recycle_(false), requested_num_pics_(0), weak_this_factory_(this) { weak_this_ = weak_this_factory_.GetWeakPtr(); va_surface_release_cb_ = media::BindToCurrentLoop( base::Bind(&VaapiVideoDecodeAccelerator::RecycleVASurfaceID, weak_this_)); } VaapiVideoDecodeAccelerator::~VaapiVideoDecodeAccelerator() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); } class XFreeDeleter { public: void operator()(void* x) const { ::XFree(x); } }; bool VaapiVideoDecodeAccelerator::InitializeFBConfig() { const int fbconfig_attr[] = { GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT, GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT, GLX_BIND_TO_TEXTURE_RGB_EXT, GL_TRUE, GLX_Y_INVERTED_EXT, GL_TRUE, GL_NONE, }; int num_fbconfigs; scoped_ptr<GLXFBConfig, XFreeDeleter> glx_fb_configs( glXChooseFBConfig(x_display_, DefaultScreen(x_display_), fbconfig_attr, &num_fbconfigs)); if (!glx_fb_configs) return false; if (!num_fbconfigs) return false; fb_config_ = glx_fb_configs.get()[0]; return true; } bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, Client* client) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); client_ = client_ptr_factory_->GetWeakPtr(); base::AutoLock auto_lock(lock_); DCHECK_EQ(state_, kUninitialized); DVLOG(2) << "Initializing VAVDA, profile: " << profile; if (!make_context_current_.Run()) return false; if (!InitializeFBConfig()) { DVLOG(1) << "Could not get a usable FBConfig"; return false; } vaapi_wrapper_ = VaapiWrapper::Create( VaapiWrapper::kDecode, profile, x_display_, base::Bind(&ReportToUMA, content::VaapiH264Decoder::VAAPI_ERROR)); if (!vaapi_wrapper_.get()) { DVLOG(1) << "Failed initializing VAAPI"; return false; } decoder_.reset( new VaapiH264Decoder( vaapi_wrapper_.get(), media::BindToCurrentLoop(base::Bind( &VaapiVideoDecodeAccelerator::SurfaceReady, weak_this_)), base::Bind(&ReportToUMA))); CHECK(decoder_thread_.Start()); decoder_thread_proxy_ = decoder_thread_.message_loop_proxy(); state_ = kIdle; return true; } void VaapiVideoDecodeAccelerator::SurfaceReady( int32 input_id, const scoped_refptr<VASurface>& va_surface) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); DCHECK(!awaiting_va_surfaces_recycle_); // Drop any requests to output if we are resetting or being destroyed. if (state_ == kResetting || state_ == kDestroying) return; pending_output_cbs_.push( base::Bind(&VaapiVideoDecodeAccelerator::OutputPicture, weak_this_, va_surface, input_id)); TryOutputSurface(); } void VaapiVideoDecodeAccelerator::OutputPicture( const scoped_refptr<VASurface>& va_surface, int32 input_id, TFPPicture* tfp_picture) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); int32 output_id = tfp_picture->picture_buffer_id(); TRACE_EVENT2("Video Decoder", "VAVDA::OutputSurface", "input_id", input_id, "output_id", output_id); DVLOG(3) << "Outputting VASurface " << va_surface->id() << " into pixmap bound to picture buffer id " << output_id; RETURN_AND_NOTIFY_ON_FAILURE(tfp_picture->Bind(), "Failed binding texture to pixmap", PLATFORM_FAILURE, ); RETURN_AND_NOTIFY_ON_FAILURE( vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), tfp_picture->x_pixmap(), tfp_picture->size()), "Failed putting surface into pixmap", PLATFORM_FAILURE, ); // Notify the client a picture is ready to be displayed. ++num_frames_at_client_; TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); DVLOG(4) << "Notifying output picture id " << output_id << " for input "<< input_id << " is ready"; // TODO(posciak): Use visible size from decoder here instead // (crbug.com/402760). if (client_) client_->PictureReady( media::Picture(output_id, input_id, gfx::Rect(tfp_picture->size()))); } void VaapiVideoDecodeAccelerator::TryOutputSurface() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); // Handle Destroy() arriving while pictures are queued for output. if (!client_) return; if (pending_output_cbs_.empty() || output_buffers_.empty()) return; OutputCB output_cb = pending_output_cbs_.front(); pending_output_cbs_.pop(); TFPPicture* tfp_picture = TFPPictureById(output_buffers_.front()); DCHECK(tfp_picture); output_buffers_.pop(); output_cb.Run(tfp_picture); if (finish_flush_pending_ && pending_output_cbs_.empty()) FinishFlush(); } void VaapiVideoDecodeAccelerator::MapAndQueueNewInputBuffer( const media::BitstreamBuffer& bitstream_buffer) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); TRACE_EVENT1("Video Decoder", "MapAndQueueNewInputBuffer", "input_id", bitstream_buffer.id()); DVLOG(4) << "Mapping new input buffer id: " << bitstream_buffer.id() << " size: " << (int)bitstream_buffer.size(); scoped_ptr<base::SharedMemory> shm( new base::SharedMemory(bitstream_buffer.handle(), true)); RETURN_AND_NOTIFY_ON_FAILURE(shm->Map(bitstream_buffer.size()), "Failed to map input buffer", UNREADABLE_INPUT,); base::AutoLock auto_lock(lock_); // Set up a new input buffer and queue it for later. linked_ptr<InputBuffer> input_buffer(new InputBuffer()); input_buffer->shm.reset(shm.release()); input_buffer->id = bitstream_buffer.id(); input_buffer->size = bitstream_buffer.size(); ++num_stream_bufs_at_decoder_; TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", num_stream_bufs_at_decoder_); input_buffers_.push(input_buffer); input_ready_.Signal(); } bool VaapiVideoDecodeAccelerator::GetInputBuffer_Locked() { DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); lock_.AssertAcquired(); if (curr_input_buffer_.get()) return true; // Will only wait if it is expected that in current state new buffers will // be queued from the client via Decode(). The state can change during wait. while (input_buffers_.empty() && (state_ == kDecoding || state_ == kIdle)) { input_ready_.Wait(); } // We could have got woken up in a different state or never got to sleep // due to current state; check for that. switch (state_) { case kFlushing: // Here we are only interested in finishing up decoding buffers that are // already queued up. Otherwise will stop decoding. if (input_buffers_.empty()) return false; // else fallthrough case kDecoding: case kIdle: DCHECK(!input_buffers_.empty()); curr_input_buffer_ = input_buffers_.front(); input_buffers_.pop(); DVLOG(4) << "New current bitstream buffer, id: " << curr_input_buffer_->id << " size: " << curr_input_buffer_->size; decoder_->SetStream( static_cast<uint8*>(curr_input_buffer_->shm->memory()), curr_input_buffer_->size, curr_input_buffer_->id); return true; default: // We got woken up due to being destroyed/reset, ignore any already // queued inputs. return false; } } void VaapiVideoDecodeAccelerator::ReturnCurrInputBuffer_Locked() { lock_.AssertAcquired(); DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); DCHECK(curr_input_buffer_.get()); int32 id = curr_input_buffer_->id; curr_input_buffer_.reset(); DVLOG(4) << "End of input buffer " << id; message_loop_->PostTask(FROM_HERE, base::Bind( &Client::NotifyEndOfBitstreamBuffer, client_, id)); --num_stream_bufs_at_decoder_; TRACE_COUNTER1("Video Decoder", "Stream buffers at decoder", num_stream_bufs_at_decoder_); } bool VaapiVideoDecodeAccelerator::FeedDecoderWithOutputSurfaces_Locked() { lock_.AssertAcquired(); DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); while (available_va_surfaces_.empty() && (state_ == kDecoding || state_ == kFlushing || state_ == kIdle)) { surfaces_available_.Wait(); } if (state_ != kDecoding && state_ != kFlushing && state_ != kIdle) return false; while (!available_va_surfaces_.empty()) { scoped_refptr<VASurface> va_surface( new VASurface(available_va_surfaces_.front(), va_surface_release_cb_)); available_va_surfaces_.pop_front(); decoder_->ReuseSurface(va_surface); } return true; } void VaapiVideoDecodeAccelerator::DecodeTask() { DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); TRACE_EVENT0("Video Decoder", "VAVDA::DecodeTask"); base::AutoLock auto_lock(lock_); if (state_ != kDecoding) return; // Main decode task. DVLOG(4) << "Decode task"; // Try to decode what stream data is (still) in the decoder until we run out // of it. while (GetInputBuffer_Locked()) { DCHECK(curr_input_buffer_.get()); VaapiH264Decoder::DecResult res; { // We are OK releasing the lock here, as decoder never calls our methods // directly and we will reacquire the lock before looking at state again. // This is the main decode function of the decoder and while keeping // the lock for its duration would be fine, it would defeat the purpose // of having a separate decoder thread. base::AutoUnlock auto_unlock(lock_); res = decoder_->Decode(); } switch (res) { case VaapiH264Decoder::kAllocateNewSurfaces: DVLOG(1) << "Decoder requesting a new set of surfaces"; message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange, weak_this_, decoder_->GetRequiredNumOfPictures(), decoder_->GetPicSize())); // We'll get rescheduled once ProvidePictureBuffers() finishes. return; case VaapiH264Decoder::kRanOutOfStreamData: ReturnCurrInputBuffer_Locked(); break; case VaapiH264Decoder::kRanOutOfSurfaces: // No more output buffers in the decoder, try getting more or go to // sleep waiting for them. if (!FeedDecoderWithOutputSurfaces_Locked()) return; break; case VaapiH264Decoder::kDecodeError: RETURN_AND_NOTIFY_ON_FAILURE(false, "Error decoding stream", PLATFORM_FAILURE, ); return; } } } void VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange(size_t num_pics, gfx::Size size) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); DCHECK(!awaiting_va_surfaces_recycle_); // At this point decoder has stopped running and has already posted onto our // loop any remaining output request callbacks, which executed before we got // here. Some of them might have been pended though, because we might not // have had enough TFPictures to output surfaces to. Initiate a wait cycle, // which will wait for client to return enough PictureBuffers to us, so that // we can finish all pending output callbacks, releasing associated surfaces. DVLOG(1) << "Initiating surface set change"; awaiting_va_surfaces_recycle_ = true; requested_num_pics_ = num_pics; requested_pic_size_ = size; TryFinishSurfaceSetChange(); } void VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); if (!awaiting_va_surfaces_recycle_) return; if (!pending_output_cbs_.empty() || tfp_pictures_.size() != available_va_surfaces_.size()) { // Either: // 1. Not all pending pending output callbacks have been executed yet. // Wait for the client to return enough pictures and retry later. // 2. The above happened and all surface release callbacks have been posted // as the result, but not all have executed yet. Post ourselves after them // to let them release surfaces. DVLOG(2) << "Awaiting pending output/surface release callbacks to finish"; message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange, weak_this_)); return; } // All surfaces released, destroy them and dismiss all PictureBuffers. awaiting_va_surfaces_recycle_ = false; available_va_surfaces_.clear(); vaapi_wrapper_->DestroySurfaces(); for (TFPPictures::iterator iter = tfp_pictures_.begin(); iter != tfp_pictures_.end(); ++iter) { DVLOG(2) << "Dismissing picture id: " << iter->first; if (client_) client_->DismissPictureBuffer(iter->first); } tfp_pictures_.clear(); // And ask for a new set as requested. DVLOG(1) << "Requesting " << requested_num_pics_ << " pictures of size: " << requested_pic_size_.ToString(); message_loop_->PostTask(FROM_HERE, base::Bind( &Client::ProvidePictureBuffers, client_, requested_num_pics_, requested_pic_size_, GL_TEXTURE_2D)); } void VaapiVideoDecodeAccelerator::Decode( const media::BitstreamBuffer& bitstream_buffer) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); TRACE_EVENT1("Video Decoder", "VAVDA::Decode", "Buffer id", bitstream_buffer.id()); // We got a new input buffer from the client, map it and queue for later use. MapAndQueueNewInputBuffer(bitstream_buffer); base::AutoLock auto_lock(lock_); switch (state_) { case kIdle: state_ = kDecoding; decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::DecodeTask, base::Unretained(this))); break; case kDecoding: // Decoder already running, fallthrough. case kResetting: // When resetting, allow accumulating bitstream buffers, so that // the client can queue after-seek-buffers while we are finishing with // the before-seek one. break; default: RETURN_AND_NOTIFY_ON_FAILURE(false, "Decode request from client in invalid state: " << state_, PLATFORM_FAILURE, ); break; } } void VaapiVideoDecodeAccelerator::RecycleVASurfaceID( VASurfaceID va_surface_id) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); base::AutoLock auto_lock(lock_); available_va_surfaces_.push_back(va_surface_id); surfaces_available_.Signal(); } void VaapiVideoDecodeAccelerator::AssignPictureBuffers( const std::vector<media::PictureBuffer>& buffers) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); base::AutoLock auto_lock(lock_); DCHECK(tfp_pictures_.empty()); while (!output_buffers_.empty()) output_buffers_.pop(); RETURN_AND_NOTIFY_ON_FAILURE( buffers.size() == requested_num_pics_, "Got an invalid number of picture buffers. (Got " << buffers.size() << ", requested " << requested_num_pics_ << ")", INVALID_ARGUMENT, ); DCHECK(requested_pic_size_ == buffers[0].size()); std::vector<VASurfaceID> va_surface_ids; RETURN_AND_NOTIFY_ON_FAILURE( vaapi_wrapper_->CreateSurfaces(requested_pic_size_, buffers.size(), &va_surface_ids), "Failed creating VA Surfaces", PLATFORM_FAILURE, ); DCHECK_EQ(va_surface_ids.size(), buffers.size()); for (size_t i = 0; i < buffers.size(); ++i) { DVLOG(2) << "Assigning picture id: " << buffers[i].id() << " to texture id: " << buffers[i].texture_id() << " VASurfaceID: " << va_surface_ids[i]; linked_ptr<TFPPicture> tfp_picture( TFPPicture::Create(make_context_current_, fb_config_, x_display_, buffers[i].id(), buffers[i].texture_id(), requested_pic_size_)); RETURN_AND_NOTIFY_ON_FAILURE( tfp_picture.get(), "Failed assigning picture buffer to a texture.", PLATFORM_FAILURE, ); bool inserted = tfp_pictures_.insert(std::make_pair( buffers[i].id(), tfp_picture)).second; DCHECK(inserted); output_buffers_.push(buffers[i].id()); available_va_surfaces_.push_back(va_surface_ids[i]); surfaces_available_.Signal(); } state_ = kDecoding; decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::DecodeTask, base::Unretained(this))); } void VaapiVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { DCHECK_EQ(message_loop_, base::MessageLoop::current()); TRACE_EVENT1("Video Decoder", "VAVDA::ReusePictureBuffer", "Picture id", picture_buffer_id); --num_frames_at_client_; TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); output_buffers_.push(picture_buffer_id); TryOutputSurface(); } void VaapiVideoDecodeAccelerator::FlushTask() { DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); DVLOG(1) << "Flush task"; // First flush all the pictures that haven't been outputted, notifying the // client to output them. bool res = decoder_->Flush(); RETURN_AND_NOTIFY_ON_FAILURE(res, "Failed flushing the decoder.", PLATFORM_FAILURE, ); // Put the decoder in idle state, ready to resume. decoder_->Reset(); message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::FinishFlush, weak_this_)); } void VaapiVideoDecodeAccelerator::Flush() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); DVLOG(1) << "Got flush request"; base::AutoLock auto_lock(lock_); state_ = kFlushing; // Queue a flush task after all existing decoding tasks to clean up. decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::FlushTask, base::Unretained(this))); input_ready_.Signal(); surfaces_available_.Signal(); } void VaapiVideoDecodeAccelerator::FinishFlush() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); finish_flush_pending_ = false; base::AutoLock auto_lock(lock_); if (state_ != kFlushing) { DCHECK_EQ(state_, kDestroying); return; // We could've gotten destroyed already. } // Still waiting for textures from client to finish outputting all pending // frames. Try again later. if (!pending_output_cbs_.empty()) { finish_flush_pending_ = true; return; } state_ = kIdle; message_loop_->PostTask(FROM_HERE, base::Bind( &Client::NotifyFlushDone, client_)); DVLOG(1) << "Flush finished"; } void VaapiVideoDecodeAccelerator::ResetTask() { DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); DVLOG(1) << "ResetTask"; // All the decoding tasks from before the reset request from client are done // by now, as this task was scheduled after them and client is expected not // to call Decode() after Reset() and before NotifyResetDone. decoder_->Reset(); base::AutoLock auto_lock(lock_); // Return current input buffer, if present. if (curr_input_buffer_.get()) ReturnCurrInputBuffer_Locked(); // And let client know that we are done with reset. message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::FinishReset, weak_this_)); } void VaapiVideoDecodeAccelerator::Reset() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); DVLOG(1) << "Got reset request"; // This will make any new decode tasks exit early. base::AutoLock auto_lock(lock_); state_ = kResetting; finish_flush_pending_ = false; // Drop all remaining input buffers, if present. while (!input_buffers_.empty()) { message_loop_->PostTask(FROM_HERE, base::Bind( &Client::NotifyEndOfBitstreamBuffer, client_, input_buffers_.front()->id)); input_buffers_.pop(); } decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::ResetTask, base::Unretained(this))); input_ready_.Signal(); surfaces_available_.Signal(); } void VaapiVideoDecodeAccelerator::FinishReset() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); DVLOG(1) << "FinishReset"; base::AutoLock auto_lock(lock_); if (state_ != kResetting) { DCHECK(state_ == kDestroying || state_ == kUninitialized) << state_; return; // We could've gotten destroyed already. } // Drop pending outputs. while (!pending_output_cbs_.empty()) pending_output_cbs_.pop(); if (awaiting_va_surfaces_recycle_) { // Decoder requested a new surface set while we were waiting for it to // finish the last DecodeTask, running at the time of Reset(). // Let the surface set change finish first before resetting. message_loop_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::FinishReset, weak_this_)); return; } num_stream_bufs_at_decoder_ = 0; state_ = kIdle; message_loop_->PostTask(FROM_HERE, base::Bind( &Client::NotifyResetDone, client_)); // The client might have given us new buffers via Decode() while we were // resetting and might be waiting for our move, and not call Decode() anymore // until we return something. Post a DecodeTask() so that we won't // sleep forever waiting for Decode() in that case. Having two of them // in the pipe is harmless, the additional one will return as soon as it sees // that we are back in kDecoding state. if (!input_buffers_.empty()) { state_ = kDecoding; decoder_thread_proxy_->PostTask(FROM_HERE, base::Bind( &VaapiVideoDecodeAccelerator::DecodeTask, base::Unretained(this))); } DVLOG(1) << "Reset finished"; } void VaapiVideoDecodeAccelerator::Cleanup() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); if (state_ == kUninitialized || state_ == kDestroying) return; DVLOG(1) << "Destroying VAVDA"; base::AutoLock auto_lock(lock_); state_ = kDestroying; client_ptr_factory_.reset(); weak_this_factory_.InvalidateWeakPtrs(); // Signal all potential waiters on the decoder_thread_, let them early-exit, // as we've just moved to the kDestroying state, and wait for all tasks // to finish. input_ready_.Signal(); surfaces_available_.Signal(); { base::AutoUnlock auto_unlock(lock_); decoder_thread_.Stop(); } state_ = kUninitialized; } void VaapiVideoDecodeAccelerator::Destroy() { DCHECK_EQ(message_loop_, base::MessageLoop::current()); Cleanup(); delete this; } bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { return false; } } // namespace content
s20121035/rk3288_android5.1_repo
external/chromium_org/content/common/gpu/media/vaapi_video_decode_accelerator.cc
C++
gpl-3.0
30,302
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2262, 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, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0) on Wed May 09 10:30:52 EDT 2007 --> <TITLE> B-Index </TITLE> <META NAME="date" CONTENT="2007-05-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="B-Index"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../edu/umd/cs/mtc/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../edu/umd/cs/mtc/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-1.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-2.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">L</A> <A HREF="index-11.html">M</A> <A HREF="index-12.html">P</A> <A HREF="index-13.html">R</A> <A HREF="index-14.html">S</A> <A HREF="index-15.html">T</A> <A HREF="index-16.html">U</A> <A HREF="index-17.html">W</A> <HR> <A NAME="_B_"><!-- --></A><H2> <B>B</B></H2> <DL> <DT><A HREF="../edu/umd/cs/mtc/TestFramework.html#buildTestSuite(java.lang.Class)"><B>buildTestSuite(Class&lt;?&gt;)</B></A> - Static method in class edu.umd.cs.mtc.<A HREF="../edu/umd/cs/mtc/TestFramework.html" title="class in edu.umd.cs.mtc">TestFramework</A> <DD>Scan through a given class <code>c</code> to find any inner classes that implement <A HREF="http://junit.sourceforge.net/javadoc/junit/framework/Test.html?is-external=true" title="class or interface in junit.framework"><CODE>Test</CODE></A>. <DT><A HREF="../edu/umd/cs/mtc/TestFramework.html#buildTestSuite(java.lang.Class, java.lang.String)"><B>buildTestSuite(Class&lt;?&gt;, String)</B></A> - Static method in class edu.umd.cs.mtc.<A HREF="../edu/umd/cs/mtc/TestFramework.html" title="class in edu.umd.cs.mtc">TestFramework</A> <DD>Scan through a given class <code>c</code> to find any inner classes that implement <A HREF="http://junit.sourceforge.net/javadoc/junit/framework/Test.html?is-external=true" title="class or interface in junit.framework"><CODE>Test</CODE></A>. </DL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../edu/umd/cs/mtc/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../edu/umd/cs/mtc/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-1.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-2.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">L</A> <A HREF="index-11.html">M</A> <A HREF="index-12.html">P</A> <A HREF="index-13.html">R</A> <A HREF="index-14.html">S</A> <A HREF="index-15.html">T</A> <A HREF="index-16.html">U</A> <A HREF="index-17.html">W</A> <HR> </BODY> </HTML>
MSch/multithreadedtc-junit4
web/docs/index-files/index-2.html
HTML
bsd-3-clause
7,566
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 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...
/* * Copyright 2016-2017 Testify Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.testifyproject.junit4; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.testifyproject.annotation.Fake; import org.testifyproject.annotation.Sut; import org.testifyproject.junit4.fixture.ImplicitType; import org.testifyproject.junit4.fixture.common.Hello; /** * * @author saden */ @RunWith(UnitTest.class) public class VerifyInteractionTest { Hello delegate = new Hello(); @Sut(verify = true) ImplicitType sut; @Fake Hello hello = delegate; @Before public void verifyInjections() { assertThat(sut).isNotNull(); assertThat(hello).isNotNull(); assertThat(Mockito.mockingDetails(sut.getHello()).isMock()).isTrue(); assertThat(Mockito.mockingDetails(hello).isMock()).isTrue(); } @Test public void givenNothingClassToExecuteShouldReturnHello() { String helloGreeting = "Hello"; given(hello.greet()).willReturn(helloGreeting); String result = sut.execute(); assertThat(result).isEqualTo(helloGreeting); assertThat(delegate.isCalled()).isTrue(); verify(hello).greet(); } }
testify-project/testify
modules/junit4/junit4-core/src/test/java/org/testifyproject/junit4/VerifyInteractionTest.java
Java
apache-2.0
1,938
[ 30522, 1013, 1008, 1008, 9385, 2355, 1011, 2418, 19919, 2622, 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, 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...
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace HA4IoT.Homepage { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); } } }
byrialsen/HA4IoT
Homepage/Global.asax.cs
C#
gpl-2.0
411
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 4773, 1025, 2478, 2291, 1012, 4773, 1012, 19842, 2278, 1025, 2478, 2291, 1012, 4773, 1012, 16972, 1025, 3415, 15327, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
# Microthyriolum astomum Speg. SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Boln Acad. nac. Cienc. Córdoba 23: 499 (1919) #### Original name Microthyriolum astomum Speg. ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Hysteriales/Parmulariaceae/Ferrarisia/Microthyriolum astomum/README.md
Markdown
apache-2.0
227
[ 30522, 1001, 12702, 16921, 9488, 12942, 2004, 20389, 2819, 11867, 13910, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 5950, 4569, 20255, 2819, 1001, 1001, 1001, 1001, 2405, 1999, 8945, 19666, 9353, 421...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 status = -1; function action(mode, type, selection) { if (mode == 1) { status++; } else { if (status == 0) { cm.dispose(); } status--; } if (status == 0) { cm.sendSimple("#b#L0#Pokemon Rankings (by Wins)#l\r\n#L1#Pokemon Rankings (by Caught)#l\r\n#L2#Pokemon Rankings (by Ratio)#l\r\n"); } else if (status == 1) { if (selection == 0) { cm.sendNext(cm.getPokemonRanking()); } else if (selection == 1) { cm.sendNext(cm.getPokemonRanking_Caught()); } else if (selection == 2) { cm.sendNext(cm.getPokemonRanking_Ratio()); } cm.dispose(); } }
swordiemen/Mushy
scripts/npc/9040004.js
JavaScript
gpl-3.0
596
[ 30522, 13075, 3570, 1027, 1011, 1015, 1025, 3853, 2895, 1006, 5549, 1010, 2828, 1010, 4989, 1007, 1063, 2065, 1006, 5549, 1027, 1027, 1015, 1007, 1063, 3570, 1009, 1009, 1025, 1065, 2842, 1063, 2065, 1006, 3570, 1027, 1027, 1014, 1007, 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 /** * Plugin element to render series of checkboxes * * @package Joomla.Plugin * @subpackage Fabrik.element.checkbox * @copyright Copyright (C) 2005-2015 fabrikar.com - All rights reserved. * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // No direct access defined('_JEXEC') or die('Restricted access'); /** * Plugin element to render series of checkboxes * * @package Joomla.Plugin * @subpackage Fabrik.element.checkbox * @since 3.0 */ class PlgFabrik_ElementCheckbox extends PlgFabrik_ElementList { protected $inputType = 'checkbox'; /** * Set the element id * and maps parameter names for common ElementList options * * @param int $id element id * * @return void */ public function setId($id) { parent::setId($id); $params = $this->getParams(); // Set elementlist params from checkbox params $params->set('options_per_row', $params->get('ck_options_per_row')); $params->set('allow_frontend_addto', (bool) $params->get('allow_frontend_addtocheckbox', false)); $params->set('allowadd-onlylabel', (bool) $params->get('chk-allowadd-onlylabel', true)); $params->set('savenewadditions', (bool) $params->get('chk-savenewadditions', false)); } /** * Shows the RAW list data - can be overwritten in plugin class * * @param string $data element data * @param object $thisRow all the data in the tables current row * * @return string formatted value */ public function renderRawListData($data, $thisRow) { return json_encode($data); } /** * Will the element allow for multiple selections * * @since 3.0.6 * * @return bool */ protected function isMultiple() { return true; } /** * Returns javascript which creates an instance of the class defined in formJavascriptClass() * * @param int $repeatCounter Repeat group counter * * @return array */ public function elementJavascript($repeatCounter) { $params = $this->getParams(); $id = $this->getHTMLId($repeatCounter); $values = (array) $this->getSubOptionValues(); $labels = (array) $this->getSubOptionLabels(); $data = $this->getFormModel()->data; $opts = $this->getElementJSOptions($repeatCounter); $opts->value = $this->getValue($data, $repeatCounter); $opts->defaultVal = $this->getDefaultValue($data); $opts->data = (empty($values) && empty($labels)) ? array() : array_combine($values, $labels); $opts->allowadd = (bool) $params->get('allow_frontend_addtocheckbox', false); JText::script('PLG_ELEMENT_CHECKBOX_ENTER_VALUE_LABEL'); return array('FbCheckBox', $id, $opts); } /** * If your element risks not to post anything in the form (e.g. check boxes with none checked) * the this function will insert a default value into the database * * @param array &$data form data * * @return array form data */ public function getEmptyDataValue(&$data) { $params = $this->getParams(); $element = $this->getElement(); $value = FArrayHelper::getValue($data, $element->name, ''); if ($value === '') { $data[$element->name] = $params->get('sub_default_value'); $data[$element->name . '_raw'] = array($params->get('sub_default_value')); } } /** * If the search value isn't what is stored in the database, but rather what the user * sees then switch from the search string to the db value here * overwritten in things like checkbox and radio plugins * * @param string $value filterVal * * @return string */ protected function prepareFilterVal($value) { $values = $this->getSubOptionValues(); $labels = $this->getSubOptionLabels(); for ($i = 0; $i < count($labels); $i++) { if (JString::strtolower($labels[$i]) == JString::strtolower($value)) { return $values[$i]; } } return $value; } /** * If no filter condition supplied (either via querystring or in posted filter data * return the most appropriate filter option for the element. * * @return string default filter condition ('=', 'REGEXP' etc.) */ public function getDefaultFilterCondition() { return '='; } /** * Manipulates posted form data for insertion into database * * @param mixed $val this elements posted form data * @param array $data posted form data * * @return mixed */ public function storeDatabaseFormat($val, $data) { if (is_array($val)) { // Ensure that array is incremental numeric key -otherwise json_encode turns it into an object $val = array_values($val); } if (is_array($val) || is_object($val)) { return json_encode($val); } else { /* * $$$ hugh - nastyish hack to try and make sure we consistently save as JSON, * for instance in CSV import, if data is just a single option value like 2, * instead of ["2"], we have been saving it as just that value, rather than a single * item JSON array. */ if (isset($val)) { // We know it's not an array or an object, so lets see if it's a string // which doesn't contain ", [ or ] if (!preg_match('#["\[\]]#', $val)) { // No ", [ or ], so lets see if wrapping it up in JSON array format // produces valid JSON $json_val = '["' . $val . '"]'; if (FabrikWorker::isJSON($json_val)) { // Looks like we we have a valid JSON array, so return that return $json_val; } else { // Give up and just store whatever it was we got! return $val; } } else { // Contains ", [ or ], so wtf, hope it's json return $val; } } else { return ''; } } } }
rodhoff/cdn1
plugins/fabrik_element/checkbox/checkbox.php
PHP
gpl-2.0
5,686
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 13354, 2378, 5783, 2000, 17552, 2186, 1997, 4638, 8758, 2229, 1008, 1008, 1030, 7427, 28576, 19968, 2050, 1012, 13354, 2378, 1008, 1030, 4942, 23947, 4270, 6904, 23736, 2243, 1012, 5783, 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...
# pylint: disable=no-self-use,invalid-name import pytest import torch from torch.autograd import Variable from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp.data import Vocabulary from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder from allennlp.common.testing import AllenNlpTestCase class TestBasicTextFieldEmbedder(AllenNlpTestCase): def setUp(self): super(TestBasicTextFieldEmbedder, self).setUp() self.vocab = Vocabulary() self.vocab.add_token_to_namespace("1") self.vocab.add_token_to_namespace("2") self.vocab.add_token_to_namespace("3") self.vocab.add_token_to_namespace("4") params = Params({ "words1": { "type": "embedding", "embedding_dim": 2 }, "words2": { "type": "embedding", "embedding_dim": 5 }, "words3": { "type": "embedding", "embedding_dim": 3 } }) self.token_embedder = BasicTextFieldEmbedder.from_params(self.vocab, params) self.inputs = { "words1": Variable(torch.LongTensor([[0, 2, 3, 5]])), "words2": Variable(torch.LongTensor([[1, 4, 3, 2]])), "words3": Variable(torch.LongTensor([[1, 5, 1, 2]])) } def test_get_output_dim_aggregates_dimension_from_each_embedding(self): assert self.token_embedder.get_output_dim() == 10 def test_forward_asserts_input_field_match(self): self.inputs['words4'] = self.inputs['words3'] del self.inputs['words3'] with pytest.raises(ConfigurationError): self.token_embedder(self.inputs) self.inputs['words3'] = self.inputs['words4'] del self.inputs['words4'] def test_forward_concats_resultant_embeddings(self): assert self.token_embedder(self.inputs).size() == (1, 4, 10)
nafitzgerald/allennlp
tests/modules/text_field_embedders/basic_token_embedder_test.py
Python
apache-2.0
2,108
[ 30522, 1001, 1052, 8516, 18447, 1024, 4487, 19150, 1027, 2053, 1011, 2969, 1011, 2224, 1010, 19528, 1011, 30524, 12723, 1012, 8285, 16307, 12324, 8023, 2013, 5297, 20554, 2361, 1012, 2691, 12324, 11498, 5244, 2013, 5297, 20554, 2361, 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...
import RPi.GPIO as GPIO KnockPin = 11 LedPin = 12 Led_status = 1 def setup(): GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output GPIO.setup(KnockPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.output(LedPin, GPIO.HIGH) # Set LedPin high(+3.3V) to off led def swLed(ev=None): global Led_status Led_status = not Led_status GPIO.output(LedPin, Led_status) # switch led status(on-->off; off-->on) print "LED: " + ("on" if Led_status else "off") def loop(): GPIO.add_event_detect(KnockPin, GPIO.FALLING, callback=swLed, bouncetime=200) # wait for falling while True: pass # Don't do anything def destroy(): GPIO.output(LedPin, GPIO.LOW) # led off GPIO.cleanup() # Release resource if __name__ == '__main__': # Program start from here setup() try: loop() except KeyboardInterrupt: # When 'Ctrl+C' is pressed, the child program destroy() will be executed. destroy()
bicard/raspberrypi
quad-store-sensors/37in1/knock-rgb-led-smd.py
Python
gpl-3.0
1,005
[ 30522, 12324, 1054, 8197, 1012, 14246, 3695, 2004, 14246, 3695, 7324, 8091, 1027, 2340, 2419, 8091, 1027, 2260, 2419, 1035, 3570, 1027, 1015, 13366, 16437, 1006, 1007, 1024, 14246, 3695, 1012, 2275, 5302, 3207, 1006, 14246, 3695, 1012, 2604...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.hotspot.replacements; import java.lang.reflect.Method; import java.util.EnumMap; import org.graalvm.compiler.api.directives.GraalDirectives; import org.graalvm.compiler.api.replacements.Snippet; import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyCallNode; import org.graalvm.compiler.nodes.java.DynamicNewArrayNode; import org.graalvm.compiler.nodes.java.NewArrayNode; import org.graalvm.compiler.replacements.Snippets; import jdk.vm.ci.meta.JavaKind; public class ObjectCloneSnippets implements Snippets { public static final EnumMap<JavaKind, Method> arrayCloneMethods = new EnumMap<>(JavaKind.class); static { arrayCloneMethods.put(JavaKind.Boolean, getCloneMethod("booleanArrayClone", boolean[].class)); arrayCloneMethods.put(JavaKind.Byte, getCloneMethod("byteArrayClone", byte[].class)); arrayCloneMethods.put(JavaKind.Char, getCloneMethod("charArrayClone", char[].class)); arrayCloneMethods.put(JavaKind.Short, getCloneMethod("shortArrayClone", short[].class)); arrayCloneMethods.put(JavaKind.Int, getCloneMethod("intArrayClone", int[].class)); arrayCloneMethods.put(JavaKind.Float, getCloneMethod("floatArrayClone", float[].class)); arrayCloneMethods.put(JavaKind.Long, getCloneMethod("longArrayClone", long[].class)); arrayCloneMethods.put(JavaKind.Double, getCloneMethod("doubleArrayClone", double[].class)); arrayCloneMethods.put(JavaKind.Object, getCloneMethod("objectArrayClone", Object[].class)); } private static Method getCloneMethod(String name, Class<?> param) { try { return ObjectCloneSnippets.class.getDeclaredMethod(name, param); } catch (SecurityException | NoSuchMethodException e) { throw new GraalError(e); } } @Snippet public static boolean[] booleanArrayClone(boolean[] src) { boolean[] result = (boolean[]) NewArrayNode.newUninitializedArray(Boolean.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Boolean); return result; } @Snippet public static byte[] byteArrayClone(byte[] src) { byte[] result = (byte[]) NewArrayNode.newUninitializedArray(Byte.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Byte); return result; } @Snippet public static short[] shortArrayClone(short[] src) { short[] result = (short[]) NewArrayNode.newUninitializedArray(Short.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Short); return result; } @Snippet public static char[] charArrayClone(char[] src) { char[] result = (char[]) NewArrayNode.newUninitializedArray(Character.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Char); return result; } @Snippet public static int[] intArrayClone(int[] src) { int[] result = (int[]) NewArrayNode.newUninitializedArray(Integer.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Int); return result; } @Snippet public static float[] floatArrayClone(float[] src) { float[] result = (float[]) NewArrayNode.newUninitializedArray(Float.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Float); return result; } @Snippet public static long[] longArrayClone(long[] src) { long[] result = (long[]) NewArrayNode.newUninitializedArray(Long.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Long); return result; } @Snippet public static double[] doubleArrayClone(double[] src) { double[] result = (double[]) NewArrayNode.newUninitializedArray(Double.TYPE, src.length); ArrayCopyCallNode.disjointArraycopy(src, 0, result, 0, src.length, JavaKind.Double); return result; } @Snippet public static Object[] objectArrayClone(Object[] src) { /* Since this snippet is lowered early the array must be initialized */ Object[] result = (Object[]) DynamicNewArrayNode.newArray(GraalDirectives.guardingNonNull(src.getClass().getComponentType()), src.length, JavaKind.Object); ArrayCopyCallNode.disjointUninitializedArraycopy(src, 0, result, 0, src.length, JavaKind.Object); return result; } }
YouDiSN/OpenJDK-Research
jdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
Java
gpl-2.0
5,679
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 1010, 2325, 1010, 14721, 1998, 1013, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1008, 2079, 2025, 11477, 2030, 6366, 9385, 14444, 2030, 2023, 5371, 20346, 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...
# # Makefile for the linux kernel. # CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) CFLAGS_REMOVE_ftrace.o = -pg CFLAGS_REMOVE_insn.o = -pg CFLAGS_REMOVE_return_address.o = -pg # Object file lists. arm64-obj-y := cputable.o debug-monitors.o entry.o irq.o fpsimd.o \ entry-fpsimd.o process.o ptrace.o setup.o signal.o \ sys.o stacktrace.o time.o traps.o io.o vdso.o \ hyp-stub.o psci.o opcodes.o insn.o return_address.o arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o \ sys_compat.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o smp_psci.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)+= hw_breakpoint.o arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arm64-obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o obj-$(CONFIG_PCI) += bios32.o obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o arm64-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) head-y := head.o extra-y := $(head-y) vmlinux.lds # vDSO - this must be built first to generate the symbol offsets $(call objectify,$(arm64-obj-y)): $(obj)/vdso/vdso-offsets.h $(obj)/vdso/vdso-offsets.h: $(obj)/vdso
MR64/android_kernel_htc_flounder
arch/arm64/kernel/Makefile
Makefile
gpl-2.0
1,511
[ 30522, 1001, 1001, 2191, 8873, 2571, 2005, 1996, 11603, 16293, 1012, 1001, 18133, 14376, 17802, 2015, 1035, 1058, 19968, 2378, 5602, 1012, 17627, 1024, 1027, 1011, 26718, 10288, 2102, 1035, 16396, 1027, 1002, 1006, 3793, 1035, 16396, 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...
<!DOCTYPE html> <html> <head> <title>ECOSOC</title> <base href="../../"> <!--Import Google Icon Font--> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'> <link rel='shortcut icon' type='image/x-icon' href="Images/logo-new.jpg" /> <!--Import materialize.css--> <link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" /><link type="text/css" rel="stylesheet" href="css/main.css" /> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=0.5" /> <!-- Global Site Tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-106611677-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments) }; gtag('js', new Date()); gtag('config', 'UA-106611677-1'); </script> <style type="text/css"> body { display: flex; min-height: 100vh; flex-direction: column; } main { flex: 1 0 auto; } </style> </head> <body> <!--Import jQuery before materialize.js--> <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="js/materialize.min.js"></script> <!-- Modal Structure --> <div id="modalSchedule" class="modal"> <div class="modal-content"> <h2>Schedule</h2> </div> </div> <div id="modalFAQ" class="modal"> <div class="modal-content"> <h3>JMUN FAQs</h3> <b>How do I know that my registration was successful?</b> <br><br> You will receive a confirmation either by September 30th or October 3rd, depending on how early you register. If you do not receive your confirmation by either of these dates, please contact us at<a href="mailto:bangalorejmun@oakridge.in" target="_blank"> bangalorejmun@oakridge.in</a> . <br><br> <b>What is the dress code?</b> <br><br> The dress code is formal business attire. For males, we recommend a button down, a pair of trousers and a nice tie. Blazers or jackets are suggested, but not required. For females, we recommend appropriate blouses, or button downs. Trousers and skirts are both acceptable. Formal dresses are also accepted. <br><br> <b>What is the technology policy?</b><br><br> Attendance at this year's Bangalore JMUN requires delegates to have a suitable electronic device through which Microsoft Teams can be used, preferrably a laptop or tablet, due to the virtual setting and nature of the event. The Microsoft Teams app must be dowloaded prior to the conference. <br><br> <b>What is a position paper?</b><br><br> Position papers are documents from each delegate summarizing his or her country’s views on each committee topic. Further requirements for position papers are laid out in each committee's background guide. Positional papers are optional for delegates this year but are recommeded for the advanced committee delegates. <br><br> <b>When is the position paper due?</b><br><br> All position papers are to be sent to the official email ID by the 7th of October. The email ID is bangalorejmun@oakridge.in and the subject should be ‘CommitteeAcronym_Country_PositionPaper’. <br><br> Ex: ‘WHO_USA_PositionPaper’<br> ‘UNSC_India_PositionPaper’<br><br> <b>What is the International Press?</b><br><br> An IP, or International Press, is pressed with the requirements of formulating and conducting interviews on various delegates, discussing key topics with the delegates, interacting frequently with the delegates, presenting the common events taking place in the various committees, and most importantly, create a report of the a detailed account of the events that took place in each committee, based on the input provided by the IP personnel who send the IP heads a detailed account of the proceedings in their particular committee. A formal diction and appropriate register will be maintained while proceeding with writing the report or merging the various information procured from the different personnel handling the collection of information from each committee. <br><br> </div> </div> <div id="modalRegister" class="modal"> <div class="modal-content"> <h4>If you are an External Delegate:</h4> <p> <b>Registration Fee: INR 500/-</b> per delegate inclusive of pre-conference training, ceremony access, and Teams account. </p> <p><b>Step 1:</b> Fill out the "School Registration Form" under the Registration tab</p> <p><b>Step 2:</b> Pay the Registration Fee using the Net-Banking details provided. Payment Details are provided under the Registration tab.</p> <p><b>Step 3:</b> Await authentication from School. Allocation details will be sent once authentication is complete</p> <br> <h4>If you are an Oakridge Delegate:</h4> <p> <b>Registration Fee: INR 500/-</b> per delegate inclusive of pre-conference training, ceremony access, and Teams account. </p> <p><b>Step 1:</b> Fill out the "Oakridge Registration Form" under the Registration tab</p> <p><b>Step 2:</b> Pay the Registration Fee using the net banking details provided or by making a payment at the Accounts Department. Further details are provided under the Registration tab.</p> <p><b>Step 3:</b> Await authentication from the School. Allocation details will be sent once authentication is complete</p> </div> </div> <div id="modalPayment" class="modal"> <div class="modal-content"> <h4>Payment Details</h4> <p>Account Name: Orange Educational Society</p> <p>Account no : 915010062389280</p> <p>Bank : AXIS BANK</p> <p>Branch : Sarjapura road, Bangalore- 560102</p> <p>IFSC CODE: UTIB0001888,</p> <p>SWIFT CODE : AXISINBB194</p> <p>A/C Type: Savings Account</p> </div> </div> <!-- Dropdown Structure --> <!-- Dropdown Structure- ENABLE ONCE ALL OF THE SUBPAGES ARE READY --> <ul id='dropdown1' class='dropdown-content'> <li class="black darken-3"><a href="Committees\ECOSOC\index.html" class="white-text">ECOSOC</a></li> <li class="black darken-3"><a href="Committees\HRC\index.html" class="white-text">UNHRC</a></li> <li class="black darken-3"><a href="Committees\SC\index.html" class="white-text">UNSC</a></li> <li class="black darken-3"><a href="Committees\WHO\index.html" class="white-text">WHO</a></li> </ul> <ul id='dropdown2' class='dropdown-content'> <li class="black darken-3"><a href="Conference/index.html" class="white-text">About</a></li> <li class="black darken-3"><a href="Secretariat/index.html" class="white-text">Secretariat</a></li> <li class="black darken-3"><a href="https://drive.google.com/file/d/1lIAxUWGqobZazhPNCon3TRwskdTrzT5t/view?usp=sharing" class="white-text">Schedule</a></li> </ul> <ul id='dropdown3' class='dropdown-content'> <li class="black darken-3"><a href="#modalRegister" class="white-text">How to Register?</a></li> <li class="black darken-3"><a href="#modalPayment" class="white-text">Payment Details</a></li> <li class="black darken-3"><a href="https://forms.gle/27Fu5WTCUFcNA7vJ6" class="white-text">Oakridge Registration</a></li> <li class="black darken-3"><a href="https://forms.gle/p5wY21u6qs1LjgFt8" class="white-text">External Registration</a></li> </ul> <ul class="side-nav" id="mobile-demo"> <li><a href="index.html">Home</a></li> <li><a class="dropdown-button" href="#!" data-activates="dropdown2">Committees<i class="material-icons right">arrow_drop_down</i></a></li> <li><a href="Conference/index.html">Conference</a></li> <li><a href="#modalFAQ">FAQs</a></li> <li><a class="dropdown-button" href="#!" data-activates="dropdown4">Registration<i class="material-icons right">arrow_drop_down</i></a></li> </ul> </ul> <ul id='dropdown3' class='dropdown-content'> <li class="black darken-3"><a href="#modalRegister" class="white-text">How to Register?</a></li> <li class="black darken-3"><a href="#modalPayment" class="white-text">Payment Details</a></li> <li class="black darken-3"><a href="https://forms.gle/27Fu5WTCUFcNA7vJ6" class="white-text">Oakridge Registration</a></li> <li class="black darken-3"><a href="https://forms.gle/p5wY21u6qs1LjgFt8" class="white-text">External Registration</a></li> </ul> <ul class="side-nav" id="mobile-demo"> <li><a href="index.html">Home</a></li> <li><a class="dropdown-button" href="#!" data-activates="dropdown2">Committees<i class="material-icons right">arrow_drop_down</i></a></li> <li><a href="Conference/index.html">Conference</a></li> <li><a href="#modalFAQ">FAQs</a></li> <!-- <li><a class="dropdown-button" href="#!" data-activates="dropdown4">Registration<i class="material-icons right">arrow_drop_down</i></a></li> --> </ul> <script> $(".button-collapse").sideNav(); </script> <div class="navbar-fixed" style="font-family: 'Montserrat'; font-weight: bold;"> <nav> <div class="nav-wrapper white darken-3"> <a href="index.html" class="brand-logo bold"><img src ="Images/logo-new.jpg" class="circle" style="height: 65px;"></a> <a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons white">menu</i></a> <ul class="right hide-on-med-and-down"> <li><a id="homeBtn" href="index.html" class="black-text">Home</a></li> <li><a id="committeesBtn" class="dropdown-button black-text" href="#!" data-activates="dropdown1">Committees<i class="material-icons right">arrow_drop_down</i></a></li> <li><a id="committeesBtn" class="dropdown-button black-text" href="#!" data-activates="dropdown2">Conference<i class="material-icons right">arrow_drop_down</i></a></li> <li><a id="registrationBtn" class="dropdown-button black-text" href="#!" data-activates="dropdown3">Registration<i class="material-icons right">arrow_drop_down</i></a></li> <li><a href="#modalFAQ" class = "black-text">FAQs</a></li> </ul> </div> </nav> </div> <div id="index-banner" class="parallax-container"> <div class="container"> <div class="parallax"> <img src="Images/ecofin_bg.jpg" alt="Unsplashed background img 1"> <div style="background-color: black; position: relative; top: 82%; height: 15%; opacity: 0.8;"> <h3 class="white-text center-align">Economic and Social Council</h3> <p> The Economic and Social Council (ECOSOC) is one of the six main organs of the United Nations. Established in 1945, this council focuses on three aspects of sustainable development: economic, social and environmental. ECOSOC encourages agreement on policies and actions that make fundamental links across all three aspects. </p> <p> This year, delegates will be engaging in exciting debate in order to discuss the connections between inclusive economic growth and its ability to eradicate poverty. </p> </div> </div> </div> </div> <div class="section white"> <div class="row"> <div class="col s6"> <div class="card white z-depth-5"> <div class="card-content black-text"> <span class="card-title flow-text"><h4 style="font-weight: lighter;">Agenda: The economic impact of COVID on income disparity.</h4></span> <br> </div> <div class="card-action"> </p> <h5 style="font-family: Segoe UI; font-weight: normal;">The Economic and Social Council is the United Nation's central forum for furthering discussion about policy recommendations for international economic and social issues. It aims to create consensuses, formulate innovative ideas, and further the tenets of sustainable development through debate and collaboration. It focuses on creating policies that create positive, tangible changes in people's real lives. </h5> <!-- REMOVE THIS COMMENT WHEN THE BACKGROUND GUIDE IS AVAILABLE!!! <b class="big">Background guide for UNSC is available <a href="https://docs.google.com/document/d/1kic0xJ0WdvtHc57dLludsTj3fS8tbWdplWfoE2ZcMIg/edit?usp=sharing" target="_blank">Here</a></b> --> <a class="btn-flat blue darken-4 white-text" href="https://drive.google.com/file/d/1sjLBW4jSbpNliwLpfn77grOy1cgZy-ah/view?usp=sharing" target="_blank">Background Guide</a> <!--<a class="btn-flat blue darken-4 white-text" href="https://docs.google.com/spreadsheets/d/1djfJjUqG8NbdlzS4ECXo8tuCls0ESM3G6g9wZRBdgLQ/edit?usp=sharing">Country Allocations</a> <a class="btn-flat blue darken-4 white-text" href="https://drive.google.com/drive/folders/0Bw0gqJdqCw_UTklPa1dyMWpHX2c?usp=sharing">Training material</a> --> </div> </div> </div> <!--EB Names and Pictures --> <div class="col s6"> <div class="card white z-depth-5"> <div class="center col s2 offset-s2 flow-text "> <img src="Images/EB/Tanvi_ECOSOC_CC.jpeg" alt="" class="circle responsive-img"> Co-Chair <br>Tanvi Gorthi </div> <div class="center col s2 offset-s2 flow-text "> <img src="Images/EB/Vignesh_ECOSOC_CC.jpeg" alt="" class="circle responsive-img">Co-Chair <br>Vignesh Somjit </div> <div class="center col s2 offset-s2 flow-text "> <img src="Images/EB/Ronav_ECOSOC_M.jpeg" alt="" class="circle responsive-img">Moderator <br>Ronav Som Kiran </div> </div> </div> </div> <div class="row"> <div class="col s6"> <div align="justify" class="card white z-depth-5"> <div class="card-content black-text"> <span class="card-title flow-text"><h4 style="font-weight: lighter;">Meet your EB</h4></span> <br> </div> <div class="card-action"> </p> <h5 style="font-weight: lighter;">Tanvi Gorthi, Co-Chair</h5> <p>Tanvi has over four years of MUN experience, both as a delegate and as an Executive Board member. She loves public speaking, has a zeal for economics, and is excited to be your chair in committee this year! </p> <h5 style="font-weight: lighter;">Vignesh Somjit, Co-Chair</h5> <p>Vignesh is an avid reader of economics and believes that it offers a comprehensive framework through which important global issues can be understood and addressed.</p> <h5 style="font-weight: lighter;">Ronav Som Kiran, Moderator</h5> <p>Ronav has had a 4 year MUN experience. This is his first time in the executive board and would like to make the most of it by helping teach you guys how to be good MUNers. He is also an avid reader and would love to see your ideas about the agenda at hand.</p> </div> </div> </div> </div> </div> </div> <footer class="page-footer black "> <div class="container "> <div class="row "> <div class="col s12 "> <h5 class="white-text ">Contact Details</h5> <p class="grey-text text-lighten-4 ">Send any queries over to <a href="mailto:bangalorejmun@oakridge.in " target="_blank "> bangalorejmun@oakridge.in</a> </p> <!--<p class="grey-text text-lighten-4 ">Teacher Advisor: <a href="tel:8971857769 " target="_blank ">+91 8971857769 (Ms. Debjani)</a> </p> <p class="grey-text text-lighten-4 ">Secretary General: <a href="tel:9108274028 " target="_blank ">+91 9108274028 (Abhinav)</a> </p> </div> --> </div> </div> <div class="row "> <div class="footer-copyright "> <div class="col s7 "> <a class="grey-text text-lighten-4 " href=" "><i class="material-icons ">copyright</i>2019 Bangalore Junior MUN</a> </div> <div class="col s5 "> Developed by <a href="https://github.com/Nexus987 " target="_blank ">Nexus</a>, <a href="https://github.com/gaurangbharti1 " target="_blank ">GBHacker23</a> and <a href="https://github.com/BK-Modding/ " target="_blank ">BK-Modding</a> </div> <div class="col s5"> Renovated for 2019 by <a href="https://github.com/muhsin7" target="_blank">Muhsin7</a>, <a href="https://github.com/Teminix" target="_blank">Teminix</a> and <a href="https://github.com/Chanmanstanflan" target="_blank">Chanmanstanflan</a> </div> <div class="col s5"> Renovated for 2020 by <a href="https://github.com/iAarush" target="_blank">iAarush</a>, <a href="https://github.com/PrasidhV" target="_blank">PrasidhV</a> and <a href="https://github.com/Shubaan7" target="_blank">Shubaan007</a> </div> </div> </div> </footer> <script> $(document).ready(function() { // the "href " attribute of the modal trigger must specify the modal ID that wants to be triggered $('.modal').modal(); }); $(document).ready(function() { $(".dropdown-button ").dropdown({ coverTrigger: false }); }); $(document).ready(function() { $('.parallax').parallax(); }); </script> </body> </html>
bangalorejmun/bangalorejmun.github.io
Committees/ECOSOC/index.html
HTML
mit
18,936
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 17338, 6499, 2278, 1026, 1013, 2516, 1028, 1026, 2918, 17850, 12879, 1027, 1000, 1012, 1012, 1013, 1012, 1012, 1013, 1000, 1028, 1026, 999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 AppBundle\Service\OAuth\UserResponseHandler; use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface; use Symfony\Component\Security\Core\User\UserInterface; /** * Interface ResponseHandlerInterface * @package AppBundle\Service\OAuth\UserResponseHandler */ interface ResponseHandlerInterface { /** * @param UserResponseInterface $response * * @return UserInterface */ public function processOauthUserResponse(UserResponseInterface $response): UserInterface; }
SenseyePrototype/SenseyePrototype
src/AppBundle/Service/OAuth/UserResponseHandler/ResponseHandlerInterface.php
PHP
mit
518
[ 30522, 1026, 1029, 25718, 3415, 15327, 10439, 27265, 2571, 1032, 2326, 1032, 1051, 4887, 2705, 1032, 5310, 6072, 26029, 3366, 11774, 3917, 1025, 2224, 1044, 9148, 1032, 14012, 1032, 1051, 4887, 2705, 27265, 2571, 1032, 1051, 4887, 2705, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/***************************************************************************** * Web3d.org Copyright (c) 2001 * Java Source * * This source is licensed under the GNU LGPL v2.1 * Please read http://www.gnu.org/copyleft/lgpl.html for more information * * This software comes with the standard NO WARRANTY disclaimer for any * purpose. Use it at your own risk. If there's a problem you get to fix it. * ****************************************************************************/ package org.web3d.vrml.renderer.ogl.nodes; // External imports import javax.vecmath.*; // Local imports import org.web3d.vrml.renderer.common.nodes.AreaListener; /** * The listener interface for receiving notice of the viewpoint on entry or * exit from an area. * <p> * Each method receives both the user's current position and orientation in * V-world coordinates but also the transform of the object that was picked * and representing this interface. The idea of this is to save internal calls * to getLocalToVWorld() and the extra capability bits required for this. The * transform is available from the initial pick SceneGraphPath anyway, so this * comes for free and leads to better performance. In addition, it saves * needing to pass in a scene graph path for dealing with the * getLocalToVWorld() case when we are under a SharedGroup. * * @author Alan Hudson, Justin Couch * @version $Revision: 1.3 $ */ public interface OGLAreaListener extends AreaListener { /** * Invoked when the user enters an area. * * @param position The new position of the user * @param orientation The orientation of the user there * @param localPosition The vworld transform object for the class * that implemented this listener */ public void areaEntry(Point3f position, Vector3f orientation, Matrix4f vpMatrix, Matrix4f localPosition); /** * Notification that the user is still in the area, but that the * viewer reference point has changed. * * @param position The new position of the user * @param orientation The orientation of the user there * @param localPosition The vworld transform object for the class * that implemented this listener */ public void userPositionChanged(Point3f position, Vector3f orientation, Matrix4f vpMatrix, Matrix4f localPosition); /** * Invoked when the tracked object exits on area. */ public void areaExit(); }
Norkart/NK-VirtualGlobe
Xj3D/src/java/org/web3d/vrml/renderer/ogl/nodes/OGLAreaListener.java
Java
gpl-2.0
2,694
[ 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...
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="html/html; charset=utf-8" /> <title>FBSDKMessengerURLHandlerDelegate Protocol Reference</title> <meta id="xcode-display" name="xcode-display" content="render"/> <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" /> <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" /> <meta name="generator" content="appledoc 2.2 (build 963)" /> </head> <body> <header id="top_header"> <div id="library" class="hideInXcode"> <h1><a id="libraryTitle" href="../index.html">Facebook Messenger Share Kit SDK 1.3.2 for iOS </a></h1> <a id="developerHome" href="../index.html">Facebook</a> </div> <div id="title" role="banner"> <h1 class="hideInXcode">FBSDKMessengerURLHandlerDelegate Protocol Reference</h1> </div> <ul id="headerButtons" role="toolbar"> <li id="toc_button"> <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button> </li> <li id="jumpto_button" role="navigation"> <select id="jumpTo"> <option value="top">Jump To&#133;</option> <option value="tasks">Tasks</option> <option value="instance_methods">Instance Methods</option> <option value="//api/name/messengerURLHandler:didHandleCancelWithContext:">&nbsp;&nbsp;&nbsp;&nbsp;- messengerURLHandler:didHandleCancelWithContext:</option> <option value="//api/name/messengerURLHandler:didHandleOpenFromComposerWithContext:">&nbsp;&nbsp;&nbsp;&nbsp;- messengerURLHandler:didHandleOpenFromComposerWithContext:</option> <option value="//api/name/messengerURLHandler:didHandleReplyWithContext:">&nbsp;&nbsp;&nbsp;&nbsp;- messengerURLHandler:didHandleReplyWithContext:</option> </select> </li> </ul> </header> <nav id="tocContainer" class="isShowingTOC"> <ul id="toc" role="tree"> <li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul> </ul></li> <li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/messengerURLHandler:didHandleCancelWithContext:">messengerURLHandler:didHandleCancelWithContext:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/messengerURLHandler:didHandleOpenFromComposerWithContext:">messengerURLHandler:didHandleOpenFromComposerWithContext:</a></span></li> <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/messengerURLHandler:didHandleReplyWithContext:">messengerURLHandler:didHandleReplyWithContext:</a></span></li> </ul></li> </ul> </nav> <article> <div id="contents" class="isShowingTOC" role="main"> <a title="FBSDKMessengerURLHandlerDelegate Protocol Reference" name="top"></a> <div class="main-navigation navigation-top"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="header"> <div class="section-header"> <h1 class="title title-header">FBSDKMessengerURLHandlerDelegate Protocol Reference</h1> </div> </div> <div id="container"> <div class="section section-specification"><table cellspacing="0"><tbody> <tr> <td class="specification-title">Conforms to</td> <td class="specification-value">NSObject</td> </tr><tr> <td class="specification-title">Declared in</td> <td class="specification-value">FBSDKMessengerURLHandler.h</td> </tr> </tbody></table></div> <div class="section section-tasks"> <a title="Tasks" name="tasks"></a> <h2 class="subtitle subtitle-tasks">Tasks</h2> <ul class="task-list"> <li> <span class="tooltip"> <code><a href="#//api/name/messengerURLHandler:didHandleReplyWithContext:">&ndash;&nbsp;messengerURLHandler:didHandleReplyWithContext:</a></code> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/messengerURLHandler:didHandleOpenFromComposerWithContext:">&ndash;&nbsp;messengerURLHandler:didHandleOpenFromComposerWithContext:</a></code> </span> </li><li> <span class="tooltip"> <code><a href="#//api/name/messengerURLHandler:didHandleCancelWithContext:">&ndash;&nbsp;messengerURLHandler:didHandleCancelWithContext:</a></code> </span> </li> </ul> </div> <div class="section section-methods"> <a title="Instance Methods" name="instance_methods"></a> <h2 class="subtitle subtitle-methods">Instance Methods</h2> <div class="section-method"> <a name="//api/name/messengerURLHandler:didHandleCancelWithContext:" title="messengerURLHandler:didHandleCancelWithContext:"></a> <h3 class="subsubtitle method-title">messengerURLHandler:didHandleCancelWithContext:</h3> <div class="method-subsection brief-description"> <p>@abstract This is called after a user canceled a share and Messenger redirected here</p> </div> <div class="method-subsection method-declaration"><code>- (void)messengerURLHandler:(FBSDKMessengerURLHandler *)<em>messengerURLHandler</em> didHandleCancelWithContext:(FBSDKMessengerURLHandlerCancelContext *)<em>context</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>messengerURLHandler</em></dt> <dd><p>The handler that handled the URL</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>context</em></dt> <dd><p>The data passed from Messenger</p></dd> </dl> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">FBSDKMessengerURLHandler.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/messengerURLHandler:didHandleOpenFromComposerWithContext:" title="messengerURLHandler:didHandleOpenFromComposerWithContext:"></a> <h3 class="subsubtitle method-title">messengerURLHandler:didHandleOpenFromComposerWithContext:</h3> <div class="method-subsection brief-description"> <p>@abstract This is called after a user tapped this app from the composer in Messenger</p> </div> <div class="method-subsection method-declaration"><code>- (void)messengerURLHandler:(FBSDKMessengerURLHandler *)<em>messengerURLHandler</em> didHandleOpenFromComposerWithContext:(FBSDKMessengerURLHandlerOpenFromComposerContext *)<em>context</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>messengerURLHandler</em></dt> <dd><p>The handler that handled the URL</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>context</em></dt> <dd><p>The data passed from Messenger</p></dd> </dl> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">FBSDKMessengerURLHandler.h</code><br /> </div> </div> <div class="section-method"> <a name="//api/name/messengerURLHandler:didHandleReplyWithContext:" title="messengerURLHandler:didHandleReplyWithContext:"></a> <h3 class="subsubtitle method-title">messengerURLHandler:didHandleReplyWithContext:</h3> <div class="method-subsection brief-description"> <p>@abstract This is called after FBSDKMessengerURLHandler has received a reply from messenger</p> </div> <div class="method-subsection method-declaration"><code>- (void)messengerURLHandler:(FBSDKMessengerURLHandler *)<em>messengerURLHandler</em> didHandleReplyWithContext:(FBSDKMessengerURLHandlerReplyContext *)<em>context</em></code></div> <div class="method-subsection arguments-section parameters"> <h4 class="method-subtitle parameter-title">Parameters</h4> <dl class="argument-def parameter-def"> <dt><em>messengerURLHandler</em></dt> <dd><p>The handler that handled the URL</p></dd> </dl> <dl class="argument-def parameter-def"> <dt><em>context</em></dt> <dd><p>The data passed from Messenger</p></dd> </dl> </div> <div class="method-subsection declared-in-section"> <h4 class="method-subtitle">Declared In</h4> <code class="declared-in-ref">FBSDKMessengerURLHandler.h</code><br /> </div> </div> </div> </div> <div class="main-navigation navigation-bottom"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="footer"> <hr /> <div class="footer-copyright"> <p><span class="copyright">&copy; 2015 Facebook. All rights reserved. (Last updated: 2015-11-11)</span><br /> <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p> </div> </div> </div> </article> <script type="text/javascript"> function jumpToChange() { window.location.hash = this.options[this.selectedIndex].value; } function toggleTOC() { var contents = document.getElementById('contents'); var tocContainer = document.getElementById('tocContainer'); if (this.getAttribute('class') == 'open') { this.setAttribute('class', ''); contents.setAttribute('class', ''); tocContainer.setAttribute('class', ''); window.name = "hideTOC"; } else { this.setAttribute('class', 'open'); contents.setAttribute('class', 'isShowingTOC'); tocContainer.setAttribute('class', 'isShowingTOC'); window.name = ""; } return false; } function toggleTOCEntryChildren(e) { e.stopPropagation(); var currentClass = this.getAttribute('class'); if (currentClass == 'children') { this.setAttribute('class', 'children open'); } else if (currentClass == 'children open') { this.setAttribute('class', 'children'); } return false; } function tocEntryClick(e) { e.stopPropagation(); return true; } function init() { var selectElement = document.getElementById('jumpTo'); selectElement.addEventListener('change', jumpToChange, false); var tocButton = document.getElementById('table_of_contents'); tocButton.addEventListener('click', toggleTOC, false); var taskTreeItem = document.getElementById('task_treeitem'); if (taskTreeItem.getElementsByTagName('li').length > 0) { taskTreeItem.setAttribute('class', 'children'); taskTreeItem.firstChild.setAttribute('class', 'disclosure'); } var tocList = document.getElementById('toc'); var tocEntries = tocList.getElementsByTagName('li'); for (var i = 0; i < tocEntries.length; i++) { tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false); } var tocLinks = tocList.getElementsByTagName('a'); for (var i = 0; i < tocLinks.length; i++) { tocLinks[i].addEventListener('click', tocEntryClick, false); } if (window.name == "hideTOC") { toggleTOC.call(tocButton); } } window.onload = init; // If showing in Xcode, hide the TOC and Header if (navigator.userAgent.match(/xcode/i)) { document.getElementById("contents").className = "hideInXcode" document.getElementById("tocContainer").className = "hideInXcode" document.getElementById("top_header").className = "hideInXcode" } </script> </body> </html>
yangboz/crispy-octo-moo
iOS/CrispyOctoMoo/FacebookSDKs/DocSets/FacebookMessengerShareKitSDK-1_3-for-iOS.docset/Contents/Resources/Documents/Protocols/FBSDKMessengerURLHandlerDelegate.html
HTML
apache-2.0
12,172
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 4180, 1011, 2828, 1000, 4180, 1027, 1000, 16129, 1013, 16129, 1025, 25869, 13462, 1027, 21183, 2546, 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 (c) 2015 Augie R. Maddox, Guavaman Enterprises. All rights reserved. #pragma warning disable 0219 #pragma warning disable 0618 #pragma warning disable 0649 namespace Rewired.UI.ControlMapper { using UnityEngine; using UnityEngine.UI; using System.Collections; using Rewired; [AddComponentMenu("")] public class InputFieldInfo : UIElementInfo { public int actionId { get; set; } public AxisRange axisRange { get; set; } public int actionElementMapId { get; set; } public ControllerType controllerType { get; set; } public int controllerId { get; set; } } }
dannis99/ninja
game/Assets/Rewired/Extras/ControlMapper/Scripts/InputFieldInfo.cs
C#
apache-2.0
642
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2325, 15476, 2666, 1054, 1012, 22730, 1010, 19739, 12462, 2386, 9926, 1012, 2035, 2916, 9235, 1012, 1001, 10975, 8490, 2863, 5432, 4487, 19150, 6185, 16147, 1001, 10975, 8490, 2863, 5432, 4487, 191...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace System.Drawing.Drawing2D { public enum SmoothingMode { Invalid = QualityMode.Invalid, Default = QualityMode.Default, HighSpeed = QualityMode.Low, HighQuality = QualityMode.High, None, AntiAlias } }
rubo/corefx
src/System.Drawing.Common/src/System/Drawing/Drawing2D/SmoothingMode.cs
C#
mit
472
[ 30522, 1013, 1013, 7000, 2000, 1996, 1012, 5658, 3192, 2104, 2028, 2030, 2062, 10540, 1012, 1013, 1013, 1996, 1012, 5658, 3192, 15943, 2023, 5371, 2000, 2017, 2104, 1996, 10210, 6105, 1012, 1013, 1013, 2156, 1996, 6105, 5371, 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...
require 'spec_helper' module Alf module Relvar describe Memory, "to_relation" do let(:value){ Relation(id: 1) } let(:rv) { Memory.new(value) } subject{ rv.to_relation } it 'is as expected' do subject.should be(value) end end end end
alf-tool/alf-core
spec/unit/alf-relvar/memory/test_to_relation.rb
Ruby
mit
291
[ 30522, 5478, 1005, 28699, 1035, 2393, 2121, 1005, 11336, 24493, 11336, 2128, 22144, 2099, 6235, 3638, 1010, 1000, 2000, 1035, 7189, 1000, 2079, 2292, 1006, 1024, 3643, 1007, 1063, 7189, 1006, 8909, 1024, 1015, 1007, 1065, 2292, 1006, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
// ------------------------------------------------------------------------------ // <autogenerated> // This code was generated by a tool. // Mono Runtime Version: 4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </autogenerated> // ------------------------------------------------------------------------------ namespace VideoMonetizationWebExample { public partial class Video { } }
vingd/vingd-api-csharp
Examples/VideoMonetizationWebExample/Video.aspx.designer.cs
C#
mit
486
[ 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...
/* * Copyright 2012-2020 the original author or 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.actuate.autoconfigure.metrics.cache; import java.util.Collection; import java.util.Map; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import org.springframework.boot.actuate.metrics.cache.CacheMeterBinderProvider; import org.springframework.boot.actuate.metrics.cache.CacheMetricsRegistrar; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.util.StringUtils; /** * Configure a {@link CacheMetricsRegistrar} and register all available {@link Cache * caches}. * * @author Stephane Nicoll */ @Configuration(proxyBeanMethods = false) @ConditionalOnBean({ CacheMeterBinderProvider.class, MeterRegistry.class }) class CacheMetricsRegistrarConfiguration { private static final String CACHE_MANAGER_SUFFIX = "cacheManager"; private final MeterRegistry registry; private final CacheMetricsRegistrar cacheMetricsRegistrar; private final Map<String, CacheManager> cacheManagers; CacheMetricsRegistrarConfiguration(MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders, Map<String, CacheManager> cacheManagers) { this.registry = registry; this.cacheManagers = cacheManagers; this.cacheMetricsRegistrar = new CacheMetricsRegistrar(this.registry, binderProviders); bindCachesToRegistry(); } @Bean CacheMetricsRegistrar cacheMetricsRegistrar() { return this.cacheMetricsRegistrar; } private void bindCachesToRegistry() { this.cacheManagers.forEach(this::bindCacheManagerToRegistry); } private void bindCacheManagerToRegistry(String beanName, CacheManager cacheManager) { cacheManager.getCacheNames() .forEach((cacheName) -> bindCacheToRegistry(beanName, cacheManager.getCache(cacheName))); } private void bindCacheToRegistry(String beanName, Cache cache) { Tag cacheManagerTag = Tag.of("cacheManager", getCacheManagerName(beanName)); this.cacheMetricsRegistrar.bindCacheToRegistry(cache, cacheManagerTag); } /** * Get the name of a {@link CacheManager} based on its {@code beanName}. * @param beanName the name of the {@link CacheManager} bean * @return a name for the given cache manager */ private String getCacheManagerName(String beanName) { if (beanName.length() > CACHE_MANAGER_SUFFIX.length() && StringUtils.endsWithIgnoreCase(beanName, CACHE_MANAGER_SUFFIX)) { return beanName.substring(0, beanName.length() - CACHE_MANAGER_SUFFIX.length()); } return beanName; } }
Buzzardo/spring-boot
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java
Java
apache-2.0
3,324
[ 30522, 1013, 1008, 1008, 9385, 2262, 1011, 12609, 1996, 2434, 3166, 2030, 6048, 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, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.10.21 at 02:36:51 PM CEST // package nl.wetten.bwbng.wti; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlMixed; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="opmerking" maxOccurs="unbounded"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;choice maxOccurs="unbounded" minOccurs="0"> * &lt;element ref="{}al"/> * &lt;/choice> * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}NCName" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "opmerking" }) @XmlRootElement(name = "opmerkingen") public class Opmerkingen { @XmlElement(required = true) protected List<Opmerkingen.Opmerking> opmerking; /** * Gets the value of the opmerking property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the opmerking property. * * <p> * For example, to add a new item, do as follows: * <pre> * getOpmerking().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Opmerkingen.Opmerking } * * */ public List<Opmerkingen.Opmerking> getOpmerking() { if (opmerking == null) { opmerking = new ArrayList<Opmerkingen.Opmerking>(); } return this.opmerking; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;choice maxOccurs="unbounded" minOccurs="0"> * &lt;element ref="{}al"/> * &lt;/choice> * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}NCName" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "content" }) public static class Opmerking { @XmlElementRef(name = "al", type = Al.class, required = false) @XmlMixed protected List<Object> content; @XmlAttribute(name = "type") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NCName") protected String type; /** * Gets the value of the content property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the content property. * * <p> * For example, to add a new item, do as follows: * <pre> * getContent().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * {@link Al } * * */ public List<Object> getContent() { if (content == null) { content = new ArrayList<Object>(); } return this.content; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } } }
digitalheir/java-wetten-nl-library
src/main/java/nl/wetten/bwbng/wti/Opmerkingen.java
Java
mit
5,627
[ 30522, 1013, 1013, 1013, 1013, 2023, 5371, 2001, 7013, 2011, 1996, 9262, 21246, 4294, 2005, 20950, 8031, 1006, 13118, 2497, 1007, 4431, 7375, 1010, 1058, 2475, 1012, 1016, 1012, 1022, 1011, 29491, 14142, 2683, 14526, 1012, 13515, 1013, 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...
<?php //////////////////////////////////////////////////////////////////////////////// /// This file contains a few configuration variables that control /// how Moodle uses this theme. //////////////////////////////////////////////////////////////////////////////// $THEME->name = 'skonline_test_wo_SKOParent'; $THEME->sheets = array('base','skonline','browser','ImportedFromMoodle1_9','CoursesSitewide','skonline_test_wo_SKOParent'); /// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order //////////////////////////////////////////////////////////////////////////////// $THEME->parents = array('base'); // TODO: new themes can not be based on standardold, instead use 'base' as the base /// This variable can be set to the name of a parent theme /// which you want to have included before the current theme. /// This can make it easy to make modifications to another /// theme without having to actually change the files /// If this variable is empty or false then a parent theme /// is not used. //////////////////////////////////////////////////////////////////////////////// $THEME->parents_exclude_sheets = array('base'=>array('styles_moz')); $THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; /// With this you can control the colours of the "big" MP3 player /// that is used for MP3 resources. $THEME->filter_mediaplugin_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. 'waitForPlay=yes'; /// ...And this controls the small embedded player $THEME->layouts = array( // Most pages - if we encounter an unknown or a missing page type, this one is used. 'base' => array( 'file' => 'general.php', 'regions' => array() ), 'standard' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'skonline' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), // Course page 'course' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), // Course page 'coursecategory' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'incourse' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'frontpage' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'admin' => array( 'file' => 'general.php', 'regions' => array('side-pre'), 'defaultregion' => 'side-pre' ), 'mydashboard' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'mypublic' => array( 'file' => 'general.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post' ), 'login' => array( 'file' => 'general.php', 'regions' => array() ), // Pages that appear in pop-up windows - no navigation, no blocks, no header. 'popup' => array( 'file' => 'general.php', 'regions' => array(), 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true), ), // No blocks and minimal footer - used for legacy frame layouts only! 'frametop' => array( 'file' => 'general.php', 'regions' => array(), 'options' => array('nofooter', 'noblocks'=>true), ), // Embeded pages, like iframe embeded in moodleform 'embedded' => array( 'file' => 'general.php', 'regions' => array(), 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true), ), // Used during upgrade and install, and for the 'This site is undergoing maintenance' message. // This must not have any blocks, and it is good idea if it does not have links to // other places - for example there should not be a home link in the footer... 'maintenance' => array( 'file' => 'general.php', 'regions' => array(), 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true), ), // Should display the content and basic headers only. 'print' => array( 'file' => 'general.php', 'regions' => array(), 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true), ), 'report' => array( 'file' => 'report.php', 'regions' => array('side-pre'), 'defaultregion' => 'side-pre' ), ); $THEME->rendererfactory = 'theme_overridden_renderer_factory'; $THEME->enable_dock = true; //$THEME->javascripts_footer = array('navigation'); $THEME->editor_sheets = array('editor'); $THEME->javascripts = array('skonline'); //$THEME->javascripts = array('skonline' => array('skonline'));
orvsd/moodle22
theme/skonline_test_wo_SKOParent/config.php
PHP
gpl-3.0
5,583
[ 30522, 1026, 1029, 25718, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 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 require 'PHPMailer/PHPMailerAutoload.php'; wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('wj-settings-script', plugin_dir_url(__FILE__) . '../js/settings_page.js'); wp_enqueue_style('jquery-theme-style', plugin_dir_url(__FILE__) . '../css/jquery-ui/jquery-ui.css'); $options = get_option('wpsyn_options_general'); $spinnerOpts = get_option('wpsyn_options_spinner'); $mailerOpts = get_option('wpsyn_options_notify'); ?> <div id="tabs"> <h2>General settings</h2> <ul> <li><a href="#tabs-1">General Settings</a></li> <li><a href="#tabs-2">SpinnerChief</a></li> <li><a href="#tabs-3">Notifications</a></li> </ul> <div id="tabs-1" class="wrap"> <form action="options.php" method="post"> <?php settings_fields('wpsyn-option-general'); ?> <h3>Minimal length of the syndicated message:</h3> <input type="text" name="wpsyn_options_general[option_min_length]" value="<?php echo esc_attr($options['option_min_length']); ?>" /> <h3>Maximal length of the syndicated message:</h3> <input type="text" name="wpsyn_options_general[option_max_length]" value="<?php echo esc_attr($options['option_max_length']); ?>" /> <h3>Text for links to your article:</h3> <input type="text" name="wpsyn_options_general[option_link_text]" value="<?php echo esc_attr($options['option_link_text']); ?>" /> <br><br> <button type="submit">Save changes</button> </form> </div> <div id="tabs-2"> <form action="options.php" method="post"> <?php settings_fields('wpsyn-option-spinner'); ?> <h3>SpinnerChief API Key:</h3> <input type="text" name="wpsyn_options_spinner[option_spinner_key]" value="<?php echo esc_attr($spinnerOpts['option_spinner_key']); ?>" /> <h3>SpinnerChief API Secret:</h3> <input type="text" name="wpsyn_options_spinner[option_spinner_secret]" value="<?php echo esc_attr($spinnerOpts['option_spinner_secret']); ?>" /> <br><br> <button type="submit">Save changes</button> </form> </div> <div id="tabs-3"> <form action="options.php" method="post"> <?php settings_fields('wpsyn-option-notify'); ?> <h3>Set main server:</h3> <input type="text" name="wpsyn_options_notify[option_mailer_server]" value="<?php echo esc_attr($mailerOpts['option_mailer_server']); ?>" /> <h3>Set username:</h3> <input type="text" name="wpsyn_options_notify[option_mailer_user]" value="<?php echo esc_attr($mailerOpts['option_mailer_user']); ?>" /> <h3>Set password:</h3> <input type="text" name="wpsyn_options_notify[option_mailer_password]" value="<?php echo esc_attr($mailerOpts['option_mailer_password']); ?>" /> <button type="submit">Save changes</button> </form> <br> <button id="test-email">Test connection</button> <div id="mailer-test-result"></div> </div> </div> <?php //sending test mail $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'wjaz1991@gmail.com'; $mail->Password = 'str@t0c@st3r'; $mail->SMTPSecure = 'ssl'; $mail->Port = 465; $mail->From = 'wp@local.com'; $mail->FromName = 'Wordpress'; $mail->addAddress('wjaz1991@gmail.com'); $mail->WordWrap = 50; $mail->isHTML(true); $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; /*if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; }*/
wjaz1991/wp-tut
wp-content/plugins/wj_syndicate/includes/general_settings.php
PHP
gpl-2.0
3,689
[ 30522, 1026, 1029, 25718, 5478, 1005, 25718, 21397, 2121, 1013, 25718, 21397, 6906, 16161, 11066, 1012, 25718, 1005, 1025, 1059, 2361, 1035, 4372, 4226, 5657, 1035, 5896, 1006, 1005, 1046, 4226, 2854, 1011, 21318, 1011, 21628, 2015, 30524, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 InMemoryList package. * * (c) Mauro Cassani<https://github.com/mauretto78> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace InMemoryList\Domain\Model; use InMemoryList\Domain\Model\Contracts\ListRepositoryInterface; use InMemoryList\Domain\Model\Exceptions\ListCollectionNotAllowedUuidException; use Ramsey\Uuid\Uuid; class ListCollectionUuid { /** * @var string */ private $uuid; /** * ListCollectionUUId constructor. * * @param null $uuid */ public function __construct($uuid = null) { $this->setUuid($uuid); } /** * @param null $uuid * * @throws ListCollectionNotAllowedUuidException */ public function setUuid($uuid = null) { $notAllowedNames = [ ListRepositoryInterface::CHUNK, ListRepositoryInterface::HEADERS, ListRepositoryInterface::INDEX, ListRepositoryInterface::SEPARATOR, ListRepositoryInterface::STATISTICS, ]; foreach ($notAllowedNames as $notAllowedName) { if (strpos($uuid, $notAllowedName) !== false) { throw new ListCollectionNotAllowedUuidException('You can\'t assign "'.$uuid.'" as list uuid.'); } } $this->uuid = str_replace(' ', '-', $uuid) ?: Uuid::uuid4()->toString(); } /** * @return mixed */ public function getUuid() { return $this->uuid; } /** * @return string */ public function __toString() { return $this->getUuid(); } }
mauretto78/in-memory-list
src/InMemoryList/Domain/Model/ListCollectionUuid.php
PHP
mit
1,705
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 1999, 4168, 5302, 23320, 2923, 7427, 1012, 1008, 1008, 1006, 1039, 1007, 5003, 10976, 16220, 7088, 1026, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 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...
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qqmlobjectcreator_p.h" #include <private/qqmlengine_p.h> #include <private/qqmlvmemetaobject_p.h> #include <private/qv4function_p.h> #include <private/qv4functionobject_p.h> #include <private/qqmlcontextwrapper_p.h> #include <private/qqmlbinding_p.h> #include <private/qqmlstringconverters_p.h> #include <private/qqmlboundsignal_p.h> #include <private/qqmltrace_p.h> #include <private/qqmlcomponentattached_p.h> #include <private/qqmlcomponent_p.h> #include <private/qqmlcustomparser_p.h> #include <private/qqmlscriptstring_p.h> #include <private/qqmlpropertyvalueinterceptor_p.h> #include <private/qqmlvaluetypeproxybinding_p.h> QT_USE_NAMESPACE namespace { struct ActiveOCRestorer { ActiveOCRestorer(QQmlObjectCreator *creator, QQmlEnginePrivate *ep) : ep(ep), oldCreator(ep->activeObjectCreator) { ep->activeObjectCreator = creator; } ~ActiveOCRestorer() { ep->activeObjectCreator = oldCreator; } QQmlEnginePrivate *ep; QQmlObjectCreator *oldCreator; }; } static void removeBindingOnProperty(QObject *o, int index) { int coreIndex = index & 0x0000FFFF; int valueTypeIndex = (index & 0xFFFF0000 ? index >> 16 : -1); QQmlAbstractBinding *binding = QQmlPropertyPrivate::setBinding(o, coreIndex, valueTypeIndex, 0); if (binding) binding->destroy(); } QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompiledData *compiledData, QQmlContextData *creationContext, void *activeVMEDataForRootContext) : phase(Startup) , compiledData(compiledData) , resolvedTypes(compiledData->resolvedTypes) , propertyCaches(compiledData->propertyCaches) , vmeMetaObjectData(compiledData->metaObjects) , activeVMEDataForRootContext(activeVMEDataForRootContext) { init(parentContext); sharedState = new QQmlObjectCreatorSharedState; topLevelCreator = true; sharedState->componentAttached = 0; sharedState->allCreatedBindings.allocate(compiledData->totalBindingsCount); sharedState->allParserStatusCallbacks.allocate(compiledData->totalParserStatusCount); sharedState->allCreatedObjects.allocate(compiledData->totalObjectCount); sharedState->allJavaScriptObjects = 0; sharedState->creationContext = creationContext; sharedState->rootContext = 0; QQmlProfiler *profiler = QQmlEnginePrivate::get(engine)->profiler; Q_QML_PROFILE_IF_ENABLED(profiler, sharedState->profiler.init(profiler, compiledData->totalParserStatusCount)); } QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QQmlCompiledData *compiledData, QQmlObjectCreatorSharedState *inheritedSharedState) : phase(Startup) , compiledData(compiledData) , resolvedTypes(compiledData->resolvedTypes) , propertyCaches(compiledData->propertyCaches) , vmeMetaObjectData(compiledData->metaObjects) , activeVMEDataForRootContext(0) { init(parentContext); sharedState = inheritedSharedState; topLevelCreator = false; } void QQmlObjectCreator::init(QQmlContextData *providedParentContext) { parentContext = providedParentContext; engine = parentContext->engine; if (!compiledData->isInitialized()) compiledData->initialize(engine); qmlUnit = compiledData->qmlUnit; context = 0; _qobject = 0; _scopeObject = 0; _valueTypeProperty = 0; _compiledObject = 0; _ddata = 0; _propertyCache = 0; _vmeMetaObject = 0; _qmlContext = 0; } QQmlObjectCreator::~QQmlObjectCreator() { if (topLevelCreator) { { QQmlObjectCreatorRecursionWatcher watcher(this); } for (int i = 0; i < sharedState->allCreatedBindings.count(); ++i) { QQmlAbstractBinding *b = sharedState->allCreatedBindings.at(i); if (b) b->m_mePtr = 0; } for (int i = 0; i < sharedState->allParserStatusCallbacks.count(); ++i) { QQmlParserStatus *ps = sharedState->allParserStatusCallbacks.at(i); if (ps) ps->d = 0; } while (sharedState->componentAttached) { QQmlComponentAttached *a = sharedState->componentAttached; a->rem(); } } } QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlInstantiationInterrupt *interrupt) { if (phase == CreatingObjectsPhase2) { phase = ObjectsCreated; return context->contextObject; } Q_ASSERT(phase == Startup); phase = CreatingObjects; int objectToCreate; if (subComponentIndex == -1) { objectIndexToId = compiledData->objectIndexToIdForRoot; objectToCreate = qmlUnit->indexOfRootObject; } else { objectIndexToId = compiledData->objectIndexToIdPerComponent[subComponentIndex]; const QV4::CompiledData::Object *compObj = qmlUnit->objectAt(subComponentIndex); objectToCreate = compObj->bindingTable()->value.objectIndex; } context = new QQmlContextData; context->isInternal = true; context->url = compiledData->url; context->urlString = compiledData->name; context->imports = compiledData->importCache; context->imports->addref(); context->setParent(parentContext); if (!sharedState->rootContext) { sharedState->rootContext = context; sharedState->rootContext->activeVMEData = activeVMEDataForRootContext; sharedState->rootContext->isRootObjectInCreation = true; } QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope scope(v4); Q_ASSERT(sharedState->allJavaScriptObjects || topLevelCreator); if (topLevelCreator) sharedState->allJavaScriptObjects = scope.alloc(compiledData->totalObjectCount); QVector<QQmlContextData::ObjectIdMapping> mapping(objectIndexToId.count()); for (QHash<int, int>::ConstIterator it = objectIndexToId.constBegin(), end = objectIndexToId.constEnd(); it != end; ++it) { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(it.key()); QQmlContextData::ObjectIdMapping m; m.id = it.value(); m.name = stringAt(obj->idIndex); mapping[m.id] = m; } context->setIdPropertyData(mapping); if (subComponentIndex == -1) { QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->scripts.count())); context->importedScripts = scripts; for (int i = 0; i < compiledData->scripts.count(); ++i) { QQmlScriptData *s = compiledData->scripts.at(i); scripts->putIndexed(i, s->scriptValueForContext(context)); } } else if (sharedState->creationContext) { context->importedScripts = sharedState->creationContext->importedScripts; } QObject *instance = createInstance(objectToCreate, parent, /*isContextObject*/true); if (instance) { QQmlData *ddata = QQmlData::get(instance); Q_ASSERT(ddata); if (ddata->compiledData) ddata->compiledData->release(); ddata->compiledData = compiledData; ddata->compiledData->addref(); } if (topLevelCreator) sharedState->allJavaScriptObjects = 0; phase = CreatingObjectsPhase2; if (interrupt && interrupt->shouldInterrupt()) return 0; phase = ObjectsCreated; return instance; } bool QQmlObjectCreator::populateDeferredProperties(QObject *instance) { QQmlData *declarativeData = QQmlData::get(instance); context = declarativeData->deferredData->context; sharedState->rootContext = context; const int objectIndex = declarativeData->deferredData->deferredIdx; const QV4::CompiledData::Object *obj = qmlUnit->objectAt(objectIndex); QObject *bindingTarget = instance; QQmlRefPointer<QQmlPropertyCache> cache = declarativeData->propertyCache; QQmlVMEMetaObject *vmeMetaObject = QQmlVMEMetaObject::get(instance); QObject *scopeObject = instance; qSwap(_scopeObject, scopeObject); QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope valueScope(v4); Q_ASSERT(topLevelCreator); Q_ASSERT(!sharedState->allJavaScriptObjects); sharedState->allJavaScriptObjects = valueScope.alloc(compiledData->totalObjectCount); QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject)); QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, new (v4->memoryManager) QV4::QmlBindingWrapper(v4->rootContext, qmlScope)); QV4::ExecutionContext *qmlContext = qmlBindingWrapper->context(); qSwap(_qmlContext, qmlContext); qSwap(_propertyCache, cache); qSwap(_qobject, instance); qSwap(_compiledObject, obj); qSwap(_ddata, declarativeData); qSwap(_bindingTarget, bindingTarget); qSwap(_vmeMetaObject, vmeMetaObject); QBitArray bindingSkipList = compiledData->deferredBindingsPerObject.value(objectIndex); for (int i = 0; i < bindingSkipList.count(); ++i) bindingSkipList.setBit(i, !bindingSkipList.testBit(i)); setupBindings(bindingSkipList); qSwap(_vmeMetaObject, vmeMetaObject); qSwap(_bindingTarget, bindingTarget); qSwap(_ddata, declarativeData); qSwap(_compiledObject, obj); qSwap(_qobject, instance); qSwap(_propertyCache, cache); qSwap(_qmlContext, qmlContext); qSwap(_scopeObject, scopeObject); phase = ObjectsCreated; return errors.isEmpty(); } void QQmlObjectCreator::setPropertyValue(QQmlPropertyData *property, const QV4::CompiledData::Binding *binding) { QQmlPropertyPrivate::WriteFlags propertyWriteFlags = QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::RemoveBindingOnAliasWrite; int propertyWriteStatus = -1; void *argv[] = { 0, 0, &propertyWriteStatus, &propertyWriteFlags }; QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope scope(v4); int propertyType = property->propType; if (property->isEnum()) { if (binding->flags & QV4::CompiledData::Binding::IsResolvedEnum) { propertyType = QMetaType::Int; } else { // ### This should be resolved earlier at compile time and the binding value should be changed accordingly. QVariant value = binding->valueAsString(&qmlUnit->header); bool ok = QQmlPropertyPrivate::write(_qobject, *property, value, context); Q_ASSERT(ok); Q_UNUSED(ok); return; } } switch (propertyType) { case QMetaType::QVariant: { if (binding->type == QV4::CompiledData::Binding::Type_Number) { double n = binding->valueAsNumber(); if (double(int(n)) == n) { if (property->isVarProperty()) { _vmeMetaObject->setVMEProperty(property->coreIndex, QV4::Primitive::fromInt32(int(n))); } else { int i = int(n); QVariant value(i); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } else { if (property->isVarProperty()) { _vmeMetaObject->setVMEProperty(property->coreIndex, QV4::Primitive::fromDouble(n)); } else { QVariant value(n); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } } else if (binding->type == QV4::CompiledData::Binding::Type_Boolean) { if (property->isVarProperty()) { _vmeMetaObject->setVMEProperty(property->coreIndex, QV4::Primitive::fromBoolean(binding->valueAsBoolean())); } else { QVariant value(binding->valueAsBoolean()); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } else { QString stringValue = binding->valueAsString(&qmlUnit->header); if (property->isVarProperty()) { QV4::ScopedString s(scope, v4->newString(stringValue)); _vmeMetaObject->setVMEProperty(property->coreIndex, s); } else { QVariant value = QQmlStringConverters::variantFromString(stringValue); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } } break; case QVariant::String: { Q_ASSERT(binding->evaluatesToString()); QString value = binding->valueAsString(&qmlUnit->header); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::StringList: { Q_ASSERT(binding->evaluatesToString()); QStringList value(binding->valueAsString(&qmlUnit->header)); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::ByteArray: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_String); QByteArray value(binding->valueAsString(&qmlUnit->header).toUtf8()); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Url: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_String); QString string = binding->valueAsString(&qmlUnit->header); // Encoded dir-separators defeat QUrl processing - decode them first string.replace(QLatin1String("%2f"), QLatin1String("/"), Qt::CaseInsensitive); QUrl value = string.isEmpty() ? QUrl() : compiledData->url.resolved(QUrl(string)); // Apply URL interceptor if (engine->urlInterceptor()) value = engine->urlInterceptor()->intercept(value, QQmlAbstractUrlInterceptor::UrlString); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::UInt: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); double d = binding->valueAsNumber(); uint value = uint(d); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } break; case QVariant::Int: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); double d = binding->valueAsNumber(); int value = int(d); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } break; case QMetaType::Float: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); float value = float(binding->valueAsNumber()); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Double: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); double value = binding->valueAsNumber(); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Color: { bool ok = false; uint colorValue = QQmlStringConverters::rgbaFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); struct { void *data[4]; } buffer; if (QQml_valueTypeProvider()->storeValueType(property->propType, &colorValue, &buffer, sizeof(buffer))) { argv[0] = reinterpret_cast<void *>(&buffer); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } break; #ifndef QT_NO_DATESTRING case QVariant::Date: { bool ok = false; QDate value = QQmlStringConverters::dateFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Time: { bool ok = false; QTime value = QQmlStringConverters::timeFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::DateTime: { bool ok = false; QDateTime value = QQmlStringConverters::dateTimeFromString(binding->valueAsString(&qmlUnit->header), &ok); // ### VME compatibility :( { const qint64 date = value.date().toJulianDay(); const int msecsSinceStartOfDay = value.time().msecsSinceStartOfDay(); value = QDateTime(QDate::fromJulianDay(date), QTime::fromMSecsSinceStartOfDay(msecsSinceStartOfDay)); } Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; #endif // QT_NO_DATESTRING case QVariant::Point: { bool ok = false; QPoint value = QQmlStringConverters::pointFFromString(binding->valueAsString(&qmlUnit->header), &ok).toPoint(); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::PointF: { bool ok = false; QPointF value = QQmlStringConverters::pointFFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Size: { bool ok = false; QSize value = QQmlStringConverters::sizeFFromString(binding->valueAsString(&qmlUnit->header), &ok).toSize(); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::SizeF: { bool ok = false; QSizeF value = QQmlStringConverters::sizeFFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Rect: { bool ok = false; QRect value = QQmlStringConverters::rectFFromString(binding->valueAsString(&qmlUnit->header), &ok).toRect(); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::RectF: { bool ok = false; QRectF value = QQmlStringConverters::rectFFromString(binding->valueAsString(&qmlUnit->header), &ok); Q_ASSERT(ok); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Bool: { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Boolean); bool value = binding->valueAsBoolean(); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Vector3D: { struct { float xp; float yp; float zy; } vec; bool ok = QQmlStringConverters::createFromString(QMetaType::QVector3D, binding->valueAsString(&qmlUnit->header), &vec, sizeof(vec)); Q_ASSERT(ok); Q_UNUSED(ok); argv[0] = reinterpret_cast<void *>(&vec); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::Vector4D: { struct { float xp; float yp; float zy; float wp; } vec; bool ok = QQmlStringConverters::createFromString(QMetaType::QVector4D, binding->valueAsString(&qmlUnit->header), &vec, sizeof(vec)); Q_ASSERT(ok); Q_UNUSED(ok); argv[0] = reinterpret_cast<void *>(&vec); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; case QVariant::RegExp: Q_ASSERT(!"not possible"); break; default: { // generate single literal value assignment to a list property if required if (property->propType == qMetaTypeId<QList<qreal> >()) { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); QList<qreal> value; value.append(binding->valueAsNumber()); argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } else if (property->propType == qMetaTypeId<QList<int> >()) { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Number); double n = binding->valueAsNumber(); QList<int> value; value.append(int(n)); argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } else if (property->propType == qMetaTypeId<QList<bool> >()) { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_Boolean); QList<bool> value; value.append(binding->valueAsBoolean()); argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } else if (property->propType == qMetaTypeId<QList<QUrl> >()) { Q_ASSERT(binding->type == QV4::CompiledData::Binding::Type_String); QString urlString = binding->valueAsString(&qmlUnit->header); QUrl u = urlString.isEmpty() ? QUrl() : compiledData->url.resolved(QUrl(urlString)); QList<QUrl> value; value.append(u); argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } else if (property->propType == qMetaTypeId<QList<QString> >()) { Q_ASSERT(binding->evaluatesToString()); QList<QString> value; value.append(binding->valueAsString(&qmlUnit->header)); argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } else if (property->propType == qMetaTypeId<QJSValue>()) { QJSValue value; if (binding->type == QV4::CompiledData::Binding::Type_Boolean) { value = QJSValue(binding->valueAsBoolean()); } else if (binding->type == QV4::CompiledData::Binding::Type_Number) { double n = binding->valueAsNumber(); if (double(int(n)) == n) { value = QJSValue(int(n)); } else value = QJSValue(n); } else { value = QJSValue(binding->valueAsString(&qmlUnit->header)); } argv[0] = reinterpret_cast<void *>(&value); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); break; } // otherwise, try a custom type assignment QString stringValue = binding->valueAsString(&qmlUnit->header); QQmlMetaType::StringConverter converter = QQmlMetaType::customStringConverter(property->propType); Q_ASSERT(converter); QVariant value = (*converter)(stringValue); QMetaProperty metaProperty = _qobject->metaObject()->property(property->coreIndex); if (value.isNull() || ((int)metaProperty.type() != property->propType && metaProperty.userType() != property->propType)) { recordError(binding->location, tr("Cannot assign value %1 to property %2").arg(stringValue).arg(QString::fromUtf8(metaProperty.name()))); break; } argv[0] = value.data(); QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } break; } } static QQmlType *qmlTypeForObject(QObject *object) { QQmlType *type = 0; const QMetaObject *mo = object->metaObject(); while (mo && !type) { type = QQmlMetaType::qmlType(mo); mo = mo->superClass(); } return type; } void QQmlObjectCreator::setupBindings(const QBitArray &bindingsToSkip) { QQmlListProperty<void> savedList; qSwap(_currentList, savedList); QQmlPropertyData *property = 0; QQmlPropertyData *defaultProperty = _compiledObject->indexOfDefaultProperty != -1 ? _propertyCache->parent()->defaultProperty() : _propertyCache->defaultProperty(); QString id = stringAt(_compiledObject->idIndex); if (!id.isEmpty()) { QQmlPropertyData *idProperty = _propertyCache->property(QStringLiteral("id"), _qobject, context); if (idProperty && idProperty->isWritable() && idProperty->propType == QMetaType::QString) { QV4::CompiledData::Binding idBinding; idBinding.propertyNameIndex = 0; // Not used idBinding.flags = 0; idBinding.type = QV4::CompiledData::Binding::Type_String; idBinding.stringIndex = _compiledObject->idIndex; idBinding.location = _compiledObject->location; // ### setPropertyValue(idProperty, &idBinding); } } // ### this is best done through type-compile-time binding skip lists. if (_valueTypeProperty) { QQmlAbstractBinding *binding = QQmlPropertyPrivate::binding(_bindingTarget, _valueTypeProperty->coreIndex, -1); if (binding && binding->bindingType() != QQmlAbstractBinding::ValueTypeProxy) { QQmlPropertyPrivate::setBinding(_bindingTarget, _valueTypeProperty->coreIndex, -1, 0); binding->destroy(); } else if (binding) { QQmlValueTypeProxyBinding *proxy = static_cast<QQmlValueTypeProxyBinding *>(binding); if (qmlTypeForObject(_bindingTarget)) { quint32 bindingSkipList = 0; const QV4::CompiledData::Binding *binding = _compiledObject->bindingTable(); for (quint32 i = 0; i < _compiledObject->nBindings; ++i, ++binding) { property = binding->propertyNameIndex != 0 ? _propertyCache->property(stringAt(binding->propertyNameIndex), _qobject, context) : defaultProperty; if (property) bindingSkipList |= (1 << property->coreIndex); } property = 0; proxy->removeBindings(bindingSkipList); } } } const QV4::CompiledData::Binding *binding = _compiledObject->bindingTable(); for (quint32 i = 0; i < _compiledObject->nBindings; ++i, ++binding) { QString name = stringAt(binding->propertyNameIndex); if (name.isEmpty()) property = 0; if (!property || (i > 0 && ((binding - 1)->propertyNameIndex != binding->propertyNameIndex || (binding - 1)->flags != binding->flags)) ) { if (!name.isEmpty()) { if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression || binding->flags & QV4::CompiledData::Binding::IsSignalHandlerObject) property = QmlIR::PropertyResolver(_propertyCache).signal(name, /*notInRevision*/0, _qobject, context); else property = _propertyCache->property(name, _qobject, context); } else property = defaultProperty; if (property && property->isQList()) { void *argv[1] = { (void*)&_currentList }; QMetaObject::metacall(_qobject, QMetaObject::ReadProperty, property->coreIndex, argv); } else if (_currentList.object) _currentList = QQmlListProperty<void>(); } if (static_cast<int>(i) < bindingsToSkip.size() && bindingsToSkip.testBit(i)) continue; if (!setPropertyBinding(property, binding)) return; } qSwap(_currentList, savedList); } bool QQmlObjectCreator::setPropertyBinding(QQmlPropertyData *property, const QV4::CompiledData::Binding *binding) { if (binding->type == QV4::CompiledData::Binding::Type_AttachedProperty) { Q_ASSERT(stringAt(qmlUnit->objectAt(binding->value.objectIndex)->inheritedTypeNameIndex).isEmpty()); QQmlCompiledData::TypeReference *tr = resolvedTypes.value(binding->propertyNameIndex); Q_ASSERT(tr); QQmlType *attachedType = tr->type; const int id = attachedType->attachedPropertiesId(); QObject *qmlObject = qmlAttachedPropertiesObjectById(id, _qobject); if (!populateInstance(binding->value.objectIndex, qmlObject, qmlObject, /*value type property*/0)) return false; return true; } // ### resolve this at compile time if (property && property->propType == qMetaTypeId<QQmlScriptString>()) { QQmlScriptString ss(binding->valueAsScriptString(&qmlUnit->header), context->asQQmlContext(), _scopeObject); ss.d.data()->bindingId = binding->value.compiledScriptIndex; ss.d.data()->lineNumber = binding->location.line; ss.d.data()->columnNumber = binding->location.column; ss.d.data()->isStringLiteral = binding->type == QV4::CompiledData::Binding::Type_String; ss.d.data()->isNumberLiteral = binding->type == QV4::CompiledData::Binding::Type_Number; ss.d.data()->numberValue = binding->valueAsNumber(); QQmlPropertyPrivate::WriteFlags propertyWriteFlags = QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::RemoveBindingOnAliasWrite; int propertyWriteStatus = -1; void *argv[] = { &ss, 0, &propertyWriteStatus, &propertyWriteFlags }; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); return true; } QObject *createdSubObject = 0; if (binding->type == QV4::CompiledData::Binding::Type_Object) { createdSubObject = createInstance(binding->value.objectIndex, _bindingTarget); if (!createdSubObject) return false; } if (!property) // ### error return true; if (binding->type == QV4::CompiledData::Binding::Type_GroupProperty) { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(binding->value.objectIndex); if (stringAt(obj->inheritedTypeNameIndex).isEmpty()) { QObject *groupObject = 0; QQmlValueType *valueType = 0; QQmlPropertyData *valueTypeProperty = 0; QObject *bindingTarget = _bindingTarget; if (QQmlValueTypeFactory::isValueType(property->propType)) { valueType = QQmlValueTypeFactory::valueType(property->propType); if (!valueType) { recordError(binding->location, tr("Cannot set properties on %1 as it is null").arg(stringAt(binding->propertyNameIndex))); return false; } valueType->read(_qobject, property->coreIndex); groupObject = valueType; valueTypeProperty = property; } else { void *argv[1] = { &groupObject }; QMetaObject::metacall(_qobject, QMetaObject::ReadProperty, property->coreIndex, argv); if (!groupObject) { recordError(binding->location, tr("Cannot set properties on %1 as it is null").arg(stringAt(binding->propertyNameIndex))); return false; } bindingTarget = groupObject; } if (!populateInstance(binding->value.objectIndex, groupObject, bindingTarget, valueTypeProperty)) return false; if (valueType) valueType->write(_qobject, property->coreIndex, QQmlPropertyPrivate::BypassInterceptor); return true; } } if (_ddata->hasBindingBit(property->coreIndex) && !(binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) && !(binding->flags & QV4::CompiledData::Binding::IsOnAssignment) && !_valueTypeProperty) removeBindingOnProperty(_bindingTarget, property->coreIndex); if (binding->type == QV4::CompiledData::Binding::Type_Script) { QV4::Function *runtimeFunction = compiledData->compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]; QV4::Scope scope(_qmlContext); QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createScriptFunction(_qmlContext, runtimeFunction, /*createProto*/ false)); if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) { int signalIndex = _propertyCache->methodIndexToSignalIndex(property->coreIndex); QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine); QQmlBoundSignalExpression *expr = new QQmlBoundSignalExpression(_bindingTarget, signalIndex, context, _scopeObject, function); bs->takeExpression(expr); } else { QQmlBinding *qmlBinding = new QQmlBinding(function, _scopeObject, context); // When writing bindings to grouped properties implemented as value types, // such as point.x: { someExpression; }, then the binding is installed on // the point property (_qobjectForBindings) and after evaluating the expression, // the result is written to a value type virtual property, that contains the sub-index // of the "x" property. QQmlPropertyData targetCorePropertyData = *property; if (_valueTypeProperty) targetCorePropertyData = QQmlPropertyPrivate::saveValueType(*_valueTypeProperty, _qobject->metaObject(), property->coreIndex, engine); sharedState->allCreatedBindings.push(qmlBinding); qmlBinding->m_mePtr = &sharedState->allCreatedBindings.top(); qmlBinding->setTarget(_bindingTarget, targetCorePropertyData, context); if (targetCorePropertyData.isAlias()) { QQmlAbstractBinding *old = QQmlPropertyPrivate::setBindingNoEnable(_bindingTarget, targetCorePropertyData.coreIndex, targetCorePropertyData.getValueTypeCoreIndex(), qmlBinding); if (old) { old->destroy(); } } else { qmlBinding->addToObject(); if (!_valueTypeProperty) { QQmlData *targetDeclarativeData = QQmlData::get(_bindingTarget); Q_ASSERT(targetDeclarativeData); targetDeclarativeData->setPendingBindingBit(_bindingTarget, property->coreIndex); } } } return true; } if (binding->type == QV4::CompiledData::Binding::Type_Object) { if (binding->flags & QV4::CompiledData::Binding::IsOnAssignment) { // ### determine value source and interceptor casts ahead of time. QQmlType *type = qmlTypeForObject(createdSubObject); Q_ASSERT(type); QQmlPropertyData targetCorePropertyData = *property; if (_valueTypeProperty) targetCorePropertyData = QQmlPropertyPrivate::saveValueType(*_valueTypeProperty, _qobject->metaObject(), property->coreIndex, engine); int valueSourceCast = type->propertyValueSourceCast(); if (valueSourceCast != -1) { QQmlPropertyValueSource *vs = reinterpret_cast<QQmlPropertyValueSource *>(reinterpret_cast<char *>(createdSubObject) + valueSourceCast); QObject *target = createdSubObject->parent(); vs->setTarget(QQmlPropertyPrivate::restore(target, targetCorePropertyData, context)); return true; } int valueInterceptorCast = type->propertyValueInterceptorCast(); if (valueInterceptorCast != -1) { QQmlPropertyValueInterceptor *vi = reinterpret_cast<QQmlPropertyValueInterceptor *>(reinterpret_cast<char *>(createdSubObject) + valueInterceptorCast); QObject *target = createdSubObject->parent(); QQmlProperty prop = QQmlPropertyPrivate::restore(target, targetCorePropertyData, context); vi->setTarget(prop); QQmlVMEMetaObject *mo = QQmlVMEMetaObject::get(target); Q_ASSERT(mo); mo->registerInterceptor(prop.index(), QQmlPropertyPrivate::valueTypeCoreIndex(prop), vi); return true; } return false; } // Assigning object to signal property? if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerObject) { if (!property->isFunction()) { recordError(binding->valueLocation, tr("Cannot assign an object to signal property %1").arg(property->name(_qobject))); return false; } QMetaMethod method = QQmlMetaType::defaultMethod(createdSubObject); if (!method.isValid()) { recordError(binding->valueLocation, tr("Cannot assign object type %1 with no default method").arg(QString::fromLatin1(createdSubObject->metaObject()->className()))); return false; } QMetaMethod signalMethod = _qobject->metaObject()->method(property->coreIndex); if (!QMetaObject::checkConnectArgs(signalMethod, method)) { recordError(binding->valueLocation, tr("Cannot connect mismatched signal/slot %1 %vs. %2") .arg(QString::fromLatin1(method.methodSignature().constData())) .arg(QString::fromLatin1(signalMethod.methodSignature().constData()))); return false; } QQmlPropertyPrivate::connect(_qobject, property->coreIndex, createdSubObject, method.methodIndex()); return true; } QQmlPropertyPrivate::WriteFlags propertyWriteFlags = QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::RemoveBindingOnAliasWrite; int propertyWriteStatus = -1; void *argv[] = { 0, 0, &propertyWriteStatus, &propertyWriteFlags }; if (const char *iid = QQmlMetaType::interfaceIId(property->propType)) { void *ptr = createdSubObject->qt_metacast(iid); if (ptr) { argv[0] = &ptr; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } else { recordError(binding->location, tr("Cannot assign object to interface property")); return false; } } else if (property->propType == QMetaType::QVariant) { if (property->isVarProperty()) { QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope scope(v4); QV4::ScopedValue wrappedObject(scope, QV4::QObjectWrapper::wrap(QV8Engine::getV4(engine), createdSubObject)); _vmeMetaObject->setVMEProperty(property->coreIndex, wrappedObject); } else { QVariant value = QVariant::fromValue(createdSubObject); argv[0] = &value; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } } else if (property->isQList()) { Q_ASSERT(_currentList.object); void *itemToAdd = createdSubObject; const char *iid = 0; int listItemType = QQmlEnginePrivate::get(engine)->listType(property->propType); if (listItemType != -1) iid = QQmlMetaType::interfaceIId(listItemType); if (iid) itemToAdd = createdSubObject->qt_metacast(iid); if (_currentList.append) _currentList.append(&_currentList, itemToAdd); else { recordError(binding->location, tr("Cannot assign object to read only list")); return false; } } else { // pointer compatibility was tested in QQmlPropertyValidator at type compile time argv[0] = &createdSubObject; QMetaObject::metacall(_qobject, QMetaObject::WriteProperty, property->coreIndex, argv); } return true; } if (property->isQList()) { recordError(binding->location, tr("Cannot assign primitives to lists")); return false; } setPropertyValue(property, binding); return true; } void QQmlObjectCreator::setupFunctions() { QV4::Scope scope(_qmlContext); QV4::ScopedValue function(scope); const quint32 *functionIdx = _compiledObject->functionOffsetTable(); for (quint32 i = 0; i < _compiledObject->nFunctions; ++i, ++functionIdx) { QV4::Function *runtimeFunction = compiledData->compilationUnit->runtimeFunctions[*functionIdx]; const QString name = runtimeFunction->name()->toQString(); QQmlPropertyData *property = _propertyCache->property(name, _qobject, context); if (!property->isVMEFunction()) continue; function = QV4::FunctionObject::createScriptFunction(_qmlContext, runtimeFunction); _vmeMetaObject->setVmeMethod(property->coreIndex, function); } } void QQmlObjectCreator::recordError(const QV4::CompiledData::Location &location, const QString &description) { QQmlError error; error.setUrl(compiledData->url); error.setLine(location.line); error.setColumn(location.column); error.setDescription(description); errors << error; } void QQmlObjectCreator::registerObjectWithContextById(int objectIndex, QObject *instance) const { QHash<int, int>::ConstIterator idEntry = objectIndexToId.find(objectIndex); if (idEntry != objectIndexToId.constEnd()) context->setIdProperty(idEntry.value(), instance); } QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isContextObject) { QQmlObjectCreationProfiler profiler(sharedState->profiler.profiler); ActiveOCRestorer ocRestorer(this, QQmlEnginePrivate::get(engine)); bool isComponent = false; QObject *instance = 0; QQmlData *ddata = 0; QQmlCustomParser *customParser = 0; QQmlParserStatus *parserStatus = 0; bool installPropertyCache = true; const QV4::CompiledData::Object *obj = qmlUnit->objectAt(index); if (compiledData->isComponent(index)) { isComponent = true; QQmlComponent *component = new QQmlComponent(engine, compiledData, index, parent); Q_QML_OC_PROFILE(sharedState->profiler, profiler.update(QStringLiteral("<component>"), context->url, obj->location.line, obj->location.column)); QQmlComponentPrivate::get(component)->creationContext = context; instance = component; ddata = QQmlData::get(instance, /*create*/true); } else { QQmlCompiledData::TypeReference *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex); Q_ASSERT(typeRef); installPropertyCache = !typeRef->isFullyDynamicType; QQmlType *type = typeRef->type; if (type) { Q_QML_OC_PROFILE(sharedState->profiler, profiler.update(type->qmlTypeName(), context->url, obj->location.line, obj->location.column)); instance = type->create(); if (!instance) { recordError(obj->location, tr("Unable to create object of type %1").arg(stringAt(obj->inheritedTypeNameIndex))); return 0; } const int parserStatusCast = type->parserStatusCast(); if (parserStatusCast != -1) parserStatus = reinterpret_cast<QQmlParserStatus*>(reinterpret_cast<char *>(instance) + parserStatusCast); customParser = type->customParser(); if (sharedState->rootContext && sharedState->rootContext->isRootObjectInCreation) { QQmlData *ddata = QQmlData::get(instance, /*create*/true); ddata->rootObjectInCreation = true; sharedState->rootContext->isRootObjectInCreation = false; } sharedState->allCreatedObjects.push(instance); } else { Q_ASSERT(typeRef->component); Q_QML_OC_PROFILE(sharedState->profiler, profiler.update(typeRef->component->name, context->url, obj->location.line, obj->location.column)); if (typeRef->component->qmlUnit->isSingleton()) { recordError(obj->location, tr("Composite Singleton Type %1 is not creatable").arg(stringAt(obj->inheritedTypeNameIndex))); return 0; } QQmlObjectCreator subCreator(context, typeRef->component, sharedState.data()); instance = subCreator.create(); if (!instance) { errors += subCreator.errors; return 0; } } if (parent) QQml_setParent_noEvent(instance, parent); ddata = QQmlData::get(instance, /*create*/true); ddata->lineNumber = obj->location.line; ddata->columnNumber = obj->location.column; } ddata->setImplicitDestructible(); if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject || ddata->rootObjectInCreation) { if (ddata->context) { Q_ASSERT(ddata->context != context); Q_ASSERT(ddata->outerContext); Q_ASSERT(ddata->outerContext != context); QQmlContextData *c = ddata->context; while (c->linkedContext) c = c->linkedContext; c->linkedContext = context; } else context->addObject(instance); ddata->ownContext = true; } else if (!ddata->context) context->addObject(instance); ddata->outerContext = context; if (parserStatus) { parserStatus->classBegin(); // push() the profiler state here, together with the parserStatus, as we'll pop() them // together, too. Q_QML_OC_PROFILE(sharedState->profiler, sharedState->profiler.push(profiler)); sharedState->allParserStatusCallbacks.push(parserStatus); parserStatus->d = &sharedState->allParserStatusCallbacks.top(); } // Register the context object in the context early on in order for pending binding // initialization to find it available. if (isContextObject) context->contextObject = instance; QBitArray bindingsToSkip; if (customParser) { QHash<int, QQmlCompiledData::CustomParserData>::ConstIterator entry = compiledData->customParserData.find(index); if (entry != compiledData->customParserData.constEnd()) { customParser->setCustomData(instance, entry->compilationArtifact, compiledData); bindingsToSkip = entry->bindings; } } if (isComponent) { registerObjectWithContextById(index, instance); return instance; } QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(index); Q_ASSERT(!cache.isNull()); if (installPropertyCache) { if (ddata->propertyCache) ddata->propertyCache->release();; ddata->propertyCache = cache; ddata->propertyCache->addref(); } QObject *scopeObject = instance; qSwap(_scopeObject, scopeObject); QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); Q_ASSERT(sharedState->allJavaScriptObjects); QV4::ValueRef ref = QV4::ValueRef::fromRawValue(sharedState->allJavaScriptObjects++); ref = QV4::QObjectWrapper::wrap(v4, instance); QV4::Scope valueScope(v4); QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject)); QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, new (v4->memoryManager) QV4::QmlBindingWrapper(v4->rootContext, qmlScope)); QV4::ExecutionContext *qmlContext = qmlBindingWrapper->context(); qSwap(_qmlContext, qmlContext); bool result = populateInstance(index, instance, /*binding target*/instance, /*value type property*/0, bindingsToSkip); qSwap(_qmlContext, qmlContext); qSwap(_scopeObject, scopeObject); return result ? instance : 0; } QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interrupt) { Q_ASSERT(phase == ObjectsCreated || phase == Finalizing); phase = Finalizing; QQmlObjectCreatorRecursionWatcher watcher(this); ActiveOCRestorer ocRestorer(this, QQmlEnginePrivate::get(engine)); { QQmlTrace trace("VME Binding Enable"); trace.event("begin binding eval"); while (!sharedState->allCreatedBindings.isEmpty()) { QQmlAbstractBinding *b = sharedState->allCreatedBindings.pop(); if (!b) continue; b->m_mePtr = 0; QQmlData *data = QQmlData::get(b->object()); Q_ASSERT(data); data->clearPendingBindingBit(b->propertyIndex()); b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); if (watcher.hasRecursed() || interrupt.shouldInterrupt()) return 0; } } if (QQmlVME::componentCompleteEnabled()) { // the qml designer does the component complete later QQmlTrace trace("VME Component Complete"); while (!sharedState->allParserStatusCallbacks.isEmpty()) { QQmlObjectCompletionProfiler profiler(&sharedState->profiler); QQmlParserStatus *status = sharedState->allParserStatusCallbacks.pop(); if (status && status->d) { status->d = 0; status->componentComplete(); } if (watcher.hasRecursed() || interrupt.shouldInterrupt()) return 0; } } { QQmlTrace trace("VME Finalize Callbacks"); for (int ii = 0; ii < sharedState->finalizeCallbacks.count(); ++ii) { QQmlEnginePrivate::FinalizeCallback callback = sharedState->finalizeCallbacks.at(ii); QObject *obj = callback.first; if (obj) { void *args[] = { 0 }; QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, callback.second, args); } if (watcher.hasRecursed()) return 0; } sharedState->finalizeCallbacks.clear(); } { QQmlTrace trace("VME Component.onCompleted Callbacks"); while (sharedState->componentAttached) { QQmlComponentAttached *a = sharedState->componentAttached; a->rem(); QQmlData *d = QQmlData::get(a->parent()); Q_ASSERT(d); Q_ASSERT(d->context); a->add(&d->context->componentAttached); if (QQmlVME::componentCompleteEnabled()) emit a->completed(); if (watcher.hasRecursed() || interrupt.shouldInterrupt()) return 0; } } phase = Done; return sharedState->rootContext; } void QQmlObjectCreator::clear() { if (phase == Done || phase == Finalizing || phase == Startup) return; Q_ASSERT(phase != Startup); while (!sharedState->allCreatedObjects.isEmpty()) delete sharedState->allCreatedObjects.pop(); phase = Done; } bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *bindingTarget, QQmlPropertyData *valueTypeProperty, const QBitArray &bindingsToSkip) { const QV4::CompiledData::Object *obj = qmlUnit->objectAt(index); QQmlData *declarativeData = QQmlData::get(instance, /*create*/true); qSwap(_qobject, instance); qSwap(_valueTypeProperty, valueTypeProperty); qSwap(_compiledObject, obj); qSwap(_ddata, declarativeData); qSwap(_bindingTarget, bindingTarget); QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::Scope valueScope(v4); QV4::ScopedValue scopeObjectProtector(valueScope); QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(index); QQmlVMEMetaObject *vmeMetaObject = 0; const QByteArray data = vmeMetaObjectData.value(index); if (!data.isEmpty()) { Q_ASSERT(!cache.isNull()); // install on _object vmeMetaObject = new QQmlVMEMetaObject(_qobject, cache, reinterpret_cast<const QQmlVMEMetaData*>(data.constData())); if (_ddata->propertyCache) _ddata->propertyCache->release(); _ddata->propertyCache = cache; _ddata->propertyCache->addref(); scopeObjectProtector = _ddata->jsWrapper.value(); } else { vmeMetaObject = QQmlVMEMetaObject::get(_qobject); } registerObjectWithContextById(index, _qobject); qSwap(_propertyCache, cache); qSwap(_vmeMetaObject, vmeMetaObject); QBitArray bindingSkipList = bindingsToSkip; { QHash<int, QBitArray>::ConstIterator deferredBindings = compiledData->deferredBindingsPerObject.find(index); if (deferredBindings != compiledData->deferredBindingsPerObject.constEnd()) { if (bindingSkipList.isEmpty()) bindingSkipList.resize(deferredBindings->count()); for (int i = 0; i < deferredBindings->count(); ++i) if (deferredBindings->testBit(i)) bindingSkipList.setBit(i); QQmlData::DeferredData *deferData = new QQmlData::DeferredData; deferData->deferredIdx = index; deferData->compiledData = compiledData; deferData->compiledData->addref(); deferData->context = context; _ddata->deferredData = deferData; } } setupFunctions(); setupBindings(bindingSkipList); qSwap(_vmeMetaObject, vmeMetaObject); qSwap(_bindingTarget, bindingTarget); qSwap(_ddata, declarativeData); qSwap(_compiledObject, obj); qSwap(_valueTypeProperty, valueTypeProperty); qSwap(_qobject, instance); qSwap(_propertyCache, cache); return errors.isEmpty(); } QQmlObjectCreatorRecursionWatcher::QQmlObjectCreatorRecursionWatcher(QQmlObjectCreator *creator) : sharedState(creator->sharedState) , watcher(creator->sharedState.data()) { }
matthewvogt/qtdeclarative
src/qml/qml/qqmlobjectcreator.cpp
C++
lgpl-2.1
57,182
[ 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...
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * 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. */ package org.opencps.dossiermgt.service.persistence; import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery; import com.liferay.portal.kernel.exception.SystemException; import org.opencps.dossiermgt.model.ServiceConfig; import org.opencps.dossiermgt.service.ServiceConfigLocalServiceUtil; /** * @author trungnt * @generated */ public abstract class ServiceConfigActionableDynamicQuery extends BaseActionableDynamicQuery { public ServiceConfigActionableDynamicQuery() throws SystemException { setBaseLocalService(ServiceConfigLocalServiceUtil.getService()); setClass(ServiceConfig.class); setClassLoader(org.opencps.dossiermgt.service.ClpSerializer.class.getClassLoader()); setPrimaryKeyPropertyName("serviceConfigId"); } }
hltn/opencps
portlets/opencps-portlet/docroot/WEB-INF/service/org/opencps/dossiermgt/service/persistence/ServiceConfigActionableDynamicQuery.java
Java
agpl-3.0
1,346
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2456, 1011, 2556, 2166, 9447, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 3075, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 203...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
// // IOService.cpp // Firedrake // // Created by Sidney Just // Copyright (c) 2015 by Sidney Just // 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. // #include "IOService.h" namespace IO { IODefineMeta(Service, RegistryEntry) String *kServiceProviderMatchKey; String *kServiceClassMatchKey; String *kServicePropertiesMatchKey; extern void RegisterClass(MetaClass *meta, Dictionary *properties); extern void RegisterProvider(Service *provider); extern void EnumerateClassesForProvider(Service *provider, const Function<bool (MetaClass *meta, Dictionary *properties)> &callback); void Service::InitialWakeUp(MetaClass *meta) { if(meta == Service::GetMetaClass()) { kServiceProviderMatchKey = String::Alloc()->InitWithCString("kServiceProviderMatchKey"); kServiceClassMatchKey = String::Alloc()->InitWithCString("kServiceClassMatchKey"); kServicePropertiesMatchKey = String::Alloc()->InitWithCString("kServicePropertiesMatchKey"); } RegistryEntry::InitialWakeUp(meta); } void Service::RegisterService(MetaClass *meta, Dictionary *properties) { RegisterClass(meta, properties); } Service *Service::InitWithProperties(Dictionary *properties) { if(!RegistryEntry::Init()) return nullptr; _started = false; _properties = properties->Retain(); return this; } Dictionary *Service::GetProperties() const { return _properties; } void Service::Start() { _started = true; } void Service::Stop() {} // Matching void Service::RegisterProvider() { IO::RegisterProvider(this); } bool Service::MatchProperties(__unused Dictionary *properties) { return true; } void Service::StartMatching() { DoMatch(); } void Service::DoMatch() { EnumerateClassesForProvider(this, [this](MetaClass *meta, Dictionary *properties) { if(MatchProperties(properties)) { Service *service = static_cast<Service *>(meta->Alloc()); service = service->InitWithProperties(properties); if(service) { PublishService(service); return true; } } return false; }); } void Service::PublishService(Service *service) { AttachChild(service); } void Service::AttachToParent(RegistryEntry *parent) { RegistryEntry::AttachToParent(parent); Start(); } }
JustSid/Firedrake
slib/libio/service/IOService.cpp
C++
mit
3,272
[ 30522, 1013, 1013, 1013, 1013, 16380, 2121, 7903, 2063, 1012, 18133, 2361, 1013, 1013, 5045, 16555, 2063, 1013, 1013, 1013, 1013, 2580, 2011, 11430, 2074, 1013, 1013, 9385, 1006, 1039, 1007, 2325, 2011, 11430, 2074, 1013, 1013, 6656, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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> #include<string.h> main() { char s1[20]="hello world"; s1[5]='\0'; printf("%d\n",strlen(s1)); }
fahadsiddiqui3/C_CodeCollection
2dArray/test1.c
C
gpl-3.0
123
[ 30522, 1001, 2421, 1026, 2358, 30524, 1019, 1033, 1027, 1005, 1032, 1014, 1005, 1025, 6140, 2546, 1006, 1000, 1003, 1040, 1032, 1050, 1000, 1010, 2358, 20927, 2078, 1006, 1055, 2487, 1007, 1007, 1025, 1065, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Module crap_json</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc"> </head> <body bgcolor="white"> <div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div> <hr> <h1>Module crap_json</h1> <ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>World's garbage-est to-JSON encoder. <p>Copyright © 2014 all rights reserved by John Haugeland</p> <p><b>Version:</b> 1.0.0 </p> <p><b>Authors:</b> John Haugeland [<em>web site:</em> <tt><a href="http://fullof.bs/" target="_top">http://fullof.bs/</a></tt>].</p> <h2><a name="description">Description</a></h2><p>World's garbage-est to-JSON encoder.</p> <p>You essentially always want <a href="crap_json.html#to_json-1"><code>crap_json:to_json/1</code></a>.</p> <p>Uni-directional. Assumes all lists of integers are strings. Assumes all 2-ary proplists are objects. Assumes all tuples are arrays. Represents integers and floats. Converts binaries to strings (!). Atoms true, false, and null are converted to the equivalent literals; others catch fire and die (JSON does not have undefined; thanks Gocy). Nests sanely from tuples and proplists *only*. Will flatten improper iolists. Dies violently on any other type (ports, PIDs, references, etc.)</p> The new Erlang type "maps" have not yet been handled. <h2><a name="types">Data Types</a></h2> <h3 class="typedecl"><a name="type-json_array">json_array()</a></h3> <p><tt>json_array() = [] | [<a href="#type-json_term">json_term()</a>]</tt></p> <h3 class="typedecl"><a name="type-json_escaped_binary">json_escaped_binary()</a></h3> <p><tt>json_escaped_binary() = binary()</tt></p> <h3 class="typedecl"><a name="type-json_escaped_string">json_escaped_string()</a></h3> <p><tt>json_escaped_string() = list()</tt></p> <h3 class="typedecl"><a name="type-json_kw">json_kw()</a></h3> <p><tt>json_kw() = true | false | null</tt></p> <h3 class="typedecl"><a name="type-json_object">json_object()</a></h3> <p><tt>json_object() = [] | [{<a href="#type-json_escaped_string">json_escaped_string()</a>, <a href="#type-json_term">json_term()</a>}]</tt></p> <h3 class="typedecl"><a name="type-json_term">json_term()</a></h3> <p><tt>json_term() = integer() | float() | <a href="#type-json_object">json_object()</a> | <a href="#type-json_array">json_array()</a> | binary() | <a href="#type-json_kw">json_kw()</a></tt></p> <h2><a name="index">Function Index</a></h2> <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#escape_char-1">escape_char/1</a></td><td><span style="color: #0a3; font-weight: bold;">Stoch tested</span> Escapes a single character for use in JSON; unicode safe.</td></tr> <tr><td valign="top"><a href="#escape_string-1">escape_string/1</a></td><td><span style="color: green; font-weight: bold;">Tested</span> Escapes a string for use in JSON; unicode safe.</td></tr> <tr><td valign="top"><a href="#test-0">test/0</a></td><td>Runs the test cases verbosely.</td></tr> <tr><td valign="top"><a href="#test-1">test/1</a></td><td>Runs the test cases verbosely or quietly.</td></tr> <tr><td valign="top"><a href="#to_json-1">to_json/1</a></td><td><span style="color: #0a3; font-weight: bold;">Stoch tested</span> Escapes a single character for use in JSON; unicode safe.</td></tr> </table> <h2><a name="functions">Function Details</a></h2> <h3 class="function"><a name="escape_char-1">escape_char/1</a></h3> <div class="spec"> <p><tt>escape_char(Char::non_neg_integer()) -&gt; <a href="#type-json_escaped_string">json_escaped_string()</a></tt><br></p> </div><p><span style="color: #0a3; font-weight: bold;">Stoch tested</span> Escapes a single character for use in JSON; unicode safe. <pre> 1&gt; crap_json:escape_char($a). "a" 2&gt; crap_json:escape_char($汉). "\\u6C49" 3&gt; crap_json:escape_char($\r). "\\r"</pre> Thirteen unit tests (mostly special characters) and one stochastic test (any character escapes to a list.)</p> <h3 class="function"><a name="escape_string-1">escape_string/1</a></h3> <div class="spec"> <p><tt>escape_string(String::list()) -&gt; <a href="#type-json_escaped_string">json_escaped_string()</a></tt><br></p> </div><p><span style="color: green; font-weight: bold;">Tested</span> Escapes a string for use in JSON; unicode safe. <pre> 1&gt; crap_json:escape_string("a"). "a" 2&gt; crap_json:escape_string("abc def"). "abc def" 3&gt; crap_json:escape_string("abc \r \n def"). "abc \\r \\n def" 4&gt; crap_json:escape_string("汉语"). "\\u6C49\\u8BED"</pre> Nine unit tests (special characters and one Chinese character.)</p> <h3 class="function"><a name="test-0">test/0</a></h3> <div class="spec"> <p><tt>test() -&gt; ok | error</tt><br></p> </div><p>Runs the test cases verbosely. <pre> 1&gt; crap_json:test(). ======================== EUnit ======================== module 'crap_json' module 'crap_json_tests' escape_string tests crap_json_tests:144: escape_string_test_ (empty string)...ok crap_json_tests:145: escape_string_test_ (a)...ok crap_json_tests:146: escape_string_test_ (abc)...ok crap_json_tests:147: escape_string_test_ (\r)...ok crap_json_tests:148: escape_string_test_ (\n)...ok crap_json_tests:149: escape_string_test_ (\r\n)...ok crap_json_tests:150: escape_string_test_ (a\bc)...ok crap_json_tests:151: escape_string_test_ (\vc\r)...ok crap_json_tests:152: escape_string_test_ (BC(zh)DE)...ok [done in 0.140 s] escape_char tests crap_json_tests:164: escape_char_test_ (backspace)...ok crap_json_tests:165: escape_char_test_ (form feed)...ok crap_json_tests:166: escape_char_test_ (newline)...ok crap_json_tests:167: escape_char_test_ (carriage return)...ok crap_json_tests:168: escape_char_test_ (tab)...ok crap_json_tests:169: escape_char_test_ (vertical tab)...ok crap_json_tests:170: escape_char_test_ (null)...ok crap_json_tests:171: escape_char_test_ (backslash)...ok crap_json_tests:172: escape_char_test_ (single quote)...ok crap_json_tests:173: escape_char_test_ (double quote)...ok crap_json_tests:174: escape_char_test_ (low ascii)...ok crap_json_tests:175: escape_char_test_ (high unicode)...ok crap_json_tests:176: escape_char_test_ (capital D)...ok crap_json_tests:178: escape_char_test_ (Stochastic: any ASCII or unicode character escapes to a list)...[0.047 s] ok [done in 0.266 s] to_json tests crap_json_tests:190: to_json_test_ (true)...ok crap_json_tests:191: to_json_test_ (false)...ok crap_json_tests:192: to_json_test_ (null)...ok crap_json_tests:194: to_json_test_ (Int Zero)...ok crap_json_tests:195: to_json_test_ (Int Two)...ok crap_json_tests:196: to_json_test_ (Int Neg Two)...ok crap_json_tests:198: to_json_test_ (Float Zero)...ok crap_json_tests:199: to_json_test_ (Float Two)...ok crap_json_tests:200: to_json_test_ (Float Neg Two)...ok crap_json_tests:201: to_json_test_ (Float Two Point Five)...ok crap_json_tests:202: to_json_test_ (Float Neg Two Point Five)...ok crap_json_tests:203: to_json_test_ (Float Zero Point One)...ok crap_json_tests:204: to_json_test_ (Float Neg Zero Point One)...ok crap_json_tests:206: to_json_test_ (Empty string)...ok crap_json_tests:207: to_json_test_ (ASCII one-char string)...ok crap_json_tests:208: to_json_test_ (ASCII string)...ok crap_json_tests:210: to_json_test_ (Empty binary string)...ok crap_json_tests:211: to_json_test_ (ASCII binary one-char string)...ok crap_json_tests:212: to_json_test_ (ASCII binary string)...ok crap_json_tests:214: to_json_test_ (Unicode one-char string)...ok crap_json_tests:215: to_json_test_ (Unicode string)...ok crap_json_tests:218: to_json_test_ (PL Obj 1-prop)...ok crap_json_tests:219: to_json_test_ (PL Obj 2-prop)...ok crap_json_tests:221: to_json_test_ (Tuple array, empty)...ok crap_json_tests:222: to_json_test_ ({1,2,3})...ok crap_json_tests:223: to_json_test_ ({1,true,"foo",{{3,null}}})...ok crap_json_tests:226: to_json_test_ (Stochastic: any integer yields binary)...ok crap_json_tests:227: to_json_test_ (Stochastic: any float yields binary)...ok crap_json_tests:228: to_json_test_ (Stochastic: any ASCII list yields binary)...ok crap_json_tests:229: to_json_test_ (Stochastic: any Unicode list yields binary)...ok crap_json_tests:230: to_json_test_ (Stochastic: ASCII list result correct length)...ok [done in 0.484 s] [done in 0.890 s] [done in 0.890 s] ======================================================= All 54 tests passed. ok</pre> Not test-worthy per se. The above list may be out of date. Run time for tests will vary by machine.</p> <h3 class="function"><a name="test-1">test/1</a></h3> <div class="spec"> <p><tt>test(X1::quiet | verbose) -&gt; ok | error</tt><br></p> </div><p>Runs the test cases verbosely or quietly. Verbosely is as shown above. <pre> 1&gt; crap_json:test(quiet). All 54 tests passed. ok</pre></p> <h3 class="function"><a name="to_json-1">to_json/1</a></h3> <div class="spec"> <p><tt>to_json(Term::integer() | float() | tuple() | list() | binary() | <a href="#type-json_kw">json_kw()</a>) -&gt; <a href="#type-json_escaped_binary">json_escaped_binary()</a></tt><br></p> </div><p><span style="color: #0a3; font-weight: bold;">Stoch tested</span> Escapes a single character for use in JSON; unicode safe. <pre> 1&gt; crap_json:to_json("a"). &lt;&lt;"\"a\""&gt;&gt; 2&gt; crap_json:to_json("abc \r \n def"). &lt;&lt;"\"abc \\r \\n def\""&gt;&gt; 3&gt; crap_json:to_json("汉语"). &lt;&lt;"\"\\u6C49\\u8BED\""&gt;&gt; 4&gt; crap_json:to_json(1). &lt;&lt;"1"&gt;&gt; 5&gt; crap_json:to_json(0.1). % good handling of rounding error &lt;&lt;"0.1"&gt;&gt; 6&gt; crap_json:to_json(true). &lt;&lt;"true"&gt;&gt; 7&gt; crap_json:to_json( [ {"height", "2in"}, {"width", "3in"} ]). &lt;&lt;"{\"height\":\"2in\",\"width\":\"3in\"}"&gt;&gt; 8&gt; crap_json:to_json( {1,2,3} ). &lt;&lt;"[1,2,3]"&gt;&gt; 9&gt; crap_json:to_json( {1, {2,3}, {true,false,null} } ). &lt;&lt;"[1,[2,3],[true,false,null]]"&gt;&gt;</pre> A simple example of nested use: <pre> 1&gt; Joe = [ {name,"Joe Smith"}, {position, "Programmer"}, {salary, 125000} ]. [{name,"Joe Smith"},{position,"Programmer"},{salary,125000}] 2&gt; Becca = [ {name,"Becca Raymond"}, {position, "Programmer"}, {salary, 128000} ]. [{name,"Becca Raymond"}, {position,"Programmer"}, {salary,128000}] 3&gt; Pat = [ {name, "Pat Henry"}, {position, "Manager"}, {salary, 141000} ]. [{name,"Pat Henry"},{position,"Manager"},{salary,141000}] 4&gt; Staff = { Joe, Becca, Pat }. {[{name,"Joe Smith"}, {position,"Programmer"}, {salary,125000}], [{name,"Becca Raymond"}, {position,"Programmer"}, {salary,128000}], [{name,"Pat Henry"},{position,"Manager"},{salary,141000}]} 5&gt; crap_json:to_json(Staff). &lt;&lt;"[{\"name\":\"Joe Smith\",\"position\":\"Programmer\",\"salary\":125000},{\"name\":\"Becca Raymond\",\"position\":\"Programmer\",\"salar"...&gt;&gt;</pre> 26 unit tests (special characters, chinese, keywords, various types) and five stochastic tests (any int, float, ascii string, unicode string escapes to a binary; length of result checking.)</p> <hr> <div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div> <p><i>Generated by EDoc, Jul 7 2014, 01:15:19.</i></p> </body> </html>
StoneCypher/crap_json
doc/crap_json.html
HTML
mit
12,623
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM 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. OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "fvcCurl.H" #include "fvcGrad.H" #include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace fvc { // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<class Type> tmp<GeometricField<Type, fvPatchField, volMesh>> curl ( const GeometricField<Type, fvPatchField, volMesh>& vf ) { word nameCurlVf = "curl(" + vf.name() + ')'; // Gausses theorem curl // tmp<GeometricField<Type, fvPatchField, volMesh>> tcurlVf = // fvc::surfaceIntegrate(vf.mesh().Sf() ^ fvc::interpolate(vf)); // Calculate curl as the Hodge dual of the skew-symmetric part of grad tmp<GeometricField<Type, fvPatchField, volMesh>> tcurlVf = 2.0*(*skew(fvc::grad(vf, nameCurlVf))); tcurlVf.ref().rename(nameCurlVf); return tcurlVf; } template<class Type> tmp<GeometricField<Type, fvPatchField, volMesh>> curl ( const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvf ) { tmp<GeometricField<Type, fvPatchField, volMesh>> Curl(fvc::curl(tvf())); tvf.clear(); return Curl; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fvc // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // ************************************************************************* //
OpenFOAM/OpenFOAM-4.x
src/finiteVolume/finiteVolume/fvc/fvcCurl.C
C++
gpl-3.0
2,657
[ 30522, 1013, 1008, 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...
#!/bin/bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" channel() { if [ -n "${TRAVIS}" ]; then if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then pwd (set -x; cargo "$@") fi elif [ -n "${APPVEYOR}" ]; then if [ "${APPVEYOR_RUST_CHANNEL}" = "${CHANNEL}" ]; then pwd (set -x; cargo "$@") fi else pwd (set -x; cargo "+${CHANNEL}" "$@") fi } if [ -n "${CLIPPY}" ]; then # cached installation will not work on a later nightly if [ -n "${TRAVIS}" ] && ! cargo install clippy --debug --force; then echo "COULD NOT COMPILE CLIPPY, IGNORING CLIPPY TESTS" exit fi cargo clippy -- -Dclippy else CHANNEL=nightly channel clean channel build (cd "$DIR/tests/deps" && channel build) channel test channel test --features preserve_order for CHANNEL in stable 1.15.0 1.16.0 1.17.0 beta; do channel clean channel build channel build --features preserve_order done fi
tomasvdw/bitcrust
serde_json/travis.sh
Shell
mit
1,072
[ 30522, 1001, 999, 1013, 8026, 1013, 24234, 2275, 1011, 1041, 16101, 1027, 1000, 1002, 1006, 3729, 1000, 1002, 1006, 16101, 18442, 1000, 1002, 1063, 24234, 1035, 3120, 1031, 1014, 1033, 1065, 1000, 1007, 1000, 1004, 1004, 1052, 21724, 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...
{extends file="contact.html"} {block name="contact-form"} <div class="contact-success alert alert-success" style="text-align: center"> <h2 class="icon-comments">{intl l="Thanks !"}</h2> <p>{intl l="Thanks for your message, we will contact as soon as possible."}</p> </div> {/block}
AznStyle/lwb2
templates/frontOffice/default/contact-success.html
HTML
lgpl-3.0
306
[ 30522, 1063, 8908, 5371, 1027, 1000, 3967, 1012, 16129, 1000, 1065, 1063, 3796, 2171, 1027, 1000, 3967, 1011, 2433, 1000, 1065, 1026, 4487, 2615, 2465, 1027, 1000, 3967, 1011, 3112, 9499, 9499, 1011, 3112, 1000, 2806, 1027, 1000, 3793, 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...
using System; using System.Data; using Repository.Pattern.Infrastructure; using Repository.Pattern.Repositories; using Repository.Pattern.DataContext; namespace Repository.Pattern.UnitOfWork { public interface IUnitOfWork : IDisposable { int SaveChanges(); void Dispose(bool disposing); IRepository<TEntity> Repository<TEntity>() where TEntity : class, IObjectState; void BeginTransaction(IsolationLevel isolationLevel = IsolationLevel.Unspecified); bool Commit(); void Rollback(); void SetContext(IDataContextAsync DataContext); } }
rvegajr/rzdb-urf-app-gen
Frameworks/Repository.Pattern/UnitOfWork/IUnitOfWork.cs
C#
mit
605
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 2951, 1025, 2478, 22409, 1012, 5418, 1012, 6502, 1025, 2478, 22409, 1012, 5418, 1012, 16360, 20049, 29469, 2229, 1025, 2478, 22409, 1012, 5418, 1012, 2951, 8663, 18209, 1025, 3415, 15327, 22409, 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...
.ff0{font-family:sans-serif;visibility:hidden;} @font-face{font-family:ff1;src:url(f1.woff)format("woff");}.ff1{font-family:ff1;line-height:1.589369;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff2;src:url(f2.woff)format("woff");}.ff2{font-family:ff2;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff3;src:url(f3.woff)format("woff");}.ff3{font-family:ff3;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} .m0{transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-ms-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-webkit-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);} .m1{transform:none;-ms-transform:none;-webkit-transform:none;} .v0{vertical-align:0.000000px;} .ls0{letter-spacing:0.000000px;} .sc_{text-shadow:none;} .sc0{text-shadow:-0.015em 0 transparent,0 0.015em transparent,0.015em 0 transparent,0 -0.015em transparent;} @media screen and (-webkit-min-device-pixel-ratio:0){ .sc_{-webkit-text-stroke:0px transparent;} .sc0{-webkit-text-stroke:0.015em transparent;text-shadow:none;} } .ws0{word-spacing:0.000000px;} .fc2{color:rgb(33,78,123);} .fc1{color:rgb(255,0,0);} .fc0{color:rgb(0,0,0);} .fs3{font-size:48.000000px;} .fs2{font-size:56.000000px;} .fs1{font-size:60.000000px;} .fs0{font-size:80.000000px;} .y6{bottom:17.000000px;} .y2b{bottom:22.000000px;} .y7{bottom:35.500000px;} .yc7{bottom:52.220000px;} .y6e{bottom:52.730000px;} .y29{bottom:54.000000px;} .y49{bottom:56.130000px;} .y94{bottom:62.000000px;} .ydd{bottom:63.670000px;} .yc6{bottom:68.220000px;} .y6d{bottom:68.730000px;} .y28{bottom:70.000000px;} .y48{bottom:76.130000px;} .y93{bottom:80.000000px;} .ydc{bottom:81.670000px;} .y27{bottom:82.000000px;} .yc5{bottom:84.220000px;} .y6c{bottom:84.730000px;} .ydb{bottom:93.670000px;} .y26{bottom:94.000000px;} .y47{bottom:94.130000px;} .y6b{bottom:96.730000px;} .y92{bottom:100.000000px;} .yc4{bottom:100.220000px;} .yed{bottom:100.780000px;} .yda{bottom:105.670000px;} .y6a{bottom:108.730000px;} .y25{bottom:110.000000px;} .y46{bottom:112.130000px;} .yc3{bottom:116.220000px;} .y91{bottom:118.000000px;} .yec{bottom:118.780000px;} .y10a{bottom:119.110000px;} .y24{bottom:126.000000px;} .y69{bottom:126.730000px;} .yc2{bottom:128.220000px;} .y45{bottom:130.130000px;} .yeb{bottom:130.780000px;} .y109{bottom:131.110000px;} .yac{bottom:131.560000px;} .y90{bottom:136.000000px;} .yc1{bottom:140.220000px;} .y23{bottom:142.000000px;} .y44{bottom:142.130000px;} .yea{bottom:142.780000px;} .y108{bottom:143.110000px;} .yab{bottom:143.560000px;} .y68{bottom:146.730000px;} .y22{bottom:154.000000px;} .yaa{bottom:155.560000px;} .yc0{bottom:156.220000px;} .y43{bottom:158.130000px;} .y107{bottom:161.110000px;} .y67{bottom:164.730000px;} .y8f{bottom:166.000000px;} .ybf{bottom:168.220000px;} .ya9{bottom:173.560000px;} .y42{bottom:174.130000px;} .ybe{bottom:180.220000px;} .y106{bottom:181.110000px;} .y8e{bottom:182.000000px;} .y66{bottom:182.730000px;} .y41{bottom:190.130000px;} .ya8{bottom:193.560000px;} .y8d{bottom:198.000000px;} .ybd{bottom:198.220000px;} .y105{bottom:199.110000px;} .y65{bottom:200.730000px;} .y40{bottom:206.130000px;} .ya7{bottom:211.560000px;} .y64{bottom:212.730000px;} .y8c{bottom:214.000000px;} .y104{bottom:217.110000px;} .ybc{bottom:218.220000px;} .y3f{bottom:222.130000px;} .y63{bottom:228.730000px;} .ya6{bottom:229.560000px;} .y8b{bottom:230.000000px;} .y103{bottom:235.110000px;} .ybb{bottom:236.220000px;} .y3e{bottom:238.130000px;} .y62{bottom:244.730000px;} .y8a{bottom:246.000000px;} .y102{bottom:247.110000px;} .ya5{bottom:247.560000px;} .y3d{bottom:250.130000px;} .yba{bottom:254.220000px;} .y89{bottom:258.000000px;} .ya4{bottom:259.560000px;} .y61{bottom:260.730000px;} .y3c{bottom:262.130000px;} .y101{bottom:263.110000px;} .y88{bottom:270.000000px;} .yb9{bottom:272.220000px;} .ya3{bottom:275.560000px;} .y60{bottom:276.730000px;} .y3b{bottom:278.130000px;} .y100{bottom:279.110000px;} .yb8{bottom:284.220000px;} .y87{bottom:286.000000px;} .ya2{bottom:291.560000px;} .y5f{bottom:292.730000px;} .y3a{bottom:294.130000px;} .yff{bottom:295.110000px;} .yb7{bottom:300.220000px;} .y86{bottom:302.000000px;} .y39{bottom:306.130000px;} .ya1{bottom:307.560000px;} .y5e{bottom:308.730000px;} .yfe{bottom:311.110000px;} .yb6{bottom:316.220000px;} .y85{bottom:318.000000px;} .ya0{bottom:323.560000px;} .y5d{bottom:324.730000px;} .yfd{bottom:327.110000px;} .yb5{bottom:332.220000px;} .y84{bottom:334.000000px;} .y9f{bottom:335.560000px;} .y5c{bottom:336.730000px;} .yfc{bottom:343.110000px;} .yd9{bottom:344.000000px;} .y83{bottom:346.000000px;} .y9e{bottom:347.560000px;} .yb4{bottom:348.220000px;} .y5b{bottom:348.730000px;} .yfb{bottom:355.110000px;} .yd8{bottom:356.000000px;} .y82{bottom:358.000000px;} .y5{bottom:358.500000px;} .yb3{bottom:360.220000px;} .y9d{bottom:363.560000px;} .y5a{bottom:364.730000px;} .yfa{bottom:367.110000px;} .yd7{bottom:368.000000px;} .yb2{bottom:372.220000px;} .ye9{bottom:372.670000px;} .y9c{bottom:375.560000px;} .y81{bottom:376.000000px;} .y59{bottom:380.730000px;} .y4{bottom:381.000000px;} .yf9{bottom:383.110000px;} .ye8{bottom:384.670000px;} .yd6{bottom:386.000000px;} .y9b{bottom:387.560000px;} .yb1{bottom:388.220000px;} .y58{bottom:392.730000px;} .y21{bottom:394.000000px;} .y80{bottom:396.000000px;} .ye7{bottom:396.670000px;} .yf8{bottom:399.110000px;} .y9a{bottom:403.560000px;} .yb0{bottom:404.220000px;} .y20{bottom:406.000000px;} .y3{bottom:411.000000px;} .yf7{bottom:411.110000px;} .y7f{bottom:414.000000px;} .ye6{bottom:414.670000px;} .y1f{bottom:418.000000px;} .y99{bottom:419.560000px;} .yaf{bottom:420.220000px;} .yf6{bottom:423.110000px;} .yd5{bottom:424.000000px;} .y7e{bottom:432.000000px;} .ye5{bottom:434.670000px;} .y98{bottom:435.560000px;} .y1e{bottom:436.000000px;} .yae{bottom:436.220000px;} .yf5{bottom:441.110000px;} .yd4{bottom:448.000000px;} .yad{bottom:448.220000px;} .y7d{bottom:450.000000px;} .y97{bottom:451.560000px;} .y57{bottom:452.000000px;} .ye4{bottom:452.670000px;} .y1d{bottom:456.000000px;} .yd3{bottom:460.000000px;} .yf4{bottom:461.110000px;} .y7c{bottom:462.000000px;} .y56{bottom:464.000000px;} .y96{bottom:467.560000px;} .ye3{bottom:470.670000px;} .y1c{bottom:474.000000px;} .y55{bottom:476.000000px;} .y7b{bottom:478.000000px;} .yf3{bottom:479.110000px;} .y95{bottom:479.560000px;} .ye2{bottom:488.670000px;} .y0{bottom:490.500000px;} .y1b{bottom:492.000000px;} .y54{bottom:494.000000px;} .yf2{bottom:497.110000px;} .ye1{bottom:506.670000px;} .yd2{bottom:508.000000px;} .y1a{bottom:510.000000px;} .y53{bottom:514.000000px;} .yf1{bottom:515.110000px;} .ye0{bottom:524.670000px;} .y7a{bottom:526.000000px;} .y19{bottom:528.000000px;} .y52{bottom:532.000000px;} .yf0{bottom:533.110000px;} .y18{bottom:540.000000px;} .y79{bottom:542.000000px;} .ydf{bottom:542.670000px;} .yd1{bottom:544.000000px;} .y51{bottom:550.000000px;} .yef{bottom:551.110000px;} .y17{bottom:556.000000px;} .y78{bottom:558.000000px;} .yde{bottom:560.670000px;} .yd0{bottom:562.000000px;} .y50{bottom:568.000000px;} .yee{bottom:569.110000px;} .y77{bottom:570.000000px;} .y16{bottom:572.000000px;} .y4f{bottom:580.000000px;} .y38{bottom:582.000000px;} .y15{bottom:588.000000px;} .y37{bottom:594.000000px;} .y4e{bottom:596.000000px;} .y76{bottom:598.000000px;} .y14{bottom:604.000000px;} .y36{bottom:606.000000px;} .y4d{bottom:612.000000px;} .y75{bottom:614.000000px;} .ycf{bottom:616.000000px;} .y13{bottom:620.000000px;} .y35{bottom:624.000000px;} .y74{bottom:626.000000px;} .y4c{bottom:628.000000px;} .y12{bottom:632.000000px;} .yce{bottom:634.000000px;} .y2{bottom:636.000000px;} .y73{bottom:638.000000px;} .y11{bottom:644.000000px;} .ycd{bottom:652.000000px;} .y72{bottom:656.000000px;} .y10{bottom:660.000000px;} .y34{bottom:662.000000px;} .ycc{bottom:670.000000px;} .yf{bottom:672.000000px;} .y4b{bottom:676.000000px;} .y33{bottom:680.000000px;} .ye{bottom:684.000000px;} .y4a{bottom:688.000000px;} .y71{bottom:694.000000px;} .y32{bottom:698.000000px;} .yd{bottom:700.000000px;} .ycb{bottom:706.000000px;} .y31{bottom:710.000000px;} .y70{bottom:712.000000px;} .yc{bottom:716.000000px;} .yca{bottom:724.000000px;} .y30{bottom:726.000000px;} .y6f{bottom:730.000000px;} .yb{bottom:732.000000px;} .y2f{bottom:742.000000px;} .ya{bottom:748.000000px;} .y2e{bottom:758.000000px;} .yc9{bottom:760.000000px;} .y9{bottom:764.000000px;} .y2d{bottom:774.000000px;} .y1{bottom:776.000000px;} .yc8{bottom:778.000000px;} .y8{bottom:788.000000px;} .y2c{bottom:790.000000px;} .y2a{bottom:808.000000px;} .h6{height:56.367840px;} .h7{height:59.156250px;} .h4{height:69.015625px;} .h3{height:70.459800px;} .h2{height:93.946400px;} .h1{height:130.500000px;} .h5{height:770.500000px;} .h0{height:842.000000px;} .w1{width:456.500000px;} .w2{width:523.500000px;} .w0{width:595.000000px;} .x1{left:36.000000px;} .x0{left:69.500000px;} .x2{left:71.340000px;} .x5{left:241.810000px;} .x4{left:245.000000px;} .x3{left:254.980000px;} .x7{left:543.660000px;} .x6{left:550.330000px;} @media print{ .v0{vertical-align:0.000000pt;} .ls0{letter-spacing:0.000000pt;} .ws0{word-spacing:0.000000pt;} .fs3{font-size:64.000000pt;} .fs2{font-size:74.666667pt;} .fs1{font-size:80.000000pt;} .fs0{font-size:106.666667pt;} .y6{bottom:22.666667pt;} .y2b{bottom:29.333333pt;} .y7{bottom:47.333333pt;} .yc7{bottom:69.626667pt;} .y6e{bottom:70.306667pt;} .y29{bottom:72.000000pt;} .y49{bottom:74.840000pt;} .y94{bottom:82.666667pt;} .ydd{bottom:84.893333pt;} .yc6{bottom:90.960000pt;} .y6d{bottom:91.640000pt;} .y28{bottom:93.333333pt;} .y48{bottom:101.506667pt;} .y93{bottom:106.666667pt;} .ydc{bottom:108.893333pt;} .y27{bottom:109.333333pt;} .yc5{bottom:112.293333pt;} .y6c{bottom:112.973333pt;} .ydb{bottom:124.893333pt;} .y26{bottom:125.333333pt;} .y47{bottom:125.506667pt;} .y6b{bottom:128.973333pt;} .y92{bottom:133.333333pt;} .yc4{bottom:133.626667pt;} .yed{bottom:134.373333pt;} .yda{bottom:140.893333pt;} .y6a{bottom:144.973333pt;} .y25{bottom:146.666667pt;} .y46{bottom:149.506667pt;} .yc3{bottom:154.960000pt;} .y91{bottom:157.333333pt;} .yec{bottom:158.373333pt;} .y10a{bottom:158.813333pt;} .y24{bottom:168.000000pt;} .y69{bottom:168.973333pt;} .yc2{bottom:170.960000pt;} .y45{bottom:173.506667pt;} .yeb{bottom:174.373333pt;} .y109{bottom:174.813333pt;} .yac{bottom:175.413333pt;} .y90{bottom:181.333333pt;} .yc1{bottom:186.960000pt;} .y23{bottom:189.333333pt;} .y44{bottom:189.506667pt;} .yea{bottom:190.373333pt;} .y108{bottom:190.813333pt;} .yab{bottom:191.413333pt;} .y68{bottom:195.640000pt;} .y22{bottom:205.333333pt;} .yaa{bottom:207.413333pt;} .yc0{bottom:208.293333pt;} .y43{bottom:210.840000pt;} .y107{bottom:214.813333pt;} .y67{bottom:219.640000pt;} .y8f{bottom:221.333333pt;} .ybf{bottom:224.293333pt;} .ya9{bottom:231.413333pt;} .y42{bottom:232.173333pt;} .ybe{bottom:240.293333pt;} .y106{bottom:241.480000pt;} .y8e{bottom:242.666667pt;} .y66{bottom:243.640000pt;} .y41{bottom:253.506667pt;} .ya8{bottom:258.080000pt;} .y8d{bottom:264.000000pt;} .ybd{bottom:264.293333pt;} .y105{bottom:265.480000pt;} .y65{bottom:267.640000pt;} .y40{bottom:274.840000pt;} .ya7{bottom:282.080000pt;} .y64{bottom:283.640000pt;} .y8c{bottom:285.333333pt;} .y104{bottom:289.480000pt;} .ybc{bottom:290.960000pt;} .y3f{bottom:296.173333pt;} .y63{bottom:304.973333pt;} .ya6{bottom:306.080000pt;} .y8b{bottom:306.666667pt;} .y103{bottom:313.480000pt;} .ybb{bottom:314.960000pt;} .y3e{bottom:317.506667pt;} .y62{bottom:326.306667pt;} .y8a{bottom:328.000000pt;} .y102{bottom:329.480000pt;} .ya5{bottom:330.080000pt;} .y3d{bottom:333.506667pt;} .yba{bottom:338.960000pt;} .y89{bottom:344.000000pt;} .ya4{bottom:346.080000pt;} .y61{bottom:347.640000pt;} .y3c{bottom:349.506667pt;} .y101{bottom:350.813333pt;} .y88{bottom:360.000000pt;} .yb9{bottom:362.960000pt;} .ya3{bottom:367.413333pt;} .y60{bottom:368.973333pt;} .y3b{bottom:370.840000pt;} .y100{bottom:372.146667pt;} .yb8{bottom:378.960000pt;} .y87{bottom:381.333333pt;} .ya2{bottom:388.746667pt;} .y5f{bottom:390.306667pt;} .y3a{bottom:392.173333pt;} .yff{bottom:393.480000pt;} .yb7{bottom:400.293333pt;} .y86{bottom:402.666667pt;} .y39{bottom:408.173333pt;} .ya1{bottom:410.080000pt;} .y5e{bottom:411.640000pt;} .yfe{bottom:414.813333pt;} .yb6{bottom:421.626667pt;} .y85{bottom:424.000000pt;} .ya0{bottom:431.413333pt;} .y5d{bottom:432.973333pt;} .yfd{bottom:436.146667pt;} .yb5{bottom:442.960000pt;} .y84{bottom:445.333333pt;} .y9f{bottom:447.413333pt;} .y5c{bottom:448.973333pt;} .yfc{bottom:457.480000pt;} .yd9{bottom:458.666667pt;} .y83{bottom:461.333333pt;} .y9e{bottom:463.413333pt;} .yb4{bottom:464.293333pt;} .y5b{bottom:464.973333pt;} .yfb{bottom:473.480000pt;} .yd8{bottom:474.666667pt;} .y82{bottom:477.333333pt;} .y5{bottom:478.000000pt;} .yb3{bottom:480.293333pt;} .y9d{bottom:484.746667pt;} .y5a{bottom:486.306667pt;} .yfa{bottom:489.480000pt;} .yd7{bottom:490.666667pt;} .yb2{bottom:496.293333pt;} .ye9{bottom:496.893333pt;} .y9c{bottom:500.746667pt;} .y81{bottom:501.333333pt;} .y59{bottom:507.640000pt;} .y4{bottom:508.000000pt;} .yf9{bottom:510.813333pt;} .ye8{bottom:512.893333pt;} .yd6{bottom:514.666667pt;} .y9b{bottom:516.746667pt;} .yb1{bottom:517.626667pt;} .y58{bottom:523.640000pt;} .y21{bottom:525.333333pt;} .y80{bottom:528.000000pt;} .ye7{bottom:528.893333pt;} .yf8{bottom:532.146667pt;} .y9a{bottom:538.080000pt;} .yb0{bottom:538.960000pt;} .y20{bottom:541.333333pt;} .y3{bottom:548.000000pt;} .yf7{bottom:548.146667pt;} .y7f{bottom:552.000000pt;} .ye6{bottom:552.893333pt;} .y1f{bottom:557.333333pt;} .y99{bottom:559.413333pt;} .yaf{bottom:560.293333pt;} .yf6{bottom:564.146667pt;} .yd5{bottom:565.333333pt;} .y7e{bottom:576.000000pt;} .ye5{bottom:579.560000pt;} .y98{bottom:580.746667pt;} .y1e{bottom:581.333333pt;} .yae{bottom:581.626667pt;} .yf5{bottom:588.146667pt;} .yd4{bottom:597.333333pt;} .yad{bottom:597.626667pt;} .y7d{bottom:600.000000pt;} .y97{bottom:602.080000pt;} .y57{bottom:602.666667pt;} .ye4{bottom:603.560000pt;} .y1d{bottom:608.000000pt;} .yd3{bottom:613.333333pt;} .yf4{bottom:614.813333pt;} .y7c{bottom:616.000000pt;} .y56{bottom:618.666667pt;} .y96{bottom:623.413333pt;} .ye3{bottom:627.560000pt;} .y1c{bottom:632.000000pt;} .y55{bottom:634.666667pt;} .y7b{bottom:637.333333pt;} .yf3{bottom:638.813333pt;} .y95{bottom:639.413333pt;} .ye2{bottom:651.560000pt;} .y0{bottom:654.000000pt;} .y1b{bottom:656.000000pt;} .y54{bottom:658.666667pt;} .yf2{bottom:662.813333pt;} .ye1{bottom:675.560000pt;} .yd2{bottom:677.333333pt;} .y1a{bottom:680.000000pt;} .y53{bottom:685.333333pt;} .yf1{bottom:686.813333pt;} .ye0{bottom:699.560000pt;} .y7a{bottom:701.333333pt;} .y19{bottom:704.000000pt;} .y52{bottom:709.333333pt;} .yf0{bottom:710.813333pt;} .y18{bottom:720.000000pt;} .y79{bottom:722.666667pt;} .ydf{bottom:723.560000pt;} .yd1{bottom:725.333333pt;} .y51{bottom:733.333333pt;} .yef{bottom:734.813333pt;} .y17{bottom:741.333333pt;} .y78{bottom:744.000000pt;} .yde{bottom:747.560000pt;} .yd0{bottom:749.333333pt;} .y50{bottom:757.333333pt;} .yee{bottom:758.813333pt;} .y77{bottom:760.000000pt;} .y16{bottom:762.666667pt;} .y4f{bottom:773.333333pt;} .y38{bottom:776.000000pt;} .y15{bottom:784.000000pt;} .y37{bottom:792.000000pt;} .y4e{bottom:794.666667pt;} .y76{bottom:797.333333pt;} .y14{bottom:805.333333pt;} .y36{bottom:808.000000pt;} .y4d{bottom:816.000000pt;} .y75{bottom:818.666667pt;} .ycf{bottom:821.333333pt;} .y13{bottom:826.666667pt;} .y35{bottom:832.000000pt;} .y74{bottom:834.666667pt;} .y4c{bottom:837.333333pt;} .y12{bottom:842.666667pt;} .yce{bottom:845.333333pt;} .y2{bottom:848.000000pt;} .y73{bottom:850.666667pt;} .y11{bottom:858.666667pt;} .ycd{bottom:869.333333pt;} .y72{bottom:874.666667pt;} .y10{bottom:880.000000pt;} .y34{bottom:882.666667pt;} .ycc{bottom:893.333333pt;} .yf{bottom:896.000000pt;} .y4b{bottom:901.333333pt;} .y33{bottom:906.666667pt;} .ye{bottom:912.000000pt;} .y4a{bottom:917.333333pt;} .y71{bottom:925.333333pt;} .y32{bottom:930.666667pt;} .yd{bottom:933.333333pt;} .ycb{bottom:941.333333pt;} .y31{bottom:946.666667pt;} .y70{bottom:949.333333pt;} .yc{bottom:954.666667pt;} .yca{bottom:965.333333pt;} .y30{bottom:968.000000pt;} .y6f{bottom:973.333333pt;} .yb{bottom:976.000000pt;} .y2f{bottom:989.333333pt;} .ya{bottom:997.333333pt;} .y2e{bottom:1010.666667pt;} .yc9{bottom:1013.333333pt;} .y9{bottom:1018.666667pt;} .y2d{bottom:1032.000000pt;} .y1{bottom:1034.666667pt;} .yc8{bottom:1037.333333pt;} .y8{bottom:1050.666667pt;} .y2c{bottom:1053.333333pt;} .y2a{bottom:1077.333333pt;} .h6{height:75.157120pt;} .h7{height:78.875000pt;} .h4{height:92.020833pt;} .h3{height:93.946400pt;} .h2{height:125.261866pt;} .h1{height:174.000000pt;} .h5{height:1027.333333pt;} .h0{height:1122.666667pt;} .w1{width:608.666667pt;} .w2{width:698.000000pt;} .w0{width:793.333333pt;} .x1{left:48.000000pt;} .x0{left:92.666667pt;} .x2{left:95.120000pt;} .x5{left:322.413333pt;} .x4{left:326.666667pt;} .x3{left:339.973333pt;} .x7{left:724.880000pt;} .x6{left:733.773333pt;} }
braindumps/all_braindumps
642-647.css
CSS
apache-2.0
16,916
[ 30522, 1012, 21461, 2692, 1063, 15489, 1011, 2155, 1024, 20344, 1011, 14262, 10128, 1025, 16476, 1024, 5023, 1025, 1065, 1030, 15489, 1011, 2227, 1063, 15489, 1011, 2155, 1024, 21461, 2487, 1025, 5034, 2278, 1024, 24471, 2140, 1006, 20069, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 ems.security import javax.security.auth.login.{LoginException, LoginContext} import javax.security.auth.callback._ import scalaz.\/ class JAASAuthenticator[A, B] extends Authenticator[A, B] { def authenticate(username: String, password: String) = { val context = new LoginContext("ems", new CallbackHandler { def handle(callbacks: Array[Callback]) { callbacks.foreach { case n: NameCallback => n.setName(username) case n: PasswordCallback => n.setPassword(password.toCharArray) case cb => throw new UnsupportedCallbackException(cb, "Uexpected callback found") } } }) try { context.login() \/.right(AuthenticatedUser(username)) } catch { case e: LoginException => \/.left(e) case e: UnsupportedCallbackException => \/.left(e) } } }
javaBin/ems-redux
src/main/scala/ems/security/JAASAuthenticator.scala
Scala
apache-2.0
854
[ 30522, 7427, 29031, 1012, 3036, 12324, 9262, 2595, 1012, 3036, 1012, 8740, 2705, 1012, 8833, 2378, 1012, 1063, 8833, 3170, 2595, 24422, 1010, 8833, 2378, 8663, 18209, 1065, 12324, 9262, 2595, 1012, 3036, 1012, 8740, 2705, 1012, 2655, 5963, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 apple.security; import java.io.*; import java.nio.*; import java.util.*; import com.google.j2objc.annotations.*; import com.google.j2objc.runtime.*; import com.google.j2objc.runtime.block.*; import apple.audiotoolbox.*; import apple.corefoundation.*; import apple.coregraphics.*; import apple.coreservices.*; import apple.dispatch.*; @Library("Security/Security.h") @Mapping("SSLConnectionType") public final class SSLConnectionType extends ObjCEnum { @GlobalConstant("kSSLStreamType") public static final long StreamType = 0L; @GlobalConstant("kSSLDatagramType") public static final long DatagramType = 1L; }
Sellegit/j2objc
runtime/src/main/java/apple/security/SSLConnectionType.java
Java
apache-2.0
645
[ 30522, 7427, 6207, 1012, 3036, 1025, 12324, 9262, 1012, 22834, 1012, 1008, 1025, 12324, 9262, 1012, 9152, 2080, 1012, 1008, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 1008, 1025, 12324, 4012, 1012, 8224, 1012, 1046, 2475, 16429, 3501, 2278...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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...