text
stringlengths 2
100k
| meta
dict |
---|---|
'use strict';
// https://github.com/davidshimjs/qrcodejs
// MIT licence
var QRCode;
(function () {
//---------------------------------------------------------------------
// QRCode for JavaScript
//
// Copyright (c) 2009 Kazuhiko Arase
//
// URL: http://www.d-project.com/
//
// Licensed under the MIT license:
// http://www.opensource.org/licenses/mit-license.php
//
// The word "QR Code" is registered trademark of
// DENSO WAVE INCORPORATED
// http://www.denso-wave.com/qrcode/faqpatent-e.html
//
//---------------------------------------------------------------------
function QR8bitByte(data) {
this.mode = QRMode.MODE_8BIT_BYTE;
this.data = data;
this.parsedData = [];
// Added to support UTF-8 Characters
for (var i = 0, l = this.data.length; i < l; i++) {
var byteArray = [];
var code = this.data.charCodeAt(i);
if (code > 0x10000) {
byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
byteArray[3] = 0x80 | (code & 0x3F);
} else if (code > 0x800) {
byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
byteArray[2] = 0x80 | (code & 0x3F);
} else if (code > 0x80) {
byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
byteArray[1] = 0x80 | (code & 0x3F);
} else {
byteArray[0] = code;
}
this.parsedData.push(byteArray);
}
this.parsedData = Array.prototype.concat.apply([], this.parsedData);
if (this.parsedData.length != this.data.length) {
this.parsedData.unshift(191);
this.parsedData.unshift(187);
this.parsedData.unshift(239);
}
}
QR8bitByte.prototype = {
getLength: function (buffer) {
return this.parsedData.length;
},
write: function (buffer) {
for (var i = 0, l = this.parsedData.length; i < l; i++) {
buffer.put(this.parsedData[i], 8);
}
}
};
function QRCodeModel(typeNumber, errorCorrectLevel) {
this.typeNumber = typeNumber;
this.errorCorrectLevel = errorCorrectLevel;
this.modules = null;
this.moduleCount = 0;
this.dataCache = null;
this.dataList = [];
}
QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}
return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}}
this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);}
if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}
this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}}
return qr_mc;},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;}
this.modules[r][6]=(r%2==0);}
for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;}
this.modules[6][c]=(c%2==0);}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;}
for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||(r==0&&c==0)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}
for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}
for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}
this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(((data[byteIndex]>>>bitIndex)&1)==1);}
var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}
this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}
row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber));data.write(buffer);}
var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}
if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. ("
+buffer.getLengthInBits()
+">"
+totalDataCount*8
+")");}
if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}
while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}
while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}
buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}
buffer.put(QRCodeModel.PAD1,8);}
return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];}
offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount);var rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=(modIndex>=0)?modPoly.get(modIndex):0;}}
var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;}
var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}
for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}
return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}
return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}
return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;}
return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));}
return a;},getLengthInBits:function(mode,type){if(1<=type&&type<10){switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;}
for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;}
if(r==0&&c==0){continue;}
if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}}
if(sameCount>5){lostPoint+=(3+sameCount-5);}}}
for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}}
for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}}
for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}}
var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}}
var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var QRMath={glog:function(n){if(n<1){throw new Error("glog("+n+")");}
return QRMath.LOG_TABLE[n];},gexp:function(n){while(n<0){n+=255;}
while(n>=256){n-=255;}
return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;}
for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];}
for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;}
function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);}
var offset=0;while(offset<num.length&&num[offset]==0){offset++;}
this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}
QRPolynomial.prototype={get:function(index){return this.num[index];},getLength:function(){return this.num.length;},multiply:function(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));}}
return new QRPolynomial(num,0);},mod:function(e){if(this.getLength()-e.getLength()<0){return this;}
var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);}
for(var i=0;i<e.getLength();i++){num[i]^=QRMath.gexp(QRMath.glog(e.get(i))+ratio);}
return new QRPolynomial(num,0).mod(e);}};function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;}
QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);}
var length=rsBlock.length/3;var list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}}
return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};function QRBitBuffer(){this.buffer=[];this.length=0;}
QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return((this.buffer[bufIndex]>>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i<length;i++){this.putBit(((num>>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}
if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));}
this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];
function _isSupportCanvas() {
return typeof CanvasRenderingContext2D != "undefined";
}
// android 2.x doesn't support Data-URI spec
function _getAndroid() {
var android = false;
var sAgent = navigator.userAgent;
if (/android/i.test(sAgent)) { // android
android = true;
var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
if (aMat && aMat[1]) {
android = parseFloat(aMat[1]);
}
}
return android;
}
var svgDrawer = (function() {
var Drawing = function (el, htOption) {
this._el = el;
this._htOption = htOption;
};
Drawing.prototype.draw = function (oQRCode) {
var _htOption = this._htOption;
var _el = this._el;
var nCount = oQRCode.getModuleCount();
var nWidth = Math.floor(_htOption.width / nCount);
var nHeight = Math.floor(_htOption.height / nCount);
this.clear();
function makeSVG(tag, attrs) {
var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
for (var k in attrs)
if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);
return el;
}
var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight});
svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
_el.appendChild(svg);
svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"}));
svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"}));
for (var row = 0; row < nCount; row++) {
for (var col = 0; col < nCount; col++) {
if (oQRCode.isDark(row, col)) {
var child = makeSVG("use", {"x": String(col), "y": String(row)});
child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template")
svg.appendChild(child);
}
}
}
};
Drawing.prototype.clear = function () {
while (this._el.hasChildNodes())
this._el.removeChild(this._el.lastChild);
};
return Drawing;
})();
var useSVG = document.documentElement.tagName.toLowerCase() === "svg";
// Drawing in DOM by using Table tag
var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {
var Drawing = function (el, htOption) {
this._el = el;
this._htOption = htOption;
};
/**
* Draw the QRCode
*
* @param {QRCode} oQRCode
*/
Drawing.prototype.draw = function (oQRCode) {
var _htOption = this._htOption;
var _el = this._el;
var nCount = oQRCode.getModuleCount();
var nWidth = Math.floor(_htOption.width / nCount);
var nHeight = Math.floor(_htOption.height / nCount);
var aHTML = ['<table style="border:0;border-collapse:collapse;">'];
for (var row = 0; row < nCount; row++) {
aHTML.push('<tr>');
for (var col = 0; col < nCount; col++) {
aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>');
}
aHTML.push('</tr>');
}
aHTML.push('</table>');
_el.innerHTML = aHTML.join('');
// Fix the margin values as real size.
var elTable = _el.childNodes[0];
var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;
var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;
if (nLeftMarginTable > 0 && nTopMarginTable > 0) {
elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px";
}
};
/**
* Clear the QRCode
*/
Drawing.prototype.clear = function () {
this._el.innerHTML = '';
};
return Drawing;
})() : (function () { // Drawing in Canvas
function _onMakeImage() {
this._elImage.src = this._elCanvas.toDataURL("image/png");
this._elImage.style.display = "block";
this._elCanvas.style.display = "none";
}
// Android 2.1 bug workaround
// http://code.google.com/p/android/issues/detail?id=5141
/**
* Check whether the user's browser supports Data URI or not
*
* @private
* @param {Function} fSuccess Occurs if it supports Data URI
* @param {Function} fFail Occurs if it doesn't support Data URI
*/
function _safeSetDataURI(fSuccess, fFail) {
var self = this;
self._fFail = fFail;
self._fSuccess = fSuccess;
// Check it just once
if (self._bSupportDataURI === null) {
var el = document.createElement("img");
var fOnError = function() {
self._bSupportDataURI = false;
if (self._fFail) {
self._fFail.call(self);
}
};
var fOnSuccess = function() {
self._bSupportDataURI = true;
if (self._fSuccess) {
self._fSuccess.call(self);
}
};
el.onabort = fOnError;
el.onerror = fOnError;
el.onload = fOnSuccess;
el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data.
return;
} else if (self._bSupportDataURI === true && self._fSuccess) {
self._fSuccess.call(self);
} else if (self._bSupportDataURI === false && self._fFail) {
self._fFail.call(self);
}
};
/**
* Drawing QRCode by using canvas
*
* @constructor
* @param {HTMLElement} el
* @param {Object} htOption QRCode Options
*/
var Drawing = function (el, htOption) {
this._bIsPainted = false;
this._android = _getAndroid();
this._htOption = htOption;
this._elCanvas = document.createElement("canvas");
this._elCanvas.width = htOption.width;
this._elCanvas.height = htOption.height;
el.appendChild(this._elCanvas);
this._el = el;
this._oContext = this._elCanvas.getContext("2d");
this._bIsPainted = false;
this._elImage = document.createElement("img");
this._elImage.alt = "Scan me!";
this._elImage.style.display = "none";
this._el.appendChild(this._elImage);
this._bSupportDataURI = null;
};
/**
* Draw the QRCode
*
* @param {QRCode} oQRCode
*/
Drawing.prototype.draw = function (oQRCode) {
var _elImage = this._elImage;
var _oContext = this._oContext;
var _htOption = this._htOption;
var nCount = oQRCode.getModuleCount();
var nWidth = _htOption.width / nCount;
var nHeight = _htOption.height / nCount;
var nRoundedWidth = Math.round(nWidth);
var nRoundedHeight = Math.round(nHeight);
_elImage.style.display = "none";
this.clear();
for (var row = 0; row < nCount; row++) {
for (var col = 0; col < nCount; col++) {
var bIsDark = oQRCode.isDark(row, col);
var nLeft = col * nWidth;
var nTop = row * nHeight;
_oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
_oContext.lineWidth = 1;
_oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
_oContext.fillRect(nLeft, nTop, nWidth, nHeight);
// 안티 앨리어싱 방지 처리
_oContext.strokeRect(
Math.floor(nLeft) + 0.5,
Math.floor(nTop) + 0.5,
nRoundedWidth,
nRoundedHeight
);
_oContext.strokeRect(
Math.ceil(nLeft) - 0.5,
Math.ceil(nTop) - 0.5,
nRoundedWidth,
nRoundedHeight
);
}
}
this._bIsPainted = true;
};
/**
* Make the image from Canvas if the browser supports Data URI.
*/
Drawing.prototype.makeImage = function () {
if (this._bIsPainted) {
_safeSetDataURI.call(this, _onMakeImage);
}
};
/**
* Return whether the QRCode is painted or not
*
* @return {Boolean}
*/
Drawing.prototype.isPainted = function () {
return this._bIsPainted;
};
/**
* Clear the QRCode
*/
Drawing.prototype.clear = function () {
this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);
this._bIsPainted = false;
};
/**
* @private
* @param {Number} nNumber
*/
Drawing.prototype.round = function (nNumber) {
if (!nNumber) {
return nNumber;
}
return Math.floor(nNumber * 1000) / 1000;
};
return Drawing;
})();
/**
* Get the type by string length
*
* @private
* @param {String} sText
* @param {Number} nCorrectLevel
* @return {Number} type
*/
function _getTypeNumber(sText, nCorrectLevel) {
var nType = 1;
var length = _getUTF8Length(sText);
for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
var nLimit = 0;
switch (nCorrectLevel) {
case QRErrorCorrectLevel.L :
nLimit = QRCodeLimitLength[i][0];
break;
case QRErrorCorrectLevel.M :
nLimit = QRCodeLimitLength[i][1];
break;
case QRErrorCorrectLevel.Q :
nLimit = QRCodeLimitLength[i][2];
break;
case QRErrorCorrectLevel.H :
nLimit = QRCodeLimitLength[i][3];
break;
}
if (length <= nLimit) {
break;
} else {
nType++;
}
}
if (nType > QRCodeLimitLength.length) {
throw new Error("Too long data");
}
return nType;
}
function _getUTF8Length(sText) {
var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
return replacedText.length + (replacedText.length != sText ? 3 : 0);
}
/**
* @class QRCode
* @constructor
* @example
* new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
*
* @example
* var oQRCode = new QRCode("test", {
* text : "http://naver.com",
* width : 128,
* height : 128
* });
*
* oQRCode.clear(); // Clear the QRCode.
* oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
*
* @param {HTMLElement|String} el target element or 'id' attribute of element.
* @param {Object|String} vOption
* @param {String} vOption.text QRCode link data
* @param {Number} [vOption.width=256]
* @param {Number} [vOption.height=256]
* @param {String} [vOption.colorDark="#000000"]
* @param {String} [vOption.colorLight="#ffffff"]
* @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H]
*/
QRCode = function (el, vOption) {
this._htOption = {
width : 256,
height : 256,
typeNumber : 4,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRErrorCorrectLevel.H
};
if (typeof vOption === 'string') {
vOption = {
text : vOption
};
}
// Overwrites options
if (vOption) {
for (var i in vOption) {
this._htOption[i] = vOption[i];
}
}
if (typeof el == "string") {
el = document.getElementById(el);
}
if (this._htOption.useSVG) {
Drawing = svgDrawer;
}
this._android = _getAndroid();
this._el = el;
this._oQRCode = null;
this._oDrawing = new Drawing(this._el, this._htOption);
if (this._htOption.text) {
this.makeCode(this._htOption.text);
}
};
/**
* Make the QRCode
*
* @param {String} sText link data
*/
QRCode.prototype.makeCode = function (sText) {
this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
this._oQRCode.addData(sText);
this._oQRCode.make();
this._el.title = sText;
this._oDrawing.draw(this._oQRCode);
this.makeImage();
};
/**
* Make the Image from Canvas element
* - It occurs automatically
* - Android below 3 doesn't support Data-URI spec.
*
* @private
*/
QRCode.prototype.makeImage = function () {
if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) {
this._oDrawing.makeImage();
}
};
/**
* Clear the QRCode
*/
QRCode.prototype.clear = function () {
this._oDrawing.clear();
};
/**
* @name QRCode.CorrectLevel
*/
QRCode.CorrectLevel = QRErrorCorrectLevel;
})();
exports.clearDomNodeImpl = function(nodeId){
var node = document.getElementById(nodeId);
while (node.hasChildNodes()) {
node.removeChild(node.firstChild);
}
}
exports.mkQRCodeImpl = function (elm, config) {
return new QRCode(document.getElementById(elm), config);
};
exports.clearImpl = function (self) {
return self.clear();
};
| {
"pile_set_name": "Github"
} |
a::=~Hello World
::=
a
| {
"pile_set_name": "Github"
} |
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1031\deflangfe1031{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;}{\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}
{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}
{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f47\fswiss\fcharset238\fprq2 Arial CE;}{\f48\fswiss\fcharset204\fprq2 Arial Cyr;}{\f50\fswiss\fcharset161\fprq2 Arial Greek;}{\f51\fswiss\fcharset162\fprq2 Arial Tur;}
{\f52\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f53\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f54\fswiss\fcharset186\fprq2 Arial Baltic;}{\f55\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 \snext0 Normal;}{\*\cs10 \additive
\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid1558901980
\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\'01*;}{\levelnumbers;}}{\listname ;}\listid-2}}{\*\listoverridetable{\listoverride\listid-2\listoverridecount1{\lfolevel
\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 }}\ls1}}{\*\rsidtbl \rsid7038667\rsid14693713}{\*\generator Microsoft
Word 11.0.6502;}{\info{\author Daniel Grunwald}{\operator Daniel Grunwald}{\creatim\yr2006\mo2\dy12\hr15\min14}{\revtim\yr2006\mo2\dy12\hr15\min14}{\version2}{\edmins0}{\nofpages1}{\nofwords126}{\nofchars800}{\nofcharsws925}{\vern24579}}
\margl1417\margr1417\margt1417\margb1134 \widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3
\jcompress\viewkind4\viewscale80\nolnhtadjtbl\rsidroot7038667 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
\qj \li0\ri0\sa120\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 {\b\fs48\lang1023\langfe1031\langnp1023\insrsid14693713 Codon Creation Sample}{\lang1023\langfe1031\langnp1023\insrsid14693713
\par
\par The codon creation example shows how to extend the default codon set that ships with SharpDevelop.
\par A codon is an xml node in an .addin file that represents a custom type. When SharpDevelop starts it reads the codons and creates objects using doozer (builder) classes. SharpDevelop can be customised to use custom doozers defined by an addin author.
\par SharpDevelop defines several codons and associated doozers.
\par
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj \fi-720\li720\ri0\sa120\nowidctlpar{\*\pn \pnlvlblt\ilvl0\ls1\pnrnot0\pnf3 {\pntxtb \'b7}}\faauto\ls1\rin0\lin720\itap0\pararsid14693713 {
\lang1023\langfe1031\langnp1023\insrsid14693713 MenuItem
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}ToolBarItem
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}CodeCompletionBinding
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}DialogPanel
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}DisplayBinding
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Icon
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Pad
\par {\pntext\pard\plain\f3\lang1023\langfe1031\langnp1023 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Parser
\par }\pard \qj \li0\ri0\sa120\nowidctlpar\faauto\rin0\lin0\itap0 {\lang1023\langfe1031\langnp1023\insrsid14693713
\par For example, SharpDevelop creates its menus based on the MenuItem codons in all the .addin files.
\par After the sample has been built and SharpDev
elop re-started, it can be run by selecting the menu option Codon Creation Sample | Read Test Codon. This causes SharpDevelop to use the custom doozer class (TestDoozer) to create a TestCodon class with the text specified in the CodonCreation.addin file.
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\lang1033\langfe1031\langnp1033\insrsid14693713
\par
\par }{\f1\fs20\lang1033\langfe1031\langnp1033\insrsid14693713
\par }} | {
"pile_set_name": "Github"
} |
#!/bin/bash
msa_commit=`git log -n1 | grep "msautotest=" | sed 's/msautotest=//'`
branch=master
repo=git://github.com/mapserver/msautotest.git
if [ -n "$msa_commit" ]; then
repo=`echo "$msa_commit" | grep -o '^[^@]*'`
branch=`echo "$msa_commit" | grep -o '[^@]*$'`
fi
echo "git clone $repo msautotest"
git clone $repo msautotest
cd msautotest
echo "git checkout $branch"
git checkout $branch
| {
"pile_set_name": "Github"
} |
(* This program 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 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 Lesser General Public *)
(* License along with this program; if not, write to the Free *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA *)
(* COUNTING *)
(* decomptes des parametres de la machine*)
Require Export DistributedReferenceCounting.machine0.machine.
Section CONTROL.
(* decompte des messages dans une file d'attente, puis sommation sur
toutes les files d'attente issues ou arrivant sur un site *)
Variable s0 : Site.
Definition ctrl_copy (s1 : Site) (bom : Bag_of_message) :=
card_mess copy (bom s0 s1).
Definition ctrl_dec (s1 : Site) (bom : Bag_of_message) :=
card_mess dec (bom s1 s0).
Definition ctrl_inc (s1 : Site) (bom : Bag_of_message) :=
card_mess (inc_dec s0) (bom s1 owner).
Definition sigma_ctrl_copy (bom : Bag_of_message) :=
sigma Site LS (fun si : Site => ctrl_copy si bom).
Definition sigma_ctrl_dec (bom : Bag_of_message) :=
sigma Site LS (fun si : Site => ctrl_dec si bom).
Definition sigma_ctrl_inc (bom : Bag_of_message) :=
sigma Site LS (fun si : Site => ctrl_inc si bom).
Definition sigma_ctrl (bom : Bag_of_message) :=
(sigma_ctrl_copy bom + sigma_ctrl_dec bom + sigma_ctrl_inc bom)%Z.
End CONTROL.
Section CONTROL_POS.
(* preuves que ces decomptes sont positifs (ils sont fait dans Z) *)
Variable bom : Bag_of_message.
Lemma ctrl_copy_pos : forall s0 s1 : Site, (ctrl_copy s0 s1 bom >= 0)%Z.
Proof.
intros; unfold ctrl_copy in |- *; apply pos_card_mess.
Qed.
Lemma ctrl_dec_pos : forall s0 s1 : Site, (ctrl_dec s0 s1 bom >= 0)%Z.
Proof.
intros; unfold ctrl_dec in |- *; apply pos_card_mess.
Qed.
Remark ctrl_inc_pos : forall s0 s1 : Site, (ctrl_inc s0 s1 bom >= 0)%Z.
Proof.
intros; unfold ctrl_inc in |- *; apply pos_card_mess.
Qed.
Remark ctrl_inc_strct_pos :
forall s0 s1 : Site,
In_queue Message (inc_dec s0) (bom s1 owner) -> (ctrl_inc s0 s1 bom > 0)%Z.
Proof.
unfold ctrl_inc in |- *; intros; apply strct_pos_card_mess; trivial.
Qed.
Remark sigma_ctrl_copy_pos :
forall s0 : Site, (sigma_ctrl_copy s0 bom >= 0)%Z.
Proof.
intro; unfold sigma_ctrl_copy in |- *; apply sigma_pos; intro;
apply ctrl_copy_pos.
Qed.
Remark sigma_ctrl_dec_pos : forall s0 : Site, (sigma_ctrl_dec s0 bom >= 0)%Z.
Proof.
intro; unfold sigma_ctrl_dec in |- *; apply sigma_pos; intro;
apply ctrl_dec_pos.
Qed.
Remark sigma_ctrl_inc_strct_pos :
forall s0 s1 : Site,
In_queue Message (inc_dec s0) (bom s1 owner) ->
(sigma_ctrl_inc s0 bom > 0)%Z.
Proof.
intros; unfold sigma_ctrl_inc in |- *.
generalize
(le_sigma Site LS (fun si : Site => ctrl_inc s0 si bom) s1
(ctrl_inc_pos s0) (in_s_LS s1)); intros.
generalize (ctrl_inc_strct_pos s0 s1 H); intro; omega.
Qed.
Lemma sigma_ctrl_strct_pos :
forall s0 s1 : Site,
In_queue Message (inc_dec s0) (bom s1 owner) -> (sigma_ctrl s0 bom > 0)%Z.
Proof.
intros; unfold sigma_ctrl in |- *.
generalize (sigma_ctrl_copy_pos s0); intro.
generalize (sigma_ctrl_dec_pos s0); intro.
generalize (sigma_ctrl_inc_strct_pos s0 s1 H); intro.
omega.
Qed.
End CONTROL_POS.
Section XY.
(* definition des variables xi et yi relative a un site et sommations
*)
Variable c0 : Config.
Definition xi (s0 : Site) :=
(Int (rt c0 s0) + ctrl_copy owner s0 (bm c0) + ctrl_dec owner s0 (bm c0))%Z.
Definition yi (s0 : Site) :=
sigma Site LS (fun s' : Site => ctrl_inc s' s0 (bm c0)).
Definition sigma_xi := sigma Site LS (fun s' : Site => xi s').
Definition sigma_yi := sigma Site LS (fun s' : Site => yi s').
End XY.
Section ALT_CTRL.
(* decompte des messages sur une file d'attente alternee *)
Remark S_card_mess :
forall (q0 : queue Message) (m : Message),
card_mess m (input Message m q0) = (card_mess m q0 + 1)%Z.
Proof.
intros; unfold card_mess in |- *; apply input_S_card; trivial.
Qed.
Remark card_mess_diff :
forall (q0 : queue Message) (m m' : Message),
m <> m' -> card_mess m (input Message m' q0) = card_mess m q0.
Proof.
intros; unfold card_mess in |- *; apply input_diff_card; trivial.
Qed.
Remark S_sigma_card_inc :
forall (s0 : Site) (q0 : queue Message),
sigma Site LS
(fun s' : Site => card_mess (inc_dec s') (input Message (inc_dec s0) q0)) =
(sigma Site LS (fun s' : Site => card_mess (inc_dec s') q0) + 1)%Z.
Proof.
intros; apply sigma__S with (eq_E_dec := eq_site_dec) (x0 := s0).
exact finite_site.
apply S_card_mess.
intros; apply card_mess_diff; injection; auto.
Qed.
Remark diff_sigma_card_inc :
forall q0 : queue Message,
sigma Site LS
(fun s' : Site => card_mess (inc_dec s') (input Message dec q0)) =
sigma Site LS (fun s' : Site => card_mess (inc_dec s') q0).
Proof.
intros; apply sigma_simpl.
intros; apply card_mess_diff.
discriminate.
Qed.
Lemma alt_dec_inc :
forall q0 : queue Message,
alternate q0 ->
(card_mess dec q0 + 1 >=
sigma Site LS (fun s' : Site => card_mess (inc_dec s') q0))%Z.
Proof.
intros; elim H; intros.
simpl in |- *; rewrite sigma_null; omega.
rewrite card_mess_diff.
rewrite S_sigma_card_inc.
simpl in |- *; rewrite sigma_null; omega.
discriminate.
rewrite S_card_mess.
rewrite diff_sigma_card_inc.
omega.
rewrite card_mess_diff.
rewrite S_card_mess.
rewrite S_sigma_card_inc.
rewrite diff_sigma_card_inc.
omega.
discriminate.
Qed.
Lemma D_dec_inc :
forall q0 : queue Message,
alternate q0 ->
D_queue q0 ->
(card_mess dec q0 >=
sigma Site LS (fun s' : Site => card_mess (inc_dec s') q0))%Z.
Proof.
intros q0 H; elim H; intros.
simpl in |- *; rewrite sigma_null; omega.
absurd (D_queue (input Message (inc_dec s0) (empty Message))).
apply not_D_queue.
trivial.
rewrite S_card_mess.
rewrite diff_sigma_card_inc.
apply alt_dec_inc; trivial.
absurd (D_queue (input Message (inc_dec s0) (input Message dec qm))).
apply not_D_queue.
trivial.
Qed.
End ALT_CTRL. | {
"pile_set_name": "Github"
} |
/*
// Licensed to Julian Hyde under one or more contributor license
// agreements. See the NOTICE file distributed with this work for
// additional information regarding copyright ownership.
//
// Julian Hyde 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.
*/
package net.hydromatic.optiq;
import net.hydromatic.linq4j.*;
import net.hydromatic.linq4j.expressions.FunctionExpression;
import net.hydromatic.linq4j.expressions.Primitive;
import net.hydromatic.linq4j.expressions.Types;
import net.hydromatic.linq4j.function.*;
import net.hydromatic.optiq.impl.java.ReflectiveSchema;
import net.hydromatic.optiq.impl.jdbc.JdbcSchema;
import net.hydromatic.optiq.runtime.*;
import org.eigenbase.rel.metadata.Metadata;
import org.eigenbase.rex.RexNode;
import org.eigenbase.sql.SqlExplainLevel;
import com.google.common.collect.ImmutableMap;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.sql.ResultSet;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.*;
import javax.sql.DataSource;
import static org.eigenbase.rel.metadata.BuiltInMetadata.*;
/**
* Builtin methods.
*/
public enum BuiltinMethod {
QUERYABLE_SELECT(Queryable.class, "select", FunctionExpression.class),
QUERYABLE_AS_ENUMERABLE(Queryable.class, "asEnumerable"),
QUERYABLE_TABLE_AS_QUERYABLE(QueryableTable.class, "asQueryable",
QueryProvider.class, SchemaPlus.class, String.class),
AS_QUERYABLE(Enumerable.class, "asQueryable"),
ABSTRACT_ENUMERABLE_CTOR(AbstractEnumerable.class),
INTO(ExtendedEnumerable.class, "into", Collection.class),
SCHEMA_GET_SUB_SCHEMA(Schema.class, "getSubSchema", String.class),
SCHEMA_GET_TABLE(Schema.class, "getTable", String.class),
SCHEMA_PLUS_UNWRAP(SchemaPlus.class, "unwrap", Class.class),
SCHEMAS_QUERYABLE(Schemas.class, "queryable", DataContext.class,
SchemaPlus.class, Class.class, String.class),
REFLECTIVE_SCHEMA_GET_TARGET(ReflectiveSchema.class, "getTarget"),
DATA_CONTEXT_GET(DataContext.class, "get", String.class),
DATA_CONTEXT_GET_ROOT_SCHEMA(DataContext.class, "getRootSchema"),
JDBC_SCHEMA_DATA_SOURCE(JdbcSchema.class, "getDataSource"),
RESULT_SET_ENUMERABLE_OF(ResultSetEnumerable.class, "of", DataSource.class,
String.class, Function1.class),
JOIN(ExtendedEnumerable.class, "join", Enumerable.class, Function1.class,
Function1.class, Function2.class),
SELECT(ExtendedEnumerable.class, "select", Function1.class),
SELECT2(ExtendedEnumerable.class, "select", Function2.class),
SELECT_MANY(ExtendedEnumerable.class, "selectMany", Function1.class),
WHERE(ExtendedEnumerable.class, "where", Predicate1.class),
WHERE2(ExtendedEnumerable.class, "where", Predicate2.class),
DISTINCT(ExtendedEnumerable.class, "distinct"),
DISTINCT2(ExtendedEnumerable.class, "distinct", EqualityComparer.class),
GROUP_BY(ExtendedEnumerable.class, "groupBy", Function1.class),
GROUP_BY2(ExtendedEnumerable.class, "groupBy", Function1.class,
Function0.class, Function2.class, Function2.class),
AGGREGATE(ExtendedEnumerable.class, "aggregate", Object.class,
Function2.class, Function1.class),
ORDER_BY(ExtendedEnumerable.class, "orderBy", Function1.class,
Comparator.class),
UNION(ExtendedEnumerable.class, "union", Enumerable.class),
CONCAT(ExtendedEnumerable.class, "concat", Enumerable.class),
INTERSECT(ExtendedEnumerable.class, "intersect", Enumerable.class),
EXCEPT(ExtendedEnumerable.class, "except", Enumerable.class),
SKIP(ExtendedEnumerable.class, "skip", int.class),
TAKE(ExtendedEnumerable.class, "take", int.class),
SINGLETON_ENUMERABLE(Linq4j.class, "singletonEnumerable", Object.class),
NULLS_COMPARATOR(Functions.class, "nullsComparator", boolean.class,
boolean.class),
ARRAY_COMPARER(Functions.class, "arrayComparer"),
FUNCTION0_APPLY(Function0.class, "apply"),
FUNCTION1_APPLY(Function1.class, "apply", Object.class),
ARRAYS_AS_LIST(FlatLists.class, "of", Object[].class),
LIST2(FlatLists.class, "of", Object.class, Object.class),
LIST3(FlatLists.class, "of", Object.class, Object.class, Object.class),
IDENTITY_COMPARER(Functions.class, "identityComparer"),
IDENTITY_SELECTOR(Functions.class, "identitySelector"),
AS_ENUMERABLE(Linq4j.class, "asEnumerable", Object[].class),
AS_ENUMERABLE2(Linq4j.class, "asEnumerable", Iterable.class),
ENUMERABLE_TO_LIST(ExtendedEnumerable.class, "toList"),
LIST_TO_ENUMERABLE(SqlFunctions.class, "listToEnumerable"),
AS_LIST(Primitive.class, "asList", Object.class),
ENUMERATOR_CURRENT(Enumerator.class, "current"),
ENUMERATOR_MOVE_NEXT(Enumerator.class, "moveNext"),
ENUMERATOR_CLOSE(Enumerator.class, "close"),
ENUMERATOR_RESET(Enumerator.class, "reset"),
ENUMERABLE_ENUMERATOR(Enumerable.class, "enumerator"),
ENUMERABLE_FOREACH(Enumerable.class, "foreach", Function1.class),
TYPED_GET_ELEMENT_TYPE(Typed.class, "getElementType"),
BINDABLE_BIND(Bindable.class, "bind", DataContext.class),
RESULT_SET_GET_DATE2(ResultSet.class, "getDate", int.class, Calendar.class),
RESULT_SET_GET_TIME2(ResultSet.class, "getTime", int.class, Calendar.class),
RESULT_SET_GET_TIMESTAMP2(ResultSet.class, "getTimestamp", int.class,
Calendar.class),
TIME_ZONE_GET_OFFSET(TimeZone.class, "getOffset", long.class),
LONG_VALUE(Number.class, "longValue"),
COMPARATOR_COMPARE(Comparator.class, "compare", Object.class, Object.class),
COLLECTIONS_REVERSE_ORDER(Collections.class, "reverseOrder"),
COLLECTIONS_EMPTY_LIST(Collections.class, "emptyList"),
COLLECTIONS_SINGLETON_LIST(Collections.class, "singletonList", Object.class),
COLLECTION_SIZE(Collection.class, "size"),
MAP_CLEAR(Map.class, "clear"),
MAP_GET(Map.class, "get", Object.class),
MAP_PUT(Map.class, "put", Object.class, Object.class),
COLLECTION_ADD(Collection.class, "add", Object.class),
LIST_GET(List.class, "get", int.class),
ITERATOR_HAS_NEXT(Iterator.class, "hasNext"),
ITERATOR_NEXT(Iterator.class, "next"),
MATH_MAX(Math.class, "max", int.class, int.class),
MATH_MIN(Math.class, "min", int.class, int.class),
SORTED_MULTI_MAP_PUT_MULTI(SortedMultiMap.class, "putMulti", Object.class,
Object.class),
SORTED_MULTI_MAP_ARRAYS(SortedMultiMap.class, "arrays", Comparator.class),
SORTED_MULTI_MAP_SINGLETON(SortedMultiMap.class, "singletonArrayIterator",
Comparator.class, List.class),
BINARY_SEARCH5_LOWER(BinarySearch.class, "lowerBound", Object[].class,
Object.class, int.class, int.class, Comparator.class),
BINARY_SEARCH5_UPPER(BinarySearch.class, "upperBound", Object[].class,
Object.class, int.class, int.class, Comparator.class),
BINARY_SEARCH6_LOWER(BinarySearch.class, "lowerBound", Object[].class,
Object.class, int.class, int.class, Function1.class, Comparator.class),
BINARY_SEARCH6_UPPER(BinarySearch.class, "upperBound", Object[].class,
Object.class, int.class, int.class, Function1.class, Comparator.class),
ARRAY_ITEM(SqlFunctions.class, "arrayItem", List.class, int.class),
MAP_ITEM(SqlFunctions.class, "mapItem", Map.class, Object.class),
ANY_ITEM(SqlFunctions.class, "item", Object.class, Object.class),
UPPER(SqlFunctions.class, "upper", String.class),
LOWER(SqlFunctions.class, "lower", String.class),
INITCAP(SqlFunctions.class, "initcap", String.class),
SUBSTRING(SqlFunctions.class, "substring", String.class, int.class,
int.class),
CHAR_LENGTH(SqlFunctions.class, "charLength", String.class),
STRING_CONCAT(SqlFunctions.class, "concat", String.class, String.class),
OVERLAY(SqlFunctions.class, "overlay", String.class, String.class, int.class),
OVERLAY3(SqlFunctions.class, "overlay", String.class, String.class, int.class,
int.class),
POSITION(SqlFunctions.class, "position", String.class, String.class),
TRUNCATE(SqlFunctions.class, "truncate", String.class, int.class),
TRIM(SqlFunctions.class, "trim", boolean.class, boolean.class, String.class,
String.class),
LTRIM(SqlFunctions.class, "ltrim", String.class),
RTRIM(SqlFunctions.class, "rtrim", String.class),
LIKE(SqlFunctions.class, "like", String.class, String.class),
SIMILAR(SqlFunctions.class, "similar", String.class, String.class),
IS_TRUE(SqlFunctions.class, "isTrue", Boolean.class),
IS_NOT_FALSE(SqlFunctions.class, "isNotFalse", Boolean.class),
MODIFIABLE_TABLE_GET_MODIFIABLE_COLLECTION(ModifiableTable.class,
"getModifiableCollection"),
STRING_TO_BOOLEAN(SqlFunctions.class, "toBoolean", String.class),
UNIX_DATE_TO_STRING(SqlFunctions.class, "unixDateToString", int.class),
UNIX_TIME_TO_STRING(SqlFunctions.class, "unixTimeToString", int.class),
UNIX_TIMESTAMP_TO_STRING(SqlFunctions.class, "unixTimestampToString",
long.class),
INTERVAL_YEAR_MONTH_TO_STRING(SqlFunctions.class, "intervalYearMonthToString",
int.class, SqlFunctions.TimeUnitRange.class),
INTERVAL_DAY_TIME_TO_STRING(SqlFunctions.class, "intervalDayTimeToString",
long.class, SqlFunctions.TimeUnitRange.class, int.class),
UNIX_DATE_EXTRACT(SqlFunctions.class, "unixDateExtract",
SqlFunctions.TimeUnitRange.class, long.class),
CURRENT_TIMESTAMP(SqlFunctions.class, "currentTimestamp", DataContext.class),
CURRENT_TIME(SqlFunctions.class, "currentTime", DataContext.class),
CURRENT_DATE(SqlFunctions.class, "currentDate", DataContext.class),
LOCAL_TIMESTAMP(SqlFunctions.class, "localTimestamp", DataContext.class),
LOCAL_TIME(SqlFunctions.class, "localTime", DataContext.class),
BOOLEAN_TO_STRING(SqlFunctions.class, "toString", boolean.class),
JDBC_ARRAY_TO_LIST(SqlFunctions.class, "arrayToList", java.sql.Array.class),
OBJECT_TO_STRING(Object.class, "toString"),
OBJECTS_EQUAL(com.google.common.base.Objects.class, "equal", Object.class,
Object.class),
ROUND_LONG(SqlFunctions.class, "round", long.class, long.class),
ROUND_INT(SqlFunctions.class, "round", int.class, int.class),
DATE_TO_INT(SqlFunctions.class, "toInt", java.util.Date.class),
DATE_TO_INT_OPTIONAL(SqlFunctions.class, "toIntOptional",
java.util.Date.class),
TIME_TO_INT(SqlFunctions.class, "toInt", Time.class),
TIME_TO_INT_OPTIONAL(SqlFunctions.class, "toIntOptional", Time.class),
TIMESTAMP_TO_LONG(SqlFunctions.class, "toLong", java.util.Date.class),
TIMESTAMP_TO_LONG_OFFSET(SqlFunctions.class, "toLong", java.util.Date.class,
TimeZone.class),
TIMESTAMP_TO_LONG_OPTIONAL(SqlFunctions.class, "toLongOptional",
Timestamp.class),
TIMESTAMP_TO_LONG_OPTIONAL_OFFSET(SqlFunctions.class, "toLongOptional",
Timestamp.class, TimeZone.class),
SLICE(SqlFunctions.class, "slice", List.class),
ELEMENT(SqlFunctions.class, "element", List.class),
SELECTIVITY(Selectivity.class, "getSelectivity", RexNode.class),
UNIQUE_KEYS(UniqueKeys.class, "getUniqueKeys", boolean.class),
COLUMN_UNIQUENESS(ColumnUniqueness.class, "areColumnsUnique", BitSet.class,
boolean.class),
ROW_COUNT(RowCount.class, "getRowCount"),
DISTINCT_ROW_COUNT(DistinctRowCount.class, "getDistinctRowCount",
BitSet.class, RexNode.class),
PERCENTAGE_ORIGINAL_ROWS(PercentageOriginalRows.class,
"getPercentageOriginalRows"),
POPULATION_SIZE(PopulationSize.class, "getPopulationSize", BitSet.class),
COLUMN_ORIGIN(ColumnOrigin.class, "getColumnOrigins", int.class),
CUMULATIVE_COST(CumulativeCost.class, "getCumulativeCost"),
NON_CUMULATIVE_COST(NonCumulativeCost.class, "getNonCumulativeCost"),
EXPLAIN_VISIBILITY(ExplainVisibility.class, "isVisibleInExplain",
SqlExplainLevel.class),
DATA_CONTEXT_GET_QUERY_PROVIDER(DataContext.class, "getQueryProvider"),
METADATA_REL(Metadata.class, "rel");
public final Method method;
public final Constructor constructor;
public static final ImmutableMap<Method, BuiltinMethod> MAP;
static {
final ImmutableMap.Builder<Method, BuiltinMethod> builder =
ImmutableMap.builder();
for (BuiltinMethod value : BuiltinMethod.values()) {
if (value.method != null) {
builder.put(value.method, value);
}
}
MAP = builder.build();
}
BuiltinMethod(Class clazz, String methodName, Class... argumentTypes) {
this.method = Types.lookupMethod(clazz, methodName, argumentTypes);
this.constructor = null;
}
BuiltinMethod(Class clazz, Class... argumentTypes) {
this.method = null;
this.constructor = Types.lookupConstructor(clazz, argumentTypes);
}
}
// End BuiltinMethod.java
| {
"pile_set_name": "Github"
} |
@extends('layouts.email')
@section('subject')
{{ env('APP_NAME') }} - Enquiry for Instructor
@endsection
@section('content')
Dear Instructor,<br/>
<p>We would like to inform you that a user has requested a enquiry. The enquiry details are:</p>
<p>
Full Name: {{ $enquiry->full_name }}<br/>
Email ID : {{ $enquiry->email_id }}<br/>
Message :{{ $enquiry->message }}<br/>
</p>
@endsection
| {
"pile_set_name": "Github"
} |
/*
Language: Bash
Author: vah <[email protected]>
*/
hljs.LANGUAGES.bash = function(){
var BASH_LITERAL = {'true' : 1, 'false' : 1};
var VAR1 = {
className: 'variable',
begin: '\\$([a-zA-Z0-9_]+)\\b'
};
var VAR2 = {
className: 'variable',
begin: '\\$\\{(([^}])|(\\\\}))+\\}',
contains: [hljs.C_NUMBER_MODE]
};
var STRING = {
className: 'string',
begin: '"', end: '"',
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
relevance: 0
};
var TEST_CONDITION = {
className: 'test_condition',
begin: '', end: '',
contains: [STRING, VAR1, VAR2, hljs.C_NUMBER_MODE],
keywords: {
'literal': BASH_LITERAL
},
relevance: 0
};
return {
defaultMode: {
keywords: {
'keyword': {'if' : 1, 'then' : 1, 'else' : 1, 'fi' : 1, 'for' : 1, 'break' : 1, 'continue' : 1, 'while' : 1, 'in' : 1, 'do' : 1, 'done' : 1, 'echo' : 1, 'exit' : 1, 'return' : 1, 'set' : 1, 'declare' : 1},
'literal': BASH_LITERAL
},
contains: [
{
className: 'shebang',
begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
relevance: 10
},
hljs.HASH_COMMENT_MODE,
hljs.C_NUMBER_MODE,
STRING,
VAR1,
VAR2,
hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
]
}
};
}();
| {
"pile_set_name": "Github"
} |
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT
package ai.verta.modeldb.versioning.autogenerated._public.modeldb.versioning.model;
import ai.verta.modeldb.versioning.*;
import ai.verta.modeldb.versioning.blob.diff.*;
import com.pholser.junit.quickcheck.generator.*;
import com.pholser.junit.quickcheck.generator.java.util.*;
import com.pholser.junit.quickcheck.random.*;
import java.util.*;
public class AutogenQueryDatasetComponentBlobGen
extends Generator<AutogenQueryDatasetComponentBlob> {
public AutogenQueryDatasetComponentBlobGen() {
super(AutogenQueryDatasetComponentBlob.class);
}
@Override
public AutogenQueryDatasetComponentBlob generate(SourceOfRandomness r, GenerationStatus status) {
// if (r.nextBoolean())
// return null;
AutogenQueryDatasetComponentBlob obj = new AutogenQueryDatasetComponentBlob();
if (r.nextBoolean()) {
obj.setDataSourceUri(Utils.removeEmpty(new StringGenerator().generate(r, status)));
}
if (r.nextBoolean()) {
obj.setExecutionTimestamp(Utils.removeEmpty(gen().type(Long.class).generate(r, status)));
}
if (r.nextBoolean()) {
obj.setNumRecords(Utils.removeEmpty(gen().type(Long.class).generate(r, status)));
}
if (r.nextBoolean()) {
obj.setQuery(Utils.removeEmpty(new StringGenerator().generate(r, status)));
}
return obj;
}
}
| {
"pile_set_name": "Github"
} |
hg = require 'mercury'
Promise = require 'bluebird'
{h} = hg
listeners = []
log = (msg) -> #console.log(msg)
{TreeView, TreeViewItem, TreeViewUtils} = require './TreeView'
gotoBreakpoint = (breakpoint) ->
atom.workspace.open(breakpoint.script, {
initialLine: breakpoint.line
initialColumn: 0
activatePane: true
searchAllPanes: true
})
exports.create = (_debugger) ->
builder =
listBreakpoints: () ->
log "builder.listBreakpoints"
Promise.resolve(_debugger.breakpointManager.breakpoints)
breakpoint: (breakpoint) ->
log "builder.breakpoint"
TreeViewItem(
TreeViewUtils.createFileRefHeader breakpoint.script, breakpoint.line+1
handlers: { click: () -> gotoBreakpoint(breakpoint) }
)
root: () ->
TreeView("Breakpoints", (() -> builder.listBreakpoints().map(builder.breakpoint)), isRoot: true)
BreakpointPanel = () ->
state = builder.root()
refresh = () -> TreeView.populate(state)
listeners.push _debugger.onAddBreakpoint refresh
listeners.push _debugger.onRemoveBreakpoint refresh
listeners.push _debugger.onBreak refresh
return state
BreakpointPanel.render = (state) ->
TreeView.render(state)
BreakpointPanel.cleanup = () ->
for remove in listeners
remove()
return BreakpointPanel
| {
"pile_set_name": "Github"
} |
#!/bin/bash
pushd "$(dirname "$0")" >/dev/null
ROOT="$(pwd -P)"/../..
# look for kazoo release root directory
DEFAULT_ROOT=${KAZOO_ROOT:-${ROOT}/_rel/kazoo}
if [ -d "$DEFAULT_ROOT/_rel/kazoo" ]; then
DEFAULT_ROOT="$DEFAULT_ROOT/_rel/kazoo"
elif [ -d "$DEFAULT_ROOT/bin" ]; then
DEFAULT_ROOT="$DEFAULT_ROOT"
elif [ -d /opt/kazoo/_rel/kazoo ]; then
DEFAULT_ROOT="/opt/kazoo/_rel/kazoo"
elif [ -d /opt/kazoo/bin ]; then
DEFAULT_ROOT="/opt/kazoo"
else
echo "Can't find Kazoo release root directory, is the release built?"
echo "Checked ${DEFAULT_ROOT} for release and bin dir"
exit -1
fi
echo "Release path: $DEFAULT_ROOT"
# look for kazoo config file path
if [ -f "$KAZOO_CONFIG" ]; then
KAZOO_CONFIG="$KAZOO_CONFIG"
elif [ -f $HOME/config.ini ]; then
KAZOO_CONFIG=$HOME/config.ini
elif [ -f /etc/kazoo/config.ini ]; then
KAZOO_CONFIG="/etc/kazoo/config.ini"
elif [ -f /etc/kazoo/core/config.ini ]; then
KAZOO_CONFIG="/etc/kazoo/core/config.ini"
else
echo "Kazoo config doesn't exists, please provide readable kazoo config file"
exit -1
fi
echo "Kazoo config file path: $KAZOO_CONFIG"
KAZOO_NODE=${KAZOO_NODE:-"kazoo_apps"}
NODE_NAME=${NODE_NAME:-"$KAZOO_NODE"}
echo "Node name: $NODE_NAME"
COOKIE=${COOKIE:-"change_me"}
echo "Cookie: $COOKIE"
CMD=$1
if [ "$CMD" = "" ]; then
CMD=console
else
shift
fi
export RELX_REPLACE_OS_VARS=true
export RELX_MULTI_NODE=true
export KAZOO_NODE="$NODE_NAME"
export KAZOO_COOKIE="$COOKIE"
exec "$DEFAULT_ROOT"/bin/kazoo $CMD "$*"
| {
"pile_set_name": "Github"
} |
[reconnect-during-disconnected-event.https.window.html]
[A device that reconnects during the gattserverdisconnected event should still receive gattserverdisconnected events after re-connection.]
expected: FAIL
| {
"pile_set_name": "Github"
} |
package com.hfad.starbuzz;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class StarbuzzDatabaseHelper extends SQLiteOpenHelper {
private static final String DB_NAME = "starbuzz"; // the name of our database
private static final int DB_VERSION = 2; // the version of the database
StarbuzzDatabaseHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
updateMyDatabase(db, 0, DB_VERSION);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
updateMyDatabase(db, oldVersion, newVersion);
}
private static void insertDrink(SQLiteDatabase db, String name, String description,
int resourceId) {
ContentValues drinkValues = new ContentValues();
drinkValues.put("NAME", name);
drinkValues.put("DESCRIPTION", description);
drinkValues.put("IMAGE_RESOURCE_ID", resourceId);
db.insert("DRINK", null, drinkValues);
}
private void updateMyDatabase(SQLiteDatabase db, int oldVersion, int newVersion) {
if (oldVersion < 1) {
db.execSQL("CREATE TABLE DRINK (_id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "NAME TEXT, "
+ "DESCRIPTION TEXT, "
+ "IMAGE_RESOURCE_ID INTEGER);");
insertDrink(db, "Latte", "Espresso and steamed milk", R.drawable.latte);
insertDrink(db, "Cappuccino", "Espresso, hot milk and steamed-milk foam",
R.drawable.cappuccino);
insertDrink(db, "Filter", "Our best drip coffee", R.drawable.filter);
}
if (oldVersion < 2) {
db.execSQL("ALTER TABLE DRINK ADD COLUMN FAVORITE NUMERIC;");
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2011-2012 Bryce Adelstein-Lelbach
// Copyright (c) 2007-2012 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <hpx/config/defines.hpp> // avoid issues with Intel14/libstdc++4.4 nullptr
#include <hpx/modules/program_options.hpp>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iostream>
#include <numeric>
#include <random>
#include <stdexcept>
#include <vector>
#include <utility>
using hpx::program_options::variables_map;
using hpx::program_options::options_description;
using hpx::program_options::value;
using hpx::program_options::store;
using hpx::program_options::command_line_parser;
using hpx::program_options::notify;
///////////////////////////////////////////////////////////////////////////////
// Command-line variables.
std::uint64_t tasks = 500000;
std::uint64_t min_delay = 0;
std::uint64_t max_delay = 0;
std::uint64_t total_delay = 0;
std::uint64_t seed = 0;
///////////////////////////////////////////////////////////////////////////////
std::uint64_t shuffler(
std::mt19937_64& prng
, std::uint64_t high
)
{
if (high == 0)
throw std::logic_error("high value was 0");
// Our range is [0, x).
std::uniform_int_distribution<std::uint64_t>
dist(0, high - 1);
return dist(prng);
}
///////////////////////////////////////////////////////////////////////////////
int app_main(
variables_map&
)
{
///////////////////////////////////////////////////////////////////////
// Initialize the PRNG seed.
if (!seed)
seed = std::uint64_t(std::time(nullptr));
///////////////////////////////////////////////////////////////////////
// Validate command-line arguments.
if (0 == tasks)
throw std::invalid_argument("count of 0 tasks specified\n");
if (min_delay > max_delay)
throw std::invalid_argument("minimum delay cannot be larger than "
"maximum delay\n");
if (min_delay > total_delay)
throw std::invalid_argument("minimum delay cannot be larger than"
"total delay\n");
if (max_delay > total_delay)
throw std::invalid_argument("maximum delay cannot be larger than "
"total delay\n");
if ((min_delay * tasks) > total_delay)
throw std::invalid_argument("minimum delay is too small for the "
"specified total delay and number of "
"tasks\n");
if ((max_delay * tasks) < total_delay)
throw std::invalid_argument("maximum delay is too small for the "
"specified total delay and number of "
"tasks\n");
///////////////////////////////////////////////////////////////////////
// Randomly generate a description of the heterogeneous workload.
std::vector<std::uint64_t> payloads;
payloads.reserve(tasks);
// For random numbers, we use a 64-bit specialization of stdlib's
// mersenne twister engine (good uniform distribution up to 311
// dimensions, cycle length 2 ^ 19937 - 1)
std::mt19937_64 prng(seed);
std::uint64_t current_sum = 0;
for (std::uint64_t i = 0; i < tasks; ++i)
{
// Credit to Spencer Ruport for putting this algorithm on
// stackoverflow.
std::uint64_t const low_calc
= (total_delay - current_sum) - (max_delay * (tasks - 1 - i));
bool const negative
= (total_delay - current_sum) < (max_delay * (tasks - 1 - i));
std::uint64_t const low
= (negative || (low_calc < min_delay)) ? min_delay : low_calc;
std::uint64_t const high_calc
= (total_delay - current_sum) - (min_delay * (tasks - 1 - i));
std::uint64_t const high
= (high_calc > max_delay) ? max_delay : high_calc;
// Our range is [low, high].
std::uniform_int_distribution<std::uint64_t>
dist(low, high);
std::uint64_t const payload = dist(prng);
if (payload < min_delay)
throw std::logic_error("task delay is below minimum");
if (payload > max_delay)
throw std::logic_error("task delay is above maximum");
current_sum += payload;
payloads.push_back(payload);
}
// Randomly shuffle the entire sequence to deal with drift.
std::random_device random_device;
std::mt19937 generator(random_device());
std::shuffle(payloads.begin(), payloads.end(), std::move(generator));
///////////////////////////////////////////////////////////////////////
// Validate the payloads.
if (payloads.size() != tasks)
throw std::logic_error("incorrect number of tasks generated");
std::uint64_t const payloads_sum =
std::accumulate(payloads.begin(), payloads.end(), 0ULL);
if (payloads_sum != total_delay)
throw std::logic_error("incorrect total delay generated");
for (std::size_t i = 0; i < payloads.size(); ++i)
std::cout << payloads[i] << "\n";
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int main(
int argc
, char* argv[]
)
{
///////////////////////////////////////////////////////////////////////////
// Parse command line.
variables_map vm;
options_description cmdline("Usage: " HPX_APPLICATION_STRING " [options]");
cmdline.add_options()
( "help,h"
, "print out program usage (this message)")
( "tasks"
, value<std::uint64_t>(&tasks)->default_value(500000)
, "number of tasks to invoke")
( "min-delay"
, value<std::uint64_t>(&min_delay)->default_value(0)
, "minimum number of iterations in the delay loop")
( "max-delay"
, value<std::uint64_t>(&max_delay)->default_value(0)
, "maximum number of iterations in the delay loop")
( "total-delay"
, value<std::uint64_t>(&total_delay)->default_value(0)
, "total number of delay iterations to be executed")
( "seed"
, value<std::uint64_t>(&seed)->default_value(0)
, "seed for the pseudo random number generator (if 0, a seed is "
"chosen based on the current system time)")
;
store(command_line_parser(argc, argv).options(cmdline).run(), vm);
notify(vm);
// Print help screen.
if (vm.count("help"))
{
std::cout << cmdline;
return 0;
}
return app_main(vm);
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="WorklistDefinition" module="Products.DCWorkflow.Worklists"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Offered Purchase Orders to Follow (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
purchase_order_module/view?simulation_state=offered&portal_type=Purchase+Order&local_roles:list=Assignee&local_roles:list=Assignor&reset=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Offered Purchase Orders to Follow</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>4b_offered_purchase_order_list</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<tuple>
<string>Purchase Order</string>
</tuple>
</value>
</item>
<item>
<key> <string>simulation_state</string> </key>
<value>
<tuple>
<string>offered</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2017-2018 Matthias Fehring <[email protected]>
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "validatordifferent_p.h"
using namespace Cutelyst;
ValidatorDifferent::ValidatorDifferent(const QString &field, const QString &other, const char *otherLabel, const Cutelyst::ValidatorMessages &messages) :
ValidatorRule(*new ValidatorDifferentPrivate(field, other, otherLabel, messages))
{
}
ValidatorDifferent::~ValidatorDifferent()
{
}
ValidatorReturnType ValidatorDifferent::validate(Context *c, const ParamsMultiMap ¶ms) const
{
ValidatorReturnType result;
Q_D(const ValidatorDifferent);
const QString v = value(params);
const QString o = trimBefore() ? params.value(d->otherField).trimmed() : params.value(d->otherField);
if (!v.isEmpty()) {
if ((v == o)) {
result.errorMessage = validationError(c);
qCDebug(C_VALIDATOR, "ValidatorDifferent: Validation failed for value %s in field %s at %s::%s: the value in the %s field is not different.",
qPrintable(v),
qPrintable(field()),
qPrintable(c->controllerName()),
qPrintable(c->actionName()),
qPrintable(d->otherField));
} else {
result.value.setValue<QString>(v);
}
}
return result;
}
QString ValidatorDifferent::genericValidationError(Context *c, const QVariant &errorData) const
{
QString error;
Q_D(const ValidatorDifferent);
Q_UNUSED(errorData);
const QString _label = label(c);
const QString _otherLabel = d->otherLabel ? c->translate(d->translationContext.data(), d->otherLabel) : QString();
if (_label.isEmpty()) {
//: %1 will be replaced by the other field's label to compare with
error = c->translate("Cutelyst::ValidatorDifferent", "Has to be different from the value in the “%1” field.").arg(!_otherLabel.isEmpty() ? _otherLabel : d->otherField);
} else {
//: %1 will be replaced by the field label, %2 will be replaced by the other field's label to compare with
error = c->translate("Cutelyst::ValidatorDifferent", "The value in the “%1” field has to be different from the value in the “%2“ field.").arg(_label, !_otherLabel.isEmpty() ? _otherLabel : d->otherField);
}
return error;
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ('Level'),
'standard': ('Logger', 'Level', 'Source-Function'),
'long': ('Logger', 'Level', 'Source-File', 'Source-Line', 'Source-Function'),
'all': ('Logger', 'Level', 'Source-File', 'Source-Line', 'Source-Function', 'TimeStamp'),
'custom': ()
}
Senders = {}
class LogRecord:
def __init__(self, data):
offset = 0
self.headers = {}
for line in data.split("\r\n"):
offset += len(line)+2
if ':' not in line: break
key,value=line.split(":",1)
self.headers[key] = value.strip()
self.body = data[offset:]
def __getitem__(self, index):
return self.headers[index]
def format(self, sender_index, keys):
parts = ['['+str(sender_index)+']']
if 'Level' in keys:
parts.append('['+self.headers['Level']+']')
if 'Logger' in keys:
parts.append(self.headers['Logger'])
if 'TimeStamp' in keys:
parts.append(self.headers['TimeStamp'])
if 'Source-File' in keys:
if 'Source-Line' in keys:
parts.append(self.headers['Source-File']+':'+self.headers['Source-Line'])
else:
parts.append(self.headers['Source-File'])
if 'TimeStamp' in keys:
parts.append(self.headers['TimeStamp'])
if 'Source-Function' in keys:
parts.append(self.headers['Source-Function'])
parts.append(self.body)
return ' '.join(parts)
class Listener:
def __init__(self, format='standard', port=UDP_PORT):
self.socket = socket(AF_INET,SOCK_DGRAM)
self.socket.bind((UDP_ADDR, port))
self.format_keys = HEADER_KEYS[format]
def listen(self):
while True:
data,addr = self.socket.recvfrom(BUFFER_SIZE)
sender_index = len(Senders.keys())
if addr in Senders:
sender_index = Senders[addr]
else:
print "### NEW SENDER:", addr
Senders[addr] = sender_index
record = LogRecord(data)
print record.format(sender_index, self.format_keys)
### main
parser = OptionParser(usage="%prog [options]")
parser.add_option("-p", "--port", dest="port", help="port number to listen on", type="int", default=UDP_PORT)
parser.add_option("-f", "--format", dest="format", help="log format (mini, standard, long, or all)", choices=('mini', 'standard', 'long', 'all'), default='standard')
(options, args) = parser.parse_args()
print "Listening on port", options.port
l = Listener(format=options.format, port=options.port)
l.listen()
| {
"pile_set_name": "Github"
} |
<?php
namespace spec\Prophecy\Doubler;
use PhpSpec\ObjectBehavior;
use Prophecy\Doubler\Doubler;
use Prophecy\Prophecy\ProphecySubjectInterface;
class LazyDoubleSpec extends ObjectBehavior
{
function let(Doubler $doubler)
{
$this->beConstructedWith($doubler);
}
function it_returns_anonymous_double_instance_by_default($doubler, ProphecySubjectInterface $double)
{
$doubler->double(null, array())->willReturn($double);
$this->getInstance()->shouldReturn($double);
}
function it_returns_class_double_instance_if_set($doubler, ProphecySubjectInterface $double, \ReflectionClass $class)
{
$doubler->double($class, array())->willReturn($double);
$this->setParentClass($class);
$this->getInstance()->shouldReturn($double);
}
function it_returns_same_double_instance_if_called_2_times(
$doubler,
ProphecySubjectInterface $double1,
ProphecySubjectInterface $double2
) {
$doubler->double(null, array())->willReturn($double1);
$doubler->double(null, array())->willReturn($double2);
$this->getInstance()->shouldReturn($double2);
$this->getInstance()->shouldReturn($double2);
}
function its_setParentClass_throws_ClassNotFoundException_if_class_not_found()
{
$this->shouldThrow('Prophecy\Exception\Doubler\ClassNotFoundException')
->duringSetParentClass('SomeUnexistingClass');
}
function its_setParentClass_throws_exception_if_prophecy_is_already_created(
$doubler,
ProphecySubjectInterface $double
) {
$doubler->double(null, array())->willReturn($double);
$this->getInstance();
$this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
->duringSetParentClass('stdClass');
}
function its_addInterface_throws_InterfaceNotFoundException_if_no_interface_found()
{
$this->shouldThrow('Prophecy\Exception\Doubler\InterfaceNotFoundException')
->duringAddInterface('SomeUnexistingInterface');
}
function its_addInterface_throws_exception_if_prophecy_is_already_created(
$doubler,
ProphecySubjectInterface $double
) {
$doubler->double(null, array())->willReturn($double);
$this->getInstance();
$this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
->duringAddInterface('ArrayAccess');
}
}
| {
"pile_set_name": "Github"
} |
StartChar: uni06BA.medi_BaaBaaYaa
Encoding: 1115326 -1 1498
Width: 357
Flags: HW
AnchorPoint: "TashkilAbove" 96 801 basechar 0
AnchorPoint: "TashkilBelow" 251 -371 basechar 0
LayerCount: 2
Fore
Refer: 89 -1 N 1 0 0 1 0 0 2
EndChar
| {
"pile_set_name": "Github"
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Source Executable: c:\windows\system32\efslsaext.dll
// Interface ID: c681d488-d850-11d0-8c52-00c04fd90f7e
// Interface Version: 1.0
namespace rpc_c681d488_d850_11d0_8c52_00c04fd90f7e_1_0
{
#region Marshal Helpers
internal class _Marshal_Helper : NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer
{
public void Write_0(Struct_0 p0)
{
WriteStruct<Struct_0>(p0);
}
public void Write_1(Struct_1 p0)
{
WriteStruct<Struct_1>(p0);
}
public void Write_2(Struct_2 p0)
{
WriteStruct<Struct_2>(p0);
}
public void Write_3(Struct_3 p0)
{
WriteStruct<Struct_3>(p0);
}
public void Write_4(Struct_4 p0)
{
WriteStruct<Struct_4>(p0);
}
public void Write_5(Struct_5 p0)
{
WriteStruct<Struct_5>(p0);
}
public void Write_6(Struct_6 p0)
{
WriteStruct<Struct_6>(p0);
}
public void Write_7(Struct_7 p0)
{
WriteStruct<Struct_7>(p0);
}
public void Write_8(Struct_8 p0)
{
WriteStruct<Struct_8>(p0);
}
public void Write_9(Struct_9 p0)
{
WriteStruct<Struct_9>(p0);
}
public void Write_10(Struct_10 p0)
{
WriteStruct<Struct_10>(p0);
}
public void Write_11(Struct_1[] p0, long p1)
{
WriteConformantStructArray<Struct_1>(p0, p1);
}
public void Write_12(int[] p0, long p1)
{
WriteConformantArray<int>(p0, p1);
}
public void Write_13(sbyte[] p0)
{
WriteFixedPrimitiveArray<sbyte>(p0, 6);
}
public void Write_14(sbyte[] p0, long p1)
{
WriteConformantArray<sbyte>(p0, p1);
}
public void Write_15(Struct_6[] p0, long p1)
{
WriteConformantStructArray<Struct_6>(p0, p1);
}
public void Write_16(sbyte[] p0, long p1)
{
WriteConformantArray<sbyte>(p0, p1);
}
public void Write_17(sbyte[] p0, long p1)
{
WriteConformantArray<sbyte>(p0, p1);
}
public void Write_18(sbyte[] p0, long p1)
{
WriteConformantArray<sbyte>(p0, p1);
}
public void Write_19(NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> p0)
{
WritePipe<sbyte>(p0);
}
public void Write_20(NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> p0)
{
WritePipe<sbyte>(p0);
}
}
internal class _Unmarshal_Helper : NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer
{
public _Unmarshal_Helper(NtApiDotNet.Win32.Rpc.RpcClientResponse r) :
base(r.NdrBuffer, r.Handles, r.DataRepresentation)
{
}
public _Unmarshal_Helper(byte[] ba) :
base(ba)
{
}
public Struct_0 Read_0()
{
return ReadStruct<Struct_0>();
}
public Struct_1 Read_1()
{
return ReadStruct<Struct_1>();
}
public Struct_2 Read_2()
{
return ReadStruct<Struct_2>();
}
public Struct_3 Read_3()
{
return ReadStruct<Struct_3>();
}
public Struct_4 Read_4()
{
return ReadStruct<Struct_4>();
}
public Struct_5 Read_5()
{
return ReadStruct<Struct_5>();
}
public Struct_6 Read_6()
{
return ReadStruct<Struct_6>();
}
public Struct_7 Read_7()
{
return ReadStruct<Struct_7>();
}
public Struct_8 Read_8()
{
return ReadStruct<Struct_8>();
}
public Struct_9 Read_9()
{
return ReadStruct<Struct_9>();
}
public Struct_10 Read_10()
{
return ReadStruct<Struct_10>();
}
public Struct_1[] Read_11()
{
return ReadConformantStructArray<Struct_1>();
}
public int[] Read_12()
{
return ReadConformantArray<int>();
}
public sbyte[] Read_13()
{
return ReadFixedPrimitiveArray<sbyte>(6);
}
public sbyte[] Read_14()
{
return ReadConformantArray<sbyte>();
}
public Struct_6[] Read_15()
{
return ReadConformantStructArray<Struct_6>();
}
public sbyte[] Read_16()
{
return ReadConformantArray<sbyte>();
}
public sbyte[] Read_17()
{
return ReadConformantArray<sbyte>();
}
public sbyte[] Read_18()
{
return ReadConformantArray<sbyte>();
}
public NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> Read_19()
{
return ReadPipe<sbyte>();
}
public NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> Read_20()
{
return ReadPipe<sbyte>();
}
}
#endregion
#region Complex Types
public struct Struct_0 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<Struct_1[], long>(Member8, new System.Action<Struct_1[], long>(m.Write_11), Member0);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_1[]>(new System.Func<Struct_1[]>(u.Read_11), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_1[]> Member8;
public static Struct_0 CreateDefault()
{
return new Struct_0();
}
public Struct_0(int Member0, Struct_1[] Member8)
{
this.Member0 = Member0;
this.Member8 = Member8;
}
}
public struct Struct_1 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<Struct_2>(Member8, new System.Action<Struct_2>(m.Write_2));
m.WriteEmbeddedPointer<Struct_4>(Member10, new System.Action<Struct_4>(m.Write_4));
m.WriteEmbeddedPointer<string>(Member18, new System.Action<string>(m.WriteTerminatedString));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_2>(new System.Func<Struct_2>(u.Read_2), false);
Member10 = u.ReadEmbeddedPointer<Struct_4>(new System.Func<Struct_4>(u.Read_4), false);
Member18 = u.ReadEmbeddedPointer<string>(new System.Func<string>(u.ReadConformantVaryingString), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_2> Member8;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_4> Member10;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<string> Member18;
public static Struct_1 CreateDefault()
{
return new Struct_1();
}
public Struct_1(int Member0, System.Nullable<Struct_2> Member8, System.Nullable<Struct_4> Member10, string Member18)
{
this.Member0 = Member0;
this.Member8 = Member8;
this.Member10 = Member10;
this.Member18 = Member18;
}
}
public struct Struct_2 : NtApiDotNet.Ndr.Marshal.INdrConformantStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteSByte(Member0);
m.WriteSByte(Member1);
m.Write_3(Member2);
m.Write_12(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(Member8, "Member8"), Member1);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadSByte();
Member1 = u.ReadSByte();
Member2 = u.Read_3();
Member8 = u.Read_12();
}
int NtApiDotNet.Ndr.Marshal.INdrConformantStructure.GetConformantDimensions()
{
return 1;
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public sbyte Member0;
public sbyte Member1;
public Struct_3 Member2;
public int[] Member8;
public static Struct_2 CreateDefault()
{
Struct_2 ret = new Struct_2();
ret.Member8 = new int[0];
return ret;
}
public Struct_2(sbyte Member0, sbyte Member1, Struct_3 Member2, int[] Member8)
{
this.Member0 = Member0;
this.Member1 = Member1;
this.Member2 = Member2;
this.Member8 = Member8;
}
}
public struct Struct_3 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.Write_13(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(Member0, "Member0"));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.Read_13();
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 1;
}
public sbyte[] Member0;
public static Struct_3 CreateDefault()
{
Struct_3 ret = new Struct_3();
ret.Member0 = new sbyte[6];
return ret;
}
public Struct_3(sbyte[] Member0)
{
this.Member0 = Member0;
}
}
public struct Struct_4 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<sbyte[], long>(Member8, new System.Action<sbyte[], long>(m.Write_14), Member0);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<sbyte[]>(new System.Func<sbyte[]>(u.Read_14), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<sbyte[]> Member8;
public static Struct_4 CreateDefault()
{
return new Struct_4();
}
public Struct_4(int Member0, sbyte[] Member8)
{
this.Member0 = Member0;
this.Member8 = Member8;
}
}
public struct Struct_5 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<Struct_6[], long>(Member8, new System.Action<Struct_6[], long>(m.Write_15), Member0);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_6[]>(new System.Func<Struct_6[]>(u.Read_15), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_6[]> Member8;
public static Struct_5 CreateDefault()
{
return new Struct_5();
}
public Struct_5(int Member0, Struct_6[] Member8)
{
this.Member0 = Member0;
this.Member8 = Member8;
}
}
public struct Struct_6 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<Struct_2>(Member8, new System.Action<Struct_2>(m.Write_2));
m.WriteEmbeddedPointer<Struct_7>(Member10, new System.Action<Struct_7>(m.Write_7));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_2>(new System.Func<Struct_2>(u.Read_2), false);
Member10 = u.ReadEmbeddedPointer<Struct_7>(new System.Func<Struct_7>(u.Read_7), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_2> Member8;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_7> Member10;
public static Struct_6 CreateDefault()
{
return new Struct_6();
}
public Struct_6(int Member0, System.Nullable<Struct_2> Member8, System.Nullable<Struct_7> Member10)
{
this.Member0 = Member0;
this.Member8 = Member8;
this.Member10 = Member10;
}
}
public struct Struct_7 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteInt32(Member4);
m.WriteEmbeddedPointer<sbyte[], long>(Member8, new System.Action<sbyte[], long>(m.Write_16), Member4);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member4 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<sbyte[]>(new System.Func<sbyte[]>(u.Read_16), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public int Member4;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<sbyte[]> Member8;
public static Struct_7 CreateDefault()
{
return new Struct_7();
}
public Struct_7(int Member0, int Member4, sbyte[] Member8)
{
this.Member0 = Member0;
this.Member4 = Member4;
this.Member8 = Member8;
}
}
public struct Struct_8 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<sbyte[], long>(Member8, new System.Action<sbyte[], long>(m.Write_17), Member0);
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<sbyte[]>(new System.Func<sbyte[]>(u.Read_17), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<sbyte[]> Member8;
public static Struct_8 CreateDefault()
{
return new Struct_8();
}
public Struct_8(int Member0, sbyte[] Member8)
{
this.Member0 = Member0;
this.Member8 = Member8;
}
}
public struct Struct_9 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteInt32(Member4);
m.WriteEmbeddedPointer<sbyte[], long>(Member8, new System.Action<sbyte[], long>(m.Write_18), NtApiDotNet.Win32.Rpc.RpcUtils.OpPlus(Member4, Member0));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member4 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<sbyte[]>(new System.Func<sbyte[]>(u.Read_18), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public int Member4;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<sbyte[]> Member8;
public static Struct_9 CreateDefault()
{
return new Struct_9();
}
public Struct_9(int Member0, int Member4, sbyte[] Member8)
{
this.Member0 = Member0;
this.Member4 = Member4;
this.Member8 = Member8;
}
}
public struct Struct_10 : NtApiDotNet.Ndr.Marshal.INdrStructure
{
void NtApiDotNet.Ndr.Marshal.INdrStructure.Marshal(NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer m)
{
Marshal(((_Marshal_Helper)(m)));
}
private void Marshal(_Marshal_Helper m)
{
m.WriteInt32(Member0);
m.WriteEmbeddedPointer<Struct_0>(Member8, new System.Action<Struct_0>(m.Write_0));
m.WriteEmbeddedPointer<Struct_6>(Member10, new System.Action<Struct_6>(m.Write_6));
m.WriteEmbeddedPointer<Struct_8>(Member18, new System.Action<Struct_8>(m.Write_8));
}
void NtApiDotNet.Ndr.Marshal.INdrStructure.Unmarshal(NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer u)
{
Unmarshal(((_Unmarshal_Helper)(u)));
}
private void Unmarshal(_Unmarshal_Helper u)
{
Member0 = u.ReadInt32();
Member8 = u.ReadEmbeddedPointer<Struct_0>(new System.Func<Struct_0>(u.Read_0), false);
Member10 = u.ReadEmbeddedPointer<Struct_6>(new System.Func<Struct_6>(u.Read_6), false);
Member18 = u.ReadEmbeddedPointer<Struct_8>(new System.Func<Struct_8>(u.Read_8), false);
}
int NtApiDotNet.Ndr.Marshal.INdrStructure.GetAlignment()
{
return 4;
}
public int Member0;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_0> Member8;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_6> Member10;
public NtApiDotNet.Ndr.Marshal.NdrEmbeddedPointer<Struct_8> Member18;
public static Struct_10 CreateDefault()
{
return new Struct_10();
}
public Struct_10(int Member0, System.Nullable<Struct_0> Member8, System.Nullable<Struct_6> Member10, System.Nullable<Struct_8> Member18)
{
this.Member0 = Member0;
this.Member8 = Member8;
this.Member10 = Member10;
this.Member18 = Member18;
}
}
#endregion
#region Client Implementation
public sealed class Client : NtApiDotNet.Win32.Rpc.RpcClientBase
{
public Client() :
base("c681d488-d850-11d0-8c52-00c04fd90f7e", 1, 0)
{
}
private _Unmarshal_Helper SendReceive(int p, _Marshal_Helper m)
{
return new _Unmarshal_Helper(SendReceive(p, m.DataRepresentation, m.ToArray(), m.Handles));
}
public int EfsRpcOpenFileRaw_Downlevel(out NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, string p1, int p2)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p1, "p1"));
m.WriteInt32(p2);
_Unmarshal_Helper u = SendReceive(0, m);
p0 = u.ReadContextHandle();
return u.ReadInt32();
}
public int EfsRpcReadFileRaw_Downlevel(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, out NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteContextHandle(p0);
_Unmarshal_Helper u = SendReceive(1, m);
p1 = u.Read_19();
return u.ReadInt32();
}
public int EfsRpcWriteFileRaw_Downlevel(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, NtApiDotNet.Ndr.Marshal.NdrPipe<sbyte> p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteContextHandle(p0);
m.Write_20(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p1, "p1"));
_Unmarshal_Helper u = SendReceive(2, m);
return u.ReadInt32();
}
public void EfsRpcCloseRaw_Downlevel(ref NtApiDotNet.Ndr.Marshal.NdrContextHandle p0)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteContextHandle(p0);
_Unmarshal_Helper u = SendReceive(3, m);
p0 = u.ReadContextHandle();
}
public int EfsRpcEncryptFileSrv_Downlevel(string p0)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
_Unmarshal_Helper u = SendReceive(4, m);
return u.ReadInt32();
}
public int EfsRpcDecryptFileSrv_Downlevel(string p0, int p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.WriteInt32(p1);
_Unmarshal_Helper u = SendReceive(5, m);
return u.ReadInt32();
}
public int EfsRpcQueryUsersOnFile_Downlevel(string p0, out System.Nullable<Struct_0> p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
_Unmarshal_Helper u = SendReceive(6, m);
p1 = u.ReadReferentValue<Struct_0>(new System.Func<Struct_0>(u.Read_0), false);
return u.ReadInt32();
}
public int EfsRpcQueryRecoveryAgents_Downlevel(string p0, out System.Nullable<Struct_0> p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
_Unmarshal_Helper u = SendReceive(7, m);
p1 = u.ReadReferentValue<Struct_0>(new System.Func<Struct_0>(u.Read_0), false);
return u.ReadInt32();
}
public int EfsRpcRemoveUsersFromFile_Downlevel(string p0, Struct_0 p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.Write_0(p1);
_Unmarshal_Helper u = SendReceive(8, m);
return u.ReadInt32();
}
public int EfsRpcAddUsersToFile_Downlevel(string p0, Struct_5 p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.Write_5(p1);
_Unmarshal_Helper u = SendReceive(9, m);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel(System.Nullable<Struct_6> p0, int p1, int p2)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteReferent(p0, new System.Action<Struct_6>(m.Write_6));
m.WriteInt32(p1);
m.WriteInt32(p2);
_Unmarshal_Helper u = SendReceive(10, m);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_11(string p0, string p1, int p2, int p3, System.Nullable<Struct_8> p4, int p5)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p1, "p1"));
m.WriteInt32(p2);
m.WriteInt32(p3);
m.WriteReferent(p4, new System.Action<Struct_8>(m.Write_8));
m.WriteInt32(p5);
_Unmarshal_Helper u = SendReceive(11, m);
return u.ReadInt32();
}
public int EfsRpcFileKeyInfo_Downlevel(string p0, int p1, out System.Nullable<Struct_8> p2)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.WriteInt32(p1);
_Unmarshal_Helper u = SendReceive(12, m);
p2 = u.ReadReferentValue<Struct_8>(new System.Func<Struct_8>(u.Read_8), false);
return u.ReadInt32();
}
public int EfsRpcDuplicateEncryptionInfoFile_Downlevel(string p0, string p1, int p2, int p3, System.Nullable<Struct_8> p4, int p5)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p1, "p1"));
m.WriteInt32(p2);
m.WriteInt32(p3);
m.WriteReferent(p4, new System.Action<Struct_8>(m.Write_8));
m.WriteInt32(p5);
_Unmarshal_Helper u = SendReceive(13, m);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_14(Struct_4 p0, Struct_9 p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.Write_4(p0);
m.Write_9(p1);
_Unmarshal_Helper u = SendReceive(14, m);
return u.ReadInt32();
}
public int EfsRpcAddUsersToFileEx_Downlevel(int p0, System.Nullable<Struct_8> p1, string p2, Struct_5 p3)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteInt32(p0);
m.WriteReferent(p1, new System.Action<Struct_8>(m.Write_8));
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p2, "p2"));
m.Write_5(p3);
_Unmarshal_Helper u = SendReceive(15, m);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_16(int p0, System.Nullable<Struct_8> p1, string p2, int p3, out System.Nullable<Struct_8> p4)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteInt32(p0);
m.WriteReferent(p1, new System.Action<Struct_8>(m.Write_8));
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p2, "p2"));
m.WriteInt32(p3);
_Unmarshal_Helper u = SendReceive(16, m);
p4 = u.ReadReferentValue<Struct_8>(new System.Func<Struct_8>(u.Read_8), false);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_17(out System.Nullable<Struct_8> p0)
{
_Marshal_Helper m = new _Marshal_Helper();
_Unmarshal_Helper u = SendReceive(17, m);
p0 = u.ReadReferentValue<Struct_8>(new System.Func<Struct_8>(u.Read_8), false);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_18(string p0, out System.Nullable<Struct_8> p1)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
_Unmarshal_Helper u = SendReceive(18, m);
p1 = u.ReadReferentValue<Struct_8>(new System.Func<Struct_8>(u.Read_8), false);
return u.ReadInt32();
}
public int EfsRpcSetEncryptedFileMetadata_Downlevel_19(string p0, System.Nullable<Struct_8> p1, Struct_8 p2, System.Nullable<Struct_10> p3)
{
_Marshal_Helper m = new _Marshal_Helper();
m.WriteTerminatedString(NtApiDotNet.Win32.Rpc.RpcUtils.CheckNull(p0, "p0"));
m.WriteReferent(p1, new System.Action<Struct_8>(m.Write_8));
m.Write_8(p2);
m.WriteReferent(p3, new System.Action<Struct_10>(m.Write_10));
_Unmarshal_Helper u = SendReceive(19, m);
return u.ReadInt32();
}
public int EfsRpcFlushEfsCache_Downlevel()
{
_Marshal_Helper m = new _Marshal_Helper();
_Unmarshal_Helper u = SendReceive(20, m);
return u.ReadInt32();
}
}
#endregion
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env ruby
#---
# Copyright 2003, 2004, 2005, 2006, 2007 by Jim Weirich ([email protected]).
# All rights reserved.
# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#+++
class FlexMock
# #################################################################
# The ordering module contains the methods and data structures used
# to determine proper orderring of mocked calls. By providing the
# functionality in a module, a individual mock object can order its
# own calls, and the container can provide ordering at a global
# level.
module Ordering
# Allocate the next available order number.
def flexmock_allocate_order
@flexmock_allocated_order ||= 0
@flexmock_allocated_order += 1
end
# Hash of groups defined in this ordering.
def flexmock_groups
@flexmock_groups ||= {}
end
# Current order number in this ordering.
def flexmock_current_order
@flexmock_current_order ||= 0
end
# Set the current order for this ordering.
def flexmock_current_order=(value)
@flexmock_current_order = value
end
def flexmock_validate_order(method_name, order_number)
FlexMock.check("method #{method_name} called out of order " +
"(expected order #{order_number}, was #{flexmock_current_order})") {
order_number >= self.flexmock_current_order
}
self.flexmock_current_order = order_number
end
end
end
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<title>Template String</title>
<meta name="description" content="Simple templating using the most barebones interpolation method, ES6 template strings"></meta>
<meta property="og:image" content="https://raw.githubusercontent.com/supermedium/superframe/master/components/template/examples/template-string/preview.png"></meta>
<script src="../build.js"></script>
</head>
<body>
<a-scene>
<a-entity>
<a-entity template="src: cubes.template" data-color="#FA8572"
data-position="-4 0 -8"></a-entity>
<a-entity template="src: cubes.template" data-color="#B24968"
data-position="0 4 -8"></a-entity>
<a-entity template="src: cubes.template" data-color="#6C3779"
data-position="4 0 -8"></a-entity>
</a-entity>
<a-sky color="#6C5FA7"></a-sky>
</a-scene>
<!--githubcorner-->
<a href="https://github.com/supermedium/superframe/tree/master/components/template/examples/template-string/" class="github-corner">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill: #111; color: #EFEFEF; position: fixed; bottom: 0; border: 0; left: 0; transform: rotate(180deg); opacity: 0.8">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
</style>
<!--endgithubcorner-->
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2011-2020, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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 boofcv.alg.distort;
import boofcv.alg.distort.spherical.EquirectangularTools_F32;
import boofcv.alg.interpolate.InterpolationType;
import boofcv.alg.misc.ImageMiscOps;
import boofcv.factory.distort.FactoryDistort;
import boofcv.struct.border.BorderType;
import boofcv.struct.distort.Point2Transform3_F32;
import boofcv.struct.distort.Point2Transform3_F64;
import boofcv.struct.distort.Point3Transform2_F32;
import boofcv.struct.distort.Point3Transform2_F64;
import boofcv.struct.image.GrayF32;
import boofcv.struct.image.GrayU8;
import boofcv.struct.image.ImageType;
import georegression.geometry.ConvertRotation3D_F32;
import georegression.metric.UtilAngle;
import georegression.misc.GrlConstants;
import georegression.struct.EulerType;
import georegression.struct.point.Point2D_F32;
import georegression.struct.point.Point3D_F32;
import georegression.struct.se.Se3_F32;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Unit tests below handle the following:
* 1) masking due to an explicit mask
* 2) masking due to non-invertible function
*
* Do not check the following:
* 1) Return of NaN in forward or reverse direction
* 2) Transform goes outside of the input image
*
* @author Peter Abeles
*/
public class TestMultiCameraToEquirectangular {
private int inputHeight = 150;
private int inputWidth = 200;
private int equiHeight = 200;
private int equiWidth = 250;
@Test
public void all() {
MultiCameraToEquirectangular<GrayF32> alg = createAlgorithm();
alg.addCamera(new Se3_F32(),new HelperDistortion(),inputWidth,inputHeight);
Se3_F32 cam2_to_1 = new Se3_F32();
ConvertRotation3D_F32.eulerToMatrix(EulerType.XYZ, GrlConstants.F_PI, 0,0,cam2_to_1.R);
alg.addCamera(cam2_to_1,new HelperDistortion(),inputWidth,inputHeight);
GrayF32 image0 = new GrayF32(inputWidth,inputHeight);
GrayF32 image1 = new GrayF32(inputWidth,inputHeight);
ImageMiscOps.fill(image0,200);
ImageMiscOps.fill(image1,100);
List<GrayF32> images = new ArrayList<>();
images.add(image0);
images.add(image1);
alg.render(images);
GrayF32 found = alg.getRenderedImage();
double totalError = 0;
for (int y = 0; y < equiHeight; y++) {
for (int x = 0; x < equiWidth; x++) {
if( y < equiHeight/2 ) {
totalError += Math.abs(200-found.get(x,y));
} else {
totalError += Math.abs(100-found.get(x,y));
}
}
}
double errorFraction = totalError/(equiWidth*equiHeight*100);
assertTrue(errorFraction<0.05);
}
@Test
public void addCamera_implicit_mask() {
MultiCameraToEquirectangular<GrayF32> alg = createAlgorithm();
alg.addCamera(new Se3_F32(),new HelperDistortion(),inputWidth,inputHeight);
MultiCameraToEquirectangular.Camera c = alg.cameras.get(0);
// should be masked off by the passed in mask and because values are repeated
int correct = 0;
for (int y = 0; y < inputHeight; y++) {
for (int x = 0; x < inputWidth; x++) {
if( y<inputHeight/2 && c.mask.get(x,y) > 0 ) {
correct++;
}
}
}
double found = Math.abs(1.0 - correct/(inputWidth*inputHeight/2.0));
assertTrue(found <= 0.05 );
}
@Test
public void addCamera_explicit_mask() {
MultiCameraToEquirectangular<GrayF32> alg = createAlgorithm();
// mask out the right part of the image
GrayU8 mask = new GrayU8(inputWidth,inputHeight);
for (int y = 0; y < inputHeight; y++) {
for (int x = 0; x < inputWidth/2; x++) {
mask.set(x,y,1);
}
}
alg.addCamera(new Se3_F32(),new HelperDistortion(),mask);
MultiCameraToEquirectangular.Camera c = alg.cameras.get(0);
// should be masked off by the passed in mask and because values are repeated
int correct = 0;
for (int y = 0; y < inputHeight; y++) {
for (int x = 0; x < inputWidth; x++) {
boolean valid = y<inputHeight/2 && x < inputWidth/2;
if( valid && c.mask.get(x,y) > 0 ) {
correct++;
}
}
}
double found = Math.abs(1.0 - correct/(inputWidth*inputHeight/4.0));
assertTrue(found <= 0.05 );
}
private MultiCameraToEquirectangular<GrayF32> createAlgorithm() {
ImageType<GrayF32> imageType = ImageType.single(GrayF32.class);
ImageDistort<GrayF32,GrayF32> distort = FactoryDistort.
distort(false, InterpolationType.BILINEAR, BorderType.ZERO,imageType,imageType);
MultiCameraToEquirectangular<GrayF32> alg = new MultiCameraToEquirectangular<>(distort,
equiWidth, equiHeight, imageType);
alg.setMaskToleranceAngle(UtilAngle.radian(2)); // increase tolerance due to resolution
return alg;
}
private class HelperDistortion implements LensDistortionWideFOV {
@Override
public Point3Transform2_F64 distortStoP_F64() {return null;}
@Override
public Point3Transform2_F32 distortStoP_F32() {
return new HelperTransform();
}
@Override
public Point2Transform3_F64 undistortPtoS_F64() {return null;}
@Override
public Point2Transform3_F32 undistortPtoS_F32() {
return new HelperTransform2();
}
}
/**
* Transform where multiple pixels in input image map to the same value
*/
private class HelperTransform implements Point3Transform2_F32
{
EquirectangularTools_F32 tools = new EquirectangularTools_F32();
public HelperTransform() {
this.tools.configure(inputWidth, inputHeight);
}
@Override
public void compute(float x, float y, float z, Point2D_F32 out) {
// multiple normal angles map to the same pixel. This will effectively make the top and bottom
// half of the image map to the same pixels. This should cause it to get masked out
tools.normToEquiFV(x,y,-Math.abs(z),out);
}
@Override
public Point3Transform2_F32 copyConcurrent() {
return null;
}
}
private class HelperTransform2 implements Point2Transform3_F32
{
EquirectangularTools_F32 tools = new EquirectangularTools_F32();
public HelperTransform2() {
this.tools.configure(inputWidth, inputHeight);
}
@Override
public void compute(float x, float y, Point3D_F32 out) {
tools.equiToNormFV(x,y,out);
}
@Override
public Point2Transform3_F32 copyConcurrent() {
return null;
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/MMCSServices.framework/MMCSServices
*/
#import <MMCSServices/MMCSServices-Structs.h>
@class NSMutableDictionary;
@interface MMCSController : NSObject {
int _connectionBehavior; // 4 = 0x4
MMCSEngineRef _engine; // 8 = 0x8
CFURLRef _chunkStoreURL; // 12 = 0xc
unsigned long long _currentItemID; // 16 = 0x10
NSMutableDictionary *_transfers; // 24 = 0x18
NSMutableDictionary *_requestIDToBlockMap; // 28 = 0x1c
NSMutableDictionary *_requestIDToTransfersMap; // 32 = 0x20
NSMutableDictionary *_requestIDToRemainingTransfersMap; // 36 = 0x24
NSMutableDictionary *_transferToRequestIDsMap; // 40 = 0x28
}
@property(readonly, assign) BOOL isActive; // G=0x3da1;
@property(assign) int connectionBehavior; // G=0x4ce5; S=0x4cf5; @synthesize=_connectionBehavior
// declared property setter: - (void)setConnectionBehavior:(int)behavior; // 0x4cf5
// declared property getter: - (int)connectionBehavior; // 0x4ce5
- (void)_itemCompleted:(id)completed; // 0x4c89
- (void)_getItemCompleted:(id)completed path:(id)path error:(id)error; // 0x498d
- (void)_putItemCompleted:(id)completed error:(id)error; // 0x46e5
- (void)_processCompletedItem:(id)item; // 0x4379
- (void)_getItemUpdated:(id)updated progress:(double)progress state:(int)state error:(id)error; // 0x4239
- (void)_putItemUpdated:(id)updated progress:(double)progress state:(int)state error:(id)error; // 0x40e1
- (void)putFiles:(id)files requestURL:(id)url requestorID:(id)anId authToken:(id)token completionBlock:(id)block; // 0x3f49
- (void)getFiles:(id)files requestURL:(id)url requestorID:(id)anId authToken:(id)token completionBlock:(id)block; // 0x3e85
- (BOOL)unregisterFiles:(id)files; // 0x3e25
- (BOOL)registerFiles:(id)files; // 0x3dc5
// declared property getter: - (BOOL)isActive; // 0x3da1
- (BOOL)_getTransfers:(id)transfers requestURL:(id)url requestorID:(id)anId token:(id)token error:(id *)error; // 0x3a45
- (BOOL)_putTransfers:(id)transfers requestURL:(id)url requestorID:(id)anId token:(id)token error:(id *)error; // 0x33b1
- (void)_setScheduledTransfers:(id)transfers block:(id)block; // 0x306d
- (BOOL)_unregisterTransfers:(id)transfers; // 0x2e29
- (BOOL)_registerTransfers:(id)transfers; // 0x29ed
- (id)_registeredTransferForItemID:(unsigned long long)itemID; // 0x28ed
- (id)_registeredTransferForGUID:(id)guid; // 0x28cd
- (MMCSEngineRef)_engine; // 0x1a85
- (id)_options; // 0x1975
- (void)dealloc; // 0x18b1
@end
| {
"pile_set_name": "Github"
} |
name = "AsyPlots"
uuid = "77e5a97a-5ef9-58df-9d21-21957d92d960"
repo = "https://github.com/sswatson/AsyPlots.jl.git"
| {
"pile_set_name": "Github"
} |
package com.meiqia.meiqiasdk.pw;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.support.v4.view.ViewCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.meiqia.meiqiasdk.R;
import com.meiqia.meiqiasdk.imageloader.MQImage;
import com.meiqia.meiqiasdk.model.ImageFolderModel;
import com.meiqia.meiqiasdk.util.MQUtils;
import com.meiqia.meiqiasdk.widget.MQImageView;
import java.util.ArrayList;
import java.util.List;
/**
* 作者:王浩 邮件:[email protected]
* 创建时间:16/2/26 下午4:00
* 描述:图片选择界面中的图片目录选择窗口
*/
public class MQPhotoFolderPw extends MQBasePopupWindow implements AdapterView.OnItemClickListener {
public static final int ANIM_DURATION = 300;
private LinearLayout mRootLl;
private ListView mContentLv;
private FolderAdapter mFolderAdapter;
private Callback mCallback;
private int mCurrentPosition;
public MQPhotoFolderPw(Activity activity, View anchorView, Callback callback) {
super(activity, R.layout.mq_pw_photo_folder, anchorView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
mCallback = callback;
}
@Override
protected void initView() {
mRootLl = getViewById(R.id.root_ll);
mContentLv = getViewById(R.id.content_lv);
}
@Override
protected void setListener() {
mRootLl.setOnClickListener(this);
mContentLv.setOnItemClickListener(this);
}
@Override
protected void processLogic() {
setAnimationStyle(android.R.style.Animation);
setBackgroundDrawable(new ColorDrawable(0x90000000));
mFolderAdapter = new FolderAdapter();
mContentLv.setAdapter(mFolderAdapter);
}
/**
* 设置目录数据集合
*
* @param datas
*/
public void setDatas(ArrayList<ImageFolderModel> datas) {
mFolderAdapter.setDatas(datas);
}
@Override
public void show() {
showAsDropDown(mAnchorView);
ViewCompat.animate(mContentLv).translationY(-mWindowRootView.getHeight()).setDuration(0).start();
ViewCompat.animate(mContentLv).translationY(0).setDuration(ANIM_DURATION).start();
ViewCompat.animate(mRootLl).alpha(0).setDuration(0).start();
ViewCompat.animate(mRootLl).alpha(1).setDuration(ANIM_DURATION).start();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mCallback != null && mCurrentPosition != position) {
mCallback.onSelectedFolder(position);
}
mCurrentPosition = position;
dismiss();
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.root_ll) {
dismiss();
}
}
@Override
public void dismiss() {
ViewCompat.animate(mContentLv).translationY(-mWindowRootView.getHeight()).setDuration(ANIM_DURATION).start();
ViewCompat.animate(mRootLl).alpha(1).setDuration(0).start();
ViewCompat.animate(mRootLl).alpha(0).setDuration(ANIM_DURATION).start();
if (mCallback != null) {
mCallback.executeDismissAnim();
}
mContentLv.postDelayed(new Runnable() {
@Override
public void run() {
MQPhotoFolderPw.super.dismiss();
}
}, ANIM_DURATION);
}
public int getCurrentPosition() {
return mCurrentPosition;
}
private class FolderAdapter extends BaseAdapter {
private List<ImageFolderModel> mDatas;
private int mImageWidth;
private int mImageHeight;
public FolderAdapter() {
mDatas = new ArrayList<>();
mImageWidth = MQUtils.getScreenWidth(mActivity) / 10;
mImageHeight = mImageWidth;
}
@Override
public int getCount() {
return mDatas.size();
}
@Override
public ImageFolderModel getItem(int position) {
return mDatas.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
FolderViewHolder folderViewHolder;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.mq_item_photo_folder, parent, false);
folderViewHolder = new FolderViewHolder();
folderViewHolder.photoIv = (MQImageView) convertView.findViewById(R.id.photo_iv);
folderViewHolder.nameTv = (TextView) convertView.findViewById(R.id.name_tv);
folderViewHolder.countTv = (TextView) convertView.findViewById(R.id.count_tv);
convertView.setTag(folderViewHolder);
} else {
folderViewHolder = (FolderViewHolder) convertView.getTag();
}
ImageFolderModel imageFolderModel = getItem(position);
folderViewHolder.nameTv.setText(imageFolderModel.name);
folderViewHolder.countTv.setText(String.valueOf(imageFolderModel.getCount()));
MQImage.displayImage(mActivity, folderViewHolder.photoIv, imageFolderModel.coverPath, R.drawable.mq_ic_holder_light, R.drawable.mq_ic_holder_light, mImageWidth, mImageHeight, null);
return convertView;
}
public void setDatas(ArrayList<ImageFolderModel> datas) {
if (datas != null) {
mDatas = datas;
} else {
mDatas.clear();
}
notifyDataSetChanged();
}
}
private class FolderViewHolder {
public MQImageView photoIv;
public TextView nameTv;
public TextView countTv;
}
public interface Callback {
void onSelectedFolder(int position);
void executeDismissAnim();
}
} | {
"pile_set_name": "Github"
} |
#ifndef WebCore_FWD_SHA1_h
#define WebCore_FWD_SHA1_h
#include <JavaScriptCore/SHA1.h>
#endif
| {
"pile_set_name": "Github"
} |
@import "variables.less";
@import "../common/Switch.less";
/* Default Shape */
.mblSwDefaultShape {
.mblSwSquareShape-styles;
}
| {
"pile_set_name": "Github"
} |
//
// PriorityQueue.swift
// Platform
//
// Created by Krunoslav Zaher on 12/27/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
struct PriorityQueue<Element> {
private let _hasHigherPriority: (Element, Element) -> Bool
private let _isEqual: (Element, Element) -> Bool
fileprivate var _elements = [Element]()
init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) {
_hasHigherPriority = hasHigherPriority
_isEqual = isEqual
}
mutating func enqueue(_ element: Element) {
_elements.append(element)
bubbleToHigherPriority(_elements.count - 1)
}
func peek() -> Element? {
return _elements.first
}
var isEmpty: Bool {
return _elements.count == 0
}
mutating func dequeue() -> Element? {
guard let front = peek() else {
return nil
}
removeAt(0)
return front
}
mutating func remove(_ element: Element) {
for i in 0 ..< _elements.count {
if _isEqual(_elements[i], element) {
removeAt(i)
return
}
}
}
private mutating func removeAt(_ index: Int) {
let removingLast = index == _elements.count - 1
if !removingLast {
swap(&_elements[index], &_elements[_elements.count - 1])
}
_ = _elements.popLast()
if !removingLast {
bubbleToHigherPriority(index)
bubbleToLowerPriority(index)
}
}
private mutating func bubbleToHigherPriority(_ initialUnbalancedIndex: Int) {
precondition(initialUnbalancedIndex >= 0)
precondition(initialUnbalancedIndex < _elements.count)
var unbalancedIndex = initialUnbalancedIndex
while unbalancedIndex > 0 {
let parentIndex = (unbalancedIndex - 1) / 2
guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break }
swap(&_elements[unbalancedIndex], &_elements[parentIndex])
unbalancedIndex = parentIndex
}
}
private mutating func bubbleToLowerPriority(_ initialUnbalancedIndex: Int) {
precondition(initialUnbalancedIndex >= 0)
precondition(initialUnbalancedIndex < _elements.count)
var unbalancedIndex = initialUnbalancedIndex
while true {
let leftChildIndex = unbalancedIndex * 2 + 1
let rightChildIndex = unbalancedIndex * 2 + 2
var highestPriorityIndex = unbalancedIndex
if leftChildIndex < _elements.count && _hasHigherPriority(_elements[leftChildIndex], _elements[highestPriorityIndex]) {
highestPriorityIndex = leftChildIndex
}
if rightChildIndex < _elements.count && _hasHigherPriority(_elements[rightChildIndex], _elements[highestPriorityIndex]) {
highestPriorityIndex = rightChildIndex
}
guard highestPriorityIndex != unbalancedIndex else { break }
swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex])
unbalancedIndex = highestPriorityIndex
}
}
}
extension PriorityQueue : CustomDebugStringConvertible {
var debugDescription: String {
return _elements.debugDescription
}
}
| {
"pile_set_name": "Github"
} |
A toolkit of support libraries and Ruby core extensions extracted from
the Rails framework. Rich support for multibyte strings,
internationalization, time zones, and testing.
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# CIS Debian 7/8 Hardening
#
#
# 13.14 Check for Duplicate UIDs (Scored)
#
set -e # One error, it's over
set -u # One variable unset, it's over
HARDENING_LEVEL=2
ERRORS=0
# This function will be called if the script status is on enabled / audit mode
audit () {
RESULT=$(cat /etc/passwd | cut -f3 -d":" | sort -n | uniq -c | awk {'print $1":"$2'} )
for LINE in $RESULT; do
debug "Working on line $LINE"
OCC_NUMBER=$(awk -F: {'print $1'} <<< $LINE)
USERID=$(awk -F: {'print $2'} <<< $LINE)
if [ $OCC_NUMBER -gt 1 ]; then
USERS=$(awk -F: '($3 == n) { print $1 }' n=$USERID /etc/passwd | xargs)
ERRORS=$((ERRORS+1))
crit "Duplicate UID ($USERID): ${USERS}"
fi
done
if [ $ERRORS = 0 ]; then
ok "No duplicate UIDs"
fi
}
# This function will be called if the script status is on enabled mode
apply () {
info "Editing automatically uids may seriously harm your system, report only here"
}
# This function will check config parameters required
check_config() {
:
}
# Source Root Dir Parameter
if [ -r /etc/default/cis-hardening ]; then
. /etc/default/cis-hardening
fi
if [ -z "$CIS_ROOT_DIR" ]; then
echo "There is no /etc/default/cis-hardening file nor cis-hardening directory in current environment."
echo "Cannot source CIS_ROOT_DIR variable, aborting."
exit 128
fi
# Main function, will call the proper functions given the configuration (audit, enabled, disabled)
if [ -r $CIS_ROOT_DIR/lib/main.sh ]; then
. $CIS_ROOT_DIR/lib/main.sh
else
echo "Cannot find main.sh, have you correctly defined your root directory? Current value is $CIS_ROOT_DIR in /etc/default/cis-hardening"
exit 128
fi
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.security.cert;
import java.math.BigInteger;
import java.util.Date;
import javax.security.auth.x500.X500Principal;
import sun.security.x509.X509CRLEntryImpl;
/**
* <p>Abstract class for a revoked certificate in a CRL (Certificate
* Revocation List).
*
* The ASN.1 definition for <em>revokedCertificates</em> is:
* <pre>
* revokedCertificates SEQUENCE OF SEQUENCE {
* userCertificate CertificateSerialNumber,
* revocationDate ChoiceOfTime,
* crlEntryExtensions Extensions OPTIONAL
* -- if present, must be v2
* } OPTIONAL
*
* CertificateSerialNumber ::= INTEGER
*
* Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
*
* Extension ::= SEQUENCE {
* extnId OBJECT IDENTIFIER,
* critical BOOLEAN DEFAULT FALSE,
* extnValue OCTET STRING
* -- contains a DER encoding of a value
* -- of the type registered for use with
* -- the extnId object identifier value
* }
* </pre>
*
* @see X509CRL
* @see X509Extension
*
* @author Hemma Prafullchandra
* @since 1.2
*/
public abstract class X509CRLEntry implements X509Extension {
/**
* Compares this CRL entry for equality with the given
* object. If the {@code other} object is an
* {@code instanceof} {@code X509CRLEntry}, then
* its encoded form (the inner SEQUENCE) is retrieved and compared
* with the encoded form of this CRL entry.
*
* @param other the object to test for equality with this CRL entry.
* @return true iff the encoded forms of the two CRL entries
* match, false otherwise.
*/
public boolean equals(Object other) {
if (this == other)
return true;
if (!(other instanceof X509CRLEntry))
return false;
try {
byte[] thisCRLEntry = this.getEncoded();
byte[] otherCRLEntry = ((X509CRLEntry)other).getEncoded();
if (thisCRLEntry.length != otherCRLEntry.length)
return false;
for (int i = 0; i < thisCRLEntry.length; i++)
if (thisCRLEntry[i] != otherCRLEntry[i])
return false;
} catch (CRLException ce) {
return false;
}
return true;
}
/**
* Returns a hashcode value for this CRL entry from its
* encoded form.
*
* @return the hashcode value.
*/
public int hashCode() {
int retval = 0;
try {
byte[] entryData = this.getEncoded();
for (int i = 1; i < entryData.length; i++)
retval += entryData[i] * i;
} catch (CRLException ce) {
return(retval);
}
return(retval);
}
/**
* Returns the ASN.1 DER-encoded form of this CRL Entry,
* that is the inner SEQUENCE.
*
* @return the encoded form of this certificate
* @exception CRLException if an encoding error occurs.
*/
public abstract byte[] getEncoded() throws CRLException;
/**
* Gets the serial number from this X509CRLEntry,
* the <em>userCertificate</em>.
*
* @return the serial number.
*/
public abstract BigInteger getSerialNumber();
/**
* Get the issuer of the X509Certificate described by this entry. If
* the certificate issuer is also the CRL issuer, this method returns
* null.
*
* <p>This method is used with indirect CRLs. The default implementation
* always returns null. Subclasses that wish to support indirect CRLs
* should override it.
*
* @return the issuer of the X509Certificate described by this entry
* or null if it is issued by the CRL issuer.
*
* @since 1.5
*/
public X500Principal getCertificateIssuer() {
return null;
}
/**
* Gets the revocation date from this X509CRLEntry,
* the <em>revocationDate</em>.
*
* @return the revocation date.
*/
public abstract Date getRevocationDate();
/**
* Returns true if this CRL entry has extensions.
*
* @return true if this entry has extensions, false otherwise.
*/
public abstract boolean hasExtensions();
/**
* Returns a string representation of this CRL entry.
*
* @return a string representation of this CRL entry.
*/
public abstract String toString();
/**
* Returns the reason the certificate has been revoked, as specified
* in the Reason Code extension of this CRL entry.
*
* @return the reason the certificate has been revoked, or
* {@code null} if this CRL entry does not have
* a Reason Code extension
* @since 1.7
*/
public CRLReason getRevocationReason() {
if (!hasExtensions()) {
return null;
}
return X509CRLEntryImpl.getRevocationReason(this);
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
***************************************************************************
Copyright (c) 2010 Qcadoo Limited
Project: Qcadoo MES
Version: 1.4
This file is part of Qcadoo.
Qcadoo 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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
***************************************************************************
-->
<model name="shiftTimetableException" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schema.qcadoo.org/model"
xsi:schemaLocation="http://schema.qcadoo.org/model http://schema.qcadoo.org/model.xsd">
<fields>
<string name="name" required="false">
<validatesLength max="1024" />
</string>
<datetime name="fromDate" required="true" />
<datetime name="toDate" required="true" />
<enum name="type" required="true" values="01freeTime,02workTime"
default="01freeTime" />
<manyToMany name="shifts" plugin="basic" model="shift"
joinField="shiftTimetableExceptions" cascade="nullify"/>
<manyToMany name="productionLines" plugin="productionLines" model="productionLine"
joinField="shiftTimetableExceptions" cascade="nullify"/>
<boolean name="relatesToPrevDay" default="false"/>
</fields>
<hooks>
<validatesWith class="com.qcadoo.mes.basic.ShiftsServiceImpl"
method="validateShiftTimetableException" />
</hooks>
</model>
| {
"pile_set_name": "Github"
} |
package com.company.pkcross.wrapper.proxy;
/**
* @author cbf4Life [email protected]
* I'm glad to share my knowledge with you all.
* 受众
*/
public class Idolater {
public static void main(String[] args) {
//崇拜的明星是谁
IStar star = new Singer();
//找到明星的代理人
IStar agent = new Agent(star);
System.out.println("追星族:我是你的崇拜者,请签名!");
//签字
agent.sign();
}
}
| {
"pile_set_name": "Github"
} |
package org.mozilla.fenix.utils;
/**
* Functional interface for listening to when wifi is/is not connected.
*
* This is not a () -> Boolean so that method parameters can be more clearly typed.
*
* This file is in Java because of the SAM conversion problem in Kotlin.
* See https://youtrack.jetbrains.com/issue/KT-7770.
*/
@FunctionalInterface
public interface OnWifiChanged {
void invoke(boolean Connected);
}
| {
"pile_set_name": "Github"
} |
# [How to Execute BASH Commands in a Remote Machine in Python](https://www.thepythoncode.com/article/executing-bash-commands-remotely-in-python)
To run this:
- `pip3 install -r requirements.txt`
- To execute certain commands, edit `execute_commands.py` on your needs and then execute.
- To execute an entire BASH script (.sh) named `script.sh` for instance on `192.168.1.101` with `test` as username and `abc123` as password:
```
python execute_bash.py 192.168.1.101 -u root -p inventedpassword123 -b script.sh
``` | {
"pile_set_name": "Github"
} |
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).
package nl.bzk.brp.model.data.kern;
import nl.bzk.brp.model.data.kern.Verantwoordelijke;
import org.springframework.beans.factory.annotation.Configurable;
privileged aspect Verantwoordelijke_Roo_Configurable {
declare @type: Verantwoordelijke: @Configurable;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2015 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.
*/
#ifndef SDK_ANDROID_SRC_JNI_AUDIO_DEVICE_OPENSLES_PLAYER_H_
#define SDK_ANDROID_SRC_JNI_AUDIO_DEVICE_OPENSLES_PLAYER_H_
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
#include <SLES/OpenSLES_AndroidConfiguration.h>
#include <memory>
#include "absl/types/optional.h"
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/fine_audio_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "sdk/android/src/jni/audio_device/audio_common.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
#include "sdk/android/src/jni/audio_device/opensles_common.h"
namespace webrtc {
class FineAudioBuffer;
namespace jni {
// Implements 16-bit mono PCM audio output support for Android using the
// C based OpenSL ES API. No calls from C/C++ to Java using JNI is done.
//
// An instance can be created on any thread, but must then be used on one and
// the same thread. All public methods must also be called on the same thread. A
// thread checker will RTC_DCHECK if any method is called on an invalid thread.
// Decoded audio buffers are requested on a dedicated internal thread managed by
// the OpenSL ES layer.
//
// The existing design forces the user to call InitPlayout() after Stoplayout()
// to be able to call StartPlayout() again. This is inline with how the Java-
// based implementation works.
//
// OpenSL ES is a native C API which have no Dalvik-related overhead such as
// garbage collection pauses and it supports reduced audio output latency.
// If the device doesn't claim this feature but supports API level 9 (Android
// platform version 2.3) or later, then we can still use the OpenSL ES APIs but
// the output latency may be higher.
class OpenSLESPlayer : public AudioOutput {
public:
// Beginning with API level 17 (Android 4.2), a buffer count of 2 or more is
// required for lower latency. Beginning with API level 18 (Android 4.3), a
// buffer count of 1 is sufficient for lower latency. In addition, the buffer
// size and sample rate must be compatible with the device's native output
// configuration provided via the audio manager at construction.
// TODO(henrika): perhaps set this value dynamically based on OS version.
static const int kNumOfOpenSLESBuffers = 2;
OpenSLESPlayer(const AudioParameters& audio_parameters,
std::unique_ptr<OpenSLEngineManager> engine_manager);
~OpenSLESPlayer() override;
int Init() override;
int Terminate() override;
int InitPlayout() override;
bool PlayoutIsInitialized() const override;
int StartPlayout() override;
int StopPlayout() override;
bool Playing() const override;
bool SpeakerVolumeIsAvailable() override;
int SetSpeakerVolume(uint32_t volume) override;
absl::optional<uint32_t> SpeakerVolume() const override;
absl::optional<uint32_t> MaxSpeakerVolume() const override;
absl::optional<uint32_t> MinSpeakerVolume() const override;
void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
private:
// These callback methods are called when data is required for playout.
// They are both called from an internal "OpenSL ES thread" which is not
// attached to the Dalvik VM.
static void SimpleBufferQueueCallback(SLAndroidSimpleBufferQueueItf caller,
void* context);
void FillBufferQueue();
// Reads audio data in PCM format using the AudioDeviceBuffer.
// Can be called both on the main thread (during Start()) and from the
// internal audio thread while output streaming is active.
// If the |silence| flag is set, the audio is filled with zeros instead of
// asking the WebRTC layer for real audio data. This procedure is also known
// as audio priming.
void EnqueuePlayoutData(bool silence);
// Allocate memory for audio buffers which will be used to render audio
// via the SLAndroidSimpleBufferQueueItf interface.
void AllocateDataBuffers();
// Obtaines the SL Engine Interface from the existing global Engine object.
// The interface exposes creation methods of all the OpenSL ES object types.
// This method defines the |engine_| member variable.
bool ObtainEngineInterface();
// Creates/destroys the output mix object.
bool CreateMix();
void DestroyMix();
// Creates/destroys the audio player and the simple-buffer object.
// Also creates the volume object.
bool CreateAudioPlayer();
void DestroyAudioPlayer();
SLuint32 GetPlayState() const;
// Ensures that methods are called from the same thread as this object is
// created on.
rtc::ThreadChecker thread_checker_;
// Stores thread ID in first call to SimpleBufferQueueCallback() from internal
// non-application thread which is not attached to the Dalvik JVM.
// Detached during construction of this object.
rtc::ThreadChecker thread_checker_opensles_;
const AudioParameters audio_parameters_;
// Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the
// AudioDeviceModuleImpl class and called by AudioDeviceModule::Create().
AudioDeviceBuffer* audio_device_buffer_;
bool initialized_;
bool playing_;
// PCM-type format definition.
// TODO(henrika): add support for SLAndroidDataFormat_PCM_EX (android-21) if
// 32-bit float representation is needed.
SLDataFormat_PCM pcm_format_;
// Queue of audio buffers to be used by the player object for rendering
// audio.
std::unique_ptr<SLint16[]> audio_buffers_[kNumOfOpenSLESBuffers];
// FineAudioBuffer takes an AudioDeviceBuffer which delivers audio data
// in chunks of 10ms. It then allows for this data to be pulled in
// a finer or coarser granularity. I.e. interacting with this class instead
// of directly with the AudioDeviceBuffer one can ask for any number of
// audio data samples.
// Example: native buffer size can be 192 audio frames at 48kHz sample rate.
// WebRTC will provide 480 audio frames per 10ms but OpenSL ES asks for 192
// in each callback (one every 4th ms). This class can then ask for 192 and
// the FineAudioBuffer will ask WebRTC for new data approximately only every
// second callback and also cache non-utilized audio.
std::unique_ptr<FineAudioBuffer> fine_audio_buffer_;
// Keeps track of active audio buffer 'n' in the audio_buffers_[n] queue.
// Example (kNumOfOpenSLESBuffers = 2): counts 0, 1, 0, 1, ...
int buffer_index_;
std::unique_ptr<OpenSLEngineManager> engine_manager_;
// This interface exposes creation methods for all the OpenSL ES object types.
// It is the OpenSL ES API entry point.
SLEngineItf engine_;
// Output mix object to be used by the player object.
ScopedSLObjectItf output_mix_;
// The audio player media object plays out audio to the speakers. It also
// supports volume control.
ScopedSLObjectItf player_object_;
// This interface is supported on the audio player and it controls the state
// of the audio player.
SLPlayItf player_;
// The Android Simple Buffer Queue interface is supported on the audio player
// and it provides methods to send audio data from the source to the audio
// player for rendering.
SLAndroidSimpleBufferQueueItf simple_buffer_queue_;
// This interface exposes controls for manipulating the object’s audio volume
// properties. This interface is supported on the Audio Player object.
SLVolumeItf volume_;
// Last time the OpenSL ES layer asked for audio data to play out.
uint32_t last_play_time_;
};
} // namespace jni
} // namespace webrtc
#endif // SDK_ANDROID_SRC_JNI_AUDIO_DEVICE_OPENSLES_PLAYER_H_
| {
"pile_set_name": "Github"
} |
1
00:00:20,300 --> 00:00:22,050
别了
2
00:00:26,530 --> 00:00:30,710
我想单独待着...
3
00:00:31,040 --> 00:00:33,130
跟我妻子一起
4
00:00:46,680 --> 00:00:49,770
我是个自私的混蛋
5
00:00:50,520 --> 00:00:54,430
我没能带你去里约热内卢...
6
00:00:54,860 --> 00:00:57,330
店里总是...
7
00:00:57,340 --> 00:01:00,540
有层出不穷的问题
8
00:01:00,550 --> 00:01:03,470
你该过更美好的人生
9
00:01:04,360 --> 00:01:06,640
我爱你
10
00:01:07,780 --> 00:01:10,090
一直爱着你
11
00:01:14,930 --> 00:01:17,660
- 我准备好了
- 没事的
12
00:01:23,350 --> 00:01:25,510
我知道...
13
00:01:53,170 --> 00:01:55,650
来人啊...
14
00:01:55,660 --> 00:01:57,880
救救她!
15
00:02:00,050 --> 00:02:01,920
救救她!
19
00:02:34,010 --> 00:02:36,270
54岁女性 出现急性呼吸衰竭
20
00:02:36,310 --> 00:02:39,840
无过敏 肺部正常 无气管损伤
21
00:02:39,860 --> 00:02:41,930
毒性检测
没有可卡因或安非他明残留
22
00:02:41,960 --> 00:02:48,410
我能说出30个可能
每个都足以引起呼吸骤停 会厌发炎
23
00:02:48,850 --> 00:02:52,390
咱们彩虹联盟中棕色皮肤和双性恋那两位
咋都不在?
24
00:02:52,420 --> 00:02:54,980
13看着病人 卡特纳的狗病了
25
00:02:54,990 --> 00:02:56,110
午饭前他应该能来
26
00:02:56,150 --> 00:02:58,940
这不是呼吸骤停
她睡觉的时候好着呢
27
00:02:58,970 --> 00:03:02,490
她这半年以来都在照料她丈夫
他丈夫心力衰竭 时日无多
28
00:03:02,520 --> 00:03:06,820
第31个可能 重创她丈夫心脏的元凶
也重创了她的气管
29
00:03:06,850 --> 00:03:10,120
而且 谢天谢地 我还以为
卡特纳是回家疗伤去了呢
30
00:03:10,130 --> 00:03:13,760
上次的病例 你抢功劳的时候
真是在他背后狠狠给了一刀啊
31
00:03:13,770 --> 00:03:15,100
我帮了大忙
32
00:03:15,150 --> 00:03:18,830
那病人的病因也不是来自她丈夫
除非肺癌也能传染
33
00:03:18,850 --> 00:03:22,410
真有意思 不过不是说病例
那挺无聊的
34
00:03:22,420 --> 00:03:25,730
我原以为你是为了掩护卡特纳才说谎的
这听上去还蛮高尚
35
00:03:25,740 --> 00:03:29,010
但实际上你是因为愧疚 而非出于友情
36
00:03:29,020 --> 00:03:33,060
大约半年前 他丈夫得病之前
她去夏威夷看望过她妹妹
37
00:03:33,100 --> 00:03:35,830
有可能在某个岛上感染了类鼻疽
38
00:03:35,850 --> 00:03:40,000
然后传染她老公
把他和他弱小的免疫系统都放倒了
39
00:03:40,030 --> 00:03:42,240
无肿瘤 无药物残留 无细菌
40
00:03:42,270 --> 00:03:44,330
只剩病毒这一种可能--水痘
41
00:03:44,350 --> 00:03:46,320
给她用阿昔洛韦 静脉输液
42
00:03:46,330 --> 00:03:49,700
办不到 她要求出院照看她丈夫
43
00:03:49,710 --> 00:03:52,070
多么甜蜜动人啊
他们俩可以死在一块了
44
00:03:52,080 --> 00:03:54,330
不用前后相差40年分开死了
45
00:03:54,350 --> 00:03:57,500
她说她呼吸骤停的时候
他病情似乎有好转
46
00:03:57,510 --> 00:03:59,030
精神刺激确是一剂良药
47
00:03:59,070 --> 00:04:02,420
看到自己老婆痛苦
真有可能延缓他死亡呢
48
00:04:02,450 --> 00:04:06,710
不然就是他意识到自己快要恢复单身了
于是肾上腺素暴涨
49
00:04:06,740 --> 00:04:08,840
- 送她回家
- 不一定非这样
50
00:04:09,590 --> 00:04:13,240
我有主意... 我自己想出来的
51
00:04:19,540 --> 00:04:22,430
- 艾迪?
- 他刚刚在大厅里游荡
52
00:04:22,930 --> 00:04:24,400
你还陪着我呢
53
00:04:24,410 --> 00:04:26,380
我这副衰样 还能上哪去呢?
54
00:04:26,400 --> 00:04:30,730
若你允许的话 我们准备治好你
55
00:04:37,930 --> 00:04:39,680
表演还有一小时就要开始了
56
00:04:39,700 --> 00:04:40,910
你得帮帮忙
57
00:04:40,940 --> 00:04:42,530
她脑袋好像出问题了
58
00:04:42,550 --> 00:04:45,710
完全搞不清楚周围的状况
59
00:04:45,720 --> 00:04:48,450
我还当她是挑逗我呢
60
00:04:49,260 --> 00:04:53,940
我能搞定 但得花你三块七毛五分钱
61
00:04:54,370 --> 00:04:57,370
这咖啡我才不肯白给你呢
62
00:04:57,830 --> 00:05:02,020
就当这是哥斯达黎加醒酒果汁吧
63
00:05:02,790 --> 00:05:04,210
她喝醉酒了?
64
00:05:04,240 --> 00:05:07,710
有一丝清新的薄荷味 隐藏在玫瑰香水
65
00:05:07,750 --> 00:05:12,390
樱桃花保湿面霜和晨露般发胶的香气下
66
00:05:12,940 --> 00:05:16,860
你溜到妈妈的盥洗室里
灌了杯她的漱口水?
67
00:05:16,890 --> 00:05:19,080
感觉棒极了
68
00:05:19,100 --> 00:05:20,460
你吐出来了么?
69
00:05:20,470 --> 00:05:22,900
妈妈都不吐出来
70
00:05:24,920 --> 00:05:28,240
治疗见效了 夏洛特的呼吸
恢复正常 她可以出院了
71
00:05:28,250 --> 00:05:31,350
她又能继续给丈夫守夜了
他又快不行了
72
00:05:31,380 --> 00:05:32,800
有所得 必有所失嘛
73
00:05:32,820 --> 00:05:36,410
而严格来说 他又不是我的病人
所以我们大有所得
74
00:05:36,420 --> 00:05:40,650
瞧 这都几点了
比陶柏为卡特纳撒的谎还迟了半小时
75
00:05:40,660 --> 00:05:45,190
他可能又去了个漫画节
找了个神奇女侠共度良宵
76
00:05:45,200 --> 00:05:47,870
- 他应该...
- 查明他在干嘛 或者在干谁
77
00:05:47,880 --> 00:05:51,260
无论如何 柯帝终究会要我
在"解雇理由"上写明的
78
00:05:52,430 --> 00:05:54,710
- 是卡特纳么?
- 是夏洛特
79
00:05:54,720 --> 00:05:57,310
氧饱和度和ST正常 不是气管的问题
80
00:06:00,360 --> 00:06:03,160
- 你没事?
- 别惦记我了 她正疼呢
81
00:06:04,210 --> 00:06:05,900
脉动有力 脉速正常
82
00:06:05,930 --> 00:06:07,800
- 肺部没有积水
- 怎么回事?
83
00:06:09,190 --> 00:06:11,170
我不知道
84
00:06:12,550 --> 00:06:16,010
卡特纳 是佛曼和13 开门啊
85
00:06:17,890 --> 00:06:19,390
你往哪走?
86
00:06:19,400 --> 00:06:21,390
豪斯可不是要查明他不在哪里
87
00:06:21,410 --> 00:06:23,570
你要是想顺着防火梯爬到五楼...
88
00:06:23,600 --> 00:06:26,080
这样会快些
89
00:06:29,820 --> 00:06:31,830
卡特纳
90
00:06:32,680 --> 00:06:35,260
果真是男孩和男人的天堂啊
91
00:06:35,270 --> 00:06:37,130
难怪他不想出门呢
92
00:06:43,970 --> 00:06:45,590
日程表上什么都没有
93
00:06:45,650 --> 00:06:47,760
他的寻呼机还在这
94
00:06:52,500 --> 00:06:54,860
哦 天啊
95
00:07:01,680 --> 00:07:04,930
赶紧派辆救护车来
Willis街410号 5楼C座
96
00:07:04,960 --> 00:07:07,250
28岁男子 一枪正中右太阳穴
97
00:07:07,260 --> 00:07:08,770
没有脉搏!
98
00:07:08,820 --> 00:07:11,600
通知普林斯顿医院 请外伤部门人员就位
99
00:07:12,330 --> 00:07:14,190
瞳孔已扩大 头部肿胀
100
00:07:14,200 --> 00:07:17,470
- 还是没有脉搏 醒醒啊 卡特纳!
- 让我试试
101
00:07:26,580 --> 00:07:28,740
他全身冰冷
102
00:07:31,210 --> 00:07:33,860
艾瑞克!
103
00:08:11,300 --> 00:08:14,840
他什么都没说...跟谁都没说
104
00:08:16,050 --> 00:08:17,960
家庭问题...
105
00:08:17,970 --> 00:08:20,310
感情问题 经济压力?
106
00:08:20,330 --> 00:08:23,000
他双亲曾在他眼前被杀
107
00:08:23,610 --> 00:08:25,340
这都是几百年前的事了
108
00:08:25,370 --> 00:08:28,190
要是真在意的话 就不会淡忘
109
00:08:28,200 --> 00:08:31,180
他不是割脉...
110
00:08:31,590 --> 00:08:34,280
不是静静地离去 他是用枪
111
00:08:35,360 --> 00:08:36,660
也没写遗书
112
00:08:36,670 --> 00:08:38,870
说明极度恐慌
113
00:08:38,880 --> 00:08:43,800
要是每周共事80小时的那些笨蛋
有所察觉的话 这本是可以避免的
114
00:08:43,850 --> 00:08:46,250
你是在怪我们?
115
00:08:46,660 --> 00:08:48,050
只是想搞明白
116
00:08:48,100 --> 00:08:51,190
如果他曾求助的话
我们当然会帮忙 但他没有
117
00:08:51,830 --> 00:08:53,660
我们应当有所察觉
118
00:08:53,710 --> 00:08:55,440
这不是我们的错!
119
00:08:55,480 --> 00:08:59,720
四分之一的自杀者
都从来不将苦闷外露
120
00:08:59,730 --> 00:09:00,840
不对
121
00:09:00,890 --> 00:09:05,370
四分之一的自杀者身边只有
漠不关心 不愿负疚的朋友
122
00:09:05,410 --> 00:09:11,050
自杀相当于毁掉一切可能
所以卡特纳是大笨蛋
123
00:09:11,480 --> 00:09:14,790
深感遗憾 那是当然的
因此内疚 毫无道理
124
00:09:14,820 --> 00:09:16,530
这不过是自我安慰罢了
125
00:09:16,570 --> 00:09:19,780
我们手上还有个病人呢
确切地说 有两个
126
00:09:19,790 --> 00:09:22,990
一个病情恶化
另一个病情应当恶化
127
00:09:23,010 --> 00:09:25,490
你不是在同时否认
卡特纳和那老公的现实吧
128
00:09:25,540 --> 00:09:28,590
艾迪是以精神支撑着生命
这也不是不可能
129
00:09:28,630 --> 00:09:30,610
这种奇闻 留给小报吧
130
00:09:30,640 --> 00:09:35,030
跟他们说你刚刚目睹了
肾功能小小增强的奇迹
131
00:09:35,750 --> 00:09:39,340
也许我们该把这病例
移交给别的医生
132
00:09:39,380 --> 00:09:41,120
下个病例呢 也移交?
133
00:09:41,140 --> 00:09:43,450
那再下个病例呢?
134
00:09:44,710 --> 00:09:48,460
要移交多少个病例 你们才能
接受卡特纳死了这个现实?
135
00:09:51,380 --> 00:09:54,540
从心肌酶来看 她没有心脏病发作
136
00:09:54,560 --> 00:09:57,630
视觉正常 说明没有线粒体疾病
137
00:09:57,650 --> 00:09:59,950
可能是代谢紊乱 酸毒症
138
00:10:00,010 --> 00:10:01,700
血液酸碱值很正常
139
00:10:01,740 --> 00:10:04,540
多浆膜炎能使会厌附近的薄膜发炎
140
00:10:04,550 --> 00:10:08,170
心包膜发炎 使胸口疼痛
141
00:10:08,900 --> 00:10:11,040
我很惋惜
142
00:10:11,430 --> 00:10:14,910
我雇了一位悲痛心理咨询师
我敢说你们都不会去看
143
00:10:14,950 --> 00:10:17,600
我也准你们假
但我敢说你们也都不会要
144
00:10:17,640 --> 00:10:20,380
记得有这些选择就好
145
00:10:24,280 --> 00:10:27,720
符合多浆膜炎症状 给她用消炎痛
146
00:10:32,390 --> 00:10:35,370
- 如果你不想处理这个病例...
- 我没事...
147
00:10:36,000 --> 00:10:38,420
不管威尔森会怎么说
148
00:10:38,430 --> 00:10:39,550
他还没来找过你?
149
00:10:39,580 --> 00:10:42,050
我很确定他周二早上要搓麻将来着
150
00:10:42,090 --> 00:10:44,660
我猜想
他是觉得我自个儿解决更好
151
00:10:44,670 --> 00:10:48,050
没了他给我拚命插翅膀
我没准还能飞得更高
152
00:10:51,430 --> 00:10:52,790
你一点概念也没有?
153
00:10:52,810 --> 00:10:55,520
我知道
他心中的橄榄球梦之队土崩瓦解了
154
00:10:55,550 --> 00:10:57,900
还以为他已经承受过来了
155
00:10:59,200 --> 00:11:01,240
那...
156
00:11:05,070 --> 00:11:07,540
对你的损失深表遗憾
157
00:11:07,860 --> 00:11:10,710
多谢 但我没啥损失
158
00:11:10,720 --> 00:11:13,780
那就为你这么想深表遗憾
159
00:11:21,930 --> 00:11:25,300
病人的膜组织可没法自愈
160
00:11:25,310 --> 00:11:27,610
陶柏去进行治疗了
161
00:11:27,650 --> 00:11:31,200
我们想去见卡特纳的父母
162
00:11:33,250 --> 00:11:35,600
我也去
163
00:11:42,700 --> 00:11:46,360
多浆膜炎损伤组织和器官外
包裹着的保护性薄膜
164
00:11:46,380 --> 00:11:50,070
消炎痛就是种消炎药 能治好这种病
165
00:11:50,110 --> 00:11:53,320
只要别再疼了就成
166
00:11:54,200 --> 00:11:56,900
夏洛特...
167
00:11:57,570 --> 00:12:00,460
闭上眼睛
168
00:12:00,950 --> 00:12:03,630
快闭上...
169
00:12:03,640 --> 00:12:05,940
想像自己...
170
00:12:05,980 --> 00:12:08,500
终于去到里约热内卢了
171
00:12:08,540 --> 00:12:11,350
正站在阳台上...
172
00:12:13,640 --> 00:12:16,850
在一家豪华宾馆阳台上
173
00:12:17,600 --> 00:12:19,630
你从没这样甜言蜜语过
174
00:12:19,660 --> 00:12:23,100
你就... 别说话 让我来说
175
00:12:23,110 --> 00:12:27,060
你站在阳台上 看盛大的游行
176
00:12:27,090 --> 00:12:29,900
那叫嘉年华
177
00:12:31,250 --> 00:12:34,930
如果不能跟你一起 我哪也不想去
178
00:12:35,480 --> 00:12:38,340
我要你去
179
00:12:38,350 --> 00:12:42,490
我要你成就你梦想过的一切
180
00:12:43,040 --> 00:12:48,000
很抱歉打扰了...
但我得再做个检查...
181
00:12:48,010 --> 00:12:50,420
给你做
182
00:12:53,580 --> 00:12:57,090
这是我们领养他的第一天
他那时才6岁
183
00:12:57,880 --> 00:13:00,690
绝对是你见过最教人疼爱的小孩
184
00:13:01,240 --> 00:13:03,860
他应该挺害怕的...
185
00:13:03,890 --> 00:13:07,450
刚刚经历过悲恸
又被交给一个陌生的家庭
186
00:13:07,480 --> 00:13:13,590
我们一直让他叫我们理查德和朱莉亚
但他总是叫卡特纳先生 太太
187
00:13:14,480 --> 00:13:18,870
在他9岁生日的时候
我们送了他一套化学用具
188
00:13:18,890 --> 00:13:21,960
劳伦斯一直喜欢把东西炸飞
189
00:13:22,720 --> 00:13:27,440
那时他说 "谢谢妈妈 谢谢爸爸"
190
00:13:27,910 --> 00:13:30,680
从那时起 我们就是他爸爸妈妈了
191
00:13:33,270 --> 00:13:35,280
他非常特别
192
00:13:35,310 --> 00:13:37,290
曾与他共事 我们深感荣幸
193
00:13:38,770 --> 00:13:41,910
你们与他一起的时间最长
194
00:13:41,930 --> 00:13:45,300
他对你们所有人都赞誉有加
195
00:13:45,910 --> 00:13:48,900
你们知道这是为什么吗?
196
00:13:48,910 --> 00:13:51,660
我们也很想知道 我们...
197
00:13:51,670 --> 00:13:54,410
是名字的问题
198
00:13:55,010 --> 00:13:59,300
他很矛盾
不知哪里有自己的容身之地
199
00:13:59,330 --> 00:14:02,830
被强行抽离自己的生活
跟你们扯到一块
200
00:14:02,850 --> 00:14:05,390
我们一向鼓励他
保持自己民族的传统
201
00:14:05,400 --> 00:14:10,060
当每个人都叫你劳伦斯 卡特纳时
很难把自己看作劳伦斯 曹德哈里
202
00:14:10,100 --> 00:14:12,670
是他提出随我们姓的
203
00:14:12,710 --> 00:14:14,590
- 你们应该拒绝
- 豪斯
204
00:14:14,600 --> 00:14:18,120
他的英文姓氏使他混淆了自己的身份
205
00:14:18,170 --> 00:14:20,910
你们只从感性而没有理性考量
206
00:14:20,930 --> 00:14:22,000
你们根本不了解他
207
00:14:22,040 --> 00:14:24,580
我们爱这个孩子 你这王八蛋
208
00:14:24,620 --> 00:14:27,500
你们希望他快乐
于是把他的痛苦拦在门外
209
00:14:27,510 --> 00:14:30,570
表面看来他很快乐
你们以为痛苦消失了
210
00:14:30,580 --> 00:14:33,270
其实是隐藏得更深了...
211
00:14:33,280 --> 00:14:36,420
他苦苦挣扎于自己的身份
直至把一颗子弹射进--
212
00:14:36,430 --> 00:14:39,140
豪斯!
213
00:14:39,150 --> 00:14:42,110
回医院去
214
00:15:02,500 --> 00:15:04,820
我为你们儿子的死感到遗憾
215
00:15:16,680 --> 00:15:20,720
消炎药不起作用 她还是痛
排除多发性浆膜炎
216
00:15:20,730 --> 00:15:23,950
我给艾迪做了个荷尔蒙测试
促乳素高于正常水平
217
00:15:23,960 --> 00:15:26,360
就是说他正在好转
218
00:15:27,620 --> 00:15:29,980
很多因素会引起人体化学状态改变--
219
00:15:30,000 --> 00:15:31,910
压力 恐惧-- 为什么爱不可以?
220
00:15:31,930 --> 00:15:34,720
也许他就这么好起来了
221
00:15:34,910 --> 00:15:38,140
你没问我有没有
从卡特纳家看出了什么端倪
222
00:15:38,160 --> 00:15:40,150
如果你看出来了 我想你会主动说的
223
00:15:40,180 --> 00:15:42,910
或者你害怕真有什么和他的死有关
224
00:15:42,920 --> 00:15:45,320
这意味着 你原本可以挽救他的生命
225
00:15:45,340 --> 00:15:47,460
我不认为 人们选择自杀
就是为了寻求他人帮助
226
00:15:47,470 --> 00:15:50,690
有时 你根本不想别人帮你
227
00:15:51,420 --> 00:15:54,160
幸亏当初有人拉你一把...
228
00:15:54,800 --> 00:15:58,290
不然你会再度寻死
而且不会失手...
229
00:15:59,220 --> 00:16:02,280
她没得韦格纳肉芽肿
230
00:16:02,320 --> 00:16:05,410
肾功能正常 不是棉尘症
231
00:16:05,420 --> 00:16:08,270
也不是心二尖瓣狭窄
所有诊断都不符合
232
00:16:09,690 --> 00:16:12,630
如果所有诊断都不符合
233
00:16:12,640 --> 00:16:15,970
那就只剩下一个原因
234
00:16:20,290 --> 00:16:24,290
我是豪斯医生 你得了肥厚性心肌病
235
00:16:24,300 --> 00:16:27,660
他的心脏太弱 你的则太强
好消息是 这是可治愈的
236
00:16:27,670 --> 00:16:30,920
我们引发一次心脏病
然后杀死多余的肌肉
237
00:16:30,960 --> 00:16:32,390
你要使我心脏病发作?
238
00:16:32,400 --> 00:16:34,720
只有在心脏大小正常情况下
才会有危险
239
00:16:34,730 --> 00:16:36,820
- 但既然--
- 你说真的吗?
240
00:16:37,720 --> 00:16:39,640
假的
241
00:16:39,670 --> 00:16:41,150
实在很让人郁闷
242
00:16:41,180 --> 00:16:45,160
我已经厌倦了靠撒谎
来威吓病人说出真话
243
00:16:45,180 --> 00:16:46,840
她在装病
244
00:16:46,860 --> 00:16:50,970
如果她再装下去
接下来的治疗方法会杀死她
245
00:16:51,000 --> 00:16:54,000
那为什么...她的气管是怎么回事?
246
00:16:54,010 --> 00:16:56,350
那是真的 治疗使她好转了
247
00:16:56,360 --> 00:16:59,810
但她好转了你就会恶化
所以她继续装病
248
00:16:59,840 --> 00:17:00,940
就这么简单
249
00:17:00,960 --> 00:17:04,490
她发现她病得越厉害
你就撑得越久
250
00:17:06,240 --> 00:17:08,920
夏洛特?
251
00:17:13,210 --> 00:17:15,420
我们很多年没这么亲近了
252
00:17:15,440 --> 00:17:18,110
我希望能一直这样
253
00:17:20,250 --> 00:17:22,760
拜托 你没听过狼来了吗
254
00:17:22,770 --> 00:17:25,390
是我的腿 我发誓这次是真的
255
00:17:25,400 --> 00:17:29,100
你要上吊赌咒呢 还是拉钩发誓?因为--
256
00:17:29,110 --> 00:17:31,400
她怎么装得了这个?
257
00:17:34,300 --> 00:17:36,690
装不了
258
00:17:40,800 --> 00:17:45,920
那么...什么会撕裂会厌
并且让肌肉消失?
259
00:17:46,910 --> 00:17:49,550
卡特纳先生和卡特纳太太
260
00:17:49,560 --> 00:17:51,930
他们既然能害死卡特纳
为什么不能害死夏洛特?
261
00:17:51,940 --> 00:17:54,990
哀悼期结束 佛曼回复刻薄本色
262
00:17:55,600 --> 00:17:58,540
我错了 种族困惑不会立刻致死
263
00:17:58,550 --> 00:18:01,160
第1步-- 先把姓名改回去
264
00:18:01,170 --> 00:18:04,530
第2步-- 如果第1步失败
搬到班加罗尔 (印度城市)
265
00:18:04,560 --> 00:18:08,520
第14步-- 如果13步失败 才是自杀
266
00:18:08,550 --> 00:18:12,260
怎么-- 你打算把他通讯录上的人
都奚落一遍 直至找出答案?
267
00:18:12,280 --> 00:18:15,880
我很客气地打给他的朋友
全都帮不上忙
268
00:18:15,890 --> 00:18:18,570
他们并非帮不上忙
只是知道的不比我们多
269
00:18:18,580 --> 00:18:19,780
还不是一样
270
00:18:19,800 --> 00:18:23,020
多发性硬化病 髓鞘脱失
影响神经传导
271
00:18:23,030 --> 00:18:26,410
我说的是夏洛特
还有救的那一位
272
00:18:26,420 --> 00:18:29,490
你们俩 把她塞入MRI
确定是否多发性硬化
273
00:18:29,500 --> 00:18:33,060
你 去给艾迪做个超声
反正你正盘算背着我做
274
00:18:33,070 --> 00:18:35,450
看他的心脏有没有好转
275
00:18:38,420 --> 00:18:40,860
你居然让我雇一个变态?
276
00:18:40,870 --> 00:18:42,950
要是我自己雇了而不让你雇
岂不太虚伪了
277
00:18:42,990 --> 00:18:45,820
这是卡特纳的警方记录调查
278
00:18:45,830 --> 00:18:48,100
他曾被控以不恰当露体罪
279
00:18:48,140 --> 00:18:50,650
卡特纳在宾夕法尼亚对阵达特茅斯
的橄榄球赛中脱光了衣服
280
00:18:50,670 --> 00:18:53,600
在你心目中 他不正是会这样做的人吗?
281
00:18:54,040 --> 00:18:57,560
不要紧的 你觉得难过是应该的
282
00:18:57,570 --> 00:19:00,470
他像你一样思考
像你一样挑战极限
283
00:19:00,500 --> 00:19:02,220
如果他想我一样思考...
284
00:19:02,250 --> 00:19:06,980
他就会知道 活得再痛苦
也比死了强那么一点点
285
00:19:10,740 --> 00:19:13,770
再忍耐一下 很快就能
回到艾迪身边了
286
00:19:14,840 --> 00:19:18,090
30年来和同一个男人在一起
这是什么感觉?
287
00:19:18,130 --> 00:19:22,410
我感觉很好 我希望他也是
288
00:19:23,470 --> 00:19:25,400
你觉得他不爱你?
289
00:19:25,420 --> 00:19:27,980
他用他的方式来爱我
290
00:19:28,010 --> 00:19:34,060
只不过不是"形影不离 情话绵绵"的方式罢了
291
00:19:36,020 --> 00:19:38,660
你为什么留在他身边?
292
00:19:38,690 --> 00:19:42,870
我不需要他像我爱他一样爱我
293
00:19:43,560 --> 00:19:47,520
爱...不是...
294
00:19:47,530 --> 00:19:49,450
夏洛特?
295
00:19:53,710 --> 00:20:00,470
我听过很多癌症病人不药而愈的故事
296
00:20:00,850 --> 00:20:02,710
这会不会发生在我身上?
297
00:20:02,750 --> 00:20:04,710
不大可能 但谁知道呢
298
00:20:04,730 --> 00:20:06,960
如果我有多点时间...
299
00:20:07,000 --> 00:20:10,690
我会好好陪夏洛特
努力做个好丈夫
300
00:20:10,700 --> 00:20:13,040
也许吧
301
00:20:13,080 --> 00:20:15,570
你不相信我是真心的
302
00:20:15,600 --> 00:20:17,290
我相信你是真心的
303
00:20:17,300 --> 00:20:20,300
说真心话比拿出实际行动要简单得多
304
00:20:29,430 --> 00:20:33,220
心房壁几乎不动了 很抱歉
305
00:20:48,180 --> 00:20:50,480
他需要一个朋友
306
00:20:50,490 --> 00:20:54,100
我应付不了豪斯和这件事
307
00:20:54,110 --> 00:20:55,970
你也需要一个朋友
308
00:20:56,010 --> 00:20:57,880
别把我的需要扯进去
309
00:20:57,890 --> 00:21:00,630
你只是想有人盯紧他
310
00:21:06,320 --> 00:21:09,710
他告诉卡特纳的父母 这是他们的错
311
00:21:15,590 --> 00:21:18,100
脾破裂 说明不是硬皮病
312
00:21:19,650 --> 00:21:20,930
你在这儿干什么?
313
00:21:20,940 --> 00:21:24,650
等你把她的脾缝好后做活检
看是不是风湿性关节炎
314
00:21:24,690 --> 00:21:26,310
我做就行 回家去吧
315
00:21:26,320 --> 00:21:27,680
她不是你的病人
316
00:21:27,740 --> 00:21:31,270
卡特纳也不是我的朋友
317
00:21:31,670 --> 00:21:34,170
卡特纳想死 夏洛特不想
318
00:21:34,180 --> 00:21:37,870
因此在我的衡量标准里 她更重要
319
00:21:37,890 --> 00:21:42,220
好吧 要么你是个冷血的混球
要么是太痛苦以致无法面对
320
00:21:42,240 --> 00:21:44,610
回家大哭一场吧
321
00:21:44,620 --> 00:21:47,790
不是风湿性关节炎 她的肝也有疤痕
322
00:21:47,800 --> 00:21:50,510
不管她得了什么病 病情扩散了
323
00:22:08,540 --> 00:22:13,930
先澄清下 我无意冒犯
一位已故同事的尊严
324
00:22:17,880 --> 00:22:21,600
除非你找到什么 才算得上冒犯
325
00:22:23,060 --> 00:22:25,820
见到你真好
326
00:22:25,830 --> 00:22:28,530
你想找什么?
327
00:22:29,550 --> 00:22:32,190
他在逃避
328
00:22:32,200 --> 00:22:34,130
为什么?
329
00:22:34,140 --> 00:22:38,470
出于羞耻? 恐惧 你还好吧?
330
00:22:38,970 --> 00:22:42,250
你觉得难过也没关系的
331
00:22:42,690 --> 00:22:46,260
"殖民军战士镭射枪 编号11"
332
00:22:47,930 --> 00:22:52,600
肯定是花几个月淘来的
说明他对生活很有热情
333
00:22:52,610 --> 00:22:56,040
显然他正陷于痛苦
334
00:22:56,050 --> 00:22:58,740
原因真的那么重要吗?
335
00:23:00,290 --> 00:23:03,190
他把好的和不好的回忆挂在一起
336
00:23:03,200 --> 00:23:07,070
失去的和得到的并排放
337
00:23:07,460 --> 00:23:11,000
说明他对痛苦很看得开
338
00:23:11,450 --> 00:23:15,200
如果痛苦加深 他没理由会隐瞒
339
00:23:18,730 --> 00:23:21,220
接下来这么办吧 豪斯
340
00:23:21,250 --> 00:23:26,350
我们离开这里 找间最近的酒吧
边喝酒边聊天
341
00:23:26,390 --> 00:23:29,800
聊聊卡特纳当初怎么差点把手术室炸了
342
00:23:29,830 --> 00:23:32,980
发发牢骚 大醉一场
343
00:23:33,410 --> 00:23:36,260
这主意不错吧?
344
00:23:56,000 --> 00:23:58,530
我漏掉了什么?
345
00:24:03,710 --> 00:24:06,670
你这副表情又来了
346
00:24:06,680 --> 00:24:09,560
你又看出什么了
347
00:24:10,850 --> 00:24:12,680
你来这里 不是因为你关心卡特纳
348
00:24:12,700 --> 00:24:14,660
而是因为这是一个谜
349
00:24:14,680 --> 00:24:17,420
你要解开这个谜题
350
00:24:18,380 --> 00:24:20,600
会不会是 不是我漏了什么...
351
00:24:20,610 --> 00:24:23,580
而是根本没什么可遗漏的?
352
00:24:25,450 --> 00:24:30,980
他并不是自杀 而是被人谋杀
353
00:24:50,900 --> 00:24:53,470
会厌肌肉 脾脏 现在轮到肝
354
00:24:53,490 --> 00:24:57,170
只剩余20%功能 仍在加速恶化
355
00:24:57,200 --> 00:24:58,680
自体免疫性肝炎?
356
00:24:58,690 --> 00:24:59,660
你呼佛曼了没?
357
00:24:59,690 --> 00:25:02,070
他接受了柯帝让他休假的建议
358
00:25:02,110 --> 00:25:04,310
甲状腺激素水平正常 说明不是肝炎
359
00:25:04,340 --> 00:25:07,530
可能是淀粉样变性
淀粉堵塞攻击器官 组织--
360
00:25:07,540 --> 00:25:09,380
解释不了肌肉萎缩
361
00:25:09,420 --> 00:25:11,100
你给丈夫做的超声如何?
362
00:25:11,120 --> 00:25:14,110
心脏持续衰竭 好转只是暂时的
363
00:25:14,550 --> 00:25:18,220
我比较喜欢简单的答法:
豪斯 你是对的
364
00:25:18,520 --> 00:25:21,710
既然...不用花时间
纠结丈夫为什么死不了
365
00:25:21,720 --> 00:25:25,310
就有更多时间研究卡特纳为什么会死...
366
00:25:27,000 --> 00:25:28,830
谋杀动机
367
00:25:28,870 --> 00:25:32,710
豪斯...这是自杀
警察已经调查过了
368
00:25:32,720 --> 00:25:35,880
他们只调查他们眼见的东西
而忽略了看不到的
369
00:25:35,900 --> 00:25:39,640
去找他的朋友 同学 送比萨的人聊聊
370
00:25:39,700 --> 00:25:40,890
还有联系佛曼
371
00:25:40,920 --> 00:25:43,070
- 他可以边抹眼泪边接电话
- 不
372
00:25:43,080 --> 00:25:45,120
你这个"不" 是指"我才不要打给我男友
373
00:25:45,170 --> 00:25:48,030
谁叫他刚才打给我上司
而不是我说他不回来"吗?
374
00:25:48,040 --> 00:25:50,880
真不公平 凭什么你一个音节
里头能包含这么多潜台词?
375
00:25:50,920 --> 00:25:53,080
我们都想知道 为什么卡特纳这么做
376
00:25:53,110 --> 00:25:56,090
但我们不想浪费时间去纠缠鬼魂
377
00:25:59,640 --> 00:26:01,430
你们一点不好奇吗?
378
00:26:01,470 --> 00:26:06,560
我只好奇为什么一个崇尚理性的人
忽然变得不理智了
379
00:26:08,960 --> 00:26:12,650
她可能得了α1-抗胰蛋白酶缺乏症
380
00:26:12,670 --> 00:26:15,570
给她做个α1抗胰蛋白酶测试
381
00:26:20,700 --> 00:26:22,220
我想和艾迪在一起
382
00:26:22,230 --> 00:26:25,010
你才做完手术不久
383
00:26:25,050 --> 00:26:29,050
你死后可以指定把器官捐给某个人 对吧?
384
00:26:29,070 --> 00:26:31,870
即便器官银行不批准?
385
00:26:31,910 --> 00:26:36,650
个人捐赠者可以绕过登记程序
但还有很多因素要考虑...
386
00:26:36,660 --> 00:26:39,040
- 比如血型--
- 我给他输过血
387
00:26:39,050 --> 00:26:41,570
- 不只是--
- 求你了
388
00:26:42,630 --> 00:26:47,000
如果我先走一步
我想你把我的心脏给他
389
00:26:49,620 --> 00:26:52,090
治疗还没结束呢
390
00:26:52,100 --> 00:26:54,400
我还有得治
391
00:26:54,430 --> 00:26:57,010
可他没别的指望了 不是吗?
392
00:26:57,990 --> 00:27:00,590
是的
393
00:27:03,090 --> 00:27:05,780
雷米 哈德利 也可以叫我13
394
00:27:05,790 --> 00:27:09,070
有时会和你上床
395
00:27:09,080 --> 00:27:11,200
我知道我应该打给你
396
00:27:11,260 --> 00:27:14,590
- 我只是需要点时间
- 一个人?
397
00:27:16,630 --> 00:27:19,730
我这辈子经历了很多困难
398
00:27:19,790 --> 00:27:22,750
都一个人撑过来了
399
00:27:29,390 --> 00:27:32,220
那我走好了
400
00:27:32,540 --> 00:27:36,940
- 对不起
- 没什么
401
00:27:49,280 --> 00:27:52,710
信息部门准备关闭卡特纳的电邮账号
402
00:27:52,800 --> 00:27:55,320
显然有人还登陆着
403
00:27:55,350 --> 00:27:59,220
不难猜到密码是卡特纳
404
00:27:59,500 --> 00:28:01,150
他做了他们不让你做的事
405
00:28:01,170 --> 00:28:03,500
- 他不是被谋杀的
- 他父母是
406
00:28:03,510 --> 00:28:05,580
杀了他们的人就要假释了
407
00:28:05,620 --> 00:28:07,100
他是要假释了
408
00:28:07,120 --> 00:28:08,350
不是已经出来了
409
00:28:08,390 --> 00:28:11,780
卡特纳在每个听证会上都作了供
410
00:28:11,820 --> 00:28:14,320
他不是唯一在计算时间的人
411
00:28:14,340 --> 00:28:16,050
他是被自己的枪杀死的
412
00:28:16,090 --> 00:28:18,650
出于防卫目的 在几年前买的
413
00:28:18,690 --> 00:28:20,580
太阳穴 警察发现了火药残留
414
00:28:20,590 --> 00:28:23,940
凶手从没想过把它弄得像自杀--
415
00:28:23,980 --> 00:28:26,480
这太不道德了
416
00:28:30,650 --> 00:28:32,800
你没问病人的事
417
00:28:32,830 --> 00:28:35,060
你在等α-1抗胰蛋白酶的结果
418
00:28:35,070 --> 00:28:37,390
就是说你查过我是不是还关注病人
419
00:28:37,440 --> 00:28:40,040
你想把病人转给别人 但又没有
420
00:28:40,050 --> 00:28:43,190
因为你认为这是唯一
能让我集中精力的事
421
00:28:43,200 --> 00:28:47,880
放轻松 我是对是错 很快就知道了
422
00:28:47,890 --> 00:28:50,600
找到这个病人的病因...
423
00:28:50,650 --> 00:28:53,900
我会再给你下一个病人
424
00:28:58,780 --> 00:28:59,660
怎么回事?
425
00:28:59,700 --> 00:29:00,580
护士发现她的
426
00:29:00,600 --> 00:29:03,560
她从推车上抓到什么 就注射进身体
427
00:29:03,590 --> 00:29:04,990
做傻事 让自己情况比艾迪更糟
428
00:29:05,000 --> 00:29:07,550
她不是想让自己更糟
429
00:29:07,970 --> 00:29:10,740
她是想自杀
430
00:29:14,100 --> 00:29:18,280
现在稳定了 但她的肝彻底停止工作
431
00:29:18,320 --> 00:29:20,210
艾迪也没什么变化
432
00:29:20,240 --> 00:29:23,330
那...感谢这个白痴般的行为
433
00:29:23,560 --> 00:29:26,570
找不到新肝脏的话
二十四小时内她就会死
434
00:29:26,580 --> 00:29:28,880
这是无私 她很爱他
435
00:29:28,890 --> 00:29:31,020
这和我说的有冲突吗?
436
00:29:31,080 --> 00:29:32,830
α-1抗胰蛋白酶缺乏检查呈阴性
437
00:29:32,880 --> 00:29:36,550
可能是骨髓纤维变性
但检查至少要四十八小时
438
00:29:36,600 --> 00:29:38,970
得试试活体部分捐赠
439
00:29:39,000 --> 00:29:40,750
损伤太严重了 她需要一整个肝
440
00:29:40,760 --> 00:29:42,590
没有诊断结果 没有肝脏
441
00:29:42,630 --> 00:29:44,810
没有肝脏 活不下去
442
00:29:44,820 --> 00:29:47,290
你怎么知道?
443
00:29:47,320 --> 00:29:50,400
这就是骨髓纤维变性
444
00:29:50,420 --> 00:29:51,800
这儿写着呢
445
00:29:51,850 --> 00:29:53,070
谁去给柯帝说?
446
00:29:53,120 --> 00:29:55,330
你对移植委员会撒过多少次谎了?
447
00:29:55,380 --> 00:29:57,670
- 就两次
- 几次有用的?
448
00:29:58,100 --> 00:30:00,670
我...看不出来这有什么联系
449
00:30:05,210 --> 00:30:06,660
住手 警察来了
450
00:30:06,670 --> 00:30:09,960
在你执着于调查卡特纳的时候
我们不会放任他们死去
451
00:30:10,010 --> 00:30:12,710
技术上说 他不是我们的病人
452
00:30:12,740 --> 00:30:14,490
所以我只是任她死了
453
00:30:14,500 --> 00:30:16,440
通常情况我们已经想过了
454
00:30:16,480 --> 00:30:18,750
不再考虑下罕见的情况吗?
455
00:30:18,780 --> 00:30:22,420
当然 别担心 上帝给了我两只耳朵
456
00:30:22,430 --> 00:30:26,580
卡特纳会说 让我们对柯帝坦白
457
00:30:28,230 --> 00:30:30,700
如果他在这儿的话
458
00:30:30,710 --> 00:30:32,980
我确定柯帝一定会偏向那个老家伙
459
00:30:32,990 --> 00:30:36,440
"嗨 死人不会介意我们--"
460
00:30:43,720 --> 00:30:47,490
需要一个无可救药浪漫主义者说服另一个
461
00:30:47,530 --> 00:30:48,650
卡特纳不是被谋杀的
462
00:30:48,660 --> 00:30:52,370
你是伴着那首"Who"摘下墨镜
推论出来的吧?(CSI)
463
00:30:52,450 --> 00:30:56,030
自杀意味着你原本能帮他
谋杀就不是你的责任
464
00:31:00,130 --> 00:31:02,650
说肝脏肝脏到
465
00:31:02,910 --> 00:31:05,000
他能部分捐赠
466
00:31:05,050 --> 00:31:08,580
他越快同意 她越快逃过死神
467
00:31:08,650 --> 00:31:10,410
部分不够 她要整个肝
468
00:31:10,420 --> 00:31:13,890
而他会死于手术
469
00:31:15,960 --> 00:31:18,550
真对仗啊?
470
00:31:19,230 --> 00:31:22,430
要是他在手术中死去 你就有一整个肝了
471
00:31:22,450 --> 00:31:25,410
如果他会 那也是为了爱
472
00:31:25,450 --> 00:31:29,110
我想他得和说同种语言的人交流
473
00:31:30,650 --> 00:31:32,960
你想我死在手术台上
474
00:31:33,010 --> 00:31:34,970
不是我们想
475
00:31:35,010 --> 00:31:37,560
是你妻子需要
476
00:31:37,590 --> 00:31:38,740
我的心脏呢?
477
00:31:38,770 --> 00:31:42,170
快要不行了 你最多还有几天
478
00:31:42,720 --> 00:31:45,590
但这时间足够救她
479
00:31:45,610 --> 00:31:48,170
我什么时候对她说再见?
480
00:31:48,190 --> 00:31:49,850
你不能
481
00:31:49,900 --> 00:31:53,120
如果她知道了这个 你认为她会同意吗?
482
00:31:54,640 --> 00:31:57,530
她会恨我
483
00:31:57,570 --> 00:32:01,420
她会活下来 其他的都不重要
484
00:32:21,580 --> 00:32:23,070
不能进行移植
485
00:32:23,130 --> 00:32:24,840
除非他说不
486
00:32:24,870 --> 00:32:27,330
但你这样急说明他同意了
487
00:32:27,350 --> 00:32:30,340
他的手指有结节 可能他的医生诊断错了
488
00:32:30,350 --> 00:32:33,370
或是你想得太美好了
489
00:32:33,380 --> 00:32:36,880
肥胖者伴有肺癌--很容易解释心衰
490
00:32:36,900 --> 00:32:39,350
但结节说明是另外的 可治愈的
491
00:32:39,400 --> 00:32:40,690
回急诊室去
492
00:32:40,720 --> 00:32:42,780
感谢你和你的怯懦
493
00:32:42,830 --> 00:32:45,260
怎么? 我让你去告诉好消息--
494
00:32:45,270 --> 00:32:47,870
甚至是让你嘲笑别的医生的机会
495
00:32:47,910 --> 00:32:50,140
除了你是错的
496
00:32:50,580 --> 00:32:54,270
你也是伴着那首"Who"摘下墨镜时
推论出来的?
497
00:32:54,830 --> 00:32:59,640
杀了卡特纳父母的人
两个月前死于动脉瘤
498
00:32:59,700 --> 00:33:01,760
卡特纳没说过
499
00:33:01,790 --> 00:33:04,830
你没有机会救他--没人有
500
00:33:04,880 --> 00:33:08,230
去检查 看你是不是有机会救艾迪
501
00:33:17,790 --> 00:33:19,930
坏消息
502
00:33:19,940 --> 00:33:22,540
爱救不了你
503
00:33:23,370 --> 00:33:26,270
另外...
504
00:33:27,300 --> 00:33:29,300
霉可以
505
00:33:29,360 --> 00:33:34,690
你的心衰是由一种叫心脏芽生菌的
真菌感染导致
506
00:33:34,740 --> 00:33:40,570
最初是在肺部结节 每个医生
除了一个 都当成了癌症
507
00:33:40,580 --> 00:33:42,260
很罕见 可治愈
508
00:33:42,310 --> 00:33:44,000
给你用抗真菌药
509
00:33:44,050 --> 00:33:46,500
但我怎么没吃药都好起来了?
510
00:33:46,540 --> 00:33:50,940
你的情绪让儿茶酚胺分泌增加
促进催乳激素的分泌
511
00:33:50,950 --> 00:33:52,180
情绪?
512
00:33:52,260 --> 00:33:56,530
三个月治疗 你就能变得健康强壮
513
00:33:57,500 --> 00:34:00,750
我不想治疗
514
00:34:01,070 --> 00:34:03,380
做移植
515
00:34:03,430 --> 00:34:05,460
但你这是在...
516
00:34:05,470 --> 00:34:10,730
放弃肯定能活的机会
换取她不一定能活的机会
517
00:34:10,740 --> 00:34:13,630
反正我都准备死了
518
00:34:13,640 --> 00:34:17,110
那就对你下个妻子好点
519
00:34:19,830 --> 00:34:23,460
如果你不干...就让我出院
520
00:34:23,470 --> 00:34:29,010
如果我被车撞了 停在了太平间
521
00:34:30,780 --> 00:34:33,930
你就能把我的肝脏给她了
522
00:34:39,300 --> 00:34:41,970
这本质上是要我们去杀人
523
00:34:41,980 --> 00:34:43,470
昨天的计划不也一样
524
00:34:43,510 --> 00:34:46,810
他还有二十年性命和两天是不一样的
525
00:34:46,860 --> 00:34:49,050
事实上和上法律都无区别
526
00:34:49,390 --> 00:34:52,850
这就是你说服我们的方法
说它不是背德的?
527
00:34:52,920 --> 00:34:55,230
那蠢货不管怎样都会做的
528
00:34:55,240 --> 00:34:57,010
只是这样能保存器官
529
00:34:57,050 --> 00:34:58,450
我们要保护他
530
00:34:58,460 --> 00:35:01,620
那就把他绑在床上 等他妻子死去?
531
00:35:01,660 --> 00:35:03,580
我不干
532
00:35:08,430 --> 00:35:10,610
我去
533
00:35:11,810 --> 00:35:14,870
已经有了一个人毫无意义地死了
534
00:35:19,430 --> 00:35:22,450
艾迪... 这怎么回事?
535
00:35:22,460 --> 00:35:24,920
不知道 他把我推过来的
536
00:35:26,470 --> 00:35:30,720
你丈夫的病能治好 但他想要死
好把肝脏给你
537
00:35:30,750 --> 00:35:33,150
你能接受这个 还是想让他接受治疗?
538
00:35:33,200 --> 00:35:35,040
你个混球!
539
00:35:35,080 --> 00:35:37,310
- 艾迪 不!
- 让我干
540
00:35:37,320 --> 00:35:39,510
夏洛特 能听见我说话吗?
541
00:35:42,030 --> 00:35:44,890
她发烧了 穿刺显示她的白血球过高
542
00:35:44,900 --> 00:35:46,180
她全身感染
543
00:35:46,250 --> 00:35:47,470
我真该炒了你
544
00:35:47,520 --> 00:35:49,440
我只是完成你没做到的事
545
00:35:49,450 --> 00:35:51,740
说服艾迪活着 让他妻子死去
546
00:35:51,750 --> 00:35:53,630
感染意味着新线索
547
00:35:53,660 --> 00:35:55,920
顶多还有两三个小时来诊断
548
00:35:55,980 --> 00:35:58,040
肉状瘤病会导致脾和肝的损伤
549
00:35:58,060 --> 00:35:58,910
那肺就该有问题
550
00:35:58,940 --> 00:36:00,410
硬皮病会使组织发炎红肿
551
00:36:00,420 --> 00:36:03,620
皮肤和胃肠道都没有问题
552
00:36:03,630 --> 00:36:06,300
- 她隐藏了些什么?
- 你不知道...
553
00:36:06,310 --> 00:36:10,240
要么我们有所有线索但我们是白痴
要么就是还没有掌握所有的线索
554
00:36:10,310 --> 00:36:13,670
可能的暴露源 接触过的人 去过的地方
555
00:36:14,790 --> 00:36:17,250
都是
556
00:36:20,410 --> 00:36:22,200
好糟糕的谎言
557
00:36:22,260 --> 00:36:26,300
你真的觉得夏威夷的海滩
和里约热内卢的是一样的吗?
558
00:36:26,310 --> 00:36:29,390
携带的病菌沙蝇就是截然不同的
559
00:36:29,430 --> 00:36:31,060
她从没去过里约热内卢
560
00:36:31,100 --> 00:36:32,920
你和谁一起去的?
561
00:36:32,970 --> 00:36:35,570
你为什么要这么做?
562
00:36:35,580 --> 00:36:38,040
我不是真的需要知道是谁
563
00:36:38,050 --> 00:36:39,750
我只是要确认你去过...
564
00:36:39,790 --> 00:36:43,740
这样我们就能知道你有内脏利什曼病
565
00:36:44,390 --> 00:36:47,640
但既然Lancelot都已经愿意为你而死了...
(亚瑟王圆桌武士中的第一位勇士)
566
00:36:47,690 --> 00:36:51,080
他大概两个答案都想知道
567
00:36:59,340 --> 00:37:02,100
去年...
568
00:37:02,930 --> 00:37:06,350
那个人你不认识的
569
00:37:07,350 --> 00:37:10,520
该是我们一起去里约热内卢的
570
00:37:10,910 --> 00:37:14,730
但我厌倦等待了
571
00:37:14,740 --> 00:37:18,710
对不起
572
00:37:29,160 --> 00:37:31,460
给她用锑
573
00:37:31,480 --> 00:37:34,600
还有 让柯帝给她找个肝脏
574
00:37:37,110 --> 00:37:39,650
他们准备为对方死
575
00:37:39,700 --> 00:37:41,310
是缘于负罪感 而不是爱
576
00:37:41,350 --> 00:37:44,730
没有爱你不会感到这么沉重的负罪感
577
00:37:51,800 --> 00:37:54,110
纽约慈济医院的直升机
正带着肝脏赶来
578
00:37:54,140 --> 00:37:56,480
- 到达的时间大概是...
- 告诉他们转向回去
579
00:37:56,490 --> 00:37:59,200
夏洛特的治疗没有起效
580
00:38:00,100 --> 00:38:02,990
我们确诊得太晚了
581
00:38:07,050 --> 00:38:09,550
别人都去参加卡特纳的葬礼了
582
00:38:09,590 --> 00:38:12,100
你可以和我一起去
583
00:38:12,110 --> 00:38:14,650
我打算留在夏洛特身边
584
00:38:16,150 --> 00:38:18,710
她给你争取了一些救艾迪的时间
585
00:38:18,740 --> 00:38:20,990
这会给她的死带来一些意义
586
00:38:21,630 --> 00:38:24,640
不 不会的
587
00:38:32,260 --> 00:38:33,530
我看错你了
588
00:38:33,540 --> 00:38:35,850
- 不 你没有
- 你很痛苦
589
00:38:36,200 --> 00:38:38,570
你再一次把这事想得太人性了
590
00:38:38,580 --> 00:38:42,650
你和他天天在一起工作两年了
你从来没有预计到这会发生
591
00:38:42,680 --> 00:38:44,390
没有人预计到
592
00:38:44,410 --> 00:38:46,690
但是你会预计到所有事
593
00:38:46,700 --> 00:38:48,460
这从来都不是关于你遗漏了什么
594
00:38:48,490 --> 00:38:50,300
是关于你为什么会遗漏
595
00:38:50,350 --> 00:38:54,740
你害怕你失去你的天赋 迷失...
596
00:38:54,750 --> 00:38:56,940
迷失你自己
597
00:38:56,970 --> 00:39:00,070
我很害怕 你在迷失后会做什么
598
00:39:01,610 --> 00:39:04,280
除非你觉得在这给我做治疗更重要...
599
00:39:04,310 --> 00:39:07,690
你不是有一场葬礼要去参加吗?
600
00:39:34,230 --> 00:39:40,160
<font color=#DB7093>曲名:Lose You
歌手:Pete Yorn</font>
601
00:39:40,230 --> 00:39:47,290
* 我 搭车离开
602
00:39:47,300 --> 00:39:51,680
* 这是我自己的事
603
00:39:51,690 --> 00:39:56,020
* 我已不能忍受
604
00:39:56,030 --> 00:40:02,150
* 困在笼子里 我并不后悔
605
00:40:03,330 --> 00:40:08,860
* 我不需要得到更多
606
00:40:09,820 --> 00:40:13,570
* 少一点刚好
607
00:40:14,910 --> 00:40:20,510
* 这对我是另一回事
608
00:40:20,520 --> 00:40:28,040
* 我只想徜徉过这个世界
609
00:40:28,580 --> 00:40:31,300
* 独自一人
610
00:40:52,210 --> 00:40:56,550
* 停 别掉进
611
00:40:56,560 --> 00:41:03,000
* 我挖好的坑里
612
00:41:03,770 --> 00:41:07,930
* 歇着 就算你
613
00:41:07,940 --> 00:41:14,670
*开始感受到我的感受
614
00:41:15,470 --> 00:41:21,140
* 我不需要得到更多
615
00:41:21,150 --> 00:41:26,060
* 我只是有些困惑
616
00:41:27,730 --> 00:41:32,660
* 别说个不停
617
00:41:32,670 --> 00:41:40,440
* 你没法让我开心起来
618
00:41:42,470 --> 00:41:46,810
* 因为我要失去你了
619
00:41:48,220 --> 00:41:52,060
* 要失去你了
620
00:41:53,970 --> 00:41:57,810
* 如果我就要失去你
621
00:42:05,600 --> 00:42:10,590
* 因为我要失去你了
622
00:42:11,460 --> 00:42:15,150
* 要失去你了
623
00:42:17,240 --> 00:42:21,340
* 如果我就要失去你
624
00:42:24,130 --> 00:42:28,960
* 那就永远失去你吧
| {
"pile_set_name": "Github"
} |
package dns
import (
"crypto/hmac"
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"encoding/binary"
"encoding/hex"
"hash"
"strconv"
"strings"
"time"
)
// HMAC hashing codes. These are transmitted as domain names.
const (
HmacMD5 = "hmac-md5.sig-alg.reg.int."
HmacSHA1 = "hmac-sha1."
HmacSHA256 = "hmac-sha256."
HmacSHA512 = "hmac-sha512."
)
// TSIG is the RR the holds the transaction signature of a message.
// See RFC 2845 and RFC 4635.
type TSIG struct {
Hdr RR_Header
Algorithm string `dns:"domain-name"`
TimeSigned uint64 `dns:"uint48"`
Fudge uint16
MACSize uint16
MAC string `dns:"size-hex:MACSize"`
OrigId uint16
Error uint16
OtherLen uint16
OtherData string `dns:"size-hex:OtherLen"`
}
// TSIG has no official presentation format, but this will suffice.
func (rr *TSIG) String() string {
s := "\n;; TSIG PSEUDOSECTION:\n"
s += rr.Hdr.String() +
" " + rr.Algorithm +
" " + tsigTimeToString(rr.TimeSigned) +
" " + strconv.Itoa(int(rr.Fudge)) +
" " + strconv.Itoa(int(rr.MACSize)) +
" " + strings.ToUpper(rr.MAC) +
" " + strconv.Itoa(int(rr.OrigId)) +
" " + strconv.Itoa(int(rr.Error)) + // BIND prints NOERROR
" " + strconv.Itoa(int(rr.OtherLen)) +
" " + rr.OtherData
return s
}
func (rr *TSIG) parse(c *zlexer, origin string) *ParseError {
panic("dns: internal error: parse should never be called on TSIG")
}
// The following values must be put in wireformat, so that the MAC can be calculated.
// RFC 2845, section 3.4.2. TSIG Variables.
type tsigWireFmt struct {
// From RR_Header
Name string `dns:"domain-name"`
Class uint16
Ttl uint32
// Rdata of the TSIG
Algorithm string `dns:"domain-name"`
TimeSigned uint64 `dns:"uint48"`
Fudge uint16
// MACSize, MAC and OrigId excluded
Error uint16
OtherLen uint16
OtherData string `dns:"size-hex:OtherLen"`
}
// If we have the MAC use this type to convert it to wiredata. Section 3.4.3. Request MAC
type macWireFmt struct {
MACSize uint16
MAC string `dns:"size-hex:MACSize"`
}
// 3.3. Time values used in TSIG calculations
type timerWireFmt struct {
TimeSigned uint64 `dns:"uint48"`
Fudge uint16
}
// TsigGenerate fills out the TSIG record attached to the message.
// The message should contain
// a "stub" TSIG RR with the algorithm, key name (owner name of the RR),
// time fudge (defaults to 300 seconds) and the current time
// The TSIG MAC is saved in that Tsig RR.
// When TsigGenerate is called for the first time requestMAC is set to the empty string and
// timersOnly is false.
// If something goes wrong an error is returned, otherwise it is nil.
func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, string, error) {
if m.IsTsig() == nil {
panic("dns: TSIG not last RR in additional")
}
// If we barf here, the caller is to blame
rawsecret, err := fromBase64([]byte(secret))
if err != nil {
return nil, "", err
}
rr := m.Extra[len(m.Extra)-1].(*TSIG)
m.Extra = m.Extra[0 : len(m.Extra)-1] // kill the TSIG from the msg
mbuf, err := m.Pack()
if err != nil {
return nil, "", err
}
buf := tsigBuffer(mbuf, rr, requestMAC, timersOnly)
t := new(TSIG)
var h hash.Hash
switch strings.ToLower(rr.Algorithm) {
case HmacMD5:
h = hmac.New(md5.New, rawsecret)
case HmacSHA1:
h = hmac.New(sha1.New, rawsecret)
case HmacSHA256:
h = hmac.New(sha256.New, rawsecret)
case HmacSHA512:
h = hmac.New(sha512.New, rawsecret)
default:
return nil, "", ErrKeyAlg
}
h.Write(buf)
t.MAC = hex.EncodeToString(h.Sum(nil))
t.MACSize = uint16(len(t.MAC) / 2) // Size is half!
t.Hdr = RR_Header{Name: rr.Hdr.Name, Rrtype: TypeTSIG, Class: ClassANY, Ttl: 0}
t.Fudge = rr.Fudge
t.TimeSigned = rr.TimeSigned
t.Algorithm = rr.Algorithm
t.OrigId = m.Id
tbuf := make([]byte, Len(t))
off, err := PackRR(t, tbuf, 0, nil, false)
if err != nil {
return nil, "", err
}
mbuf = append(mbuf, tbuf[:off]...)
// Update the ArCount directly in the buffer.
binary.BigEndian.PutUint16(mbuf[10:], uint16(len(m.Extra)+1))
return mbuf, t.MAC, nil
}
// TsigVerify verifies the TSIG on a message.
// If the signature does not validate err contains the
// error, otherwise it is nil.
func TsigVerify(msg []byte, secret, requestMAC string, timersOnly bool) error {
rawsecret, err := fromBase64([]byte(secret))
if err != nil {
return err
}
// Strip the TSIG from the incoming msg
stripped, tsig, err := stripTsig(msg)
if err != nil {
return err
}
msgMAC, err := hex.DecodeString(tsig.MAC)
if err != nil {
return err
}
buf := tsigBuffer(stripped, tsig, requestMAC, timersOnly)
// Fudge factor works both ways. A message can arrive before it was signed because
// of clock skew.
now := uint64(time.Now().Unix())
ti := now - tsig.TimeSigned
if now < tsig.TimeSigned {
ti = tsig.TimeSigned - now
}
if uint64(tsig.Fudge) < ti {
return ErrTime
}
var h hash.Hash
switch strings.ToLower(tsig.Algorithm) {
case HmacMD5:
h = hmac.New(md5.New, rawsecret)
case HmacSHA1:
h = hmac.New(sha1.New, rawsecret)
case HmacSHA256:
h = hmac.New(sha256.New, rawsecret)
case HmacSHA512:
h = hmac.New(sha512.New, rawsecret)
default:
return ErrKeyAlg
}
h.Write(buf)
if !hmac.Equal(h.Sum(nil), msgMAC) {
return ErrSig
}
return nil
}
// Create a wiredata buffer for the MAC calculation.
func tsigBuffer(msgbuf []byte, rr *TSIG, requestMAC string, timersOnly bool) []byte {
var buf []byte
if rr.TimeSigned == 0 {
rr.TimeSigned = uint64(time.Now().Unix())
}
if rr.Fudge == 0 {
rr.Fudge = 300 // Standard (RFC) default.
}
// Replace message ID in header with original ID from TSIG
binary.BigEndian.PutUint16(msgbuf[0:2], rr.OrigId)
if requestMAC != "" {
m := new(macWireFmt)
m.MACSize = uint16(len(requestMAC) / 2)
m.MAC = requestMAC
buf = make([]byte, len(requestMAC)) // long enough
n, _ := packMacWire(m, buf)
buf = buf[:n]
}
tsigvar := make([]byte, DefaultMsgSize)
if timersOnly {
tsig := new(timerWireFmt)
tsig.TimeSigned = rr.TimeSigned
tsig.Fudge = rr.Fudge
n, _ := packTimerWire(tsig, tsigvar)
tsigvar = tsigvar[:n]
} else {
tsig := new(tsigWireFmt)
tsig.Name = strings.ToLower(rr.Hdr.Name)
tsig.Class = ClassANY
tsig.Ttl = rr.Hdr.Ttl
tsig.Algorithm = strings.ToLower(rr.Algorithm)
tsig.TimeSigned = rr.TimeSigned
tsig.Fudge = rr.Fudge
tsig.Error = rr.Error
tsig.OtherLen = rr.OtherLen
tsig.OtherData = rr.OtherData
n, _ := packTsigWire(tsig, tsigvar)
tsigvar = tsigvar[:n]
}
if requestMAC != "" {
x := append(buf, msgbuf...)
buf = append(x, tsigvar...)
} else {
buf = append(msgbuf, tsigvar...)
}
return buf
}
// Strip the TSIG from the raw message.
func stripTsig(msg []byte) ([]byte, *TSIG, error) {
// Copied from msg.go's Unpack() Header, but modified.
var (
dh Header
err error
)
off, tsigoff := 0, 0
if dh, off, err = unpackMsgHdr(msg, off); err != nil {
return nil, nil, err
}
if dh.Arcount == 0 {
return nil, nil, ErrNoSig
}
// Rcode, see msg.go Unpack()
if int(dh.Bits&0xF) == RcodeNotAuth {
return nil, nil, ErrAuth
}
for i := 0; i < int(dh.Qdcount); i++ {
_, off, err = unpackQuestion(msg, off)
if err != nil {
return nil, nil, err
}
}
_, off, err = unpackRRslice(int(dh.Ancount), msg, off)
if err != nil {
return nil, nil, err
}
_, off, err = unpackRRslice(int(dh.Nscount), msg, off)
if err != nil {
return nil, nil, err
}
rr := new(TSIG)
var extra RR
for i := 0; i < int(dh.Arcount); i++ {
tsigoff = off
extra, off, err = UnpackRR(msg, off)
if err != nil {
return nil, nil, err
}
if extra.Header().Rrtype == TypeTSIG {
rr = extra.(*TSIG)
// Adjust Arcount.
arcount := binary.BigEndian.Uint16(msg[10:])
binary.BigEndian.PutUint16(msg[10:], arcount-1)
break
}
}
if rr == nil {
return nil, nil, ErrNoSig
}
return msg[:tsigoff], rr, nil
}
// Translate the TSIG time signed into a date. There is no
// need for RFC1982 calculations as this date is 48 bits.
func tsigTimeToString(t uint64) string {
ti := time.Unix(int64(t), 0).UTC()
return ti.Format("20060102150405")
}
func packTsigWire(tw *tsigWireFmt, msg []byte) (int, error) {
// copied from zmsg.go TSIG packing
// RR_Header
off, err := PackDomainName(tw.Name, msg, 0, nil, false)
if err != nil {
return off, err
}
off, err = packUint16(tw.Class, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(tw.Ttl, msg, off)
if err != nil {
return off, err
}
off, err = PackDomainName(tw.Algorithm, msg, off, nil, false)
if err != nil {
return off, err
}
off, err = packUint48(tw.TimeSigned, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(tw.Fudge, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(tw.Error, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(tw.OtherLen, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(tw.OtherData, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func packMacWire(mw *macWireFmt, msg []byte) (int, error) {
off, err := packUint16(mw.MACSize, msg, 0)
if err != nil {
return off, err
}
off, err = packStringHex(mw.MAC, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func packTimerWire(tw *timerWireFmt, msg []byte) (int, error) {
off, err := packUint48(tw.TimeSigned, msg, 0)
if err != nil {
return off, err
}
off, err = packUint16(tw.Fudge, msg, off)
if err != nil {
return off, err
}
return off, nil
}
| {
"pile_set_name": "Github"
} |
/**
* Thai translation for foundation-datepicker
* Suchau Jiraprapot <[email protected]>
*/
;(function($){
$.fn.fdatepicker.dates['th'] = {
days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"],
daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
today: "วันนี้"
};
}(jQuery));
| {
"pile_set_name": "Github"
} |
package tc.oc.pgm.structure;
import org.bukkit.World;
import org.bukkit.region.BlockRegion;
import org.bukkit.util.Vector;
import tc.oc.pgm.features.Feature;
/**
* Created from a {@link StructureDefinition} for a specific {@link org.bukkit.World}.
*/
public interface Structure extends Feature<StructureDefinition> {
/**
* Return a {@link BlockRegion} containing only the blocks
* that were copied from the {@link org.bukkit.World} for this
* structure when it was loaded.
*
* This may be a subset of the {@link tc.oc.pgm.regions.Region}
* from the structure's {@link StructureDefinition}.
*/
BlockRegion dynamicBlocks();
/**
* Place this structure in its origin world, offset by the given delta.
*/
void place(World world, Vector offset);
}
| {
"pile_set_name": "Github"
} |
package lints
/*
* ZLint Copyright 2018 Regents of the University of Michigan
*
* 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.
*/
/************************************************
BRs: 7.1.4.2.1
Subject Alternative Name Extension
Certificate Field: extensions:subjectAltName
Required/Optional: Required
************************************************/
import (
"github.com/zmap/zcrypto/x509"
"github.com/zmap/zlint/util"
)
type SANMissing struct{}
func (l *SANMissing) Initialize() error {
return nil
}
func (l *SANMissing) CheckApplies(c *x509.Certificate) bool {
return !util.IsCACert(c)
}
func (l *SANMissing) Execute(c *x509.Certificate) *LintResult {
if util.IsExtInCert(c, util.SubjectAlternateNameOID) {
return &LintResult{Status: Pass}
} else {
return &LintResult{Status: Error}
}
}
func init() {
RegisterLint(&Lint{
Name: "e_ext_san_missing",
Description: "Subscriber certificates MUST contain the Subject Alternate Name extension",
Citation: "BRs: 7.1.4.2.1",
Source: CABFBaselineRequirements,
EffectiveDate: util.CABEffectiveDate,
Lint: &SANMissing{},
})
}
| {
"pile_set_name": "Github"
} |
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// VirtualProcessor.cpp
//
// Source file containing the VirtualProcessor implementation.
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#include "concrtinternal.h"
namespace Concurrency
{
namespace details
{
/// <summary>
/// Constructs a virtual processor.
/// </summary>
VirtualProcessor::VirtualProcessor()
: m_localRunnableContexts(&m_lock)
{
// Derived classes should use Initialize(...) to init the virtual processor
}
/// <summary>
/// Initializes the virtual processor. This API is called by the constructor, and when a virtual processor is to
/// be re-initialized, when it is pulled of the free pool in the list array.
/// </summary>
/// <param name="pOwningNode">
/// The owning schedule node for this virtual processor
/// </param>
/// <param name="pOwningRoot">
/// The owning IVirtualProcessorRoot
/// </param>
void VirtualProcessor::Initialize(SchedulingNode *pOwningNode, IVirtualProcessorRoot *pOwningRoot)
{
OMTRACE(MTRACE_EVT_INITIALIZED, this, NULL, NULL, NULL);
m_lastServiceTime = 0;
m_priorityServiceLink.m_boostState = BoostedObject::BoostStateUnboosted;
m_priorityServiceLink.m_type = BoostedObject::BoostTypeVirtualProcessor;
m_pPushContext = NULL;
m_pOwningNode = pOwningNode;
m_pOwningRing = pOwningNode->GetSchedulingRing();
m_pOwningRoot = pOwningRoot;
m_fMarkedForRetirement = false;
m_fOversubscribed = false;
m_availabilityType = AvailabilityClaimed;
m_enqueuedTaskCounter = 0;
m_dequeuedTaskCounter = 0;
m_enqueuedTaskCheckpoint = 0;
m_dequeuedTaskCheckpoint = 0;
m_pExecutingContext = NULL;
m_pOversubscribingContext = NULL;
m_safePointMarker.Reset();
m_pSubAllocator = NULL;
m_fLocal = false;
m_fAffine = false;
//
// When a VPROC first comes online, it **MUST** do one affine SFW before moving on with life. This avoids a wake/arrive race with affine
// work.
//
m_fShortAffine = true;
SchedulerBase *pScheduler = m_pOwningNode->GetScheduler();
// A virtual procesor has the same id as its associated virtual processor root. The roots have process unique ids.
m_id = pOwningRoot->GetId();
// Keep track of the abstract identifier for the underlying execution resource.
m_resourceId = pOwningRoot->GetExecutionResourceId();
// Determine our hash id and create our map.
m_maskId = pScheduler->GetResourceMaskId(m_resourceId);
m_resourceMask.Grow(pScheduler->GetMaskIdCount());
m_resourceMask.Wipe();
m_resourceMask.Set(m_maskId);
if (pScheduler->GetSchedulingProtocol() == ::Concurrency::EnhanceScheduleGroupLocality)
m_searchCtx.Reset(this, WorkSearchContext::AlgorithmCacheLocal);
else
m_searchCtx.Reset(this, WorkSearchContext::AlgorithmFair);
m_location = location(location::_ExecutionResource, m_resourceId, m_pOwningNode->m_pScheduler->Id(), this);
// Notify the scheduler that we are listening for events pertaining to affinity and locality.
pScheduler->ListenAffinity(m_maskId);
TraceVirtualProcessorEvent(CONCRT_EVENT_START, TRACE_LEVEL_INFORMATION, m_pOwningNode->m_pScheduler->Id(), m_id);
}
/// <summary>
/// Destroys a virtual processor
/// </summary>
VirtualProcessor::~VirtualProcessor()
{
ASSERT(m_localRunnableContexts.Count() == 0);
if (m_pSubAllocator != NULL)
{
SchedulerBase::ReturnSubAllocator(m_pSubAllocator);
m_pSubAllocator = NULL;
}
}
/// <summary>
/// Activates a virtual processor with the context provided.
/// </summary>
void VirtualProcessor::Activate(IExecutionContext * pContext)
{
VMTRACE(MTRACE_EVT_ACTIVATE, ToInternalContext(pContext), this, SchedulerBase::FastCurrentContext());
#if _UMSTRACE
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
CMTRACE(MTRACE_EVT_ACTIVATE, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, pContext);
CMTRACE(MTRACE_EVT_ACTIVATED, ToInternalContext(pContext), this, pCurrentContext);
#endif // _UMSTRACE
m_pOwningRoot->Activate(pContext);
}
/// <summary>
/// Temporarily deactivates a virtual processor.
/// <summary>
/// <returns>
/// An indication of which side the awakening occured from (true -- we activated it, false -- the RM awoke it).
/// </returns>
bool VirtualProcessor::Deactivate(IExecutionContext * pContext)
{
VMTRACE(MTRACE_EVT_DEACTIVATE, ToInternalContext(pContext), this, false);
#if _UMSTRACE
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
CMTRACE(MTRACE_EVT_DEACTIVATE, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, pContext);
#endif // _UMSTRACE
return m_pOwningRoot->Deactivate(pContext);
}
/// <summary>
/// Invokes the underlying virtual processor root to ensure all tasks are visible
/// </summary>
void VirtualProcessor::EnsureAllTasksVisible(IExecutionContext * pContext)
{
VMTRACE(MTRACE_EVT_DEACTIVATE, ToInternalContext(pContext), this, true);
#if _UMSTRACE
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
CMTRACE(MTRACE_EVT_DEACTIVATE, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, pContext);
#endif // _UMSTRACE
m_pOwningRoot->EnsureAllTasksVisible(pContext);
}
/// <summary>
/// Exercises a claim of ownership over a virtual processor and starts it up.
/// </summary>
bool VirtualProcessor::ExerciseClaim(VirtualProcessor::AvailabilityType type, ScheduleGroupSegmentBase *pSegment, InternalContextBase *pContext)
{
VMTRACE(MTRACE_EVT_TICKETEXERCISE, SchedulerBase::FastCurrentContext(), this, type);
SchedulerBase *pScheduler = GetOwningNode()->GetScheduler();
CONCRT_COREASSERT(type != AvailabilityClaimed);
//
// @TODO: Should we allow a generic exercise with AvailabilityInactivePendingThread or should this require an explicit exercise.
//
switch(type)
{
case AvailabilityInactive:
case AvailabilityInactivePendingThread:
if (!pScheduler->VirtualProcessorActive(true))
{
//
// This happened during a shutdown/DRM race. We do not need to notify the background thread of anything. It will all work out
// as finalization proceeds.
//
if (pContext != NULL)
{
CONCRT_COREASSERT(!pContext->IsPrepared());
//
// Only a pre-bound context is passed into here. If we cannot start up the vproc right now, the context needs
// to get retired.
//
pScheduler->ReleaseInternalContext(pContext, true);
}
MakeAvailable(type, false);
return false;
}
if (pSegment == NULL)
pSegment = pScheduler->GetAnonymousScheduleGroupSegment();
return StartupWorkerContext(pSegment, pContext);
case AvailabilityIdlePendingThread:
//
// This path is not generalized and is specific to UMS.
//
// Consideration might be given to allowing push to this virtual processor we just decided to wake up instead of allowing the
// SFW. The problem here is that the context might be doing its own SFW and the two contexts might collide. If they do, there's
// a question about what's reasonable to do. For now, this is unsupported -- we only push to inactive vprocs.
//
CONCRT_COREASSERT(pContext == NULL);
break;
default:
//
// See above comments under IdlePendingThread.
//
CONCRT_COREASSERT(pContext == NULL);
CONCRT_COREASSERT(m_pAvailableContext != NULL);
//
// Note: We cannot validate that m_pExecutingContext is running atop this. On UMS, it's legal (although extremely discouraged) to UMS
// block between MakeAvailable and Deactivate in the SFW path. In that case, we pick up other runnables. The context which is going
// to be activated and subsequently swallow the activate with a corresponding deactivate is m_pAvailableContext. m_pExecutingContext
// may be the random thing we switched to. If this happens, m_pAvailableContext may also have a NULL vproc.
//
// Note that this typically occasionally happens due to the FlushProcessWriteBuffers call before final deactivation.
//
#if defined(_DEBUG)
{
VirtualProcessor *pVProc = ToInternalContext(m_pAvailableContext) ? ToInternalContext(m_pAvailableContext)->m_pVirtualProcessor : NULL;
CONCRT_COREASSERT(pVProc == this || pVProc == NULL);
}
#endif // defined(_DEBUG)
}
m_pOwningRoot->Activate(m_pAvailableContext);
return true;
}
/// <summary>
/// Start a worker context executing on this.virtual processor.
/// </summary>
bool VirtualProcessor::StartupWorkerContext(ScheduleGroupSegmentBase *pSegment, InternalContextBase *pContext)
{
//
// We need to spin until m_pExecutingContext is NULL so we can appropriately affinitize a new thread and not conflict.
//
if (m_pExecutingContext != NULL)
{
_SpinWaitBackoffNone spinWait(_Sleep0);
while(m_pExecutingContext != NULL)
spinWait._SpinOnce();
}
if (pContext != NULL)
{
if (!pContext->IsPrepared())
pContext->PrepareForUse(pSegment, NULL, false);
}
else
{
pContext = pSegment->GetInternalContext();
}
//
// It's entirely possible we could *NOT* get a thread to wake up this virtual processor. In this case, we need to make it idle
// again and tell the background thread to wake us up when there is a thread available.
//
if (pContext == NULL)
{
MakeAvailable(AvailabilityInactivePendingThread);
GetOwningNode()->GetScheduler()->DeferredGetInternalContext();
return false;
}
Affinitize(pContext);
m_pOwningRoot->Activate(m_pExecutingContext);
return true;
}
/// <summary>
/// Affinitizes an internal context to the virtual processor.
/// </summary>
/// <param name="pContext">
/// The internal context to affinitize.
/// </param>
void VirtualProcessor::Affinitize(InternalContextBase *pContext)
{
//
// Wait until the context is firmly blocked, if it has started. This is essential to prevent vproc orphanage
// if the context we're switching to is IN THE PROCESS of switching out to a different one. An example of how this
// could happen:
//
// 1] ctxA is running on vp1. It is in the process of blocking, and wants to switch to ctxB. This means ctxA needs to
// affintize ctxB to its own vproc, vp1.
//
// 2] At the exact same time, ctxA is unblocked by ctxY and put onto a runnables collection in its scheduler. Meanwhile, ctxZ
// executing on vp2, has also decided to block. It picks ctxA off the runnables collection, and proceeds to switch to it.
// This means that ctxZ needs to affinitize ctxA to ITS vproc vp2.
//
// 3] Now, if ctxZ affintizes ctxA to vp2 BEFORE ctxA has had a chance to affintize ctxB to vp1, ctxB gets mistakenly
// affintized to vp2, and vp1 is orphaned.
//
// In order to prevent this, ctxZ MUST wait until AFTER ctxA has finished its affinitization. This is indicated via the
// blocked flag. ctxA will set its blocked flag to 1, after it has finished affintizing ctxB to vp1, at which point it is
// safe for ctxZ to modify ctxA's vproc and change it from vp1 to vp2.
//
// Note that it is possible that pContext is NULL in the case where we are going to SwitchOut a virtual processor due to a lack of
// available threads.
//
if (pContext != NULL)
{
pContext->SpinUntilBlocked();
pContext->PrepareToRun(this);
VCMTRACE(MTRACE_EVT_AFFINITIZED, pContext, this, NULL);
#if defined(_DEBUG)
pContext->ClearDebugBits();
pContext->SetDebugBits(CTX_DEBUGBIT_AFFINITIZED);
#endif // _DEBUG
}
// Make sure there is a two-way mapping between a virual processor and the affinitized context attached to it.
// The pContext-> side of this mapping was established in PrepareToRun.
m_pExecutingContext = pContext;
//
// If we were unable to update the statistical information because internal context was not
// affinitized to a virtual processor, then do it now when the affinitization is done.
//
if (pContext != NULL && pContext->m_fHasDequeuedTask)
{
m_dequeuedTaskCounter++;
pContext->m_fHasDequeuedTask = false;
}
}
/// <summary>
/// Marks the virtual processor such that it removes itself from the scheduler once the context it is executing
/// reaches a safe yield point. Alternatively, if the context has not started executing yet, it can be retired immediately.
/// </summary>
void VirtualProcessor::MarkForRetirement()
{
ClaimTicket ticket;
if (ClaimExclusiveOwnership(ticket))
{
//
// If there is a context attached to this virtual processor but we were able to claim it for
// retirement then we have to unblock this context and send it for retirement. Otherwise, if
// there was no context attached we can simply retire the virtual processor.
//
if (ticket.ExerciseWakesExisting())
{
m_fMarkedForRetirement = true;
ticket.Exercise();
}
else
{
Retire();
}
}
else
{
//
// Instruct the virtual processor to exit at a yield point - when the context it is executing enters the scheduler
// from user code.
//
m_fMarkedForRetirement = true;
}
}
/// <summary>
/// Attempts to claim exclusive ownership of the virtual processor by resetting the available flag.
/// </summary>
/// <param name="ticket">
/// If true is returned, this will contain the claim ticket used to activate the virtual processor.
/// </param>
/// <param name="type">
/// If specified, indicates the type of availability that we can claim. If the caller is only interested in inactive virtual processors,
/// for instance, AvailabilityInactive can be passed.
/// </param>
/// <returns>
/// True if it was able to claim the virtual processor, false otherwise.
/// </returns>
bool VirtualProcessor::ClaimExclusiveOwnership(VirtualProcessor::ClaimTicket &ticket, ULONG type, bool updateCounters)
{
CONCRT_COREASSERT(type != AvailabilityClaimed);
AvailabilityType curType = m_availabilityType;
if ((curType & type) != 0)
{
AvailabilityType prevType = AvailabilityType();
bool fClaimed = false;
if (type == AvailabilityAny)
{
prevType = (AvailabilityType)(InterlockedExchange(reinterpret_cast<volatile long *>(&m_availabilityType), AvailabilityClaimed));
fClaimed = (prevType != AvailabilityClaimed);
}
else
{
for(;;)
{
if ((curType & type) == 0)
break;
prevType = (AvailabilityType)(InterlockedCompareExchange(reinterpret_cast<volatile long *>(&m_availabilityType), AvailabilityClaimed, curType));
if (prevType == curType)
{
fClaimed = true;
break;
}
curType = prevType;
}
}
if (fClaimed)
{
CONCRT_COREASSERT(m_availabilityType == AvailabilityClaimed);
#if _UMSTRACE
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
VCMTRACE(MTRACE_EVT_CLAIMEDOWNERSHIP, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, SchedulerBase::FastCurrentContext());
#endif // _UMSTRACE
if (updateCounters)
{
InterlockedDecrement(&m_pOwningNode->m_pScheduler->m_virtualProcessorAvailableCount);
InterlockedDecrement(&m_pOwningNode->m_virtualProcessorAvailableCount);
//
// Keep track of the number of virtual processors pending thread creation.
//
if (prevType == AvailabilityInactivePendingThread || prevType == AvailabilityIdlePendingThread)
{
InterlockedDecrement(&m_pOwningNode->m_pScheduler->m_virtualProcessorsPendingThreadCreate);
InterlockedDecrement(&m_pOwningNode->m_virtualProcessorsPendingThreadCreate);
}
OMTRACE(MTRACE_EVT_CLAIMEDOWNERSHIP, m_pOwningNode->m_pScheduler, pCurrentContext, this, pCurrentContext);
}
OMTRACE(MTRACE_EVT_AVAILABLEVPROCS, m_pOwningNode->m_pScheduler, pCurrentContext, this, m_pOwningNode->m_pScheduler->m_virtualProcessorAvailableCount);
ticket.InitializeTicket(prevType, this);
m_claimantType = prevType;
return true;
}
}
return false;
}
/// <summary>
/// Makes a virtual processor available for scheduling work.
/// </summary>
/// <param name="fCanChangeActiveState">
/// Indicates whether the routine should update active state for the vproc based upon type or not.
/// </param>
void VirtualProcessor::MakeAvailable(AvailabilityType type, bool fCanChangeActiveState)
{
ASSERT(m_availabilityType == AvailabilityClaimed);
//
// Keep track of the context which made the virtual processor available. It will be the one that deactivates if there's a corresponding activate
// from outside. This is a spec requirement. On UMS, we can temporarily execute another context if the scheduler blocks with a Win32 primitive
// between the MakeAvailable and the Deactivate call. This should be avoided if at all possible -- it is a performance hit!
//
m_pAvailableContext = m_pExecutingContext;
if (fCanChangeActiveState && (type == AvailabilityInactive || type == AvailabilityInactivePendingThread))
GetOwningNode()->GetScheduler()->VirtualProcessorActive(false);
#if _UMSTRACE
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
VCMTRACE(MTRACE_EVT_MADEAVAILABLE, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, NULL);
#endif // _UMSTRACE
InterlockedIncrement(&m_pOwningNode->m_pScheduler->m_virtualProcessorAvailableCount);
InterlockedIncrement(&m_pOwningNode->m_virtualProcessorAvailableCount);
//
// Keep track of the number of virtual processors pending thread creation (if any are).
//
if (type == AvailabilityInactivePendingThread || type == AvailabilityIdlePendingThread)
{
InterlockedIncrement(&m_pOwningNode->m_pScheduler->m_virtualProcessorsPendingThreadCreate);
InterlockedIncrement(&m_pOwningNode->m_virtualProcessorsPendingThreadCreate);
}
OMTRACE(MTRACE_EVT_MADEAVAILABLE, m_pOwningNode->m_pScheduler, pCurrentContext, this, NULL);
OMTRACE(MTRACE_EVT_AVAILABLEVPROCS, m_pOwningNode->m_pScheduler, pCurrentContext, this, m_pOwningNode->m_pScheduler->m_virtualProcessorAvailableCount);
InterlockedExchange(reinterpret_cast<volatile long *>(&m_availabilityType), type);
}
/// <summary>
/// Oversubscribes the virtual processor by creating a new virtual processor root affinitized to the same
/// execution resource as that of the current root
/// </summary>
/// <returns>
/// A virtual processor that oversubscribes this one.
/// </returns>
VirtualProcessor * VirtualProcessor::Oversubscribe()
{
IVirtualProcessorRoot *pOversubscriberRoot = GetOwningNode()->GetScheduler()->GetSchedulerProxy()->CreateOversubscriber(m_pOwningRoot);
ASSERT(pOversubscriberRoot != NULL);
return m_pOwningNode->AddVirtualProcessor(pOversubscriberRoot, true);
}
/// <summary>
/// Causes the virtual processor to remove itself from the scheduler. This is used either when oversubscription
/// ends or when the resource manager asks the vproc to retire.
/// </summary>
void VirtualProcessor::Retire()
{
VMTRACE(MTRACE_EVT_RETIRE, SchedulerBase::FastCurrentContext(), this, m_availabilityType);
m_pOwningNode->m_pScheduler->RemovePrioritizedObject(&m_priorityServiceLink);
// Virtual processor available counts are already decremented by this point. We need to decrement the total counts
// on both the node and the scheduler. Oversubscribed vprocs do not contribute to the total vproc count on the scheduler.
m_pOwningNode->m_pScheduler->DecrementActiveResourcesByMask(m_maskId);
InterlockedDecrement(&m_pOwningNode->m_virtualProcessorCount);
if (!m_fOversubscribed)
{
InterlockedDecrement(&m_pOwningNode->m_pScheduler->m_virtualProcessorCount);
}
// Since virtual processor is going away we'd like to preserve its counts
m_pOwningNode->GetScheduler()->SaveRetiredVirtualProcessorStatistics(this);
// Make sure we're no longer flagged as listening for affinity messages.
if (!m_fAffine)
m_pOwningNode->GetScheduler()->IgnoreAffinity(m_maskId);
// If this is a virtual processor currently associated with an executing context, it's important to assert there that
// the scheduler is not shutting down. We want to make sure that all virtual processor root removals (for executing virtual
// processors) occur before the scheduler shuts down. This will ensure that all IVirtualProcessorRoot::Remove calls
// that can originate from a scheduler's internal contexts instance are received the RM before the ISchedulerProxy::Shutdown call,
// which asks the RM to release all resources and destroy the remaining virtual processor roots allocated to the scheduler.
// RM should not receive Remove calls for roots that are already destroyed.
ASSERT(ClaimantWasInactive() || ToInternalContext(m_pExecutingContext) == SchedulerBase::FastCurrentContext());
ASSERT(ClaimantWasInactive() || (!m_pOwningNode->GetScheduler()->InFinalizationSweep() && !m_pOwningNode->GetScheduler()->HasCompletedShutdown()));
m_pExecutingContext = NULL;
// Check if there are contexts in the Local Runnables Collection and put them into the collection of runnables in their
// respective schedule groups.
InternalContextBase *pContext = GetLocalRunnableContext();
while (pContext != NULL)
{
ScheduleGroupSegmentBase *pSegment = pContext->GetScheduleGroupSegment();
pSegment->AddRunnableContext(pContext, pSegment->GetAffinity());
pContext = GetLocalRunnableContext();
}
// Send an IScheduler pointer into to Remove. Scheduler does derive from IScheduler, and therefore we need
// an extra level of indirection.
m_pOwningRoot->Remove(m_pOwningNode->GetScheduler()->GetIScheduler());
m_pOwningRoot = NULL;
TraceVirtualProcessorEvent(CONCRT_EVENT_END, TRACE_LEVEL_INFORMATION, m_pOwningNode->m_pScheduler->Id(), m_id);
if (m_pSubAllocator != NULL)
{
SchedulerBase::ReturnSubAllocator(m_pSubAllocator);
m_pSubAllocator = NULL;
}
// Removing this VirtualProcessor from the ListArray will move it to a pool for reuse
// This must be done at the end of this function, otherwise, this virtual processor itself could be
// pulled out of the list array for reuse and stomped over before retirement is complete.
m_pOwningNode->m_virtualProcessors.Remove(this);
// *DO NOT* touch 'this' after removing it from the list array.
}
/// <summary>
/// Returns a pointer to the suballocator for the virtual processor.
/// </summary>
SubAllocator * VirtualProcessor::GetCurrentSubAllocator()
{
if (m_pSubAllocator == NULL)
{
m_pSubAllocator = SchedulerBase::GetSubAllocator(false);
}
return m_pSubAllocator;
}
/// <summary>
/// Updates tracking on the virtual processor whether it is executing affine work and/or local work.
/// </summary>
/// <param name="fAffine">
/// An indication of whether the virtual processor is executing work which has affinity to it or not.
/// </param>
/// <param name="fLocal">
/// An indication of whether the virtual processor is executing work which is local to it or not.
/// </param>
void VirtualProcessor::UpdateWorkState(bool fAffine, bool fLocal)
{
SchedulerBase *pScheduler = m_pOwningNode->GetScheduler();
//
// Notify the scheduler if we need to listen for affinity events or not.
//
if (m_fAffine)
{
if (!fAffine)
{
VCMTRACE(MTRACE_EVT_CHANGEAFFINITYSTATE, m_pExecutingContext, this, 0);
//
// See CheckAffinityNotification comments. We need to avoid a listen/arrive race to prevent ourselves getting stuck on non-affine
// work.
//
m_fShortAffine = true;
pScheduler->ListenAffinity(m_maskId);
}
}
else
{
if (fAffine)
{
VCMTRACE(MTRACE_EVT_CHANGEAFFINITYSTATE, m_pExecutingContext, this, 1);
pScheduler->IgnoreAffinity(m_maskId);
}
}
m_fAffine = fAffine;
m_fLocal = fLocal;
}
/// <summary>
/// Performs a quick check as to whether work which is affine to the virtual processor has arrived. This allows short circuiting of
/// expensive searches for affine work in cases where a user does not use any location objects.
/// </summary>
/// <returns>
/// An indication of whether or not work affine to the virtual processor has arrived since UpdateWorkState was called to indicate that
/// the virtual processor began working on non-affine work.
/// </returns>
bool VirtualProcessor::CheckAffinityNotification()
{
//
// Once we switch to executing non-affine work and flag that we are listening to messages, we will get affinity notifications and do not
// need to SFW for affine work. There is an inherent race in this, however. If we are doing an affine search and have passed segment "S"
// (affine to us), and a series of work comes into "S", and then we find non-affine work (because we already checked "S"), we will get no
// message for that work that came into "S". We must ensure that we do an affine SFW **ONCE** immediately after flagging ourselves
// as a listener. m_fShortAffine tracks this requirement.
//
if (m_fShortAffine)
{
VCMTRACE(MTRACE_EVT_ACKNOWLEDGEAFFINITYMESSAGE, m_pExecutingContext, this, 1);
m_fShortAffine = false;
return true;
}
else
{
bool fAck = GetOwningNode()->GetScheduler()->AcknowledgedAffinityMessage(m_maskId);
#if _UMSTRACE
if (fAck)
{
VCMTRACE(MTRACE_EVT_ACKNOWLEDGEAFFINITYMESSAGE, m_pExecutingContext, this, 0);
}
#endif // UMSTRACE
return fAck;
}
}
/// <summary>
/// Send a virtual processor ETW event.
/// </summary>
void VirtualProcessor::ThrowVirtualProcessorEvent(ConcRT_EventType eventType, UCHAR level, DWORD schedulerId, DWORD vprocId)
{
if (g_pEtw != NULL)
{
CONCRT_TRACE_EVENT_HEADER_COMMON concrtHeader = {0};
concrtHeader.header.Size = sizeof concrtHeader;
concrtHeader.header.Flags = WNODE_FLAG_TRACED_GUID;
concrtHeader.header.Class.Type = (UCHAR)eventType;
concrtHeader.header.Class.Level = level;
concrtHeader.header.Guid = VirtualProcessorEventGuid;
concrtHeader.SchedulerID = schedulerId;
concrtHeader.VirtualProcessorID = vprocId;
g_pEtw->Trace(g_ConcRTSessionHandle, &concrtHeader.header);
}
}
#if _UMSTRACE
void VirtualProcessor::TraceSearchedLocalRunnables()
{
ContextBase *pCurrentContext = SchedulerBase::FastCurrentContext();
CMTRACE(MTRACE_EVT_SEARCHEDLOCALRUNNABLES, (pCurrentContext && !pCurrentContext->IsExternal()) ? static_cast<InternalContextBase *>(pCurrentContext) : NULL, this, NULL);
}
#endif // UMSTRACE
/// <summary>
/// Returns a type-cast of pContext to an InternalContextBase or NULL if it is not.
/// </summary>
InternalContextBase *VirtualProcessor::ToInternalContext(IExecutionContext *pContext)
{
return static_cast<InternalContextBase *>(pContext);
}
/// <summary>
/// Called when the context running atop this virtual processor has reached a safe point.
/// </summary>
/// <returns>
/// An indication of whether the caller should perform a commit.
/// </returns>
bool VirtualProcessor::SafePoint()
{
return GetOwningNode()->GetScheduler()->MarkSafePoint(&m_safePointMarker);
}
/// <summary>
/// Exercises the ticket with a particular context. This is only valid if ExerciseWakesExisting() returns false. Callers should have
/// sought virtual processors with specific claim rights.
/// </summary>
bool VirtualProcessor::ClaimTicket::ExerciseWith(InternalContextBase *pContext)
{
bool fResult = false;
if (m_type != AvailabilityClaimed)
{
//
// @TODO: It should be started on a specific group plumbed through from the point at which the vproc couldn't find a thread.
// Right now, this info is not plumbed through so we pick up the anonymous group.
//
fResult = m_pVirtualProcessor->ExerciseClaim(m_type, m_pVirtualProcessor->GetOwningNode()->GetSchedulingRing()->GetAnonymousScheduleGroupSegment(), pContext);
m_type = AvailabilityClaimed;
}
return fResult;
}
} // namespace details
} // namespace Concurrency
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
* This file is part of Nanomite.
*
* Nanomite 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.
*
* Nanomite 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 Nanomite. If not, see <http://www.gnu.org/licenses/>.
*/
-->
<ui version="4.0">
<class>qtDLGRegEdit86Class</class>
<widget class="QDialog" name="qtDLGRegEdit86Class">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>280</width>
<height>391</height>
</rect>
</property>
<property name="windowTitle">
<string>[ Nanomite ] - RegEdit</string>
</property>
<property name="windowIcon">
<iconset resource="qtDLGNanomite.qrc">
<normaloff>:/DLGNanomite/Icons/IDI_MAIN.ico</normaloff>:/DLGNanomite/Icons/IDI_MAIN.ico</iconset>
</property>
<widget class="QPushButton" name="pbSave">
<property name="geometry">
<rect>
<x>10</x>
<y>360</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Save && Exit</string>
</property>
</widget>
<widget class="QPushButton" name="pbExit">
<property name="geometry">
<rect>
<x>190</x>
<y>360</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Exit</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>261</width>
<height>341</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QLineEdit" name="lineEdit_32">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>190</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EFlags</string>
</property>
</widget>
<widget class="QLineEdit" name="lineESI">
<property name="geometry">
<rect>
<x>60</x>
<y>110</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEDX">
<property name="geometry">
<rect>
<x>60</x>
<y>70</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>ESI</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_16">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EAX</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_27">
<property name="geometry">
<rect>
<x>60</x>
<y>270</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineECX">
<property name="geometry">
<rect>
<x>60</x>
<y>50</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_8">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="inputMask">
<string/>
</property>
<property name="text">
<string>EDX</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEDI">
<property name="geometry">
<rect>
<x>60</x>
<y>90</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_22">
<property name="geometry">
<rect>
<x>60</x>
<y>250</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEFlags">
<property name="geometry">
<rect>
<x>60</x>
<y>190</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_19">
<property name="geometry">
<rect>
<x>60</x>
<y>290</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_28">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>250</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineESP">
<property name="geometry">
<rect>
<x>60</x>
<y>150</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_20">
<property name="geometry">
<rect>
<x>60</x>
<y>310</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_12">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>150</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>ESP</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_26">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>230</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEAX">
<property name="geometry">
<rect>
<x>60</x>
<y>10</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_14">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EBX</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEBP">
<property name="geometry">
<rect>
<x>60</x>
<y>130</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_31">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EIP</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEIP">
<property name="geometry">
<rect>
<x>60</x>
<y>170</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_21">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>310</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EDI</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_23">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_10">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>ECX</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_18">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>270</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEBX">
<property name="geometry">
<rect>
<x>60</x>
<y>30</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>40</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>EBP</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_17">
<property name="geometry">
<rect>
<x>60</x>
<y>210</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_25">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>210</y>
<width>40</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_30">
<property name="geometry">
<rect>
<x>60</x>
<y>230</y>
<width>190</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
</widget>
<resources>
<include location="qtDLGNanomite.qrc"/>
</resources>
<connections/>
</ui>
| {
"pile_set_name": "Github"
} |
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: >
When a `yield` token appears within the Initializer of a nested
destructuring assignment and outside of a generator function body, it
should behave as an IdentifierReference.
template: default
es6id: 12.14.5.4
flags: [noStrict]
---*/
//- setup
var yield = 22;
var x;
//- elems
{ x: [x = yield] }
//- vals
{ x: [] }
//- body
assert.sameValue(x, 22);
| {
"pile_set_name": "Github"
} |
<%#
Copyright 2009 Timothy Fisher
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.
%>
<%= stylesheet_link_tag 'book_reviews' %>
<div id="book_review_links">
<% if logged_in? %>
<div id="book_reviews_all"><%= link_to 'All Book Reviews' %></div>
<div id="book_reviews_my"><%= link_to 'My Book Reviews', user_book_reviews_path(current_user) %></div>
<div id="book_reviews_add"><%= link_to 'Add a Book Review', new_book_review_path %></div>
<% end %>
</div>
<div id="book_reviews_table">
<% @book_reviews.each do |review| %>
<%= render :partial => 'book_review_brief', :locals=>{:review=>review} %>
<% end %>
<% if @book_reviews.length == 0 %>
No reviews exist.
<% end %>
</div>
<div style="clear:both;"></div>
| {
"pile_set_name": "Github"
} |
<!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.5.0_13) on Thu May 08 05:29:27 EDT 2008 -->
<TITLE>
Uses of Class org.jbox2d.integrations.slick.SlickTestMain
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Class org.jbox2d.integrations.slick.SlickTestMain";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= 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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/jbox2d/integrations/slick/SlickTestMain.html" title="class in org.jbox2d.integrations.slick"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/jbox2d/integrations/slick//class-useSlickTestMain.html" target="_top"><B>FRAMES</B></A>
<A HREF="SlickTestMain.html" target="_top"><B>NO FRAMES</B></A>
<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 ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.jbox2d.integrations.slick.SlickTestMain</B></H2>
</CENTER>
No usage of org.jbox2d.integrations.slick.SlickTestMain
<P>
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/jbox2d/integrations/slick/SlickTestMain.html" title="class in org.jbox2d.integrations.slick"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/jbox2d/integrations/slick//class-useSlickTestMain.html" target="_top"><B>FRAMES</B></A>
<A HREF="SlickTestMain.html" target="_top"><B>NO FRAMES</B></A>
<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 ======= -->
<HR>
</BODY>
</HTML>
| {
"pile_set_name": "Github"
} |
<a href="https://github.com/TencentCloudBase/cloudbase-templates"><img src="https://main.qcloudimg.com/raw/918830a5ad3321fd0524eaef4c0e4c1e.png"></a>
# Next SSR 应用示例
这个目录是基于云开发的一个 [Next-SSR](https://nextjs.org/) 应用示例,包含 Next + 云函数 + 静态网站部署,可以基于 **[CloudBase Framework](https://github.com/TencentCloudBase/cloudbase-framework)** 框架将项目一键部署到云开发环境
## 部署一个 Next SSR 应用
### 步骤一. 准备工作
具体步骤请参照 [准备云开发环境和 CloudBase CLI 命令工具](https://github.com/TencentCloudBase/cloudbase-framework/blob/master/CLI_GUIDE.md)
### 步骤二. 初始化应用示例
在命令行执行
```
cloudbase init --tempate next-ssr
```
### 步骤三. 一键部署
进入到项目目录,在命令行执行
```
cloudbase framework:deploy
```
## 开发命令及配置
### 本地开发
```
npm run dev
```
### 上线部署
```
npm run deploy
```
### CloudBase Framework 相关开发配置
查看 [CloudBase Framework 配置](https://github.com/TencentCloudBase/cloudbase-framework).
### Next 相关开发配置
查看 [Configuration Reference](https://nextjs.org/docs/api-reference/next.config.js/introduction).
| {
"pile_set_name": "Github"
} |
//
// WDSVGElement.m
// Inkpad
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Original implementation by Scott Vachalek
//
// Copyright (c) 2011-2013 Steve Sprang
//
#import "WDSVGElement.h"
#import "WDSVGParserStateStack.h"
#import "WDParseUtil.h"
@implementation WDSVGElement
@synthesize name = name_;
@synthesize attributes = attributes_;
- (WDSVGElement *) initWithName:(NSString *)name andAttributes:(NSDictionary *)attributes
{
self = [super init];
if (!self) {
return nil;
}
name_ = name;
if ([attributes count]) {
attributes_ = attributes;
}
return self;
}
- (NSMutableArray *) children
{
if (!children_) {
children_ = [[NSMutableArray alloc] init];
}
return children_;
}
- (NSMutableString *) text
{
if (!text_) {
text_ = [[NSMutableString alloc] init];
}
return text_;
}
- (NSString *) description
{
NSMutableString *buf = [NSMutableString stringWithString:@"<"];
[buf appendString:name_];
[attributes_ enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[buf appendString:@" "];
[buf appendString:key];
[buf appendString:@"="];
[buf appendString:@"\""];
[buf appendString:obj];
[buf appendString:@"\""];
}];
[buf appendString:@">"];
if (text_) {
[buf appendString:text_];
}
return buf;
}
- (NSString *) attribute:(NSString *)key withDefault:(NSString *)deft
{
return attributes_[key] ?: deft;
}
- (NSString *) attribute:(NSString *)key
{
return attributes_[key];
}
- (float) coordinate:(NSString *)key withBound:(float)bound andDefault:(float)deft
{
NSString *source = [self attribute:key];
return [WDSVGElement lengthFromString:source withBound:bound andDefault:deft];
}
- (float) coordinate:(NSString *)source withBound:(float)bound
{
return [self coordinate:source withBound:bound andDefault:0];
}
+ (float) lengthFromString:(NSString *)source withBound:(float)bound andDefault:(float)deft
{
NSInteger len = [source length];
if (len == 0) {
return deft;
} else if (len == 1) {
return [source floatValue];
} else {
unichar u1 = [source characterAtIndex:(len - 1)];
unichar u2 = (len > 2) ? [source characterAtIndex:(len - 2)] : u1;
if (u1 >= 'A' && u1 <= 'Z') {
u1 += ('a' - 'A');
}
if (u2 >= 'A' && u2 <= 'Z') {
u2 += ('a' - 'A');
}
if (u1 == '%') {
float ratio = [[source substringToIndex:len - 1] floatValue] / 100.f;
return ratio * bound;
} else if (u2 == 'p' && u1 == 'x') {
return [[source substringToIndex:len - 2] floatValue] * 0.8f;
} else if (u2 == 'p' && u1 == 't') {
return [[source substringToIndex:len - 2] floatValue];
} else if (u2 == 'p' && u1 == 'c') {
return [[source substringToIndex:len - 2] floatValue] * 15.f * 0.8f;
} else if (u2 == 'm' && u1 == 'm') {
return [[source substringToIndex:len - 2] floatValue] * 3.543307f * 0.8f;
} else if (u2 == 'c' && u1 == 'm') {
return [[source substringToIndex:len - 2] floatValue] * 35.43307f * 0.8f;
} else if (u2 == 'i' && u1 == 'n') {
return [[source substringToIndex:len - 2] floatValue] * 90.f * 0.8f;
} else if (u2 == 'p' && u1 == 'x') {
return [[source substringToIndex:len - 2] floatValue] * 0.8f;
} else if (u2 == 'e' && u1 == 'm') {
// em and ex depend on the font of the enclosing block; since we don't have one the default font-size is "medium", let's call it 12pt
return [[source substringToIndex:len - 2] floatValue] * 12.f;
} else if (u2 == 'e' && u1 == 'x') {
return [[source substringToIndex:len - 2] floatValue] * 8.f;
} else {
return [source floatValue];
}
}
}
- (float) length:(NSString *)key withBound:(float)bound andDefault:(float)deft
{
NSString *source = [self attribute:key];
return [WDSVGElement lengthFromString:source withBound:bound andDefault:deft];
}
- (float) length:(NSString *)key withBound:(float)bound
{
return [self length:key withBound:bound andDefault:0];
}
+ (NSArray *) numberListFromString:(NSString *)source
{
unichar *buf = malloc([source length] * sizeof(unichar));
NSArray *tokens = tokenize(source, buf);
NSMutableArray *numbers = [NSMutableArray array];
for (NSString *token in tokens) {
if (stringIsNumeric(token)) {
float number = [token floatValue];
[numbers addObject:@(number)];
}
}
free(buf);
return numbers;
}
- (NSArray *) numberList:(NSString *)key
{
return [WDSVGElement numberListFromString:[self attribute:key]];
}
- (NSArray *) coordinateList:(NSString *)key
{
return [WDSVGElement numberListFromString:[self attribute:key]];
}
+ (NSArray *) lengthListFromString:(NSString *)source withBound:(float)bound
{
unichar *buf = malloc([source length] * sizeof(unichar));
NSArray *tokens = tokenize(source, buf);
NSMutableArray *numbers = [NSMutableArray array];
for (NSString *token in tokens) {
if (stringIsNumeric(token)) {
float number = [WDSVGElement lengthFromString:token withBound:bound andDefault:0];
[numbers addObject:@(number)];
}
}
free(buf);
return numbers;
}
- (NSArray *) lengthList:(NSString *)key withBound:(float)bound
{
return [WDSVGElement lengthListFromString:[self attribute:key] withBound:bound];
}
- (CGPoint) x:(NSString *)xKey y:(NSString *)yKey withBounds:(CGSize)bounds andDefault:(CGPoint)deft
{
float x = [self coordinate:xKey withBound:bounds.width andDefault:deft.x];
float y = [self coordinate:yKey withBound:bounds.height andDefault:deft.y];
return CGPointMake(x, y);
}
- (CGPoint) x:(NSString *)xKey y:(NSString *)yKey withBounds:(CGSize)bounds
{
return [self x:xKey y:yKey withBounds:bounds andDefault:CGPointZero];
}
- (NSString *) idFromIRI:(NSString *)key withReporter:(id<WDErrorReporter>)reporter
{
NSString *iri = [self attribute:key];
if ([iri hasPrefix:@"#"]) {
return [iri substringFromIndex:1];
} else if (iri) {
[reporter reportError:@"unsupported iri: %@", iri];
return nil;
} else {
return nil;
}
}
- (NSString *) idFromFuncIRI:(NSString *)key withReporter:(id<WDErrorReporter>)reporter
{
NSString *funciri = [self attribute:key];
if ([funciri hasPrefix:@"url(#"] && [funciri hasSuffix:@")"]) {
return [funciri substringWithRange:NSMakeRange(5, [funciri length] - 6)];
} else if (funciri) {
[reporter reportError:@"unsupported funciri: %@", funciri];
return nil;
} else {
return nil;
}
}
@end
| {
"pile_set_name": "Github"
} |
package com.bookstore.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.bookstore.spring.dto.AuthorDto;
import com.bookstore.spring.dto.SimpleAuthorDto;
import com.bookstore.entity.Author;
import java.util.Set;
import org.springframework.data.jpa.repository.Query;
@Repository
public interface AuthorRepository extends JpaRepository<Author, Long> {
List<AuthorDto> findBy();
@Query("SELECT a.name AS name, a.genre AS genre, b AS books "
+ "FROM Author a INNER JOIN a.books b")
List<AuthorDto> findByViaQuery();
@Query("SELECT a FROM Author a JOIN FETCH a.books")
Set<AuthorDto> findByJoinFetch();
@Query("SELECT a.name AS name, a.genre AS genre, b.title AS title "
+ "FROM Author a INNER JOIN a.books b")
List<SimpleAuthorDto> findByViaQuerySimpleDto();
@Query("SELECT a.name AS name, a.genre AS genre, b.title AS title "
+ "FROM Author a INNER JOIN a.books b")
List<Object[]> findByViaArrayOfObjects();
@Query("SELECT a.id AS authorId, a.name AS name, a.genre AS genre, "
+ "b.id AS bookId, b.title AS title FROM Author a INNER JOIN a.books b")
List<Object[]> findByViaArrayOfObjectsWithIds();
}
| {
"pile_set_name": "Github"
} |
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
);
path = Runner;
sourceTree = "<group>";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
97C146F21CF9000F007C117D /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.solution09Units;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.solution09Units;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.solution09Units;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<entity_scene>
<!-- Keep the example
<scene id="The_iPods_Nano">
<name>The iPods Nano</name>
</scene>
-->
</entity_scene>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2005-2014 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* sub-routines for dentry cache
*/
#ifndef __AUFS_DCSUB_H__
#define __AUFS_DCSUB_H__
#ifdef __KERNEL__
#include <linux/dcache.h>
#include <linux/fs.h>
struct dentry;
struct au_dpage {
int ndentry;
struct dentry **dentries;
};
struct au_dcsub_pages {
int ndpage;
struct au_dpage *dpages;
};
/* ---------------------------------------------------------------------- */
/* dcsub.c */
int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp);
void au_dpages_free(struct au_dcsub_pages *dpages);
typedef int (*au_dpages_test)(struct dentry *dentry, void *arg);
int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root,
au_dpages_test test, void *arg);
int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry,
int do_include, au_dpages_test test, void *arg);
int au_dcsub_pages_rev_aufs(struct au_dcsub_pages *dpages,
struct dentry *dentry, int do_include);
int au_test_subdir(struct dentry *d1, struct dentry *d2);
/* ---------------------------------------------------------------------- */
static inline int au_d_hashed_positive(struct dentry *d)
{
int err;
struct inode *inode = d->d_inode;
err = 0;
if (unlikely(d_unhashed(d) || !inode || !inode->i_nlink))
err = -ENOENT;
return err;
}
static inline int au_d_alive(struct dentry *d)
{
int err;
struct inode *inode;
err = 0;
if (!IS_ROOT(d))
err = au_d_hashed_positive(d);
else {
inode = d->d_inode;
if (unlikely(d_unlinked(d) || !inode || !inode->i_nlink))
err = -ENOENT;
}
return err;
}
static inline int au_alive_dir(struct dentry *d)
{
int err;
err = au_d_alive(d);
if (unlikely(err || IS_DEADDIR(d->d_inode)))
err = -ENOENT;
return err;
}
static inline int au_qstreq(struct qstr *a, struct qstr *b)
{
return a->len == b->len
&& !memcmp(a->name, b->name, a->len);
}
#endif /* __KERNEL__ */
#endif /* __AUFS_DCSUB_H__ */
| {
"pile_set_name": "Github"
} |
#
# TIPC configuration
#
menuconfig TIPC
tristate "The TIPC Protocol (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
---help---
The Transparent Inter Process Communication (TIPC) protocol is
specially designed for intra cluster communication. This protocol
originates from Ericsson where it has been used in carrier grade
cluster applications for many years.
For more information about TIPC, see http://tipc.sourceforge.net.
This protocol support is also available as a module ( = code which
can be inserted in and removed from the running kernel whenever you
want). The module will be called tipc. If you want to compile it
as a module, say M here and read <file:Documentation/kbuild/modules.txt>.
If in doubt, say N.
if TIPC
config TIPC_ADVANCED
bool "Advanced TIPC configuration"
default n
help
Saying Y here will open some advanced configuration for TIPC.
Most users do not need to bother; if unsure, just say N.
config TIPC_ZONES
int "Maximum number of zones in a network"
depends on TIPC_ADVANCED
range 1 255
default "3"
help
Specifies how many zones can be supported in a TIPC network.
Can range from 1 to 255 zones; default is 3.
Setting this to a smaller value saves some memory;
setting it to a higher value allows for more zones.
config TIPC_CLUSTERS
int "Maximum number of clusters in a zone"
depends on TIPC_ADVANCED
range 1 1
default "1"
help
Specifies how many clusters can be supported in a TIPC zone.
*** Currently TIPC only supports a single cluster per zone. ***
config TIPC_NODES
int "Maximum number of nodes in a cluster"
depends on TIPC_ADVANCED
range 8 2047
default "255"
help
Specifies how many nodes can be supported in a TIPC cluster.
Can range from 8 to 2047 nodes; default is 255.
Setting this to a smaller value saves some memory;
setting it to higher allows for more nodes.
config TIPC_PORTS
int "Maximum number of ports in a node"
depends on TIPC_ADVANCED
range 127 65535
default "8191"
help
Specifies how many ports can be supported by a node.
Can range from 127 to 65535 ports; default is 8191.
Setting this to a smaller value saves some memory,
setting it to higher allows for more ports.
config TIPC_LOG
int "Size of log buffer"
depends on TIPC_ADVANCED
range 0 32768
default "0"
help
Size (in bytes) of TIPC's internal log buffer, which records the
occurrence of significant events. Can range from 0 to 32768 bytes;
default is 0.
There is no need to enable the log buffer unless the node will be
managed remotely via TIPC.
config TIPC_DEBUG
bool "Enable debug messages"
default n
help
This enables debugging of TIPC.
Only say Y here if you are having trouble with TIPC. It will
enable the display of detailed information about what is going on.
endif # TIPC
| {
"pile_set_name": "Github"
} |
/*
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
*/
#ifndef SIMPLEXY2_H
#define SIMPLEXY2_H
#include "astrometry/an-bool.h"
#define SIMPLEXY_DEFAULT_DPSF 1.0
#define SIMPLEXY_DEFAULT_PLIM 8.0
#define SIMPLEXY_DEFAULT_DLIM 1.0
#define SIMPLEXY_DEFAULT_SADDLE 5.0
#define SIMPLEXY_DEFAULT_MAXPER 1000
#define SIMPLEXY_DEFAULT_MAXSIZE 2000
#define SIMPLEXY_DEFAULT_HALFBOX 100
#define SIMPLEXY_DEFAULT_MAXNPEAKS 100000
#define SIMPLEXY_U8_DEFAULT_PLIM 4.0
#define SIMPLEXY_U8_DEFAULT_SADDLE 2.0
struct simplexy_t {
/******
Inputs
******/
float *image;
unsigned char* image_u8;
int nx;
int ny;
/* gaussian psf width (sigma, not FWHM) */
float dpsf;
/* significance to keep */
float plim;
/* closest two peaks can be */
float dlim;
/* saddle difference (in sig) */
float saddle;
/* maximum number of peaks per object */
int maxper;
/* maximum number of peaks total */
int maxnpeaks;
/* maximum size for extended objects */
int maxsize;
/* size for sliding sky estimation box */
int halfbox;
// (boolean) don't do background subtraction.
int nobgsub;
// global background.
float globalbg;
// (boolean) invert the image before processing (for black-on-white images)
int invert;
// If set to non-zero, the given sigma value will be used;
// otherwise a value will be estimated.
float sigma;
/******
Outputs
******/
float *x;
float *y;
float *flux;
float *background;
int npeaks;
// Lanczos-interpolated flux and backgrounds;
// measured if Lorder > 0.
int Lorder;
float* fluxL;
float* backgroundL;
/***
Debug
***/
// The filename for saving the background-subtracted FITS image.
const char* bgimgfn;
const char* maskimgfn;
const char* blobimgfn;
const char* bgsubimgfn;
const char* smoothimgfn;
};
typedef struct simplexy_t simplexy_t;
void simplexy_set_defaults(simplexy_t* s);
// Really this is for limited-dynamic-range images, not u8 as such...
void simplexy_set_u8_defaults(simplexy_t* i);
// Set default values for any fields that are zero.
void simplexy_fill_in_defaults(simplexy_t* s);
void simplexy_fill_in_defaults_u8(simplexy_t* s);
int simplexy_run(simplexy_t* s);
void simplexy_free_contents(simplexy_t* s);
void simplexy_clean_cache();
#endif
| {
"pile_set_name": "Github"
} |
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
namespace AssetStudio
{
public class Object
{
public SerializedFile assetsFile;
public ObjectReader reader;
public long m_PathID;
public int[] version;
protected BuildType buildType;
public BuildTarget platform;
public ClassIDType type;
public SerializedType serializedType;
public uint byteSize;
public Object(ObjectReader reader)
{
this.reader = reader;
reader.Reset();
assetsFile = reader.assetsFile;
type = reader.type;
m_PathID = reader.m_PathID;
version = reader.version;
buildType = reader.buildType;
platform = reader.platform;
serializedType = reader.serializedType;
byteSize = reader.byteSize;
if (platform == BuildTarget.NoTarget)
{
var m_ObjectHideFlags = reader.ReadUInt32();
}
}
protected bool HasStructMember(string name)
{
return serializedType?.m_Nodes != null && serializedType.m_Nodes.Any(x => x.m_Name == name);
}
public string Dump()
{
if (serializedType?.m_Nodes != null)
{
var sb = new StringBuilder();
TypeTreeHelper.ReadTypeString(sb, serializedType.m_Nodes, reader);
return sb.ToString();
}
return null;
}
public string Dump(List<TypeTreeNode> m_Nodes)
{
if (m_Nodes != null)
{
var sb = new StringBuilder();
TypeTreeHelper.ReadTypeString(sb, m_Nodes, reader);
return sb.ToString();
}
return null;
}
public OrderedDictionary ToType()
{
if (serializedType?.m_Nodes != null)
{
return TypeTreeHelper.ReadType(serializedType.m_Nodes, reader);
}
return null;
}
public OrderedDictionary ToType(List<TypeTreeNode> m_Nodes)
{
if (m_Nodes != null)
{
return TypeTreeHelper.ReadType(m_Nodes, reader);
}
return null;
}
public byte[] GetRawData()
{
reader.Reset();
return reader.ReadBytes((int)byteSize);
}
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_222) on Wed Aug 14 11:24:50 AEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.eclipse.rdf4j.sail.spin.config (RDF4J 2.5.4 API)</title>
<meta name="date" content="2019-08-14">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.eclipse.rdf4j.sail.spin.config (RDF4J 2.5.4 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/eclipse/rdf4j/sail/spin/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../org/eclipse/rdf4j/spin/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/eclipse/rdf4j/sail/spin/config/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package org.eclipse.rdf4j.sail.spin.config</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/eclipse/rdf4j/sail/spin/config/SpinSailConfig.html" title="class in org.eclipse.rdf4j.sail.spin.config">SpinSailConfig</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/eclipse/rdf4j/sail/spin/config/SpinSailFactory.html" title="class in org.eclipse.rdf4j.sail.spin.config">SpinSailFactory</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/eclipse/rdf4j/sail/spin/config/SpinSailSchema.html" title="class in org.eclipse.rdf4j.sail.spin.config">SpinSailSchema</a></td>
<td class="colLast">
<div class="block">Vocabulary constants for RDF-based configuration of the SpinSail.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/eclipse/rdf4j/sail/spin/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../org/eclipse/rdf4j/spin/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/eclipse/rdf4j/sail/spin/config/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015-2019 <a href="https://www.eclipse.org/">Eclipse Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
#ifndef POLSERVER_EXPORTEDFUNCTION_H
#define POLSERVER_EXPORTEDFUNCTION_H
#include <string>
namespace Pol::Bscript::Compiler
{
class ExportedFunction
{
public:
ExportedFunction( std::string, unsigned parameter_count, unsigned entrypoint_program_counter );
const std::string name;
const unsigned parameter_count;
const unsigned entrypoint_program_counter;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_EXPORTEDFUNCTION_H
| {
"pile_set_name": "Github"
} |
風間マリコ最新番号
【DGKD-120S】男喰い熟女 平均年齢36.2歳!12人のエロス
【MA-279】ミセス東京デート 13</a>2006-02-11メディアバンク$$$MAGANDA119分钟 | {
"pile_set_name": "Github"
} |
package designpattern.u39.storage;
import designpattern.u39.RequestInfo;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Created by HuGuodong on 1/31/20.
*/
public class RedisMetricsStorage implements MetricsStorage {
//...省略属性和构造函数等...
@Override
public void saveRequestInfo(RequestInfo requestInfo) {
//...
System.out.println("saveRequestInfo");
}
@Override
public List<RequestInfo> getRequestInfos(String apiName, long startTimestamp, long endTimestamp) {
//...
System.out.println("getRequestInfos");
return Collections.emptyList();
}
@Override
public Map<String, List<RequestInfo>> getRequestInfos(long startTimestamp, long endTimestamp) {
//...
System.out.println("getRequestInfos");
return null;
}
} | {
"pile_set_name": "Github"
} |
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#ifndef TARGET_OS_IOS
#define TARGET_OS_IOS TARGET_OS_IPHONE
#endif
#ifndef TARGET_OS_WATCH
#define TARGET_OS_WATCH 0
#endif
#ifndef TARGET_OS_TV
#define TARGET_OS_TV 0
#endif
| {
"pile_set_name": "Github"
} |
# VDL架构设计
## 1.背景
VDL的全称是:Vip Distributed Log。VDL的定位是:**高吞吐、低延时的分布式日志存储,多副本、强一致性是其关键的特征。**这里的Log不是指syslog或者log4j产生的用于跟踪或者问题分析的应用程序日志。Log贯穿于互联网企业应用开发的方方面面,从DB的存储引擎、DB的复制、分布式一致性算法到消息系统,本质上都是Log的存储和分发。
从业界技术趋势来看,互联网企业在强一致存储方面也进行了很多尝试,很多基础设施都基于强一致的存储服务:
- Amazon在2017年的SIGMOD上公开了Aurora的技术细节,其设计哲学是Log Is Database;
- Etcd,HashiCorp Consul本质上都是基于Raft的强一致分布式日志;
- 腾讯的PhxSQL其核心是基于Multi-Paxos的强一致分布式日志;
- 阿里的PolarDB,其核心的复制算法是Raft;
- PingCAP的TiDB,底层是TiKV,其核心也是基于Raft的强一致分布式日志。
LinkedIn的工程师提出:You can't fully understand databases, NoSQL stores, key value stores, replication, paxos, hadoop, version control, or almost any software system without understanding logs[[1\]](#_参考_10)。
可以看出日志是多么地重要。一个高吞吐、低延时、强一致性的分布式日志存储,是很多基础设施的基础,对于公司来说,也具有很重要的战略意义。
## 2.功能需求
### 2.1.需求定义
VDL产品形态说明书,明确了Log Stream的具体要求,总结如下。
明确的需求有:
- 复制状态机(RSM: Replicated State Machine) - 这一类应用主要使用VDL作为事务日志。在VIP RDP(Real-time Data Pipeline)的第二阶段,明确需要VDL做为RDP的强一致日志存储。
- 支持同城三中心、跨DC的部署结构 – 需要满足这种部署模式,并支持Client本DC读写(多DC可读写)。
潜在需求:
- 消息队列、消息发布订阅、流计算 - 这一类应用主要使用VDL来存储和传递消息。我们可以基于VDL实现消息发布/订阅系统;同时也可以作为Storm/Spark的输入和输出,用于实时流计算的场景。
### 2.2.VDL 实现范围
VDL 将实现上述的明确需求,对于潜在需求,将在后续版本考虑。
实现的主要功能包括:
- Log Produce:将Log有序存储到强一致性的分布式日志VDL中。
- Log Consume:根据Offset消费日志。
### 2.3.VDL实现概述
VDL操作的逻辑对象是Log Stream,主要包括对Log Stream进行Log Product与Consume。可以把Log Stream看作是Kafka中只有一个Partition的Topic。VDL采用Raft作为一致性算法,一个Raft Group可以看作一个Log Stream,Log Stream与Raft Group是1:1的关系。
VDL支持Kafka协议。VMS将在后续版本支持Kafka 0.10版本,所以VDL 支持的Kafka协议版本定为0.10,以支持新的VMS Client与Kafka 0.10原生客户端,具体支持部分见Detail Design。
Kafka 0.10版本不支持Exactly Once语义以及Follower读取功能,VDL的后续目标是考虑同时支持0.10/0.11版本(包含exactly once语义),并根据0.11版本的实现情况决定是否支持Follower读取功能。在前期实现时,需要考虑后续扩展。VDL不维护各个Consumer的消费进度,需要Consumer端自己决定自己从哪个Offset开始消费。VDL除了多副本、强一致的关键特性外,对Log的生产定义了一些特性,如下表:
| **分类** | **特性** | **说明** |
| -------- | ------------------ | ------------------------------------------------------------ |
| 生产 | 异步发送顺序性保障 | 可以异步生产Log,对于同一个TCP连接,保证只要第N个Log返回异常,> N以后的日志都将返回异常,这个将在详细设计时,根据不同的异常做不同的处理。 |
## 3.架构设计
本章节描述VDL的总体架构以达成总体的认识,各个模块的具体设计与作用在后续Detail Design章节中有详细描述。VDL总体架构如下图:

### 3.1.Client API
Client API以类库的方式提供。Client的行为可以分为Producer与Consumer,具体的行为在Detail Design中描述。
### 3.2.VDL Replica Set
VDL Replica Set 是用于存储相同Log数据的一组VDL Servers节点(进程),用于数据冗余(多副本)与高可用。VDL Server是单独运行的进程服务。VDL Replica Set通常由3个或5个VDL Server组成,如下图所示(3个节点示例):

VDL 用Raft作为一致性算法,一个VDL Replica Set可以同时存在多个Raft Group,也就是一个VDL Replica Set可以同时服务多个Log Stream。如下图所示:

对于同城三中心的部署结构,VDL Server可以跨DC部署,如下图所示:

每个Raft Group,创建时可以指定默认的DC,并通过Config Servers组件,监控Raft Group的Leader是否有发生变化,若有则尝试恢复成默认的DC(Leader Transfer)。
总体端到端的拓扑图如下所示:

### 3.3.Config Servers
Config Servers用于管理VDL Cluster,包括
1. Raft Group的创建
2. 接收VDL Server的上报请求,存储VDL集群信息
3. 接收Management的管理请求,管理VDL集群
4. 在跨DC部署模式下,监控Leader所在DC,并进行Leader Transfer。
一个VDL集群由一个Config Servers管理,一个Config Servers由三个节点的Config Server组成,通过Raft算法选Leader,只有Leader进行服务。
## 4.数据流
VDL 的Data Flow可以分为Log Produce与Log Consume部分。Log Produce:

1. Producer生产Log,包括如下流程:
a) Producer使用Boot Strap Server连接到VDL Server,将使用Kafka协议中的Metadata协议,获取集群的路由信息。
b) 根据路由信息与需要发送的Log Stream名字(上图例子为A),查找到对应Raft Group的Leader,并连接到Leader所在的VDL Server。
c) 连接成功后,开始生产Log。
d) 若路由信息不正确,VDL Server收到生产Log的请求后,将返回NotLeaderForPartition的错误(见Kafka协议),Client将重新获取路由信息,并偿试上述步骤。
2. VDL Server收到请求后,交由RPC Interface解析之后,将运行Raft的流程。Raft流程包括:写本地Log,数据复制等。
3. 在Raft流程成功结束后(收到多数派的响应),ACK给客户端。
Log Consume流程如下图所示:

与Produce流程不同的是,Consume流程,只要在Leader读取,而不需要与Follower进行网络通讯。具体流程如下:
1. Consumer发送请求到对应的Leader。
2. Leader根据Offset读取相应的Log。
3. Leader返回对应的数据。
由于Kafka由于Kafka Client的限制,使用Kafka Client时,Consumer只能从Leader进行消费。后续如果提供VDL Client,则不受此限制。
## 5.Detail Design
### 5.1.组件设计
#### 5.1.1.Client
##### 5.1.1.1.Kafka协议支持
VDL支持Kafka 0.10版本的部分协议,达到可以直接使用Kafka原生客户端或者新VMS客户端的目的。支持的协议表如下:
| **分类** | Kafka协议说明 | **是否** **支持** | **备注** |
| ------------------------- | ------------------------------------------------------------ | ------------------- | ------------------------------------------------------------ |
| Metadata API | 描述可用的brokers,包括他们的主机和端口信息,并给出了每个broker上分别存有哪些Topic与Partition | 是 | 返回Log Stream的路由信息。 |
| Produce API | 发送消息接口 | 是 | N/A |
| Fetch API | 获取消息接口 | 是 | 实现长轮询模型 |
| Offset API | 用于获取Topic中的Offset有效范围 | 部分 | 支持获取最后一个offset与最早的有效offset。不支持请求具体时间的offset获取?? |
| Offset Commit/Fetch API | Kafka 0.8.2版本开始,提供Broker存储Consumer Offset功能 | 不支持 | 由Consumer存储消费的Offset |
| Group Membership API | 用于消费组管理 | 是 | 达到原生客户端可以直接访问VDL的级别 |
| Administrative API | 管理接口 | 部分 | 符合原生客户端要求,创建、删除Topic由Management处理。 |
##### 5.1.1.2. Producer
Kafka使用基于TCP的二进制协议,Produce是典型的Request/Response模式。Kafka的Produce协议中,一个Request可以包含一个或多个Log。所以Produce方式原理上可以支持下面几种(不同的Kafka客户端实现可能不一样):
1. 单条发送:一个Request发送一个Log。
2. 批量发送:一个Request请求发送多个Log,VDL不保证一个Request中多个Log的原子性。
3. 同步发送:客户端实现同步发送功能。
4. 异步发送:单条或批量异步发送。VDL需要保证在同一TCP连接的Log顺序性。
对于Produce的Response,作如下定义:
1. 成功:如果是单条发送,则此条发送成功。如果是批量发送,则全部成功。
2. 失败:如果是单条发送,则此条发送失败。如果是批量发送,则全部失败。一旦VDL Server返回异常,则此TCP连接的后续所有请求都将异常,客户端需要重新连接。
3. Timeout:客户端逻辑Timeout,意思是在指定时间内,没有等到Response响应。
a) Timeout不保证对应的Request操作的成功与失败,对于批量发送,不保证原子性,可能部分成功或部分失败(如其中一部分Log同步到Follower后,Leader Crash等情况),或者全部成功或全部失败。
b) 出现Timeout,客户端不需要重新连接。
##### 5.1.1.3.Consumer
Kafka 0.10可以使用Broker存储Consumer的消费进度(Offset),但现阶段VDL并不支持。Consumer端需要自已保存Offset。
VDL的Log Stream可以当作是Kafka中只有一个Partition的Topic,Kafka会为Consumer Group分配Partition,但VDL的Log Stream只有一个Partition,所以同一个Consumer Group,同时只能由一个Consumer实例进行消费。
#### 5.1.2.VDL Replica Set
如Architecture章节描述,VDL Replica Set 是用于存储相同Log数据的一组VDL Servers节点(进程)组成,VDL Server主要由RPC Interface模块、Log Stream Handler模块、一致性模块(Raft)组成。如下图所示:

### 5.2.Raft关键点设计
#### 5.2.1.存储设计
##### 5.2.1.1. Log存储设计
VDL Server中,存在两个日志逻辑视图。一个是Raft的日志(对内),一个是Log(对外)。Raft日志除了存储Log信息外,还会存储Raft算法产生的信息 。在存储设计中,需要考虑合并这两个日志,将两次IO合并成一次IO。
下图是一个Raft Group的存储结构图:

**Raft Log**
Raft算法使用的日志,用于存储Raft信息与Client发送的Log。Raft Log保证落盘与Raft Commit后才会ACK。
Raft Log由多个固定大小的Segments组成,这便于日志数据的删除。每个Segment由多个日志组成,每个日志由Raft Info与Log Data组成。
1. Raft Info:包括日志类型与Raft的信息,如Term、Index等。
2. Log Data:根据日志类型,存放Raft的日志数据或者Client发送的Log数据。
VDL Server会在内存中缓存一段最新的Raft Log,便于Consumer能快速地Tailing Read,并且不会产生磁盘IO。
**Raft Index**
用于存储Raft Log索引的文件。在Raft算法中,需要根据Index定位Raft Log。Raft Index也是由多个Index Log Segments组成,每个Segment由多个Idx组成。Idx有两个关键的字段,一个是File Position,指向Raft Log的Segment文件,另一个是Inner File Position,指向Segment文件中的偏移,这个偏移是Raft Log的在Segment文件中的偏移量。
每个Segment是固定大小,假设为M bytes,Idx也是固定长度的,假设为N bytes,若要定位Index为X的Raft Log,由用X * N / M得到具体的Segment,假设为Y,然后再由(X * N – M * Y) / N得到索引在Segment中的位置。
对于Raft Index,不是实时落盘的,VDL Server会在内存维护一段最新的Index数据,当Index数据超过PageSize的N倍时,会刷新到磁盘。
**Log Index**
对Client Log的索引文件。不同于Raft Index,Log Index只是索引Client Log的日志,并不对Raft算法产生的日志进行索引。
假设X为Raft产生的日志,Y为Client发送的日志,Raft Log为 YYXYY,那么,对于Raft Index,其1/2/3/4/5条日志为Y/Y/X/Y/Y,对于Log Index,只有四条日志,全是Y。Consumer会根据Log Index进行消费。
Log Index与Raft Index的组织形式一样,不同的是,Log Index中的Inner File Position指向的是Raft Log中Log Data的起启位置,这样便于使用ZeroCopy技术快速发送到Consumer。
与Raft Index一样,Log Index也是异步落盘。在实现时,Log Index更像是FSM的应用,应该与Raft Log/Raft Index独立出来。
##### 5.2.1.2.配置信息存储设计
配置信息包括两个:Config Servers需要存储VDL的配置信息,VDL Server需要存储Raft算法产生的配置信息。
Config Servers存储VDL的配置信息,包括:
1. VDL Cluster的拓扑信息:有多少个Replica Set
2. Replica Set的拓扑信息:每个Replica Set有多少个VDL Server,每个VDL Server的IP端口、状态等信息
3. Raft Group的信息:每个Replica Set跑多少个Raft Group,每个Raft Group的拓扑信息
VDL Server需要存储Raft算法产生的配置信息,包括:
1. Raft Membership信息:如Raft中的Peer信息
2. Vote信息:在Leader Election中所涉及的Vote信息需要持久化
由于配置信息数据量很少,不需要考虑Log Compaction,所以只需要在Raft的FSM引入Key-Value存储或者直接使用文件存储配置信息即可。
##### 5.2.1.3.存储介质选型
VDL的存储设计是针对SSD的。原因如下:
对于单个Log Stream,一般有三种操作:
1. 写入:顺序写入Raft Log文件,产生顺序写入IO。
2. Tailing Read:在尾端消费,由于VDL会在内存缓存一段日志,所以Tailing Read不会产生磁盘IO。
3. Catchup Read:从非尾端开始消费,会产生顺序读IO。
如果一个VDL Server同时有多个Log Stream,并存在单个磁盘,会产生随机读写IO。 如果一个VDL Server同时有多个Log Stream,每个Log Stream一个磁盘,则会产生顺序写IO,随机读IO(多个Consumer消费)。
综上所述,随着Consumer个数的变化与是否Catchup Read,都会带来随机读IO,所以建议使用SSD设备,避免随机的读IO带来较大的影响,使用SSD还会在多个Log Stream的情况下,为随机写IO带来更高的性能。
还有一种存储的实现方式,将读与写的IO分离,像Distributed Log,原理是一份数据,会写两份,每份独立磁盘,这样读IO就不会影响写IO。这种方式对机械磁盘会带来较高的写入TPS,但Catchup Read操作则优化不大。综合考虑两份数据的存储成本、SSD的普及程度与VDL实现成本,VDL不采用这种方式。
5.2.1.4. 存储性能优化
在实现中,为了提高Raft Log写入性能,应该使用align overwrite + overlapped + sync_file_range方式写入,如下图所示:

#### 5.2.2.Log Compaction
配置信息存储的数据量很少,不需要Compaction,这章节讨论的是Log的Compaction。对于Log Stream形态的VDL,Log Compaction主要指的是日志的删除,包括Raft Log/Raft Index/Log Index日志的删除。
VDL通过外围脚本,手工触发删除日志,从前向后删除日志文件。
#### 5.2.3. Snapshot
Snapshot用于日常备份与新节点加入时的同步。由于Log Stream形态的VDL存储的是Log,而Log又是分Segments存储的,所以Snapshot可以是已结束的Log Segments(非正在写入的Segment)。
在新节点加入时,Leader可以直接发送已结束的Segments到Follower。也可以开发VDL同步工具,自动将已结束的Segments拷贝到新的节点。
#### 5.2.4. Membership Change
无论是ETCD的Raft Lib还是HashiCorp的Raft Lib,均实现了Membership Changes,这部分确定性比较高,不会影响整体方案,使用现有实现即可。
#### 5.2.5. Raft性能优化
##### 5.2.5.1. Raft Pipeline
在Raft性能优化中,收益较大的是Raft Pipeline优化。核心思想是Leader的刷盘与AppendEntries To Follower同时进行。
在Raft算法前期的研调中,Pipeline优化使得整体TPS有一倍的增长,Latency是原来的1/2(SATA盘)。在VDL的实现中,需要实现这个优化。
##### 5.2.5.2. TCP Pipeline + Group Commit
TCP Pipeline的核心思想是:Client可以Pipeline发送(异步)数据,Leader与与Follower的TCP也可以是Pipeline通信。Group Commit的核心思想是:批量将Log刷盘,结果存储设计章节的性能优化,最小化刷盘的消耗。总体如下图所示:

#### 5.2.7.Raft与Log可见性
在某一个时刻,一个Log Stream(Raft Group)会有如下的情况:

1. First Log:指的是这个Log Stream的第一个Log,随着Log Compaction等操作,这个值会变化。
2. Commit:指的是Log Stream里面已得到多数派响应的Log Index。
3. Append:指的是Log Stream现在入写的Index
VDL承诺Log可见区间为First Log到Commit(E-H),未Commit的Log不可见(>H的Log)。
#### 5.2.8.FSM的考虑
VDL Server的FSM主要有两个,一个是Log Index,一个是用于存储Membership等Raft信息。
Config Servers的FSM主要用于存储VDL集群信息。
Raft信息与VDL集群信息的数据量不大,所以不用考虑太高的性能与Log Compaction,引入Key-Value Store即可,如Bolt-DB,Level-DB。Log Index主要用于做Log的索引,在Raft Commit之后,通知Log Index FSM,Log Index FSM在内存生成新的Index,在达到刷盘条件,异步通知刷盘线程落盘。
### 5.3.测试
VDL的测试分为单元测试与集成测试。
**单元测试**
VDL使用Go语言开发,Go Test是Go语言自带的测试工具,VDL的单元测试将使用Go Test进行。
**集成测试**
VDL是个分布式的系统,集成测试是分布式系统测试的难点。VDL的集成测试,将在代码中插入断点,模拟节点无响应,Crash等异常流程,使用测试架框(自研),根据测试用例,向VDL Server发送断点请求,测试分布式环境下各种异常。
| {
"pile_set_name": "Github"
} |
#!/bin/bash
# Importing useful functions for cc testing
if [ -f ./func.sh ]; then
source ./func.sh
elif [ -f scripts/func.sh ]; then
source scripts/func.sh
fi
echo_b " ========== Network initialization start ========== "
## Create channel
echo_b "Creating channel ${APP_CHANNEL} with ${APP_CHANNEL_TX}..."
channelCreate ${APP_CHANNEL} ${APP_CHANNEL_TX} ${ORDERER0_URL}
sleep 1
## Join all the peers to the channel
echo_b "Having peer0 join the channel..."
channelJoin ${APP_CHANNEL} 0
## Set the anchor peers for each org in the channel
echo_b "Updating anchor peers for peer0/org1... no use for only single channel"
channelUpdate ${APP_CHANNEL} 1 0 ${ORDERER0_URL} ${ORDERER0_TLS_ROOTCERT} Org1MSPanchors.tx
## Install chaincode on all peers
CC_NAME=${CC_02_NAME}
CC_PATH=${CC_02_PATH}
echo_b "Installing chaincode ${CC_NAME} on peer0..."
chaincodeInstall 1 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
# Instantiate chaincode on all peers
# Instantiate can only be executed once on any node
echo_b "Instantiating chaincode on the channel..."
chaincodeInstantiate ${APP_CHANNEL} 0
echo_g "=============== All GOOD, network initialization done =============== "
echo
exit 0
| {
"pile_set_name": "Github"
} |
/* Generated by RuntimeBrowser on iPhone OS 3.0
Image: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary
*/
@class PLVideoView, NSData, UIView, PLCropOverlay, UIImage, PLCameraElapsedTimeView, PLCameraController, UIToolbar, NSDictionary, NSString, PLImageTile, MLPhotoDCFFileGroup, UIImageView;
@interface PLCameraView : UIView <PLCameraControllerDelegate, PLVideoViewDelegate>
{
UIToolbar *_cameraButtonBar;
NSInteger _availablePictureCount;
NSInteger _captureOrientation;
NSInteger _photoSavingOptions;
BOOL _manipulatingCrop;
MLPhotoDCFFileGroup *_videoFileGroup;
PLCameraController *_cameraController;
PLCameraElapsedTimeView *_timeView;
UIView *_previewView;
UIView *_animatedCaptureView;
UIView *_irisView;
UIView *_staticIrisView;
UIImageView *_shadowView;
UIImage *_previewWellImage;
UIImage *_temporaryThumbnailImage;
NSInteger _pictureCapacity;
BOOL _irisIsClosed;
PLCropOverlay *_cropOverlay;
PLImageTile *_imageTile;
PLVideoView *_videoView;
NSDictionary *_imagePickerOptions;
id _delegate;
NSInteger _enabledGestures;
unsigned int _showsCropOverlay : 1;
unsigned int _allowsEditing : 1;
unsigned int _changesStatusBar : 1;
unsigned int _cropOverlayUsesTelephonyUI : 1;
unsigned int _showsCropRegion : 1;
unsigned int _allowsMultipleModes : 1;
unsigned int _capturePhotoWhenFocusFinished : 1;
unsigned int _dontAnimateVideoPreviewDown : 1;
NSString *_cropTitle;
NSString *_cropButtonTitle;
NSData *_lastCapturedImageData;
unsigned int _imagePickerWantsImageData : 1;
}
@property(readonly) BOOL isCameraReady;
- (void)_playShutterSound;
- (void)_updateStatusBar;
- (void)setManipulatingCrop:(BOOL)arg1;
- (void)cameraControllerReadyStateChanged:(id)arg1;
- (void)_checkDiskSpaceAfterCapture;
- (void)_previewVideoAtPath:(id)arg1;
- (void)cameraController:(id)arg1 addedVideoAtPath:(id)arg2 withPreviewSurface:(void*)arg3 metadata:(id)arg4 wasInterrupted:(BOOL)arg5;
- (void)cameraController:(id)arg1 tookPicture:(id)arg2 withPreview:(id)arg3 jpegData:(struct __CFData { }*)arg4 imageProperties:(id)arg5;
- (void)_preparePreviewWellImage:(struct CGImage { }*)arg1 isVideo:(BOOL)arg2;
- (void)setupAnimateCameraPreviewDown:(id)arg1;
- (void)setupAnimateVideoPreviewDown:(void*)arg1;
- (void)animateCameraPreviewDown;
- (void)animationDidStop:(id)arg1 finished:(BOOL)arg2;
- (void)_setShadowViewVisible:(BOOL)arg1;
- (id)initWithFrame:(struct CGRect { struct CGPoint { float x_1_1_1; float x_1_1_2; } x1; struct CGSize { float x_2_1_1; float x_2_1_2; } x2; })arg1;
- (void)dealloc;
- (void)setDelegate:(id)arg1;
- (void)setEnabledGestures:(NSInteger)arg1;
- (void)setPhotoSavingOptions:(NSInteger)arg1;
- (NSInteger)photoSavingOptions;
- (void)_updateImageEditability;
- (void)setImagePickerOptions:(id)arg1;
- (void)setAllowsImageEditing:(BOOL)arg1;
- (void)setChangesStatusBar:(BOOL)arg1;
- (void)setShowsCropOverlay:(BOOL)arg1;
- (void)setCropOverlayUsesTelephonyUI:(BOOL)arg1;
- (void)setShowsCropRegion:(BOOL)arg1;
- (void)setCropTitle:(id)arg1 buttonTitle:(id)arg2;
- (void)setImagePickerWantsImageData:(BOOL)arg1;
- (void)setCameraButtonBar:(id)arg1;
- (id)buttonBar;
- (id)_bottomBar;
- (id)_modeSwitch;
- (id)_shutterButton;
- (void)setCameraMode:(NSInteger)arg1;
- (void)setAllowsMultipleCameraModes:(BOOL)arg1;
- (id)imageTile;
- (void)_inCallStatusChanged:(id)arg1;
- (void)_applicationResumed;
- (void)takePictureOpenIrisAnimationFinished;
- (void)takePictureCloseIrisAnimationFinished;
- (void)_shutterButtonClicked;
- (void)cameraControllerFocusFinished:(id)arg1;
- (void)timeLapseTimerFired;
- (id)_newVideoFileGroup;
- (void)_deleteVideoFileGroup;
- (void)cameraShutterClicked:(id)arg1;
- (void)_performVideoCapture;
- (void)_videoSwitchValueDidChange:(id)arg1;
- (void)cameraController:(id)arg1 modeDidChange:(NSInteger)arg2;
- (void)cameraControllerVideoCaptureDidStart:(id)arg1;
- (void)cameraControllerVideoCaptureDidStop:(id)arg1;
- (void)_simpleRemoteActionDidOccur:(id)arg1;
- (void)_updateModeSwitchVisibility;
- (void)viewWillBeDisplayed;
- (void)startPreview;
- (void)viewDidAppear;
- (void)viewWillBeRemoved;
- (void)_removeVideoCaptureFileAtPath:(id)arg1;
- (void)cropOverlayWasCancelled:(id)arg1;
- (void)cropOverlayWasOKed:(id)arg1;
- (void)cropOverlayPlay:(id)arg1;
- (void)cropOverlayPause:(id)arg1;
- (void)cropOverlay:(id)arg1 didFinishSaving:(id)arg2;
- (BOOL)imageViewIsDisplayingLandscape:(id)arg1;
- (void)willStartGesture:(NSInteger)arg1 inView:(id)arg2 forEvent:(struct __GSEvent { }*)arg3;
- (void)tearDownIris;
- (void)primeStaticClosedIris;
- (void)showStaticClosedIris;
- (void)hideStaticClosedIris;
- (BOOL)irisIsClosed;
- (void)closeIris:(BOOL)arg1 didFinishSelector:(SEL)arg2;
- (void)openIrisWithDidFinishSelector:(SEL)arg1;
- (void)openIrisAnimationFinished;
- (void)closeIrisAnimationFinished;
- (void)animateIrisForSuspension;
- (BOOL)videoViewShouldDisplayScrubber:(id)arg1;
- (BOOL)videoViewShouldDisplayOverlay:(id)arg1;
- (float)videoViewScrubberYOrigin:(id)arg1;
- (BOOL)videoViewCanBeginPlayback:(id)arg1;
- (void)videoViewIsReadyToBeginPlayback:(id)arg1;
- (void)videoViewDidBeginPlayback:(id)arg1;
- (void)videoViewDidPausePlayback:(id)arg1;
- (void)videoViewDidEndPlayback:(id)arg1 didFinish:(BOOL)arg2;
- (BOOL)isCameraReady;
@end
| {
"pile_set_name": "Github"
} |
{
"name": "yuque-hexo",
"version": "1.6.5",
"description": "A downloader for articles from yuque",
"main": "index.js",
"scripts": {
"clean": "rimraf coverage",
"lint": "eslint .",
"test": "npm run lint -- --fix && npm run test-local",
"test-local": "egg-bin test",
"cov": "egg-bin cov",
"ci": "npm run clean && npm run lint && egg-bin cov",
"snyk-protect": "snyk protect",
"prepublish": "npm run snyk-protect"
},
"repository": {
"type": "git",
"url": "git+https://github.com/x-cold/yuque-hexo.git"
},
"bin": {
"yuque-hexo": "bin/yuque-hexo.js"
},
"author": "x-cold <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/x-cold/yuque-hexo/issues"
},
"homepage": "https://github.com/x-cold/yuque-hexo#readme",
"dependencies": {
"@yuque/sdk": "^1.1.1",
"chalk": "^2.4.1",
"common-bin": "^2.7.3",
"debug": "^3.1.0",
"depd": "^2.0.0",
"ejs": "^2.6.1",
"filenamify": "^4.1.0",
"hexo-front-matter": "^0.2.3",
"html-entities": "^1.2.1",
"lodash": "^4.17.10",
"mkdirp": "^1.0.0",
"moment": "^2.22.2",
"prettier": "^2.0.4",
"queue": "^4.5.0",
"rimraf": "^2.6.2",
"update-check": "^1.5.3",
"urllib": "^2.29.1",
"snyk": "^1.316.1"
},
"devDependencies": {
"coffee": "^5.1.0",
"egg-bin": "^4.8.3",
"egg-ci": "^1.8.0",
"eslint": "^5.4.0",
"eslint-config-egg": "^7.1.0"
},
"snyk": true
}
| {
"pile_set_name": "Github"
} |
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* 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 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __G_STRFUNCS_H__
#define __G_STRFUNCS_H__
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif
#include <stdarg.h>
#include <glib/gmacros.h>
#include <glib/gtypes.h>
G_BEGIN_DECLS
/* Functions like the ones in <ctype.h> that are not affected by locale. */
typedef enum {
G_ASCII_ALNUM = 1 << 0,
G_ASCII_ALPHA = 1 << 1,
G_ASCII_CNTRL = 1 << 2,
G_ASCII_DIGIT = 1 << 3,
G_ASCII_GRAPH = 1 << 4,
G_ASCII_LOWER = 1 << 5,
G_ASCII_PRINT = 1 << 6,
G_ASCII_PUNCT = 1 << 7,
G_ASCII_SPACE = 1 << 8,
G_ASCII_UPPER = 1 << 9,
G_ASCII_XDIGIT = 1 << 10
} GAsciiType;
GLIB_VAR const guint16 * const g_ascii_table;
#define g_ascii_isalnum(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_ALNUM) != 0)
#define g_ascii_isalpha(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_ALPHA) != 0)
#define g_ascii_iscntrl(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_CNTRL) != 0)
#define g_ascii_isdigit(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_DIGIT) != 0)
#define g_ascii_isgraph(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_GRAPH) != 0)
#define g_ascii_islower(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_LOWER) != 0)
#define g_ascii_isprint(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_PRINT) != 0)
#define g_ascii_ispunct(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_PUNCT) != 0)
#define g_ascii_isspace(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_SPACE) != 0)
#define g_ascii_isupper(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_UPPER) != 0)
#define g_ascii_isxdigit(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_XDIGIT) != 0)
GLIB_AVAILABLE_IN_ALL
gchar g_ascii_tolower (gchar c) G_GNUC_CONST;
GLIB_AVAILABLE_IN_ALL
gchar g_ascii_toupper (gchar c) G_GNUC_CONST;
GLIB_AVAILABLE_IN_ALL
gint g_ascii_digit_value (gchar c) G_GNUC_CONST;
GLIB_AVAILABLE_IN_ALL
gint g_ascii_xdigit_value (gchar c) G_GNUC_CONST;
/* String utility functions that modify a string argument or
* return a constant string that must not be freed.
*/
#define G_STR_DELIMITERS "_-|> <."
GLIB_AVAILABLE_IN_ALL
gchar* g_strdelimit (gchar *string,
const gchar *delimiters,
gchar new_delimiter);
GLIB_AVAILABLE_IN_ALL
gchar* g_strcanon (gchar *string,
const gchar *valid_chars,
gchar substitutor);
GLIB_AVAILABLE_IN_ALL
const gchar * g_strerror (gint errnum) G_GNUC_CONST;
GLIB_AVAILABLE_IN_ALL
const gchar * g_strsignal (gint signum) G_GNUC_CONST;
GLIB_AVAILABLE_IN_ALL
gchar * g_strreverse (gchar *string);
GLIB_AVAILABLE_IN_ALL
gsize g_strlcpy (gchar *dest,
const gchar *src,
gsize dest_size);
GLIB_AVAILABLE_IN_ALL
gsize g_strlcat (gchar *dest,
const gchar *src,
gsize dest_size);
GLIB_AVAILABLE_IN_ALL
gchar * g_strstr_len (const gchar *haystack,
gssize haystack_len,
const gchar *needle);
GLIB_AVAILABLE_IN_ALL
gchar * g_strrstr (const gchar *haystack,
const gchar *needle);
GLIB_AVAILABLE_IN_ALL
gchar * g_strrstr_len (const gchar *haystack,
gssize haystack_len,
const gchar *needle);
GLIB_AVAILABLE_IN_ALL
gboolean g_str_has_suffix (const gchar *str,
const gchar *suffix);
GLIB_AVAILABLE_IN_ALL
gboolean g_str_has_prefix (const gchar *str,
const gchar *prefix);
/* String to/from double conversion functions */
GLIB_AVAILABLE_IN_ALL
gdouble g_strtod (const gchar *nptr,
gchar **endptr);
GLIB_AVAILABLE_IN_ALL
gdouble g_ascii_strtod (const gchar *nptr,
gchar **endptr);
GLIB_AVAILABLE_IN_ALL
guint64 g_ascii_strtoull (const gchar *nptr,
gchar **endptr,
guint base);
GLIB_AVAILABLE_IN_ALL
gint64 g_ascii_strtoll (const gchar *nptr,
gchar **endptr,
guint base);
/* 29 bytes should enough for all possible values that
* g_ascii_dtostr can produce.
* Then add 10 for good measure */
#define G_ASCII_DTOSTR_BUF_SIZE (29 + 10)
GLIB_AVAILABLE_IN_ALL
gchar * g_ascii_dtostr (gchar *buffer,
gint buf_len,
gdouble d);
GLIB_AVAILABLE_IN_ALL
gchar * g_ascii_formatd (gchar *buffer,
gint buf_len,
const gchar *format,
gdouble d);
/* removes leading spaces */
GLIB_AVAILABLE_IN_ALL
gchar* g_strchug (gchar *string);
/* removes trailing spaces */
GLIB_AVAILABLE_IN_ALL
gchar* g_strchomp (gchar *string);
/* removes leading & trailing spaces */
#define g_strstrip( string ) g_strchomp (g_strchug (string))
GLIB_AVAILABLE_IN_ALL
gint g_ascii_strcasecmp (const gchar *s1,
const gchar *s2);
GLIB_AVAILABLE_IN_ALL
gint g_ascii_strncasecmp (const gchar *s1,
const gchar *s2,
gsize n);
GLIB_AVAILABLE_IN_ALL
gchar* g_ascii_strdown (const gchar *str,
gssize len) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_ascii_strup (const gchar *str,
gssize len) G_GNUC_MALLOC;
GLIB_DEPRECATED
gint g_strcasecmp (const gchar *s1,
const gchar *s2);
GLIB_DEPRECATED
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n);
GLIB_DEPRECATED
gchar* g_strdown (gchar *string);
GLIB_DEPRECATED
gchar* g_strup (gchar *string);
/* String utility functions that return a newly allocated string which
* ought to be freed with g_free from the caller at some point.
*/
GLIB_AVAILABLE_IN_ALL
gchar* g_strdup (const gchar *str) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strdup_printf (const gchar *format,
...) G_GNUC_PRINTF (1, 2) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strdup_vprintf (const gchar *format,
va_list args) G_GNUC_PRINTF(1, 0)
G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strndup (const gchar *str,
gsize n) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strnfill (gsize length,
gchar fill_char) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strconcat (const gchar *string1,
...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
GLIB_AVAILABLE_IN_ALL
gchar* g_strjoin (const gchar *separator,
...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
/* Make a copy of a string interpreting C string -style escape
* sequences. Inverse of g_strescape. The recognized sequences are \b
* \f \n \r \t \\ \" and the octal format.
*/
GLIB_AVAILABLE_IN_ALL
gchar* g_strcompress (const gchar *source) G_GNUC_MALLOC;
/* Copy a string escaping nonprintable characters like in C strings.
* Inverse of g_strcompress. The exceptions parameter, if non-NULL, points
* to a string containing characters that are not to be escaped.
*
* Deprecated API: gchar* g_strescape (const gchar *source);
* Luckily this function wasn't used much, using NULL as second parameter
* provides mostly identical semantics.
*/
GLIB_AVAILABLE_IN_ALL
gchar* g_strescape (const gchar *source,
const gchar *exceptions) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gpointer g_memdup (gconstpointer mem,
guint byte_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(2);
/* NULL terminated string arrays.
* g_strsplit(), g_strsplit_set() split up string into max_tokens tokens
* at delim and return a newly allocated string array.
* g_strjoinv() concatenates all of str_array's strings, sliding in an
* optional separator, the returned string is newly allocated.
* g_strfreev() frees the array itself and all of its strings.
* g_strdupv() copies a NULL-terminated array of strings
* g_strv_length() returns the length of a NULL-terminated array of strings
*/
GLIB_AVAILABLE_IN_ALL
gchar** g_strsplit (const gchar *string,
const gchar *delimiter,
gint max_tokens) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar ** g_strsplit_set (const gchar *string,
const gchar *delimiters,
gint max_tokens) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gchar* g_strjoinv (const gchar *separator,
gchar **str_array) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
void g_strfreev (gchar **str_array);
GLIB_AVAILABLE_IN_ALL
gchar** g_strdupv (gchar **str_array) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
guint g_strv_length (gchar **str_array);
GLIB_AVAILABLE_IN_ALL
gchar* g_stpcpy (gchar *dest,
const char *src);
G_END_DECLS
#endif /* __G_STRFUNCS_H__ */
| {
"pile_set_name": "Github"
} |
<div class="loading_flag" style="display:none;">{{ rsa_check_r['error'] }}</div>
<style type="text/css">
.error-show{
text-align: center;
}
</style>
<div class="layui-container" style="width:100%;">
<div class="layui-row" style="margin-top:28%;">
{% if rsa_check_r['error'] %}
<div class="error-show"><i class="layui-icon" style="font-size: 30px; color: #00c1de"></i> {{ rsa_check_r['msg'] }}</div>
{% else %}
<div class="error-show"><i class="layui-icon" style="font-size: 30px; color: #FF5722"></i> {{ rsa_check_r['msg'] }}</div>
{% endif %}
</div>
</div>
<script>
layui.use('layer', function(){
var layer = layui.layer,
$=layui.jquery;
//time设置为0永远不自动关闭,shade为0表示去遮罩。
var loading_index = layer.msg('加载中...', {icon: 16,time:0,shade:0});
if ($('div .loading_flag').val != null || $('div .loading_flag').val !="" || $('div .loading_flag').val !=undefined){
layer.close(loading_index);
console.log(loading_index.offset);
}
//
});
</script> | {
"pile_set_name": "Github"
} |
module VirtualBox
module COM
module Interface
module Version_4_1_X
class VirtualBox < AbstractInterface
IID_STR = "c28be65f-1a8f-43b4-81f1-eb60cb516e66"
property :version, WSTRING, :readonly => true
property :revision, T_UINT64, :readonly => true
property :package_type, WSTRING, :readonly => true
property :api_version, WSTRING, :readonly => true
property :home_folder, WSTRING, :readonly => true
property :settings_file_path, WSTRING, :readonly => true
property :host, :Host, :readonly => true
property :system_properties, :SystemProperties, :readonly => true
property :machines, [:Machine], :readonly => true
property :hard_disks, [:Medium], :readonly => true
property :dvd_images, [:Medium], :readonly => true
property :floppy_images, [:Medium], :readonly => true
property :progress_operations, [:Progress], :readonly => true
property :guest_os_types, [:GuestOSType], :readonly => true
property :shared_folders, [:SharedFolder], :readonly => true
property :performance_collector, :PerformanceCollector, :readonly => true
property :dhcp_servers, [:DHCPServer], :readonly => true
property :event_source, :EventSource, :readonly => true
property :extension_pack_manager, :ExtPackManager, :readonly => true
property :internal_networks, [WSTRING], :readonly => true
property :generic_network_drivers, [WSTRING], :readonly => true
function :compose_machine_filename, WSTRING, [WSTRING, WSTRING]
function :create_machine, :Machine, [WSTRING, WSTRING, WSTRING, WSTRING, T_BOOL]
function :open_machine, :Machine, [WSTRING]
function :register_machine, nil, [:Machine]
function :find_machine, :Machine, [WSTRING]
function :create_appliance, :Appliance, []
function :create_hard_disk, :Medium, [WSTRING, WSTRING]
function :open_medium, :Medium, [WSTRING, :DeviceType, :AccessMode, T_BOOL]
function :find_medium, :Medium, [WSTRING, :DeviceType]
function :get_guest_os_type, :GuestOSType, [WSTRING]
function :create_shared_folder, nil, [WSTRING, WSTRING, T_BOOL, T_BOOL]
function :remove_shared_folder, nil, [WSTRING]
function :get_extra_data_keys, [WSTRING], []
function :get_extra_data, WSTRING, [WSTRING]
function :set_extra_data, nil, [WSTRING, WSTRING]
function :create_dhcp_server, :DHCPServer, [WSTRING]
function :find_dhcp_server_by_network_name, :DHCPServer, [WSTRING]
function :remove_dhcp_server, nil, [:DHCPServer]
function :check_firmware_present, T_BOOL, [:FirmwareType, WSTRING, [:out, WSTRING], [:out, WSTRING]]
end
end
end
end
end
| {
"pile_set_name": "Github"
} |
// Copyright 2017 the V8 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.
#include "src/builtins/builtins-async-gen.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/codegen/code-stub-assembler.h"
#include "src/objects/js-generator.h"
#include "src/objects/js-promise.h"
#include "src/objects/objects-inl.h"
namespace v8 {
namespace internal {
class AsyncFunctionBuiltinsAssembler : public AsyncBuiltinsAssembler {
public:
explicit AsyncFunctionBuiltinsAssembler(compiler::CodeAssemblerState* state)
: AsyncBuiltinsAssembler(state) {}
protected:
template <typename Descriptor>
void AsyncFunctionAwait(const bool is_predicted_as_caught);
void AsyncFunctionAwaitResumeClosure(
const TNode<Context> context, const TNode<Object> sent_value,
JSGeneratorObject::ResumeMode resume_mode);
};
void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwaitResumeClosure(
TNode<Context> context, TNode<Object> sent_value,
JSGeneratorObject::ResumeMode resume_mode) {
DCHECK(resume_mode == JSGeneratorObject::kNext ||
resume_mode == JSGeneratorObject::kThrow);
TNode<JSAsyncFunctionObject> async_function_object =
CAST(LoadContextElement(context, Context::EXTENSION_INDEX));
// Push the promise for the {async_function_object} back onto the catch
// prediction stack to handle exceptions thrown after resuming from the
// await properly.
Label if_instrumentation(this, Label::kDeferred),
if_instrumentation_done(this);
Branch(IsDebugActive(), &if_instrumentation, &if_instrumentation_done);
BIND(&if_instrumentation);
{
TNode<JSPromise> promise = LoadObjectField<JSPromise>(
async_function_object, JSAsyncFunctionObject::kPromiseOffset);
CallRuntime(Runtime::kDebugAsyncFunctionResumed, context, promise);
Goto(&if_instrumentation_done);
}
BIND(&if_instrumentation_done);
// Inline version of GeneratorPrototypeNext / GeneratorPrototypeReturn with
// unnecessary runtime checks removed.
// Ensure that the {async_function_object} is neither closed nor running.
CSA_SLOW_ASSERT(
this, SmiGreaterThan(
LoadObjectField<Smi>(async_function_object,
JSGeneratorObject::kContinuationOffset),
SmiConstant(JSGeneratorObject::kGeneratorClosed)));
// Remember the {resume_mode} for the {async_function_object}.
StoreObjectFieldNoWriteBarrier(async_function_object,
JSGeneratorObject::kResumeModeOffset,
SmiConstant(resume_mode));
// Resume the {receiver} using our trampoline.
Callable callable = CodeFactory::ResumeGenerator(isolate());
CallStub(callable, context, sent_value, async_function_object);
// The resulting Promise is a throwaway, so it doesn't matter what it
// resolves to. What is important is that we don't end up keeping the
// whole chain of intermediate Promises alive by returning the return value
// of ResumeGenerator, as that would create a memory leak.
}
TF_BUILTIN(AsyncFunctionEnter, AsyncFunctionBuiltinsAssembler) {
TNode<JSFunction> closure = CAST(Parameter(Descriptor::kClosure));
TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
// Compute the number of registers and parameters.
TNode<SharedFunctionInfo> shared = LoadObjectField<SharedFunctionInfo>(
closure, JSFunction::kSharedFunctionInfoOffset);
TNode<IntPtrT> formal_parameter_count =
ChangeInt32ToIntPtr(LoadObjectField<Uint16T>(
shared, SharedFunctionInfo::kFormalParameterCountOffset));
TNode<BytecodeArray> bytecode_array =
LoadSharedFunctionInfoBytecodeArray(shared);
TNode<IntPtrT> frame_size = ChangeInt32ToIntPtr(LoadObjectField<Uint32T>(
bytecode_array, BytecodeArray::kFrameSizeOffset));
TNode<IntPtrT> parameters_and_register_length =
Signed(IntPtrAdd(WordSar(frame_size, IntPtrConstant(kTaggedSizeLog2)),
formal_parameter_count));
// Allocate and initialize the register file.
TNode<FixedArrayBase> parameters_and_registers =
AllocateFixedArray(HOLEY_ELEMENTS, parameters_and_register_length,
kAllowLargeObjectAllocation);
FillFixedArrayWithValue(HOLEY_ELEMENTS, parameters_and_registers,
IntPtrConstant(0), parameters_and_register_length,
RootIndex::kUndefinedValue);
// Allocate space for the promise, the async function object.
TNode<IntPtrT> size = IntPtrConstant(JSPromise::kSizeWithEmbedderFields +
JSAsyncFunctionObject::kHeaderSize);
TNode<HeapObject> base = AllocateInNewSpace(size);
// Initialize the promise.
TNode<NativeContext> native_context = LoadNativeContext(context);
TNode<JSFunction> promise_function =
CAST(LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX));
TNode<Map> promise_map = LoadObjectField<Map>(
promise_function, JSFunction::kPrototypeOrInitialMapOffset);
TNode<JSPromise> promise = UncheckedCast<JSPromise>(
InnerAllocate(base, JSAsyncFunctionObject::kHeaderSize));
StoreMapNoWriteBarrier(promise, promise_map);
StoreObjectFieldRoot(promise, JSPromise::kPropertiesOrHashOffset,
RootIndex::kEmptyFixedArray);
StoreObjectFieldRoot(promise, JSPromise::kElementsOffset,
RootIndex::kEmptyFixedArray);
PromiseInit(promise);
// Initialize the async function object.
TNode<Map> async_function_object_map = CAST(LoadContextElement(
native_context, Context::ASYNC_FUNCTION_OBJECT_MAP_INDEX));
TNode<JSAsyncFunctionObject> async_function_object =
UncheckedCast<JSAsyncFunctionObject>(base);
StoreMapNoWriteBarrier(async_function_object, async_function_object_map);
StoreObjectFieldRoot(async_function_object,
JSAsyncFunctionObject::kPropertiesOrHashOffset,
RootIndex::kEmptyFixedArray);
StoreObjectFieldRoot(async_function_object,
JSAsyncFunctionObject::kElementsOffset,
RootIndex::kEmptyFixedArray);
StoreObjectFieldNoWriteBarrier(
async_function_object, JSAsyncFunctionObject::kFunctionOffset, closure);
StoreObjectFieldNoWriteBarrier(
async_function_object, JSAsyncFunctionObject::kContextOffset, context);
StoreObjectFieldNoWriteBarrier(
async_function_object, JSAsyncFunctionObject::kReceiverOffset, receiver);
StoreObjectFieldNoWriteBarrier(async_function_object,
JSAsyncFunctionObject::kInputOrDebugPosOffset,
SmiConstant(0));
StoreObjectFieldNoWriteBarrier(async_function_object,
JSAsyncFunctionObject::kResumeModeOffset,
SmiConstant(JSAsyncFunctionObject::kNext));
StoreObjectFieldNoWriteBarrier(
async_function_object, JSAsyncFunctionObject::kContinuationOffset,
SmiConstant(JSAsyncFunctionObject::kGeneratorExecuting));
StoreObjectFieldNoWriteBarrier(
async_function_object,
JSAsyncFunctionObject::kParametersAndRegistersOffset,
parameters_and_registers);
StoreObjectFieldNoWriteBarrier(
async_function_object, JSAsyncFunctionObject::kPromiseOffset, promise);
// Fire promise hooks if enabled and push the Promise under construction
// in an async function on the catch prediction stack to handle exceptions
// thrown before the first await.
Label if_instrumentation(this, Label::kDeferred),
if_instrumentation_done(this);
Branch(IsPromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate(),
&if_instrumentation, &if_instrumentation_done);
BIND(&if_instrumentation);
{
CallRuntime(Runtime::kDebugAsyncFunctionEntered, context, promise);
Goto(&if_instrumentation_done);
}
BIND(&if_instrumentation_done);
Return(async_function_object);
}
TF_BUILTIN(AsyncFunctionReject, AsyncFunctionBuiltinsAssembler) {
TNode<JSAsyncFunctionObject> async_function_object =
CAST(Parameter(Descriptor::kAsyncFunctionObject));
TNode<Object> reason = CAST(Parameter(Descriptor::kReason));
TNode<Oddball> can_suspend = CAST(Parameter(Descriptor::kCanSuspend));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<JSPromise> promise = LoadObjectField<JSPromise>(
async_function_object, JSAsyncFunctionObject::kPromiseOffset);
// Reject the {promise} for the given {reason}, disabling the
// additional debug event for the rejection since a debug event
// already happend for the exception that got us here.
CallBuiltin(Builtins::kRejectPromise, context, promise, reason,
FalseConstant());
Label if_debugging(this, Label::kDeferred);
GotoIf(HasAsyncEventDelegate(), &if_debugging);
GotoIf(IsDebugActive(), &if_debugging);
Return(promise);
BIND(&if_debugging);
TailCallRuntime(Runtime::kDebugAsyncFunctionFinished, context, can_suspend,
promise);
}
TF_BUILTIN(AsyncFunctionResolve, AsyncFunctionBuiltinsAssembler) {
TNode<JSAsyncFunctionObject> async_function_object =
CAST(Parameter(Descriptor::kAsyncFunctionObject));
TNode<Object> value = CAST(Parameter(Descriptor::kValue));
TNode<Oddball> can_suspend = CAST(Parameter(Descriptor::kCanSuspend));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<JSPromise> promise = LoadObjectField<JSPromise>(
async_function_object, JSAsyncFunctionObject::kPromiseOffset);
CallBuiltin(Builtins::kResolvePromise, context, promise, value);
Label if_debugging(this, Label::kDeferred);
GotoIf(HasAsyncEventDelegate(), &if_debugging);
GotoIf(IsDebugActive(), &if_debugging);
Return(promise);
BIND(&if_debugging);
TailCallRuntime(Runtime::kDebugAsyncFunctionFinished, context, can_suspend,
promise);
}
// AsyncFunctionReject and AsyncFunctionResolve are both required to return
// the promise instead of the result of RejectPromise or ResolvePromise
// respectively from a lazy deoptimization.
TF_BUILTIN(AsyncFunctionLazyDeoptContinuation, AsyncFunctionBuiltinsAssembler) {
TNode<JSPromise> promise = CAST(Parameter(Descriptor::kPromise));
Return(promise);
}
TF_BUILTIN(AsyncFunctionAwaitRejectClosure, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
const TNode<Object> sentError = CAST(Parameter(Descriptor::kSentError));
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
AsyncFunctionAwaitResumeClosure(context, sentError,
JSGeneratorObject::kThrow);
Return(UndefinedConstant());
}
TF_BUILTIN(AsyncFunctionAwaitResolveClosure, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
const TNode<Object> sentValue = CAST(Parameter(Descriptor::kSentValue));
const TNode<Context> context = CAST(Parameter(Descriptor::kContext));
AsyncFunctionAwaitResumeClosure(context, sentValue, JSGeneratorObject::kNext);
Return(UndefinedConstant());
}
// ES#abstract-ops-async-function-await
// AsyncFunctionAwait ( value )
// Shared logic for the core of await. The parser desugars
// await value
// into
// yield AsyncFunctionAwait{Caught,Uncaught}(.generator_object, value)
// The 'value' parameter is the value; the .generator_object stands in
// for the asyncContext.
template <typename Descriptor>
void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwait(
const bool is_predicted_as_caught) {
TNode<JSAsyncFunctionObject> async_function_object =
CAST(Parameter(Descriptor::kAsyncFunctionObject));
TNode<Object> value = CAST(Parameter(Descriptor::kValue));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<JSPromise> outer_promise = LoadObjectField<JSPromise>(
async_function_object, JSAsyncFunctionObject::kPromiseOffset);
Label after_debug_hook(this), call_debug_hook(this, Label::kDeferred);
GotoIf(HasAsyncEventDelegate(), &call_debug_hook);
Goto(&after_debug_hook);
BIND(&after_debug_hook);
TNode<SharedFunctionInfo> on_resolve_sfi =
AsyncFunctionAwaitResolveSharedFunConstant();
TNode<SharedFunctionInfo> on_reject_sfi =
AsyncFunctionAwaitRejectSharedFunConstant();
Await(context, async_function_object, value, outer_promise, on_resolve_sfi,
on_reject_sfi, is_predicted_as_caught);
// Return outer promise to avoid adding an load of the outer promise before
// suspending in BytecodeGenerator.
Return(outer_promise);
BIND(&call_debug_hook);
CallRuntime(Runtime::kDebugAsyncFunctionSuspended, context, outer_promise);
Goto(&after_debug_hook);
}
// Called by the parser from the desugaring of 'await' when catch
// prediction indicates that there is a locally surrounding catch block.
TF_BUILTIN(AsyncFunctionAwaitCaught, AsyncFunctionBuiltinsAssembler) {
static const bool kIsPredictedAsCaught = true;
AsyncFunctionAwait<Descriptor>(kIsPredictedAsCaught);
}
// Called by the parser from the desugaring of 'await' when catch
// prediction indicates no locally surrounding catch block.
TF_BUILTIN(AsyncFunctionAwaitUncaught, AsyncFunctionBuiltinsAssembler) {
static const bool kIsPredictedAsCaught = false;
AsyncFunctionAwait<Descriptor>(kIsPredictedAsCaught);
}
} // namespace internal
} // namespace v8
| {
"pile_set_name": "Github"
} |
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __G_PRINTF_H__
#define __G_PRINTF_H__
#include <glib.h>
#include <stdio.h>
#include <stdarg.h>
G_BEGIN_DECLS
GLIB_AVAILABLE_IN_ALL
gint g_printf (gchar const *format,
...) G_GNUC_PRINTF (1, 2);
GLIB_AVAILABLE_IN_ALL
gint g_fprintf (FILE *file,
gchar const *format,
...) G_GNUC_PRINTF (2, 3);
GLIB_AVAILABLE_IN_ALL
gint g_sprintf (gchar *string,
gchar const *format,
...) G_GNUC_PRINTF (2, 3);
GLIB_AVAILABLE_IN_ALL
gint g_vprintf (gchar const *format,
va_list args) G_GNUC_PRINTF(1, 0);
GLIB_AVAILABLE_IN_ALL
gint g_vfprintf (FILE *file,
gchar const *format,
va_list args) G_GNUC_PRINTF(2, 0);
GLIB_AVAILABLE_IN_ALL
gint g_vsprintf (gchar *string,
gchar const *format,
va_list args) G_GNUC_PRINTF(2, 0);
GLIB_AVAILABLE_IN_ALL
gint g_vasprintf (gchar **string,
gchar const *format,
va_list args) G_GNUC_PRINTF(2, 0);
G_END_DECLS
#endif /* __G_PRINTF_H__ */
| {
"pile_set_name": "Github"
} |
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: [email protected] (Vlad Losev)
// Type and function utilities for implementing parameterized tests.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#include <iterator>
#include <utility>
#include <vector>
// scripts/fuse_gtest.py depends on gtest's own header being #included
// *unconditionally*. Therefore these #includes cannot be moved
// inside #if GTEST_HAS_PARAM_TEST.
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-linked_ptr.h"
#include "gtest/internal/gtest-port.h"
#include "gtest/gtest-printers.h"
#if GTEST_HAS_PARAM_TEST
namespace testing {
namespace internal {
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Outputs a message explaining invalid registration of different
// fixture class for the same test case. This may happen when
// TEST_P macro is used to define two tests with the same name
// but in different namespaces.
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
const char* file, int line);
template <typename> class ParamGeneratorInterface;
template <typename> class ParamGenerator;
// Interface for iterating over elements provided by an implementation
// of ParamGeneratorInterface<T>.
template <typename T>
class ParamIteratorInterface {
public:
virtual ~ParamIteratorInterface() {}
// A pointer to the base generator instance.
// Used only for the purposes of iterator comparison
// to make sure that two iterators belong to the same generator.
virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
// Advances iterator to point to the next element
// provided by the generator. The caller is responsible
// for not calling Advance() on an iterator equal to
// BaseGenerator()->End().
virtual void Advance() = 0;
// Clones the iterator object. Used for implementing copy semantics
// of ParamIterator<T>.
virtual ParamIteratorInterface* Clone() const = 0;
// Dereferences the current iterator and provides (read-only) access
// to the pointed value. It is the caller's responsibility not to call
// Current() on an iterator equal to BaseGenerator()->End().
// Used for implementing ParamGenerator<T>::operator*().
virtual const T* Current() const = 0;
// Determines whether the given iterator and other point to the same
// element in the sequence generated by the generator.
// Used for implementing ParamGenerator<T>::operator==().
virtual bool Equals(const ParamIteratorInterface& other) const = 0;
};
// Class iterating over elements provided by an implementation of
// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
// and implements the const forward iterator concept.
template <typename T>
class ParamIterator {
public:
typedef T value_type;
typedef const T& reference;
typedef ptrdiff_t difference_type;
// ParamIterator assumes ownership of the impl_ pointer.
ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
ParamIterator& operator=(const ParamIterator& other) {
if (this != &other)
impl_.reset(other.impl_->Clone());
return *this;
}
const T& operator*() const { return *impl_->Current(); }
const T* operator->() const { return impl_->Current(); }
// Prefix version of operator++.
ParamIterator& operator++() {
impl_->Advance();
return *this;
}
// Postfix version of operator++.
ParamIterator operator++(int /*unused*/) {
ParamIteratorInterface<T>* clone = impl_->Clone();
impl_->Advance();
return ParamIterator(clone);
}
bool operator==(const ParamIterator& other) const {
return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
}
bool operator!=(const ParamIterator& other) const {
return !(*this == other);
}
private:
friend class ParamGenerator<T>;
explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
scoped_ptr<ParamIteratorInterface<T> > impl_;
};
// ParamGeneratorInterface<T> is the binary interface to access generators
// defined in other translation units.
template <typename T>
class ParamGeneratorInterface {
public:
typedef T ParamType;
virtual ~ParamGeneratorInterface() {}
// Generator interface definition
virtual ParamIteratorInterface<T>* Begin() const = 0;
virtual ParamIteratorInterface<T>* End() const = 0;
};
// Wraps ParamGeneratorInterface<T> and provides general generator syntax
// compatible with the STL Container concept.
// This class implements copy initialization semantics and the contained
// ParamGeneratorInterface<T> instance is shared among all copies
// of the original object. This is possible because that instance is immutable.
template<typename T>
class ParamGenerator {
public:
typedef ParamIterator<T> iterator;
explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
ParamGenerator& operator=(const ParamGenerator& other) {
impl_ = other.impl_;
return *this;
}
iterator begin() const { return iterator(impl_->Begin()); }
iterator end() const { return iterator(impl_->End()); }
private:
linked_ptr<const ParamGeneratorInterface<T> > impl_;
};
// Generates values from a range of two comparable values. Can be used to
// generate sequences of user-defined types that implement operator+() and
// operator<().
// This class is used in the Range() function.
template <typename T, typename IncrementT>
class RangeGenerator : public ParamGeneratorInterface<T> {
public:
RangeGenerator(T begin, T end, IncrementT step)
: begin_(begin), end_(end),
step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
virtual ~RangeGenerator() {}
virtual ParamIteratorInterface<T>* Begin() const {
return new Iterator(this, begin_, 0, step_);
}
virtual ParamIteratorInterface<T>* End() const {
return new Iterator(this, end_, end_index_, step_);
}
private:
class Iterator : public ParamIteratorInterface<T> {
public:
Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
IncrementT step)
: base_(base), value_(value), index_(index), step_(step) {}
virtual ~Iterator() {}
virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
return base_;
}
virtual void Advance() {
value_ = value_ + step_;
index_++;
}
virtual ParamIteratorInterface<T>* Clone() const {
return new Iterator(*this);
}
virtual const T* Current() const { return &value_; }
virtual bool Equals(const ParamIteratorInterface<T>& other) const {
// Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
<< "The program attempted to compare iterators "
<< "from different generators." << std::endl;
const int other_index =
CheckedDowncastToActualType<const Iterator>(&other)->index_;
return index_ == other_index;
}
private:
Iterator(const Iterator& other)
: ParamIteratorInterface<T>(),
base_(other.base_), value_(other.value_), index_(other.index_),
step_(other.step_) {}
// No implementation - assignment is unsupported.
void operator=(const Iterator& other);
const ParamGeneratorInterface<T>* const base_;
T value_;
int index_;
const IncrementT step_;
}; // class RangeGenerator::Iterator
static int CalculateEndIndex(const T& begin,
const T& end,
const IncrementT& step) {
int end_index = 0;
for (T i = begin; i < end; i = i + step)
end_index++;
return end_index;
}
// No implementation - assignment is unsupported.
void operator=(const RangeGenerator& other);
const T begin_;
const T end_;
const IncrementT step_;
// The index for the end() iterator. All the elements in the generated
// sequence are indexed (0-based) to aid iterator comparison.
const int end_index_;
}; // class RangeGenerator
// Generates values from a pair of STL-style iterators. Used in the
// ValuesIn() function. The elements are copied from the source range
// since the source can be located on the stack, and the generator
// is likely to persist beyond that stack frame.
template <typename T>
class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
public:
template <typename ForwardIterator>
ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
: container_(begin, end) {}
virtual ~ValuesInIteratorRangeGenerator() {}
virtual ParamIteratorInterface<T>* Begin() const {
return new Iterator(this, container_.begin());
}
virtual ParamIteratorInterface<T>* End() const {
return new Iterator(this, container_.end());
}
private:
typedef typename ::std::vector<T> ContainerType;
class Iterator : public ParamIteratorInterface<T> {
public:
Iterator(const ParamGeneratorInterface<T>* base,
typename ContainerType::const_iterator iterator)
: base_(base), iterator_(iterator) {}
virtual ~Iterator() {}
virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
return base_;
}
virtual void Advance() {
++iterator_;
value_.reset();
}
virtual ParamIteratorInterface<T>* Clone() const {
return new Iterator(*this);
}
// We need to use cached value referenced by iterator_ because *iterator_
// can return a temporary object (and of type other then T), so just
// having "return &*iterator_;" doesn't work.
// value_ is updated here and not in Advance() because Advance()
// can advance iterator_ beyond the end of the range, and we cannot
// detect that fact. The client code, on the other hand, is
// responsible for not calling Current() on an out-of-range iterator.
virtual const T* Current() const {
if (value_.get() == NULL)
value_.reset(new T(*iterator_));
return value_.get();
}
virtual bool Equals(const ParamIteratorInterface<T>& other) const {
// Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
<< "The program attempted to compare iterators "
<< "from different generators." << std::endl;
return iterator_ ==
CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
}
private:
Iterator(const Iterator& other)
// The explicit constructor call suppresses a false warning
// emitted by gcc when supplied with the -Wextra option.
: ParamIteratorInterface<T>(),
base_(other.base_),
iterator_(other.iterator_) {}
const ParamGeneratorInterface<T>* const base_;
typename ContainerType::const_iterator iterator_;
// A cached value of *iterator_. We keep it here to allow access by
// pointer in the wrapping iterator's operator->().
// value_ needs to be mutable to be accessed in Current().
// Use of scoped_ptr helps manage cached value's lifetime,
// which is bound by the lifespan of the iterator itself.
mutable scoped_ptr<const T> value_;
}; // class ValuesInIteratorRangeGenerator::Iterator
// No implementation - assignment is unsupported.
void operator=(const ValuesInIteratorRangeGenerator& other);
const ContainerType container_;
}; // class ValuesInIteratorRangeGenerator
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Stores a parameter value and later creates tests parameterized with that
// value.
template <class TestClass>
class ParameterizedTestFactory : public TestFactoryBase {
public:
typedef typename TestClass::ParamType ParamType;
explicit ParameterizedTestFactory(ParamType parameter) :
parameter_(parameter) {}
virtual Test* CreateTest() {
TestClass::SetParam(¶meter_);
return new TestClass();
}
private:
const ParamType parameter_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
};
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// TestMetaFactoryBase is a base class for meta-factories that create
// test factories for passing into MakeAndRegisterTestInfo function.
template <class ParamType>
class TestMetaFactoryBase {
public:
virtual ~TestMetaFactoryBase() {}
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
};
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// TestMetaFactory creates test factories for passing into
// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
// ownership of test factory pointer, same factory object cannot be passed
// into that method twice. But ParameterizedTestCaseInfo is going to call
// it for each Test/Parameter value combination. Thus it needs meta factory
// creator class.
template <class TestCase>
class TestMetaFactory
: public TestMetaFactoryBase<typename TestCase::ParamType> {
public:
typedef typename TestCase::ParamType ParamType;
TestMetaFactory() {}
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
return new ParameterizedTestFactory<TestCase>(parameter);
}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
};
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// ParameterizedTestCaseInfoBase is a generic interface
// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
// accumulates test information provided by TEST_P macro invocations
// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
// and uses that information to register all resulting test instances
// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
// a collection of pointers to the ParameterizedTestCaseInfo objects
// and calls RegisterTests() on each of them when asked.
class ParameterizedTestCaseInfoBase {
public:
virtual ~ParameterizedTestCaseInfoBase() {}
// Base part of test case name for display purposes.
virtual const string& GetTestCaseName() const = 0;
// Test case id to verify identity.
virtual TypeId GetTestCaseTypeId() const = 0;
// UnitTest class invokes this method to register tests in this
// test case right before running them in RUN_ALL_TESTS macro.
// This method should not be called more then once on any single
// instance of a ParameterizedTestCaseInfoBase derived class.
virtual void RegisterTests() = 0;
protected:
ParameterizedTestCaseInfoBase() {}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
};
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
// macro invocations for a particular test case and generators
// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
// test case. It registers tests with all values generated by all
// generators when asked.
template <class TestCase>
class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
public:
// ParamType and GeneratorCreationFunc are private types but are required
// for declarations of public methods AddTestPattern() and
// AddTestCaseInstantiation().
typedef typename TestCase::ParamType ParamType;
// A function that returns an instance of appropriate generator type.
typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
explicit ParameterizedTestCaseInfo(const char* name)
: test_case_name_(name) {}
// Test case base name for display purposes.
virtual const string& GetTestCaseName() const { return test_case_name_; }
// Test case id to verify identity.
virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
// TEST_P macro uses AddTestPattern() to record information
// about a single test in a LocalTestInfo structure.
// test_case_name is the base name of the test case (without invocation
// prefix). test_base_name is the name of an individual test without
// parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
// test case base name and DoBar is test base name.
void AddTestPattern(const char* test_case_name,
const char* test_base_name,
TestMetaFactoryBase<ParamType>* meta_factory) {
tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
test_base_name,
meta_factory)));
}
// INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
// about a generator.
int AddTestCaseInstantiation(const string& instantiation_name,
GeneratorCreationFunc* func,
const char* /* file */,
int /* line */) {
instantiations_.push_back(::std::make_pair(instantiation_name, func));
return 0; // Return value used only to run this method in namespace scope.
}
// UnitTest class invokes this method to register tests in this test case
// test cases right before running tests in RUN_ALL_TESTS macro.
// This method should not be called more then once on any single
// instance of a ParameterizedTestCaseInfoBase derived class.
// UnitTest has a guard to prevent from calling this method more then once.
virtual void RegisterTests() {
for (typename TestInfoContainer::iterator test_it = tests_.begin();
test_it != tests_.end(); ++test_it) {
linked_ptr<TestInfo> test_info = *test_it;
for (typename InstantiationContainer::iterator gen_it =
instantiations_.begin(); gen_it != instantiations_.end();
++gen_it) {
const string& instantiation_name = gen_it->first;
ParamGenerator<ParamType> generator((*gen_it->second)());
Message test_case_name_stream;
if ( !instantiation_name.empty() )
test_case_name_stream << instantiation_name << "/";
test_case_name_stream << test_info->test_case_base_name;
int i = 0;
for (typename ParamGenerator<ParamType>::iterator param_it =
generator.begin();
param_it != generator.end(); ++param_it, ++i) {
Message test_name_stream;
test_name_stream << test_info->test_base_name << "/" << i;
MakeAndRegisterTestInfo(
test_case_name_stream.GetString().c_str(),
test_name_stream.GetString().c_str(),
NULL, // No type parameter.
PrintToString(*param_it).c_str(),
GetTestCaseTypeId(),
TestCase::SetUpTestCase,
TestCase::TearDownTestCase,
test_info->test_meta_factory->CreateTestFactory(*param_it));
} // for param_it
} // for gen_it
} // for test_it
} // RegisterTests
private:
// LocalTestInfo structure keeps information about a single test registered
// with TEST_P macro.
struct TestInfo {
TestInfo(const char* a_test_case_base_name,
const char* a_test_base_name,
TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
test_case_base_name(a_test_case_base_name),
test_base_name(a_test_base_name),
test_meta_factory(a_test_meta_factory) {}
const string test_case_base_name;
const string test_base_name;
const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
};
typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
// Keeps pairs of <Instantiation name, Sequence generator creation function>
// received from INSTANTIATE_TEST_CASE_P macros.
typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
InstantiationContainer;
const string test_case_name_;
TestInfoContainer tests_;
InstantiationContainer instantiations_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
}; // class ParameterizedTestCaseInfo
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
// macros use it to locate their corresponding ParameterizedTestCaseInfo
// descriptors.
class ParameterizedTestCaseRegistry {
public:
ParameterizedTestCaseRegistry() {}
~ParameterizedTestCaseRegistry() {
for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
it != test_case_infos_.end(); ++it) {
delete *it;
}
}
// Looks up or creates and returns a structure containing information about
// tests and instantiations of a particular test case.
template <class TestCase>
ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
const char* test_case_name,
const char* file,
int line) {
ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
it != test_case_infos_.end(); ++it) {
if ((*it)->GetTestCaseName() == test_case_name) {
if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
// Complain about incorrect usage of Google Test facilities
// and terminate the program since we cannot guaranty correct
// test case setup and tear-down in this case.
ReportInvalidTestCaseType(test_case_name, file, line);
posix::Abort();
} else {
// At this point we are sure that the object we found is of the same
// type we are looking for, so we downcast it to that type
// without further checks.
typed_test_info = CheckedDowncastToActualType<
ParameterizedTestCaseInfo<TestCase> >(*it);
}
break;
}
}
if (typed_test_info == NULL) {
typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
test_case_infos_.push_back(typed_test_info);
}
return typed_test_info;
}
void RegisterTests() {
for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
it != test_case_infos_.end(); ++it) {
(*it)->RegisterTests();
}
}
private:
typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
TestCaseInfoContainer test_case_infos_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
};
} // namespace internal
} // namespace testing
#endif // GTEST_HAS_PARAM_TEST
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
| {
"pile_set_name": "Github"
} |
syntax = "proto3";
| {
"pile_set_name": "Github"
} |
# -*- python -*-
load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_cc_library",
"drake_cc_package_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
package(default_visibility = ["//visibility:public"])
# This should encompass every cc_library in this package, except for items that
# should only ever be linked into main() programs.
drake_cc_package_library(
name = "test_utilities",
testonly = 1,
visibility = ["//visibility:public"],
deps = [
":check_constraint_eval_nonsymbolic",
],
)
drake_cc_library(
name = "check_constraint_eval_nonsymbolic",
testonly = 1,
srcs = ["check_constraint_eval_nonsymbolic.cc"],
hdrs = ["check_constraint_eval_nonsymbolic.h"],
deps = [
"//common/test_utilities",
"//math:compute_numerical_gradient",
"//math:gradient",
"//solvers:constraint",
],
)
add_lint_tests()
| {
"pile_set_name": "Github"
} |
var convert = require('./convert'),
func = convert('functions', require('../functions'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
| {
"pile_set_name": "Github"
} |
package io.quarkus.deployment.proxy;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import io.quarkus.deployment.util.ClassOutputUtil;
import io.quarkus.gizmo.ClassOutput;
/**
* A Gizmo {@link ClassOutput} that is able to write the inject the bytecode directly into the classloader
*
* The {@link ClassLoader} passed to the constructor MUST contain a public visibleDefineClass method
* This ensures that generating proxies works in any JDK version
*/
class InjectIntoClassloaderClassOutput implements ClassOutput {
private final ClassLoader classLoader;
private final Method visibleDefineClassMethod;
InjectIntoClassloaderClassOutput(ClassLoader classLoader) {
this.classLoader = classLoader;
try {
visibleDefineClassMethod = classLoader.getClass().getDeclaredMethod("visibleDefineClass", String.class,
byte[].class, int.class, int.class);
} catch (NoSuchMethodException | SecurityException e) {
throw new IllegalStateException(
"Unable to initialize InjectIntoClassloaderClassOutput - Incorrect classloader (" + classLoader.getClass()
+ ") usage detected");
}
}
@Override
public void write(String name, byte[] data) {
if (System.getProperty("dumpClass") != null) {
ClassOutputUtil.dumpClass(name, data);
}
try {
visibleDefineClassMethod.invoke(classLoader, name.replace('/', '.'), data, 0, data.length);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
}
| {
"pile_set_name": "Github"
} |
#######################################################
#
# ruboto/util/toast.rb
#
# Utility methods for doing a toast.
#
#######################################################
Java::android.content.Context.class_eval do
def toast(text, duration=Java::android.widget.Toast::LENGTH_SHORT)
Java::android.widget.Toast.makeText(self, text, duration).show
end
def toast_result(result, success, failure, duration=Java::android.widget.Toast::LENGTH_SHORT)
toast(result ? success : failure, duration)
end
end
| {
"pile_set_name": "Github"
} |
<%@ include file="taglib.jsp" %>
<html>
<head>
<title>Login Page</title>
<style>
.errorblock {
color: #ff0000;
background-color: #ffEEEE;
border: 3px solid #ff0000;
padding: 8px;
margin: 16px;
}
</style>
</head>
<body>
<h3>Login Page</h3>
<c:if test="${not empty error}">
<div class="errorblock">
Your login attempt was not successful, try again.<br /> Caused :
${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
</div>
</c:if>
<form name='f' action="<c:url value='j_spring_security_check' />"
method='POST'>
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' value=''>
</td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' />
</td>
</tr>
<tr>
<td colspan='2'><input name="submit" type="submit"
value="submit" />
</td>
</tr>
<tr>
<td colspan='2'><input name="reset" type="reset" />
</td>
</tr>
</table>
</form>
</body>
</html> | {
"pile_set_name": "Github"
} |
//
// ssl/detail/verify_callback.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP
#define BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
# include <boost/asio/ssl/verify_context.hpp>
#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace ssl {
namespace detail {
#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
class verify_callback_base
{
public:
virtual ~verify_callback_base()
{
}
virtual bool call(bool preverified, verify_context& ctx) = 0;
};
template <typename VerifyCallback>
class verify_callback : public verify_callback_base
{
public:
explicit verify_callback(VerifyCallback callback)
: callback_(callback)
{
}
virtual bool call(bool preverified, verify_context& ctx)
{
return callback_(preverified, ctx);
}
private:
VerifyCallback callback_;
};
#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
} // namespace detail
} // namespace ssl
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP
| {
"pile_set_name": "Github"
} |
CREATE TABLE list (id VARCHAR(2) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'az', E'الأذربيجانية');
INSERT INTO "list" ("id", "value") VALUES (E'az_AZ', E'الأذربيجانية (أذربيجان)');
INSERT INTO "list" ("id", "value") VALUES (E'az_Cyrl_AZ', E'الأذربيجانية (السيريلية, أذربيجان)');
INSERT INTO "list" ("id", "value") VALUES (E'az_Cyrl', E'الأذربيجانية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'az_Latn_AZ', E'الأذربيجانية (اللاتينية, أذربيجان)');
INSERT INTO "list" ("id", "value") VALUES (E'az_Latn', E'الأذربيجانية (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'ur', E'الأردية');
INSERT INTO "list" ("id", "value") VALUES (E'ur_IN', E'الأردية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'ur_PK', E'الأردية (باكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'hy', E'الأرمينية');
INSERT INTO "list" ("id", "value") VALUES (E'hy_AM', E'الأرمينية (أرمينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'as', E'الأسامية');
INSERT INTO "list" ("id", "value") VALUES (E'as_IN', E'الأسامية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'es', E'الإسبانية');
INSERT INTO "list" ("id", "value") VALUES (E'es_ES', E'الإسبانية (إسبانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_AR', E'الإسبانية (الأرجنتين)');
INSERT INTO "list" ("id", "value") VALUES (E'es_EC', E'الإسبانية (الإكوادور)');
INSERT INTO "list" ("id", "value") VALUES (E'es_SV', E'الإسبانية (السلفادور)');
INSERT INTO "list" ("id", "value") VALUES (E'es_PH', E'الإسبانية (الفلبين)');
INSERT INTO "list" ("id", "value") VALUES (E'es_MX', E'الإسبانية (المكسيك)');
INSERT INTO "list" ("id", "value") VALUES (E'es_US', E'الإسبانية (الولايات المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'es_UY', E'الإسبانية (أورغواي)');
INSERT INTO "list" ("id", "value") VALUES (E'es_PY', E'الإسبانية (باراغواي)');
INSERT INTO "list" ("id", "value") VALUES (E'es_PA', E'الإسبانية (بنما)');
INSERT INTO "list" ("id", "value") VALUES (E'es_PR', E'الإسبانية (بورتوريكو)');
INSERT INTO "list" ("id", "value") VALUES (E'es_BO', E'الإسبانية (بوليفيا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_PE', E'الإسبانية (بيرو)');
INSERT INTO "list" ("id", "value") VALUES (E'es_IC', E'الإسبانية (جزر الكناري)');
INSERT INTO "list" ("id", "value") VALUES (E'es_DO', E'الإسبانية (جمهورية الدومينيك)');
INSERT INTO "list" ("id", "value") VALUES (E'es_EA', E'الإسبانية (سيوتا وميليلا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_CL', E'الإسبانية (شيلي)');
INSERT INTO "list" ("id", "value") VALUES (E'es_GT', E'الإسبانية (غواتيمالا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_GQ', E'الإسبانية (غينيا الإستوائية)');
INSERT INTO "list" ("id", "value") VALUES (E'es_VE', E'الإسبانية (فنزويلا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_CU', E'الإسبانية (كوبا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_CR', E'الإسبانية (كوستاريكا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_CO', E'الإسبانية (كولومبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_NI', E'الإسبانية (نيكاراغوا)');
INSERT INTO "list" ("id", "value") VALUES (E'es_HN', E'الإسبانية (هندوراس)');
INSERT INTO "list" ("id", "value") VALUES (E'eo', E'الإسبرانتو');
INSERT INTO "list" ("id", "value") VALUES (E'et', E'الإستونية');
INSERT INTO "list" ("id", "value") VALUES (E'et_EE', E'الإستونية (أستونيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ug', E'الأغورية');
INSERT INTO "list" ("id", "value") VALUES (E'ug_CN', E'الأغورية (الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'ug_Arab_CN', E'الأغورية (العربية, الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'ug_Arab', E'الأغورية (العربية)');
INSERT INTO "list" ("id", "value") VALUES (E'af', E'الأفريقانية');
INSERT INTO "list" ("id", "value") VALUES (E'af_ZA', E'الأفريقانية (جنوب أفريقيا)');
INSERT INTO "list" ("id", "value") VALUES (E'af_NA', E'الأفريقانية (ناميبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ak', E'الأكانية');
INSERT INTO "list" ("id", "value") VALUES (E'ak_GH', E'الأكانية (غانا)');
INSERT INTO "list" ("id", "value") VALUES (E'sq', E'الألبانية');
INSERT INTO "list" ("id", "value") VALUES (E'sq_AL', E'الألبانية (ألبانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sq_XK', E'الألبانية (كوسوفو)');
INSERT INTO "list" ("id", "value") VALUES (E'sq_MK', E'الألبانية (مقدونيا)');
INSERT INTO "list" ("id", "value") VALUES (E'de', E'الألمانية');
INSERT INTO "list" ("id", "value") VALUES (E'de_DE', E'الألمانية (ألمانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'de_AT', E'الألمانية (النمسا)');
INSERT INTO "list" ("id", "value") VALUES (E'de_BE', E'الألمانية (بلجيكا)');
INSERT INTO "list" ("id", "value") VALUES (E'de_CH', E'الألمانية (سويسرا)');
INSERT INTO "list" ("id", "value") VALUES (E'de_LU', E'الألمانية (لوكسمبورغ)');
INSERT INTO "list" ("id", "value") VALUES (E'de_LI', E'الألمانية (ليختنشتاين)');
INSERT INTO "list" ("id", "value") VALUES (E'am', E'الأمهرية');
INSERT INTO "list" ("id", "value") VALUES (E'am_ET', E'الأمهرية (إثيوبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en', E'الإنجليزية');
INSERT INTO "list" ("id", "value") VALUES (E'en_ER', E'الإنجليزية (أريتريا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_AU', E'الإنجليزية (أستراليا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_IO', E'الإنجليزية (الإقليم البريطاني في المحيط الهندي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BS', E'الإنجليزية (الباهاما)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SD', E'الإنجليزية (السودان)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PH', E'الإنجليزية (الفلبين)');
INSERT INTO "list" ("id", "value") VALUES (E'en_CM', E'الإنجليزية (الكاميرون)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GB', E'الإنجليزية (المملكة المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'en_IN', E'الإنجليزية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'en_US', E'الإنجليزية (الولايات المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'en_AG', E'الإنجليزية (أنتيغوا وبربودا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_AI', E'الإنجليزية (أنغويلا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_UG', E'الإنجليزية (أوغندا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_IE', E'الإنجليزية (أيرلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PG', E'الإنجليزية (بابوا غينيا الجديدة)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PK', E'الإنجليزية (باكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PW', E'الإنجليزية (بالاو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BW', E'الإنجليزية (بتسوانا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BB', E'الإنجليزية (بربادوس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BM', E'الإنجليزية (برمودا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BE', E'الإنجليزية (بلجيكا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_BZ', E'الإنجليزية (بليز)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PR', E'الإنجليزية (بورتوريكو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TZ', E'الإنجليزية (تانزانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TT', E'الإنجليزية (ترينيداد وتوباغو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TV', E'الإنجليزية (توفالو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TK', E'الإنجليزية (توكيلو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TO', E'الإنجليزية (تونغا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_JM', E'الإنجليزية (جامايكا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GI', E'الإنجليزية (جبل طارق)');
INSERT INTO "list" ("id", "value") VALUES (E'en_TC', E'الإنجليزية (جزر الترك وجايكوس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_KY', E'الإنجليزية (جزر الكايمن)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MH', E'الإنجليزية (جزر المارشال)');
INSERT INTO "list" ("id", "value") VALUES (E'en_UM', E'الإنجليزية (جزر الولايات المتحدة النائية)');
INSERT INTO "list" ("id", "value") VALUES (E'en_PN', E'الإنجليزية (جزر بيتكيرن)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SB', E'الإنجليزية (جزر سليمان)');
INSERT INTO "list" ("id", "value") VALUES (E'en_VI', E'الإنجليزية (جزر فرجين الأمريكية)');
INSERT INTO "list" ("id", "value") VALUES (E'en_VG', E'الإنجليزية (جزر فرجين البريطانية)');
INSERT INTO "list" ("id", "value") VALUES (E'en_FK', E'الإنجليزية (جزر فوكلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'en_CK', E'الإنجليزية (جزر كوك)');
INSERT INTO "list" ("id", "value") VALUES (E'en_CC', E'الإنجليزية (جزر كوكوس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MP', E'الإنجليزية (جزر ماريانا الشمالية)');
INSERT INTO "list" ("id", "value") VALUES (E'en_CX', E'الإنجليزية (جزيرة الكريسماس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_IM', E'الإنجليزية (جزيرة مان)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NF', E'الإنجليزية (جزيرة نورفوك)');
INSERT INTO "list" ("id", "value") VALUES (E'en_ZA', E'الإنجليزية (جنوب أفريقيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SS', E'الإنجليزية (جنوب السودان)');
INSERT INTO "list" ("id", "value") VALUES (E'en_JE', E'الإنجليزية (جيرسي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_DM', E'الإنجليزية (دومينيكا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_DG', E'الإنجليزية (دييغو غارسيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_RW', E'الإنجليزية (رواندا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_ZM', E'الإنجليزية (زامبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_ZW', E'الإنجليزية (زيمبابوي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_AS', E'الإنجليزية (ساموا الأمريكية)');
INSERT INTO "list" ("id", "value") VALUES (E'en_WS', E'الإنجليزية (ساموا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_VC', E'الإنجليزية (سانت فنسنت وغرنادين)');
INSERT INTO "list" ("id", "value") VALUES (E'en_KN', E'الإنجليزية (سانت كيتس ونيفيس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_LC', E'الإنجليزية (سانت لوسيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SH', E'الإنجليزية (سانت هيلنا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SG', E'الإنجليزية (سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SZ', E'الإنجليزية (سوازيلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SL', E'الإنجليزية (سيراليون)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SC', E'الإنجليزية (سيشل)');
INSERT INTO "list" ("id", "value") VALUES (E'en_SX', E'الإنجليزية (سينت مارتن)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GM', E'الإنجليزية (غامبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GH', E'الإنجليزية (غانا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GD', E'الإنجليزية (غرينادا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GU', E'الإنجليزية (غوام)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GY', E'الإنجليزية (غيانا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_GG', E'الإنجليزية (غيرنزي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_VU', E'الإنجليزية (فانواتو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_FJ', E'الإنجليزية (فيجي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_CA', E'الإنجليزية (كندا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_KI', E'الإنجليزية (كيريباتي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_KE', E'الإنجليزية (كينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_LR', E'الإنجليزية (ليبيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_LS', E'الإنجليزية (ليسوتو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MT', E'الإنجليزية (مالطا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MY', E'الإنجليزية (ماليزيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MG', E'الإنجليزية (مدغشقر)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MO', E'الإنجليزية (مكاو الصينية (منطقة إدارية خاصة))');
INSERT INTO "list" ("id", "value") VALUES (E'en_MW', E'الإنجليزية (ملاوي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MU', E'الإنجليزية (موريشيوس)');
INSERT INTO "list" ("id", "value") VALUES (E'en_MS', E'الإنجليزية (مونتسرات)');
INSERT INTO "list" ("id", "value") VALUES (E'en_FM', E'الإنجليزية (ميكرونيزيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NA', E'الإنجليزية (ناميبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NR', E'الإنجليزية (ناورو)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NG', E'الإنجليزية (نيجيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NZ', E'الإنجليزية (نيوزيلاندا)');
INSERT INTO "list" ("id", "value") VALUES (E'en_NU', E'الإنجليزية (نيوي)');
INSERT INTO "list" ("id", "value") VALUES (E'en_HK', E'الإنجليزية (هونغ كونغ الصينية)');
INSERT INTO "list" ("id", "value") VALUES (E'id', E'الإندونيسية');
INSERT INTO "list" ("id", "value") VALUES (E'id_ID', E'الإندونيسية (أندونيسيا)');
INSERT INTO "list" ("id", "value") VALUES (E'om', E'الأورومو');
INSERT INTO "list" ("id", "value") VALUES (E'om_ET', E'الأورومو (إثيوبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'om_KE', E'الأورومو (كينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'or', E'الأورييا');
INSERT INTO "list" ("id", "value") VALUES (E'or_IN', E'الأورييا (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'uz', E'الأوزباكية');
INSERT INTO "list" ("id", "value") VALUES (E'uz_AF', E'الأوزباكية (أفغانستان)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Cyrl_UZ', E'الأوزباكية (السيريلية, أوزبكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Cyrl', E'الأوزباكية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Arab_AF', E'الأوزباكية (العربية, أفغانستان)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Arab', E'الأوزباكية (العربية)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Latn_UZ', E'الأوزباكية (اللاتينية, أوزبكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_Latn', E'الأوزباكية (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'uz_UZ', E'الأوزباكية (أوزبكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'os', E'الأوسيتيك');
INSERT INTO "list" ("id", "value") VALUES (E'os_GE', E'الأوسيتيك (جورجيا)');
INSERT INTO "list" ("id", "value") VALUES (E'os_RU', E'الأوسيتيك (روسيا)');
INSERT INTO "list" ("id", "value") VALUES (E'uk', E'الأوكرانية');
INSERT INTO "list" ("id", "value") VALUES (E'uk_UA', E'الأوكرانية (أوكرانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ig', E'الإيجبو');
INSERT INTO "list" ("id", "value") VALUES (E'ig_NG', E'الإيجبو (نيجيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'ga', E'الأيرلندية');
INSERT INTO "list" ("id", "value") VALUES (E'ga_IE', E'الأيرلندية (أيرلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'is', E'الأيسلاندية');
INSERT INTO "list" ("id", "value") VALUES (E'is_IS', E'الأيسلاندية (أيسلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'it', E'الإيطالية');
INSERT INTO "list" ("id", "value") VALUES (E'it_IT', E'الإيطالية (إيطاليا)');
INSERT INTO "list" ("id", "value") VALUES (E'it_SM', E'الإيطالية (سان مارينو)');
INSERT INTO "list" ("id", "value") VALUES (E'it_CH', E'الإيطالية (سويسرا)');
INSERT INTO "list" ("id", "value") VALUES (E'ee', E'الإيوي');
INSERT INTO "list" ("id", "value") VALUES (E'ee_TG', E'الإيوي (توجو)');
INSERT INTO "list" ("id", "value") VALUES (E'ee_GH', E'الإيوي (غانا)');
INSERT INTO "list" ("id", "value") VALUES (E'bm', E'البامبارا');
INSERT INTO "list" ("id", "value") VALUES (E'bm_Latn_ML', E'البامبارا (اللاتينية, مالي)');
INSERT INTO "list" ("id", "value") VALUES (E'bm_Latn', E'البامبارا (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'pt', E'البرتغالية');
INSERT INTO "list" ("id", "value") VALUES (E'pt_BR', E'البرتغالية (البرازيل)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_PT', E'البرتغالية (البرتغال)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_CV', E'البرتغالية (الرأس الأخضر)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_AO', E'البرتغالية (أنغولا)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_TL', E'البرتغالية (تيمور الشرقية)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_ST', E'البرتغالية (ساو تومي وبرينسيبي)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_GW', E'البرتغالية (غينيا بيساو)');
INSERT INTO "list" ("id", "value") VALUES (E'pt_MO', E'البرتغالية (مكاو الصينية (منطقة إدارية خاصة))');
INSERT INTO "list" ("id", "value") VALUES (E'pt_MZ', E'البرتغالية (موزمبيق)');
INSERT INTO "list" ("id", "value") VALUES (E'br', E'البريتونية');
INSERT INTO "list" ("id", "value") VALUES (E'br_FR', E'البريتونية (فرنسا)');
INSERT INTO "list" ("id", "value") VALUES (E'ps', E'البشتونية');
INSERT INTO "list" ("id", "value") VALUES (E'ps_AF', E'البشتونية (أفغانستان)');
INSERT INTO "list" ("id", "value") VALUES (E'bg', E'البلغارية');
INSERT INTO "list" ("id", "value") VALUES (E'bg_BG', E'البلغارية (بلغاريا)');
INSERT INTO "list" ("id", "value") VALUES (E'pa', E'البنجابية');
INSERT INTO "list" ("id", "value") VALUES (E'pa_Guru_IN', E'البنجابية (الجرمخي, الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'pa_Guru', E'البنجابية (الجرمخي)');
INSERT INTO "list" ("id", "value") VALUES (E'pa_Arab_PK', E'البنجابية (العربية, باكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'pa_Arab', E'البنجابية (العربية)');
INSERT INTO "list" ("id", "value") VALUES (E'pa_IN', E'البنجابية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'pa_PK', E'البنجابية (باكستان)');
INSERT INTO "list" ("id", "value") VALUES (E'bn', E'البنغالية');
INSERT INTO "list" ("id", "value") VALUES (E'bn_IN', E'البنغالية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'bn_BD', E'البنغالية (بنجلاديش)');
INSERT INTO "list" ("id", "value") VALUES (E'my', E'البورمية');
INSERT INTO "list" ("id", "value") VALUES (E'my_MM', E'البورمية (ميانمار -بورما)');
INSERT INTO "list" ("id", "value") VALUES (E'bs', E'البوسنية');
INSERT INTO "list" ("id", "value") VALUES (E'bs_BA', E'البوسنية (البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'bs_Cyrl_BA', E'البوسنية (السيريلية, البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'bs_Cyrl', E'البوسنية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'bs_Latn_BA', E'البوسنية (اللاتينية, البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'bs_Latn', E'البوسنية (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'nb', E'البوكمالية النرويجية');
INSERT INTO "list" ("id", "value") VALUES (E'nb_NO', E'البوكمالية النرويجية (النرويج)');
INSERT INTO "list" ("id", "value") VALUES (E'nb_SJ', E'البوكمالية النرويجية (سفالبارد وجان مايان)');
INSERT INTO "list" ("id", "value") VALUES (E'pl', E'البولندية');
INSERT INTO "list" ("id", "value") VALUES (E'pl_PL', E'البولندية (بولندا)');
INSERT INTO "list" ("id", "value") VALUES (E'be', E'البيلوروسية');
INSERT INTO "list" ("id", "value") VALUES (E'be_BY', E'البيلوروسية (روسيا البيضاء)');
INSERT INTO "list" ("id", "value") VALUES (E'tl', E'التاغالوغية');
INSERT INTO "list" ("id", "value") VALUES (E'tl_PH', E'التاغالوغية (الفلبين)');
INSERT INTO "list" ("id", "value") VALUES (E'ta', E'التاميلية');
INSERT INTO "list" ("id", "value") VALUES (E'ta_IN', E'التاميلية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'ta_LK', E'التاميلية (سريلانكا)');
INSERT INTO "list" ("id", "value") VALUES (E'ta_SG', E'التاميلية (سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'ta_MY', E'التاميلية (ماليزيا)');
INSERT INTO "list" ("id", "value") VALUES (E'th', E'التايلاندية');
INSERT INTO "list" ("id", "value") VALUES (E'th_TH', E'التايلاندية (تايلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'bo', E'التبتية');
INSERT INTO "list" ("id", "value") VALUES (E'bo_CN', E'التبتية (الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'bo_IN', E'التبتية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'tr', E'التركية');
INSERT INTO "list" ("id", "value") VALUES (E'tr_TR', E'التركية (تركيا)');
INSERT INTO "list" ("id", "value") VALUES (E'tr_CY', E'التركية (قبرص)');
INSERT INTO "list" ("id", "value") VALUES (E'cs', E'التشيكية');
INSERT INTO "list" ("id", "value") VALUES (E'cs_CZ', E'التشيكية (جمهورية التشيك)');
INSERT INTO "list" ("id", "value") VALUES (E'to', E'التونغية');
INSERT INTO "list" ("id", "value") VALUES (E'to_TO', E'التونغية (تونغا)');
INSERT INTO "list" ("id", "value") VALUES (E'ti', E'التيجرينيا');
INSERT INTO "list" ("id", "value") VALUES (E'ti_ET', E'التيجرينيا (إثيوبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ti_ER', E'التيجرينيا (أريتريا)');
INSERT INTO "list" ("id", "value") VALUES (E'te', E'التيلجو');
INSERT INTO "list" ("id", "value") VALUES (E'te_IN', E'التيلجو (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'gl', E'الجاليكية');
INSERT INTO "list" ("id", "value") VALUES (E'gl_ES', E'الجاليكية (إسبانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'lg', E'الجاندا');
INSERT INTO "list" ("id", "value") VALUES (E'lg_UG', E'الجاندا (أوغندا)');
INSERT INTO "list" ("id", "value") VALUES (E'ka', E'الجورجية');
INSERT INTO "list" ("id", "value") VALUES (E'ka_GE', E'الجورجية (جورجيا)');
INSERT INTO "list" ("id", "value") VALUES (E'km', E'الخميرية');
INSERT INTO "list" ("id", "value") VALUES (E'km_KH', E'الخميرية (كمبوديا)');
INSERT INTO "list" ("id", "value") VALUES (E'da', E'الدانماركية');
INSERT INTO "list" ("id", "value") VALUES (E'da_DK', E'الدانماركية (الدانمرك)');
INSERT INTO "list" ("id", "value") VALUES (E'da_GL', E'الدانماركية (غرينلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'rn', E'الرندي');
INSERT INTO "list" ("id", "value") VALUES (E'rn_BI', E'الرندي (بوروندي)');
INSERT INTO "list" ("id", "value") VALUES (E'ru', E'الروسية');
INSERT INTO "list" ("id", "value") VALUES (E'ru_UA', E'الروسية (أوكرانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ru_BY', E'الروسية (روسيا البيضاء)');
INSERT INTO "list" ("id", "value") VALUES (E'ru_RU', E'الروسية (روسيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ru_KG', E'الروسية (قرغيزستان)');
INSERT INTO "list" ("id", "value") VALUES (E'ru_KZ', E'الروسية (كازاخستان)');
INSERT INTO "list" ("id", "value") VALUES (E'ru_MD', E'الروسية (مولدافيا)');
INSERT INTO "list" ("id", "value") VALUES (E'rm', E'الرومانشية');
INSERT INTO "list" ("id", "value") VALUES (E'rm_CH', E'الرومانشية (سويسرا)');
INSERT INTO "list" ("id", "value") VALUES (E'ro', E'الرومانية');
INSERT INTO "list" ("id", "value") VALUES (E'ro_RO', E'الرومانية (رومانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ro_MD', E'الرومانية (مولدافيا)');
INSERT INTO "list" ("id", "value") VALUES (E'zu', E'الزولو');
INSERT INTO "list" ("id", "value") VALUES (E'zu_ZA', E'الزولو (جنوب أفريقيا)');
INSERT INTO "list" ("id", "value") VALUES (E'dz', E'الزونخاية');
INSERT INTO "list" ("id", "value") VALUES (E'dz_BT', E'الزونخاية (بوتان)');
INSERT INTO "list" ("id", "value") VALUES (E'se', E'السامي الشمالي');
INSERT INTO "list" ("id", "value") VALUES (E'se_SE', E'السامي الشمالي (السويد)');
INSERT INTO "list" ("id", "value") VALUES (E'se_NO', E'السامي الشمالي (النرويج)');
INSERT INTO "list" ("id", "value") VALUES (E'se_FI', E'السامي الشمالي (فنلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'sg', E'السانجو');
INSERT INTO "list" ("id", "value") VALUES (E'sg_CF', E'السانجو (جمهورية أفريقيا الوسطى)');
INSERT INTO "list" ("id", "value") VALUES (E'sk', E'السلوفاكية');
INSERT INTO "list" ("id", "value") VALUES (E'sk_SK', E'السلوفاكية (سلوفاكيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sl', E'السلوفانية');
INSERT INTO "list" ("id", "value") VALUES (E'sl_SI', E'السلوفانية (سلوفينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'si', E'السنهالية');
INSERT INTO "list" ("id", "value") VALUES (E'si_LK', E'السنهالية (سريلانكا)');
INSERT INTO "list" ("id", "value") VALUES (E'sw', E'السواحلية');
INSERT INTO "list" ("id", "value") VALUES (E'sw_UG', E'السواحلية (أوغندا)');
INSERT INTO "list" ("id", "value") VALUES (E'sw_TZ', E'السواحلية (تانزانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sw_KE', E'السواحلية (كينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sv', E'السويدية');
INSERT INTO "list" ("id", "value") VALUES (E'sv_SE', E'السويدية (السويد)');
INSERT INTO "list" ("id", "value") VALUES (E'sv_AX', E'السويدية (جزر آلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'sv_FI', E'السويدية (فنلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'ii', E'السيتشيون يي');
INSERT INTO "list" ("id", "value") VALUES (E'ii_CN', E'السيتشيون يي (الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'sn', E'الشونا');
INSERT INTO "list" ("id", "value") VALUES (E'sn_ZW', E'الشونا (زيمبابوي)');
INSERT INTO "list" ("id", "value") VALUES (E'sr', E'الصربية');
INSERT INTO "list" ("id", "value") VALUES (E'sr_BA', E'الصربية (البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_ME', E'الصربية (الجبل الأسود)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Cyrl_BA', E'الصربية (السيريلية, البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Cyrl_ME', E'الصربية (السيريلية, الجبل الأسود)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Cyrl_RS', E'الصربية (السيريلية, صربيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Cyrl_XK', E'الصربية (السيريلية, كوسوفو)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Cyrl', E'الصربية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Latn_BA', E'الصربية (اللاتينية, البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Latn_ME', E'الصربية (اللاتينية, الجبل الأسود)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Latn_RS', E'الصربية (اللاتينية, صربيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Latn_XK', E'الصربية (اللاتينية, كوسوفو)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_Latn', E'الصربية (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_RS', E'الصربية (صربيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sr_XK', E'الصربية (كوسوفو)');
INSERT INTO "list" ("id", "value") VALUES (E'so', E'الصومالية');
INSERT INTO "list" ("id", "value") VALUES (E'so_ET', E'الصومالية (إثيوبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'so_SO', E'الصومالية (الصومال)');
INSERT INTO "list" ("id", "value") VALUES (E'so_DJ', E'الصومالية (جيبوتي)');
INSERT INTO "list" ("id", "value") VALUES (E'so_KE', E'الصومالية (كينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'zh', E'الصينية');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hant_TW', E'الصينية (التقليدية, تايوان)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hant_MO', E'الصينية (التقليدية, مكاو الصينية (منطقة إدارية خاصة))');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hant_HK', E'الصينية (التقليدية, هونغ كونغ الصينية)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hant', E'الصينية (التقليدية)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_CN', E'الصينية (الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hans_CN', E'الصينية (المبسطة, الصين)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hans_SG', E'الصينية (المبسطة, سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hans_MO', E'الصينية (المبسطة, مكاو الصينية (منطقة إدارية خاصة))');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hans_HK', E'الصينية (المبسطة, هونغ كونغ الصينية)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_Hans', E'الصينية (المبسطة)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_TW', E'الصينية (تايوان)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_SG', E'الصينية (سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'zh_MO', E'الصينية (مكاو الصينية (منطقة إدارية خاصة))');
INSERT INTO "list" ("id", "value") VALUES (E'zh_HK', E'الصينية (هونغ كونغ الصينية)');
INSERT INTO "list" ("id", "value") VALUES (E'he', E'العبرية');
INSERT INTO "list" ("id", "value") VALUES (E'he_IL', E'العبرية (إسرائيل)');
INSERT INTO "list" ("id", "value") VALUES (E'ar', E'العربية');
INSERT INTO "list" ("id", "value") VALUES (E'ar_ER', E'العربية (أريتريا)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_IL', E'العربية (إسرائيل)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_PS', E'العربية (الأراضي الفلسطينية)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_JO', E'العربية (الأردن)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_AE', E'العربية (الإمارات العربية المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_BH', E'العربية (البحرين)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_DZ', E'العربية (الجزائر)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_SD', E'العربية (السودان)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_EH', E'العربية (الصحراء الغربية)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_SO', E'العربية (الصومال)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_IQ', E'العربية (العراق)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_KW', E'العربية (الكويت)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_MA', E'العربية (المغرب)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_SA', E'العربية (المملكة العربية السعودية)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_YE', E'العربية (اليمن)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_TD', E'العربية (تشاد)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_TN', E'العربية (تونس)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_KM', E'العربية (جزر القمر)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_SS', E'العربية (جنوب السودان)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_DJ', E'العربية (جيبوتي)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_SY', E'العربية (سوريا)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_OM', E'العربية (عُمان)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_QA', E'العربية (قطر)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_LB', E'العربية (لبنان)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_LY', E'العربية (ليبيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_EG', E'العربية (مصر)');
INSERT INTO "list" ("id", "value") VALUES (E'ar_MR', E'العربية (موريتانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'gu', E'الغوجاراتية');
INSERT INTO "list" ("id", "value") VALUES (E'gu_IN', E'الغوجاراتية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'gd', E'الغيلية الأسكتلندية');
INSERT INTO "list" ("id", "value") VALUES (E'gd_GB', E'الغيلية الأسكتلندية (المملكة المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'fa', E'الفارسية');
INSERT INTO "list" ("id", "value") VALUES (E'fa_AF', E'الفارسية (أفغانستان)');
INSERT INTO "list" ("id", "value") VALUES (E'fa_IR', E'الفارسية (إيران)');
INSERT INTO "list" ("id", "value") VALUES (E'fo', E'الفارويز');
INSERT INTO "list" ("id", "value") VALUES (E'fo_FO', E'الفارويز (جزر فارو)');
INSERT INTO "list" ("id", "value") VALUES (E'fr', E'الفرنسية');
INSERT INTO "list" ("id", "value") VALUES (E'fr_GA', E'الفرنسية (الجابون)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_DZ', E'الفرنسية (الجزائر)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_SN', E'الفرنسية (السنغال)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CM', E'الفرنسية (الكاميرون)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CG', E'الفرنسية (الكونغو - برازافيل)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CD', E'الفرنسية (الكونغو - كينشاسا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MA', E'الفرنسية (المغرب)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_NE', E'الفرنسية (النيجر)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_BE', E'الفرنسية (بلجيكا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_BJ', E'الفرنسية (بنين)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_BF', E'الفرنسية (بوركينا فاسو)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_BI', E'الفرنسية (بوروندي)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_PF', E'الفرنسية (بولينيزيا الفرنسية)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_TD', E'الفرنسية (تشاد)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_TG', E'الفرنسية (توجو)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_TN', E'الفرنسية (تونس)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_KM', E'الفرنسية (جزر القمر)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_WF', E'الفرنسية (جزر والس وفوتونا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CF', E'الفرنسية (جمهورية أفريقيا الوسطى)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_GP', E'الفرنسية (جوادلوب)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_DJ', E'الفرنسية (جيبوتي)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_RW', E'الفرنسية (رواندا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_RE', E'الفرنسية (روينيون)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CI', E'الفرنسية (ساحل العاج)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_BL', E'الفرنسية (سان بارتليمي)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_PM', E'الفرنسية (سانت بيير وميكولون)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MF', E'الفرنسية (سانت مارتن)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_SY', E'الفرنسية (سوريا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CH', E'الفرنسية (سويسرا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_SC', E'الفرنسية (سيشل)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_GF', E'الفرنسية (غويانا الفرنسية)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_GQ', E'الفرنسية (غينيا الإستوائية)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_GN', E'الفرنسية (غينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_VU', E'الفرنسية (فانواتو)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_FR', E'الفرنسية (فرنسا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_NC', E'الفرنسية (كاليدونيا الجديدة)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_CA', E'الفرنسية (كندا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_LU', E'الفرنسية (لوكسمبورغ)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MQ', E'الفرنسية (مارتينيك)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_ML', E'الفرنسية (مالي)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_YT', E'الفرنسية (مايوت)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MG', E'الفرنسية (مدغشقر)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MR', E'الفرنسية (موريتانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MU', E'الفرنسية (موريشيوس)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_MC', E'الفرنسية (موناكو)');
INSERT INTO "list" ("id", "value") VALUES (E'fr_HT', E'الفرنسية (هايتي)');
INSERT INTO "list" ("id", "value") VALUES (E'fy', E'الفريزيان');
INSERT INTO "list" ("id", "value") VALUES (E'fy_NL', E'الفريزيان (هولندا)');
INSERT INTO "list" ("id", "value") VALUES (E'ff', E'الفلة');
INSERT INTO "list" ("id", "value") VALUES (E'ff_SN', E'الفلة (السنغال)');
INSERT INTO "list" ("id", "value") VALUES (E'ff_CM', E'الفلة (الكاميرون)');
INSERT INTO "list" ("id", "value") VALUES (E'ff_GN', E'الفلة (غينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ff_MR', E'الفلة (موريتانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'fi', E'الفنلندية');
INSERT INTO "list" ("id", "value") VALUES (E'fi_FI', E'الفنلندية (فنلندا)');
INSERT INTO "list" ("id", "value") VALUES (E'vi', E'الفيتنامية');
INSERT INTO "list" ("id", "value") VALUES (E'vi_VN', E'الفيتنامية (فيتنام)');
INSERT INTO "list" ("id", "value") VALUES (E'ky', E'القرغيزية');
INSERT INTO "list" ("id", "value") VALUES (E'ky_Cyrl_KG', E'القرغيزية (السيريلية, قرغيزستان)');
INSERT INTO "list" ("id", "value") VALUES (E'ky_Cyrl', E'القرغيزية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'ky_KG', E'القرغيزية (قرغيزستان)');
INSERT INTO "list" ("id", "value") VALUES (E'kk', E'الكازاخستانية');
INSERT INTO "list" ("id", "value") VALUES (E'kk_Cyrl_KZ', E'الكازاخستانية (السيريلية, كازاخستان)');
INSERT INTO "list" ("id", "value") VALUES (E'kk_Cyrl', E'الكازاخستانية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'kk_KZ', E'الكازاخستانية (كازاخستان)');
INSERT INTO "list" ("id", "value") VALUES (E'kl', E'الكالاليست');
INSERT INTO "list" ("id", "value") VALUES (E'kl_GL', E'الكالاليست (غرينلاند)');
INSERT INTO "list" ("id", "value") VALUES (E'kn', E'الكانادا');
INSERT INTO "list" ("id", "value") VALUES (E'kn_IN', E'الكانادا (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'ca', E'الكتالانية');
INSERT INTO "list" ("id", "value") VALUES (E'ca_ES', E'الكتالانية (إسبانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ca_AD', E'الكتالانية (أندورا)');
INSERT INTO "list" ("id", "value") VALUES (E'ca_IT', E'الكتالانية (إيطاليا)');
INSERT INTO "list" ("id", "value") VALUES (E'ca_FR', E'الكتالانية (فرنسا)');
INSERT INTO "list" ("id", "value") VALUES (E'hr', E'الكرواتية');
INSERT INTO "list" ("id", "value") VALUES (E'hr_BA', E'الكرواتية (البوسنة والهرسك)');
INSERT INTO "list" ("id", "value") VALUES (E'hr_HR', E'الكرواتية (كرواتيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ks', E'الكشميرية');
INSERT INTO "list" ("id", "value") VALUES (E'ks_Arab_IN', E'الكشميرية (العربية, الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'ks_Arab', E'الكشميرية (العربية)');
INSERT INTO "list" ("id", "value") VALUES (E'ks_IN', E'الكشميرية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'kw', E'الكورنية');
INSERT INTO "list" ("id", "value") VALUES (E'kw_GB', E'الكورنية (المملكة المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'ko', E'الكورية');
INSERT INTO "list" ("id", "value") VALUES (E'ko_KR', E'الكورية (كوريا الجنوبية)');
INSERT INTO "list" ("id", "value") VALUES (E'ko_KP', E'الكورية (كوريا الشمالية)');
INSERT INTO "list" ("id", "value") VALUES (E'qu', E'الكويتشوا');
INSERT INTO "list" ("id", "value") VALUES (E'qu_EC', E'الكويتشوا (الإكوادور)');
INSERT INTO "list" ("id", "value") VALUES (E'qu_BO', E'الكويتشوا (بوليفيا)');
INSERT INTO "list" ("id", "value") VALUES (E'qu_PE', E'الكويتشوا (بيرو)');
INSERT INTO "list" ("id", "value") VALUES (E'ki', E'الكيكيو');
INSERT INTO "list" ("id", "value") VALUES (E'ki_KE', E'الكيكيو (كينيا)');
INSERT INTO "list" ("id", "value") VALUES (E'rw', E'الكينيارواندا');
INSERT INTO "list" ("id", "value") VALUES (E'rw_RW', E'الكينيارواندا (رواندا)');
INSERT INTO "list" ("id", "value") VALUES (E'lv', E'اللاتفية');
INSERT INTO "list" ("id", "value") VALUES (E'lv_LV', E'اللاتفية (لاتفيا)');
INSERT INTO "list" ("id", "value") VALUES (E'lo', E'اللاوية');
INSERT INTO "list" ("id", "value") VALUES (E'lo_LA', E'اللاوية (لاوس)');
INSERT INTO "list" ("id", "value") VALUES (E'lu', E'اللبا-كاتانجا');
INSERT INTO "list" ("id", "value") VALUES (E'lu_CD', E'اللبا-كاتانجا (الكونغو - كينشاسا)');
INSERT INTO "list" ("id", "value") VALUES (E'lt', E'اللتوانية');
INSERT INTO "list" ("id", "value") VALUES (E'lt_LT', E'اللتوانية (ليتوانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'lb', E'اللوكسمبرجية');
INSERT INTO "list" ("id", "value") VALUES (E'lb_LU', E'اللوكسمبرجية (لوكسمبورغ)');
INSERT INTO "list" ("id", "value") VALUES (E'ln', E'اللينجالا');
INSERT INTO "list" ("id", "value") VALUES (E'ln_CG', E'اللينجالا (الكونغو - برازافيل)');
INSERT INTO "list" ("id", "value") VALUES (E'ln_CD', E'اللينجالا (الكونغو - كينشاسا)');
INSERT INTO "list" ("id", "value") VALUES (E'ln_AO', E'اللينجالا (أنغولا)');
INSERT INTO "list" ("id", "value") VALUES (E'ln_CF', E'اللينجالا (جمهورية أفريقيا الوسطى)');
INSERT INTO "list" ("id", "value") VALUES (E'mr', E'الماراثي');
INSERT INTO "list" ("id", "value") VALUES (E'mr_IN', E'الماراثي (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'mg', E'المالاجاشية');
INSERT INTO "list" ("id", "value") VALUES (E'mg_MG', E'المالاجاشية (مدغشقر)');
INSERT INTO "list" ("id", "value") VALUES (E'mt', E'المالطية');
INSERT INTO "list" ("id", "value") VALUES (E'mt_MT', E'المالطية (مالطا)');
INSERT INTO "list" ("id", "value") VALUES (E'ml', E'الماليالام');
INSERT INTO "list" ("id", "value") VALUES (E'ml_IN', E'الماليالام (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'mk', E'المقدونية');
INSERT INTO "list" ("id", "value") VALUES (E'mk_MK', E'المقدونية (مقدونيا)');
INSERT INTO "list" ("id", "value") VALUES (E'mn', E'المنغولية');
INSERT INTO "list" ("id", "value") VALUES (E'mn_Cyrl_MN', E'المنغولية (السيريلية, منغوليا)');
INSERT INTO "list" ("id", "value") VALUES (E'mn_Cyrl', E'المنغولية (السيريلية)');
INSERT INTO "list" ("id", "value") VALUES (E'mn_MN', E'المنغولية (منغوليا)');
INSERT INTO "list" ("id", "value") VALUES (E'gv', E'المنكية');
INSERT INTO "list" ("id", "value") VALUES (E'gv_IM', E'المنكية (جزيرة مان)');
INSERT INTO "list" ("id", "value") VALUES (E'nd', E'النديبيل الشمالي');
INSERT INTO "list" ("id", "value") VALUES (E'nd_ZW', E'النديبيل الشمالي (زيمبابوي)');
INSERT INTO "list" ("id", "value") VALUES (E'no', E'النرويجية');
INSERT INTO "list" ("id", "value") VALUES (E'no_NO', E'النرويجية (النرويج)');
INSERT INTO "list" ("id", "value") VALUES (E'ne', E'النيبالية');
INSERT INTO "list" ("id", "value") VALUES (E'ne_IN', E'النيبالية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'ne_NP', E'النيبالية (نيبال)');
INSERT INTO "list" ("id", "value") VALUES (E'nn', E'النينورسك النرويجي');
INSERT INTO "list" ("id", "value") VALUES (E'nn_NO', E'النينورسك النرويجي (النرويج)');
INSERT INTO "list" ("id", "value") VALUES (E'hi', E'الهندية');
INSERT INTO "list" ("id", "value") VALUES (E'hi_IN', E'الهندية (الهند)');
INSERT INTO "list" ("id", "value") VALUES (E'hu', E'الهنغارية');
INSERT INTO "list" ("id", "value") VALUES (E'hu_HU', E'الهنغارية (هنغاريا)');
INSERT INTO "list" ("id", "value") VALUES (E'ha', E'الهوسا');
INSERT INTO "list" ("id", "value") VALUES (E'ha_Latn_NE', E'الهوسا (اللاتينية, النيجر)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_Latn_GH', E'الهوسا (اللاتينية, غانا)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_Latn_NG', E'الهوسا (اللاتينية, نيجيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_Latn', E'الهوسا (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_NE', E'الهوسا (النيجر)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_GH', E'الهوسا (غانا)');
INSERT INTO "list" ("id", "value") VALUES (E'ha_NG', E'الهوسا (نيجيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'nl', E'الهولندية');
INSERT INTO "list" ("id", "value") VALUES (E'nl_AW', E'الهولندية (آروبا)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_BE', E'الهولندية (بلجيكا)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_SR', E'الهولندية (سورينام)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_SX', E'الهولندية (سينت مارتن)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_CW', E'الهولندية (كوراساو)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_BQ', E'الهولندية (هولندا الكاريبية)');
INSERT INTO "list" ("id", "value") VALUES (E'nl_NL', E'الهولندية (هولندا)');
INSERT INTO "list" ("id", "value") VALUES (E'cy', E'الولزية');
INSERT INTO "list" ("id", "value") VALUES (E'cy_GB', E'الولزية (المملكة المتحدة)');
INSERT INTO "list" ("id", "value") VALUES (E'ja', E'اليابانية');
INSERT INTO "list" ("id", "value") VALUES (E'ja_JP', E'اليابانية (اليابان)');
INSERT INTO "list" ("id", "value") VALUES (E'yi', E'اليديشية');
INSERT INTO "list" ("id", "value") VALUES (E'yo', E'اليوروبية');
INSERT INTO "list" ("id", "value") VALUES (E'yo_BJ', E'اليوروبية (بنين)');
INSERT INTO "list" ("id", "value") VALUES (E'yo_NG', E'اليوروبية (نيجيريا)');
INSERT INTO "list" ("id", "value") VALUES (E'el', E'اليونانية');
INSERT INTO "list" ("id", "value") VALUES (E'el_GR', E'اليونانية (اليونان)');
INSERT INTO "list" ("id", "value") VALUES (E'el_CY', E'اليونانية (قبرص)');
INSERT INTO "list" ("id", "value") VALUES (E'eu', E'لغة الباسك');
INSERT INTO "list" ("id", "value") VALUES (E'eu_ES', E'لغة الباسك (إسبانيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ms', E'لغة الملايو');
INSERT INTO "list" ("id", "value") VALUES (E'ms_Latn_BN', E'لغة الملايو (اللاتينية, بروناي)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_Latn_SG', E'لغة الملايو (اللاتينية, سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_Latn_MY', E'لغة الملايو (اللاتينية, ماليزيا)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_Latn', E'لغة الملايو (اللاتينية)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_BN', E'لغة الملايو (بروناي)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_SG', E'لغة الملايو (سنغافورة)');
INSERT INTO "list" ("id", "value") VALUES (E'ms_MY', E'لغة الملايو (ماليزيا)');
INSERT INTO "list" ("id", "value") VALUES (E'sh', E'Serbo-Croatian');
INSERT INTO "list" ("id", "value") VALUES (E'sh_BA', E'Serbo-Croatian (Bosnia & Herzegovina)');
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">GraphicsCanvasBubble</string>
<string name="bubble_desc">Bubble</string>
</resources>
| {
"pile_set_name": "Github"
} |
/*
* This file is part of Nokia HEIF library
*
* Copyright (c) 2015-2020 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
*
* Contact: [email protected]
*
* This software, including documentation, is protected by copyright controlled by Nokia Corporation and/ or its
* subsidiaries. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all
* of this material requires the prior written consent of Nokia.
*
*
*/
#include <jni.h>
#include "EntityGroup.h"
#include "Heif.h"
#include "Helpers.h"
#define CLASS_NAME EntityGroup
extern "C"
{
JNI_METHOD_ARG(jlong, createContextNative, jobject javaHEIF, jstring javaFourCC)
{
UNUSED(self);
NATIVE_HEIF(nativeHeif, javaHEIF);
const char* nativeString = env->GetStringUTFChars(javaFourCC, nullptr);
auto* nativeObject = new HEIFPP::EntityGroup(nativeHeif, HEIF::FourCC(nativeString));
env->ReleaseStringUTFChars(javaFourCC, nativeString);
return (jlong) nativeObject;
}
JNI_METHOD(void, destroyContextNative)
{
NATIVE_SELF;
setNativeHandle(env, self, 0);
delete nativeSelf;
}
JNI_METHOD(jstring, getTypeNative)
{
NATIVE_SELF;
return env->NewStringUTF(nativeSelf->getType().value);
}
JNI_METHOD(jint, getEntityCountNative)
{
NATIVE_SELF;
return static_cast<jint>(nativeSelf->getEntityCount());
}
JNI_METHOD_ARG(jboolean, isItemNative, jint index)
{
NATIVE_SELF;
return static_cast<jboolean>(nativeSelf->isItem(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(jobject, getItemNative, jint index)
{
NATIVE_SELF;
return getJavaItem(env, getJavaHEIF(env, self), nativeSelf->getItem(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(void, addItemNative, jobject item)
{
NATIVE_SELF;
NATIVE_ITEM(nativeItem, item);
nativeSelf->addItem(nativeItem);
}
JNI_METHOD_ARG(void, removeItemNative, jobject item)
{
NATIVE_SELF;
NATIVE_ITEM(nativeItem, item);
nativeSelf->removeItem(nativeItem);
}
JNI_METHOD_ARG(jboolean, isTrackNative, jint index)
{
NATIVE_SELF;
return static_cast<jboolean>(nativeSelf->isTrack(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(jobject, getTrackNative, jint index)
{
NATIVE_SELF;
return getJavaTrack(env, getJavaHEIF(env, self), nativeSelf->getTrack(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(void, addTrackNative, jobject track)
{
NATIVE_SELF;
NATIVE_TRACK(nativeTrack, track);
nativeSelf->addTrack(nativeTrack);
}
JNI_METHOD_ARG(void, removeTrackNative, jobject track)
{
NATIVE_SELF;
NATIVE_TRACK(nativeTrack, track);
nativeSelf->removeTrack(nativeTrack);
}
JNI_METHOD_ARG(jboolean, isSampleNative, jint index)
{
NATIVE_SELF;
return static_cast<jboolean>(nativeSelf->isSample(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(jobject, getSampleNative, jint index)
{
NATIVE_SELF;
return getJavaSample(env, getJavaHEIF(env, self), nativeSelf->getSample(static_cast<uint32_t>(index)));
}
JNI_METHOD_ARG(void, addSampleNative, jobject sample)
{
NATIVE_SELF;
NATIVE_SAMPLE(nativeSample, sample);
nativeSelf->addSample(nativeSample);
}
JNI_METHOD_ARG(void, removeSampleNative, jobject sample)
{
NATIVE_SELF;
NATIVE_SAMPLE(nativeSample, sample);
nativeSelf->removeSample(nativeSample);
}
}
| {
"pile_set_name": "Github"
} |
package org.benf.cfr.reader.entities.constantpool;
import org.benf.cfr.reader.bytecode.analysis.parse.utils.QuotingUtils;
import org.benf.cfr.reader.bytecode.analysis.types.StackType;
import org.benf.cfr.reader.entities.AbstractConstantPoolEntry;
import org.benf.cfr.reader.util.bytestream.ByteData;
import org.benf.cfr.reader.util.output.Dumper;
public class ConstantPoolEntryString extends AbstractConstantPoolEntry implements ConstantPoolEntryLiteral {
private static final long OFFSET_OF_STRING_INDEX = 1;
private final long stringIndex;
private transient String string;
public ConstantPoolEntryString(ConstantPool cp, ByteData data) {
super(cp);
this.stringIndex = data.getU2At(OFFSET_OF_STRING_INDEX);
}
@Override
public long getRawByteLength() {
return 3;
}
@Override
public void dump(Dumper d) {
d.print("String " + getValue());
}
public String getValue() {
if (string == null) {
string = QuotingUtils.enquoteString(getCp().getUTF8Entry((int) stringIndex).getValue());
}
return string;
}
@Override
public StackType getStackType() {
return StackType.REF;
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-gc
var p = new Proxy({}, {getOwnPropertyDescriptor: function() { gc() }});
var o = Object.create(p);
assertSame(23, o.x = 23);
| {
"pile_set_name": "Github"
} |
# packaged angular-cookies
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular-cookies
```
Then add `ngCookies` as a dependency for your app:
```javascript
angular.module('myApp', [require('angular-cookies')]);
```
### bower
```shell
bower install angular-cookies
```
Add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
```
Then add `ngCookies` as a dependency for your app:
```javascript
angular.module('myApp', ['ngCookies']);
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/api/ngCookies).
## License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
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.
| {
"pile_set_name": "Github"
} |
var Immutable = require('immutable');
var Summary = require('../../../models/summary');
var File = require('../../../models/file');
describe('mergeAtLevel', function() {
var mergeAtLevel = require('../mergeAtLevel');
var summary = Summary.createFromParts(File(), [
{
articles: [
{
title: '1.1',
path: '1.1'
},
{
title: '1.2',
path: '1.2'
}
]
},
{
title: 'Part I',
articles: []
}
]);
it('should edit a part', function() {
var beforeChildren = summary.getByLevel('1').getArticles();
var newSummary = mergeAtLevel(summary, '1', {title: 'Part O'});
var edited = newSummary.getByLevel('1');
expect(edited.getTitle()).toBe('Part O');
// Same children
expect(Immutable.is(beforeChildren, edited.getArticles())).toBe(true);
});
it('should edit a part', function() {
var beforePath = summary.getByLevel('1.2').getPath();
var newSummary = mergeAtLevel(summary, '1.2', {title: 'Renamed article'});
var edited = newSummary.getByLevel('1.2');
expect(edited.getTitle()).toBe('Renamed article');
// Same children
expect(Immutable.is(beforePath, edited.getPath())).toBe(true);
});
});
| {
"pile_set_name": "Github"
} |
; Packaging information for cis
name = "CIS 2.x"
description = "Online Course Information System"
exclusive = "1"
core = "7.x"
elmslndefaulttitle = "CIS"
elmslntype = "authority"
; ----------
; ELMSLN Core Dependencies
; ----------
; Core
dependencies[] = block
dependencies[] = contextual
dependencies[] = field
dependencies[] = field_sql_storage
dependencies[] = file
dependencies[] = filter
dependencies[] = help
dependencies[] = image
dependencies[] = list
dependencies[] = menu
dependencies[] = node
dependencies[] = number
dependencies[] = options
dependencies[] = system
dependencies[] = text
dependencies[] = user
; Administration
dependencies[] = admin_menu
dependencies[] = admin_menu_toolbar
dependencies[] = admin_menu_dropdown
dependencies[] = admin_theme
dependencies[] = module_filter
; Chaos tool suite
dependencies[] = ctools
; Context
dependencies[] = context
; Entity
dependencies[] = replicate
dependencies[] = entity
dependencies[] = entity_token
; Fields
dependencies[] = entityreference
dependencies[] = entityreference_prepopulate
dependencies[] = field_group
dependencies[] = link
dependencies[] = prepopulate
; Menu
dependencies[] = menu_attributes
dependencies[] = special_menu_items
; Other
dependencies[] = navigation404
dependencies[] = better_formats
dependencies[] = defaultconfig
dependencies[] = diff
dependencies[] = elements
dependencies[] = libraries
dependencies[] = pathauto
dependencies[] = placeholder
dependencies[] = restws
dependencies[] = restws_basic_auth
dependencies[] = role_export
dependencies[] = strongarm
dependencies[] = masquerade
dependencies[] = token
dependencies[] = transliteration
; Input filters
dependencies[] = video_filter
; Performance and scalability
dependencies[] = advagg
dependencies[] = advagg_bundler
dependencies[] = blockcache_alter
dependencies[] = httprl
dependencies[] = imageinfo_cache
dependencies[] = entitycache
; Textbook
dependencies[] = textbook
dependencies[] = textbook_editor
dependencies[] = textbook_templates
; UUID
dependencies[] = uuid
; User interface
dependencies[] = addanother
dependencies[] = ckeditor_link
dependencies[] = ds
dependencies[] = ds_forms
dependencies[] = imce
dependencies[] = imce_crop
dependencies[] = imce_mkdir
dependencies[] = imce_wysiwyg
dependencies[] = jquery_update
dependencies[] = logintoboggan
dependencies[] = wysiwyg
dependencies[] = wysiwyg_template
; Views
dependencies[] = better_exposed_filters
dependencies[] = views
dependencies[] = views_autocomplete_filters
dependencies[] = views_bulk_operations
; Features
dependencies[] = features
dependencies[] = features_override
; ELMSLN Core
dependencies[] = elmsln_api
dependencies[] = cis_connector
dependencies[] = cis_service_connection
dependencies[] = cis_service_roles
dependencies[] = cis_lmsless
dependencies[] = cis_shortcodes
dependencies[] = foundation_access_ux
dependencies[] = elmsln_core
; ELMSLN Core - Performance
dependencies[] = elmsln_advagg
; ----------
; CIS Dependencies
; ----------
; CIS Core
dependencies[] = cis_helper
dependencies[] = cis_lti
dependencies[] = cis_si_cleanup
dependencies[] = cis_distro_integrations
dependencies[] = cis_user
; Content
dependencies[] = field_redirection
; Date/Time
dependencies[] = date
dependencies[] = date_api
dependencies[] = date_views
; Entity
dependencies[] = replicate
dependencies[] = replicate_field_collection
dependencies[] = replicate_ui
; Fields
dependencies[] = email
dependencies[] = field_collection
dependencies[] = field_hidden
dependencies[] = phone
dependencies[] = select_or_other
; Media
dependencies[] = video_embed_field
; Other
dependencies[] = field_collection_table
dependencies[] = file_formatters
dependencies[] = filefield_paths
dependencies[] = imagefield_focus
dependencies[] = jquery_colorpicker
dependencies[] = menu_position
dependencies[] = nocurrent_pass
dependencies[] = nodeaccess_nodereference
dependencies[] = nodeaccess_userreference
dependencies[] = responsive_tables
dependencies[] = unique_field
dependencies[] = flood_control
dependencies[] = flood_unblock
; Path breadcrumbs
dependencies[] = path_breadcrumbs
dependencies[] = subpathauto
; User interface
dependencies[] = options_element
; Views
dependencies[] = editableviews
dependencies[] = views_field_calc
dependencies[] = views_fluid_grid
dependencies[] = views_autorefresh
; Features
dependencies[] = cis_displays
dependencies[] = cis_types
dependencies[] = cis_competencies
dependencies[] = cis_users
dependencies[] = cis_service_roles
dependencies[] = cis_ux
| {
"pile_set_name": "Github"
} |
// rd_route.h
// Copyright (c) 2014-2015 Dmitry Rodionov
//
// This software may be modified and distributed under the terms
// of the MIT license. See the LICENSE file for details.
#ifndef RD_ROUTE
#define RD_ROUTE
#ifdef __cplusplus
extern "C" {
#endif
/**
* Override `function` to jump directly into `replacement` location. Caller can later
* access an original function's implementation via `original_ptr` (if passed).
* Note that `original_ptr` won't be equal to `function` due to remapping the latter
* into a different memory space.
*
* @param function pointer to a function to override;
* @param replacement pointer to new implementation;
* @param original will be set to an address of the original implementation's copy;
*
* @return KERN_SUCCESS if succeeded, or other value if failed
*/
int rd_route(void *function, void *replacement, void **original);
/**
* The same as rd_route(), but the target function is defined with its name, not its symbol pointer.
* If the `image_name` provided, rd_route_byname() looks for the function within it.
* Otherwise it iterates all images loaded into the current process' address space and, if there is more
* than one image containing a function with the specifed name, it will choose the first one.
*
* @param function_name name of a function to override;
* @param image_name name of a mach-o image containing the function. It may be NULL, a full file path or
* just a file name (e.g. "CoreFoundation");
* @param replacement pointer to new implementation of the function;
* @param original will be set to an address of the original implementation's copy;
*
* @return see rd_route() for the list of possible return values
*/
int rd_route_byname(const char *function_name, const char *image_name, void *replacement, void **original);
/**
* Copy `function` implementation into another (first available) memory region.
* @param function pointer to a function to override;
* @param duplicate will be set to an address of the function's implementation copy
*
* @return KERN_SUCCESS if succeeded, or other value if failed
*/
int rd_duplicate_function(void *function, void **duplicate);
/**
* Get function pointer by its name
*
* @param function_name name of a function to look for;
* @param image_name name of a mach-o image containing the function. It may be NULL, a full file path or
* just a file name (e.g. "CoreFoundation");
* @param result will be set to an address of the function;
*
* @return KERN_SUCCESS if succeeded, or other value if failed
*/
int rd_function_byname(const char *function_name, const char *image_name, void **result);
#ifdef __cplusplus
}
#endif
#endif /* RD_ROUTE */
| {
"pile_set_name": "Github"
} |
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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.jboss.weld.tests.ejb;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.BeanArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.weld.test.util.Utils;
import org.jboss.weld.tests.category.Integration;
import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
@Category(Integration.class)
@RunWith(Arquillian.class)
public class EJBTest {
@Deployment
public static Archive<?> deploy() {
return ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(EJBTest.class))
.addPackage(EJBTest.class.getPackage());
}
@Test
public void testNoInterface(Cow cow) {
cow.ping();
Assert.assertTrue(cow.isPinged());
}
}
| {
"pile_set_name": "Github"
} |
#! FIELDS idx_arg aver.targetdist-0 index description
#! SET type LinearBasisSet
#! SET ndimensions 1
#! SET ncoeffs_total 21
#! SET shape_arg 21
0 1.000000 0 T0(s)
1 0.000000 1 T1(s)
2 -0.333333 2 T2(s)
3 0.000000 3 T3(s)
4 -0.066667 4 T4(s)
5 0.000000 5 T5(s)
6 -0.028571 6 T6(s)
7 0.000000 7 T7(s)
8 -0.015873 8 T8(s)
9 0.000000 9 T9(s)
10 -0.010101 10 T10(s)
11 0.000000 11 T11(s)
12 -0.006993 12 T12(s)
13 0.000000 13 T13(s)
14 -0.005128 14 T14(s)
15 0.000000 15 T15(s)
16 -0.003922 16 T16(s)
17 0.000000 17 T17(s)
18 -0.003096 18 T18(s)
19 0.000000 19 T19(s)
20 -0.002506 20 T20(s)
#!-------------------
| {
"pile_set_name": "Github"
} |
{
"webp": [
{
"format": "webp",
"width": 90,
"height": 90,
"url": "/img/avatars/twitter/45d5c4f1-90.webp",
"sourceType": "image/webp",
"srcset": "/img/avatars/twitter/45d5c4f1-90.webp 90w",
"outputPath": "img/avatars/twitter/45d5c4f1-90.webp",
"size": 1756
}
],
"jpeg": [
{
"format": "jpeg",
"width": 90,
"height": 90,
"url": "/img/avatars/twitter/45d5c4f1-90.jpeg",
"sourceType": "image/jpeg",
"srcset": "/img/avatars/twitter/45d5c4f1-90.jpeg 90w",
"outputPath": "img/avatars/twitter/45d5c4f1-90.jpeg",
"size": 2430
}
]
} | {
"pile_set_name": "Github"
} |
/*
* 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 <memory>
#include "common_types.h" // NOLINT(build/include)
#include "modules/remote_bitrate_estimator/inter_arrival.h"
#include "test/gtest.h"
namespace webrtc {
namespace testing {
enum {
kTimestampGroupLengthUs = 5000,
kMinStep = 20,
kTriggerNewGroupUs = kTimestampGroupLengthUs + kMinStep,
kBurstThresholdMs = 5,
kAbsSendTimeFraction = 18,
kAbsSendTimeInterArrivalUpshift = 8,
kInterArrivalShift = kAbsSendTimeFraction + kAbsSendTimeInterArrivalUpshift,
};
const double kRtpTimestampToMs = 1.0 / 90.0;
const double kAstToMs = 1000.0 / static_cast<double>(1 << kInterArrivalShift);
class InterArrivalTest : public ::testing::Test {
protected:
virtual void SetUp() {
inter_arrival_.reset(
new InterArrival(kTimestampGroupLengthUs / 1000, 1.0, true));
inter_arrival_rtp_.reset(new InterArrival(
MakeRtpTimestamp(kTimestampGroupLengthUs), kRtpTimestampToMs, true));
inter_arrival_ast_.reset(new InterArrival(
MakeAbsSendTime(kTimestampGroupLengthUs), kAstToMs, true));
}
// Test that neither inter_arrival instance complete the timestamp group from
// the given data.
void ExpectFalse(int64_t timestamp_us,
int64_t arrival_time_ms,
size_t packet_size) {
InternalExpectFalse(inter_arrival_rtp_.get(),
MakeRtpTimestamp(timestamp_us), arrival_time_ms,
packet_size);
InternalExpectFalse(inter_arrival_ast_.get(), MakeAbsSendTime(timestamp_us),
arrival_time_ms, packet_size);
}
// Test that both inter_arrival instances complete the timestamp group from
// the given data and that all returned deltas are as expected (except
// timestamp delta, which is rounded from us to different ranges and must
// match within an interval, given in |timestamp_near].
void ExpectTrue(int64_t timestamp_us,
int64_t arrival_time_ms,
size_t packet_size,
int64_t expected_timestamp_delta_us,
int64_t expected_arrival_time_delta_ms,
int expected_packet_size_delta,
uint32_t timestamp_near) {
InternalExpectTrue(inter_arrival_rtp_.get(), MakeRtpTimestamp(timestamp_us),
arrival_time_ms, packet_size,
MakeRtpTimestamp(expected_timestamp_delta_us),
expected_arrival_time_delta_ms,
expected_packet_size_delta, timestamp_near);
InternalExpectTrue(inter_arrival_ast_.get(), MakeAbsSendTime(timestamp_us),
arrival_time_ms, packet_size,
MakeAbsSendTime(expected_timestamp_delta_us),
expected_arrival_time_delta_ms,
expected_packet_size_delta, timestamp_near << 8);
}
void WrapTestHelper(int64_t wrap_start_us,
uint32_t timestamp_near,
bool unorderly_within_group) {
// Step through the range of a 32 bit int, 1/4 at a time to not cause
// packets close to wraparound to be judged as out of order.
// G1
int64_t arrival_time = 17;
ExpectFalse(0, arrival_time, 1);
// G2
arrival_time += kBurstThresholdMs + 1;
ExpectFalse(wrap_start_us / 4, arrival_time, 1);
// G3
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(wrap_start_us / 2, arrival_time, 1, wrap_start_us / 4, 6,
0, // Delta G2-G1
0);
// G4
arrival_time += kBurstThresholdMs + 1;
int64_t g4_arrival_time = arrival_time;
ExpectTrue(wrap_start_us / 2 + wrap_start_us / 4, arrival_time, 1,
wrap_start_us / 4, 6, 0, // Delta G3-G2
timestamp_near);
// G5
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(wrap_start_us, arrival_time, 2, wrap_start_us / 4, 6,
0, // Delta G4-G3
timestamp_near);
for (int i = 0; i < 10; ++i) {
// Slowly step across the wrap point.
arrival_time += kBurstThresholdMs + 1;
if (unorderly_within_group) {
// These packets arrive with timestamps in decreasing order but are
// nevertheless accumulated to group because their timestamps are higher
// than the initial timestamp of the group.
ExpectFalse(wrap_start_us + kMinStep * (9 - i), arrival_time, 1);
} else {
ExpectFalse(wrap_start_us + kMinStep * i, arrival_time, 1);
}
}
int64_t g5_arrival_time = arrival_time;
// This packet is out of order and should be dropped.
arrival_time += kBurstThresholdMs + 1;
ExpectFalse(wrap_start_us - 100, arrival_time, 100);
// G6
arrival_time += kBurstThresholdMs + 1;
int64_t g6_arrival_time = arrival_time;
ExpectTrue(wrap_start_us + kTriggerNewGroupUs, arrival_time, 10,
wrap_start_us / 4 + 9 * kMinStep,
g5_arrival_time - g4_arrival_time,
(2 + 10) - 1, // Delta G5-G4
timestamp_near);
// This packet is out of order and should be dropped.
arrival_time += kBurstThresholdMs + 1;
ExpectFalse(wrap_start_us + kTimestampGroupLengthUs, arrival_time, 100);
// G7
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(wrap_start_us + 2 * kTriggerNewGroupUs, arrival_time, 100,
// Delta G6-G5
kTriggerNewGroupUs - 9 * kMinStep,
g6_arrival_time - g5_arrival_time, 10 - (2 + 10),
timestamp_near);
}
std::unique_ptr<InterArrival> inter_arrival_;
private:
static uint32_t MakeRtpTimestamp(int64_t us) {
return static_cast<uint32_t>(static_cast<uint64_t>(us * 90 + 500) / 1000);
}
static uint32_t MakeAbsSendTime(int64_t us) {
uint32_t absolute_send_time =
static_cast<uint32_t>(((static_cast<uint64_t>(us) << 18) + 500000) /
1000000) &
0x00FFFFFFul;
return absolute_send_time << 8;
}
static void InternalExpectFalse(InterArrival* inter_arrival,
uint32_t timestamp,
int64_t arrival_time_ms,
size_t packet_size) {
uint32_t dummy_timestamp = 101;
int64_t dummy_arrival_time_ms = 303;
int dummy_packet_size = 909;
bool computed = inter_arrival->ComputeDeltas(
timestamp, arrival_time_ms, arrival_time_ms, packet_size,
&dummy_timestamp, &dummy_arrival_time_ms, &dummy_packet_size);
EXPECT_EQ(computed, false);
EXPECT_EQ(101ul, dummy_timestamp);
EXPECT_EQ(303, dummy_arrival_time_ms);
EXPECT_EQ(909, dummy_packet_size);
}
static void InternalExpectTrue(InterArrival* inter_arrival,
uint32_t timestamp,
int64_t arrival_time_ms,
size_t packet_size,
uint32_t expected_timestamp_delta,
int64_t expected_arrival_time_delta_ms,
int expected_packet_size_delta,
uint32_t timestamp_near) {
uint32_t delta_timestamp = 101;
int64_t delta_arrival_time_ms = 303;
int delta_packet_size = 909;
bool computed = inter_arrival->ComputeDeltas(
timestamp, arrival_time_ms, arrival_time_ms, packet_size,
&delta_timestamp, &delta_arrival_time_ms, &delta_packet_size);
EXPECT_EQ(true, computed);
EXPECT_NEAR(expected_timestamp_delta, delta_timestamp, timestamp_near);
EXPECT_EQ(expected_arrival_time_delta_ms, delta_arrival_time_ms);
EXPECT_EQ(expected_packet_size_delta, delta_packet_size);
}
std::unique_ptr<InterArrival> inter_arrival_rtp_;
std::unique_ptr<InterArrival> inter_arrival_ast_;
};
TEST_F(InterArrivalTest, FirstPacket) {
ExpectFalse(0, 17, 1);
}
TEST_F(InterArrivalTest, FirstGroup) {
// G1
int64_t arrival_time = 17;
int64_t g1_arrival_time = arrival_time;
ExpectFalse(0, arrival_time, 1);
// G2
arrival_time += kBurstThresholdMs + 1;
int64_t g2_arrival_time = arrival_time;
ExpectFalse(kTriggerNewGroupUs, arrival_time, 2);
// G3
// Only once the first packet of the third group arrives, do we see the deltas
// between the first two.
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(2 * kTriggerNewGroupUs, arrival_time, 1,
// Delta G2-G1
kTriggerNewGroupUs, g2_arrival_time - g1_arrival_time, 1, 0);
}
TEST_F(InterArrivalTest, SecondGroup) {
// G1
int64_t arrival_time = 17;
int64_t g1_arrival_time = arrival_time;
ExpectFalse(0, arrival_time, 1);
// G2
arrival_time += kBurstThresholdMs + 1;
int64_t g2_arrival_time = arrival_time;
ExpectFalse(kTriggerNewGroupUs, arrival_time, 2);
// G3
arrival_time += kBurstThresholdMs + 1;
int64_t g3_arrival_time = arrival_time;
ExpectTrue(2 * kTriggerNewGroupUs, arrival_time, 1,
// Delta G2-G1
kTriggerNewGroupUs, g2_arrival_time - g1_arrival_time, 1, 0);
// G4
// First packet of 4th group yields deltas between group 2 and 3.
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(3 * kTriggerNewGroupUs, arrival_time, 2,
// Delta G3-G2
kTriggerNewGroupUs, g3_arrival_time - g2_arrival_time, -1, 0);
}
TEST_F(InterArrivalTest, AccumulatedGroup) {
// G1
int64_t arrival_time = 17;
int64_t g1_arrival_time = arrival_time;
ExpectFalse(0, arrival_time, 1);
// G2
arrival_time += kBurstThresholdMs + 1;
ExpectFalse(kTriggerNewGroupUs, 28, 2);
int64_t timestamp = kTriggerNewGroupUs;
for (int i = 0; i < 10; ++i) {
// A bunch of packets arriving within the same group.
arrival_time += kBurstThresholdMs + 1;
timestamp += kMinStep;
ExpectFalse(timestamp, arrival_time, 1);
}
int64_t g2_arrival_time = arrival_time;
int64_t g2_timestamp = timestamp;
// G3
arrival_time = 500;
ExpectTrue(2 * kTriggerNewGroupUs, arrival_time, 100, g2_timestamp,
g2_arrival_time - g1_arrival_time,
(2 + 10) - 1, // Delta G2-G1
0);
}
TEST_F(InterArrivalTest, OutOfOrderPacket) {
// G1
int64_t arrival_time = 17;
int64_t timestamp = 0;
ExpectFalse(timestamp, arrival_time, 1);
int64_t g1_timestamp = timestamp;
int64_t g1_arrival_time = arrival_time;
// G2
arrival_time += 11;
timestamp += kTriggerNewGroupUs;
ExpectFalse(timestamp, 28, 2);
for (int i = 0; i < 10; ++i) {
arrival_time += kBurstThresholdMs + 1;
timestamp += kMinStep;
ExpectFalse(timestamp, arrival_time, 1);
}
int64_t g2_timestamp = timestamp;
int64_t g2_arrival_time = arrival_time;
// This packet is out of order and should be dropped.
arrival_time = 281;
ExpectFalse(g1_timestamp, arrival_time, 100);
// G3
arrival_time = 500;
timestamp = 2 * kTriggerNewGroupUs;
ExpectTrue(timestamp, arrival_time, 100,
// Delta G2-G1
g2_timestamp - g1_timestamp, g2_arrival_time - g1_arrival_time,
(2 + 10) - 1, 0);
}
TEST_F(InterArrivalTest, OutOfOrderWithinGroup) {
// G1
int64_t arrival_time = 17;
int64_t timestamp = 0;
ExpectFalse(timestamp, arrival_time, 1);
int64_t g1_timestamp = timestamp;
int64_t g1_arrival_time = arrival_time;
// G2
timestamp += kTriggerNewGroupUs;
arrival_time += 11;
ExpectFalse(kTriggerNewGroupUs, 28, 2);
timestamp += 10 * kMinStep;
int64_t g2_timestamp = timestamp;
for (int i = 0; i < 10; ++i) {
// These packets arrive with timestamps in decreasing order but are
// nevertheless accumulated to group because their timestamps are higher
// than the initial timestamp of the group.
arrival_time += kBurstThresholdMs + 1;
ExpectFalse(timestamp, arrival_time, 1);
timestamp -= kMinStep;
}
int64_t g2_arrival_time = arrival_time;
// However, this packet is deemed out of order and should be dropped.
arrival_time = 281;
timestamp = g1_timestamp;
ExpectFalse(timestamp, arrival_time, 100);
// G3
timestamp = 2 * kTriggerNewGroupUs;
arrival_time = 500;
ExpectTrue(timestamp, arrival_time, 100, g2_timestamp - g1_timestamp,
g2_arrival_time - g1_arrival_time, (2 + 10) - 1, 0);
}
TEST_F(InterArrivalTest, TwoBursts) {
// G1
int64_t g1_arrival_time = 17;
ExpectFalse(0, g1_arrival_time, 1);
// G2
int64_t timestamp = kTriggerNewGroupUs;
int64_t arrival_time = 100; // Simulate no packets arriving for 100 ms.
for (int i = 0; i < 10; ++i) {
// A bunch of packets arriving in one burst (within 5 ms apart).
timestamp += 30000;
arrival_time += kBurstThresholdMs;
ExpectFalse(timestamp, arrival_time, 1);
}
int64_t g2_arrival_time = arrival_time;
int64_t g2_timestamp = timestamp;
// G3
timestamp += 30000;
arrival_time += kBurstThresholdMs + 1;
ExpectTrue(timestamp, arrival_time, 100, g2_timestamp,
g2_arrival_time - g1_arrival_time,
10 - 1, // Delta G2-G1
0);
}
TEST_F(InterArrivalTest, NoBursts) {
// G1
ExpectFalse(0, 17, 1);
// G2
int64_t timestamp = kTriggerNewGroupUs;
int64_t arrival_time = 28;
ExpectFalse(timestamp, arrival_time, 2);
// G3
ExpectTrue(kTriggerNewGroupUs + 30000, arrival_time + kBurstThresholdMs + 1,
100, timestamp - 0, arrival_time - 17,
2 - 1, // Delta G2-G1
0);
}
// Yields 0xfffffffe when converted to internal representation in
// inter_arrival_rtp_ and inter_arrival_ast_ respectively.
static const int64_t kStartRtpTimestampWrapUs = 47721858827;
static const int64_t kStartAbsSendTimeWrapUs = 63999995;
TEST_F(InterArrivalTest, RtpTimestampWrap) {
WrapTestHelper(kStartRtpTimestampWrapUs, 1, false);
}
TEST_F(InterArrivalTest, AbsSendTimeWrap) {
WrapTestHelper(kStartAbsSendTimeWrapUs, 1, false);
}
TEST_F(InterArrivalTest, RtpTimestampWrapOutOfOrderWithinGroup) {
WrapTestHelper(kStartRtpTimestampWrapUs, 1, true);
}
TEST_F(InterArrivalTest, AbsSendTimeWrapOutOfOrderWithinGroup) {
WrapTestHelper(kStartAbsSendTimeWrapUs, 1, true);
}
TEST_F(InterArrivalTest, PositiveArrivalTimeJump) {
const size_t kPacketSize = 1000;
uint32_t send_time_ms = 10000;
int64_t arrival_time_ms = 20000;
int64_t system_time_ms = 30000;
uint32_t send_delta;
int64_t arrival_delta;
int size_delta;
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
const int kTimeDeltaMs = 30;
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs + InterArrival::kArrivalTimeOffsetThresholdMs;
system_time_ms += kTimeDeltaMs;
EXPECT_TRUE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
EXPECT_EQ(kTimeDeltaMs, static_cast<int>(send_delta));
EXPECT_EQ(kTimeDeltaMs, arrival_delta);
EXPECT_EQ(size_delta, 0);
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
// The previous arrival time jump should now be detected and cause a reset.
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
// The two next packets will not give a valid delta since we're in the initial
// state.
for (int i = 0; i < 2; ++i) {
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
}
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_TRUE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
EXPECT_EQ(kTimeDeltaMs, static_cast<int>(send_delta));
EXPECT_EQ(kTimeDeltaMs, arrival_delta);
EXPECT_EQ(size_delta, 0);
}
TEST_F(InterArrivalTest, NegativeArrivalTimeJump) {
const size_t kPacketSize = 1000;
uint32_t send_time_ms = 10000;
int64_t arrival_time_ms = 20000;
int64_t system_time_ms = 30000;
uint32_t send_delta;
int64_t arrival_delta;
int size_delta;
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
const int kTimeDeltaMs = 30;
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_TRUE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
EXPECT_EQ(kTimeDeltaMs, static_cast<int>(send_delta));
EXPECT_EQ(kTimeDeltaMs, arrival_delta);
EXPECT_EQ(size_delta, 0);
// Three out of order will fail, after that we will be reset and two more will
// fail before we get our first valid delta after the reset.
arrival_time_ms -= 1000;
for (int i = 0; i < InterArrival::kReorderedResetThreshold + 3; ++i) {
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
// The previous arrival time jump should now be detected and cause a reset.
EXPECT_FALSE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
}
send_time_ms += kTimeDeltaMs;
arrival_time_ms += kTimeDeltaMs;
system_time_ms += kTimeDeltaMs;
EXPECT_TRUE(inter_arrival_->ComputeDeltas(
send_time_ms, arrival_time_ms, system_time_ms, kPacketSize, &send_delta,
&arrival_delta, &size_delta));
EXPECT_EQ(kTimeDeltaMs, static_cast<int>(send_delta));
EXPECT_EQ(kTimeDeltaMs, arrival_delta);
EXPECT_EQ(size_delta, 0);
}
} // namespace testing
} // namespace webrtc
| {
"pile_set_name": "Github"
} |
package logrus_sentry
import (
"compress/zlib"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"reflect"
"strings"
"testing"
"time"
"github.com/getsentry/raven-go"
pkgerrors "github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
const (
message = "error message"
server_name = "testserver.internal"
logger_name = "test.logger"
)
func getTestLogger() *logrus.Logger {
l := logrus.New()
l.Out = ioutil.Discard
return l
}
// raven.Packet does not have a json directive for deserializing stacktrace
// so need to explicitly construct one for purpose of test
type resultPacket struct {
raven.Packet
Stacktrace raven.Stacktrace `json:"stacktrace"`
Exception raven.Exception `json:"exception"`
}
func WithTestDSN(t *testing.T, tf func(string, <-chan *resultPacket)) {
pch := make(chan *resultPacket, 1)
s := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
defer req.Body.Close()
contentType := req.Header.Get("Content-Type")
var bodyReader io.Reader = req.Body
// underlying client will compress and encode payload above certain size
if contentType == "application/octet-stream" {
bodyReader = base64.NewDecoder(base64.StdEncoding, bodyReader)
bodyReader, _ = zlib.NewReader(bodyReader)
}
d := json.NewDecoder(bodyReader)
p := &resultPacket{}
err := d.Decode(p)
if err != nil {
t.Fatal(err.Error())
}
pch <- p
}))
defer s.Close()
fragments := strings.SplitN(s.URL, "://", 2)
dsn := fmt.Sprintf(
"%s://public:secret@%s/sentry/project-id",
fragments[0],
fragments[1],
)
tf(dsn, pch)
}
func TestSpecialFields(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
hook, err := NewSentryHook(dsn, []logrus.Level{
logrus.ErrorLevel,
})
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
req, _ := http.NewRequest("GET", "url", nil)
logger.WithFields(logrus.Fields{
"server_name": server_name,
"logger": logger_name,
"http_request": req,
}).Error(message)
packet := <-pch
if packet.Logger != logger_name {
t.Errorf("logger should have been %s, was %s", logger_name, packet.Logger)
}
if packet.ServerName != server_name {
t.Errorf("server_name should have been %s, was %s", server_name, packet.ServerName)
}
})
}
func TestSentryHandler(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
hook, err := NewSentryHook(dsn, []logrus.Level{
logrus.ErrorLevel,
})
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
logger.Error(message)
packet := <-pch
if packet.Message != message {
t.Errorf("message should have been %s, was %s", message, packet.Message)
}
})
}
func TestSentryWithClient(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
client, _ := raven.New(dsn)
hook, err := NewWithClientSentryHook(client, []logrus.Level{
logrus.ErrorLevel,
})
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
logger.Error(message)
packet := <-pch
if packet.Message != message {
t.Errorf("message should have been %s, was %s", message, packet.Message)
}
})
}
func TestSentryWithClientAndError(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
client, _ := raven.New(dsn)
hook, err := NewWithClientSentryHook(client, []logrus.Level{
logrus.ErrorLevel,
})
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
errorMsg := "error message"
logger.WithError(errors.New(errorMsg)).Error(message)
packet := <-pch
if packet.Message != message {
t.Errorf("message should have been %s, was %s", message, packet.Message)
}
if packet.Culprit != errorMsg {
t.Errorf("culprit should have been %s, was %s", errorMsg, packet.Culprit)
}
})
}
func TestSentryTags(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
tags := map[string]string{
"site": "test",
}
levels := []logrus.Level{
logrus.ErrorLevel,
}
hook, err := NewWithTagsSentryHook(dsn, tags, levels)
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
logger.Error(message)
packet := <-pch
expected := raven.Tags{
raven.Tag{
Key: "site",
Value: "test",
},
}
if !reflect.DeepEqual(packet.Tags, expected) {
t.Errorf("tags should have been %+v, was %+v", expected, packet.Tags)
}
})
}
func TestSentryFingerprint(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
levels := []logrus.Level{
logrus.ErrorLevel,
}
fingerprint := []string{"fingerprint"}
hook, err := NewSentryHook(dsn, levels)
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
logger.WithFields(logrus.Fields{
"fingerprint": fingerprint,
}).Error(message)
packet := <-pch
if !reflect.DeepEqual(packet.Fingerprint, fingerprint) {
t.Errorf("fingerprint should have been %v, was %v", fingerprint, packet.Fingerprint)
}
})
}
func TestSentryStacktrace(t *testing.T) {
WithTestDSN(t, func(dsn string, pch <-chan *resultPacket) {
logger := getTestLogger()
hook, err := NewSentryHook(dsn, []logrus.Level{
logrus.ErrorLevel,
logrus.InfoLevel,
})
if err != nil {
t.Fatal(err.Error())
}
logger.Hooks.Add(hook)
logger.Error(message)
packet := <-pch
stacktraceSize := len(packet.Stacktrace.Frames)
if stacktraceSize != 0 {
t.Error("Stacktrace should be empty as it is not enabled")
}
hook.StacktraceConfiguration.Enable = true
logger.Error(message) // this is the call that the last frame of stacktrace should capture
expectedLineno := 250 //this should be the line number of the previous line
packet = <-pch
stacktraceSize = len(packet.Stacktrace.Frames)
if stacktraceSize == 0 {
t.Error("Stacktrace should not be empty")
}
lastFrame := packet.Stacktrace.Frames[stacktraceSize-1]
expectedSuffix := "logrus_sentry/sentry_test.go"
if !strings.HasSuffix(lastFrame.Filename, expectedSuffix) {
t.Errorf("File name should have ended with %s, was %s", expectedSuffix, lastFrame.Filename)
}
if lastFrame.Lineno != expectedLineno {
t.Errorf("Line number should have been %d, was %d", expectedLineno, lastFrame.Lineno)
}
if lastFrame.InApp {
t.Error("Frame should not be identified as in_app without prefixes")
}
hook.StacktraceConfiguration.InAppPrefixes = []string{"github.com/sirupsen/logrus"}
hook.StacktraceConfiguration.Context = 2
hook.StacktraceConfiguration.Skip = 2
logger.Error(message)
packet = <-pch
stacktraceSize = len(packet.Stacktrace.Frames)
if stacktraceSize == 0 {
t.Error("Stacktrace should not be empty")
}
lastFrame = packet.Stacktrace.Frames[stacktraceSize-1]
expectedFilename := "github.com/sirupsen/logrus/entry.go"
if lastFrame.Filename != expectedFilename {
t.Errorf("File name should have been %s, was %s", expectedFilename, lastFrame.Filename)
}
if !lastFrame.InApp {
t.Error("Frame should be identified as in_app")
}
logger.WithError(myStacktracerError{}).Error(message) // use an error that implements Stacktracer
packet = <-pch
var frames []*raven.StacktraceFrame
if packet.Exception.Stacktrace != nil {
frames = packet.Exception.Stacktrace.Frames
}
if len(frames) != 1 || frames[0].Filename != expectedStackFrameFilename {
t.Error("Stacktrace should be taken from err if it implements the Stacktracer interface")
}
logger.WithError(pkgerrors.Wrap(myStacktracerError{}, "wrapped")).Error(message) // use an error that wraps a Stacktracer
packet = <-pch
if packet.Exception.Stacktrace != nil {
frames = packet.Exception.Stacktrace.Frames
}
expectedCulprit := "wrapped: myStacktracerError!"
if packet.Culprit != expectedCulprit {
t.Errorf("Expected culprit of '%s', got '%s'", expectedCulprit, packet.Culprit)
}
if len(frames) != 1 || frames[0].Filename != expectedStackFrameFilename {
t.Error("Stacktrace should be taken from err if it implements the Stacktracer interface")
}
logger.WithError(pkgerrors.New("errorX")).Error(message) // use an error that implements pkgErrorStackTracer
packet = <-pch
if packet.Exception.Stacktrace != nil {
frames = packet.Exception.Stacktrace.Frames
}
expectedPkgErrorsStackTraceFilename := "testing/testing.go"
expectedFrameCount := 4
expectedCulprit = "errorX"
if packet.Culprit != expectedCulprit {
t.Errorf("Expected culprit of '%s', got '%s'", expectedCulprit, packet.Culprit)
}
if len(frames) != expectedFrameCount {
t.Errorf("Expected %d frames, got %d", expectedFrameCount, len(frames))
}
if !strings.HasSuffix(frames[0].Filename, expectedPkgErrorsStackTraceFilename) {
t.Error("Stacktrace should be taken from err if it implements the pkgErrorStackTracer interface")
}
// zero stack frames
defer func() {
if err := recover(); err != nil {
t.Error("Zero stack frames should not cause panic")
}
}()
hook.StacktraceConfiguration.Skip = 1000
logger.Error(message)
<-pch // check panic
})
}
func TestAddIgnore(t *testing.T) {
hook := SentryHook{
ignoreFields: make(map[string]struct{}),
}
list := []string{"foo", "bar", "baz"}
for i, key := range list {
if len(hook.ignoreFields) != i {
t.Errorf("hook.ignoreFields has %d length, but %d", i, len(hook.ignoreFields))
continue
}
hook.AddIgnore(key)
if len(hook.ignoreFields) != i+1 {
t.Errorf("hook.ignoreFields should be added")
continue
}
for j := 0; j <= i; j++ {
k := list[j]
if _, ok := hook.ignoreFields[k]; !ok {
t.Errorf("%s should be added into hook.ignoreFields", k)
continue
}
}
}
}
func TestAddExtraFilter(t *testing.T) {
hook := SentryHook{
extraFilters: make(map[string]func(interface{}) interface{}),
}
list := []string{"foo", "bar", "baz"}
for i, key := range list {
if len(hook.extraFilters) != i {
t.Errorf("hook.extraFilters has %d length, but %d", i, len(hook.extraFilters))
continue
}
hook.AddExtraFilter(key, nil)
if len(hook.extraFilters) != i+1 {
t.Errorf("hook.extraFilters should be added")
continue
}
for j := 0; j <= i; j++ {
k := list[j]
if _, ok := hook.extraFilters[k]; !ok {
t.Errorf("%s should be added into hook.extraFilters", k)
continue
}
}
}
}
func TestFormatExtraData(t *testing.T) {
hook := SentryHook{
ignoreFields: make(map[string]struct{}),
extraFilters: make(map[string]func(interface{}) interface{}),
}
hook.AddIgnore("ignore1")
hook.AddIgnore("ignore2")
hook.AddIgnore("ignore3")
hook.AddExtraFilter("filter1", func(v interface{}) interface{} {
return "filter1 value"
})
tests := []struct {
isExist bool
key string
value interface{}
expected interface{}
}{
{true, "integer", 13, 13},
{true, "string", "foo", "foo"},
{true, "bool", true, true},
{true, "time.Time", time.Time{}, "0001-01-01 00:00:00 +0000 UTC"},
{true, "myStringer", myStringer{}, "myStringer!"},
{true, "myStringer_ptr", &myStringer{}, "myStringer!"},
{true, "notStringer", notStringer{}, notStringer{}},
{true, "notStringer_ptr", ¬Stringer{}, ¬Stringer{}},
{false, "ignore1", 13, false},
{false, "ignore2", "foo", false},
{false, "ignore3", time.Time{}, false},
{true, "filter1", "filter1", "filter1 value"},
{true, "filter1", time.Time{}, "filter1 value"},
}
for _, tt := range tests {
target := fmt.Sprintf("%+v", tt)
fields := logrus.Fields{
"time_stamp": time.Now(), // implements JSON marshaler
"time_duration": time.Hour, // implements .String()
"err": errors.New("this is a test error"),
"order": 13,
tt.key: tt.value,
}
df := newDataField(fields)
result := hook.formatExtraData(df)
value, ok := result[tt.key]
if !tt.isExist {
if ok {
t.Errorf("%s should not be exist. data=%s", tt.key, target)
}
continue
}
if fmt.Sprint(tt.expected) != fmt.Sprint(value) {
t.Errorf("%s should be %v, but %v. data=%s", tt.key, tt.expected, value, target)
}
}
}
func TestFormatData(t *testing.T) {
// assertion types
var (
assertTypeInt int
assertTypeString string
assertTypeTime time.Time
)
tests := []struct {
name string
value interface{}
expectedType interface{}
}{
{"int", 13, assertTypeInt},
{"string", "foo", assertTypeString},
{"error", errors.New("this is a test error"), assertTypeString},
{"time_stamp", time.Now(), assertTypeTime}, // implements JSON marshaler
{"time_duration", time.Hour, assertTypeString}, // implements .String()
{"stringer", myStringer{}, assertTypeString}, // implements .String()
{"stringer_ptr", &myStringer{}, assertTypeString}, // implements .String()
{"not_stringer", notStringer{}, notStringer{}},
{"not_stringer_ptr", ¬Stringer{}, ¬Stringer{}},
}
for _, tt := range tests {
target := fmt.Sprintf("%+v", tt)
result := formatData(tt.value)
resultType := reflect.TypeOf(result).String()
expectedType := reflect.TypeOf(tt.expectedType).String()
if resultType != expectedType {
t.Errorf("invalid type: type should be %s, but %s. data=%s", resultType, expectedType, target)
}
}
}
type myStringer struct{}
func (myStringer) String() string { return "myStringer!" }
type notStringer struct{}
func (notStringer) String() {}
type myStacktracerError struct{}
func (myStacktracerError) Error() string { return "myStacktracerError!" }
const expectedStackFrameFilename = "errorFile.go"
func (myStacktracerError) GetStacktrace() *raven.Stacktrace {
return &raven.Stacktrace{
Frames: []*raven.StacktraceFrame{
{Filename: expectedStackFrameFilename},
},
}
}
func TestConvertStackTrace(t *testing.T) {
hook := SentryHook{}
expected := raven.NewStacktrace(0, 0, nil)
st := pkgerrors.New("-").(pkgErrorStackTracer).StackTrace()
ravenSt := hook.convertStackTrace(st)
// Obscure the line numbes, so DeepEqual doesn't fail erroneously
for _, frame := range append(expected.Frames, ravenSt.Frames...) {
frame.Lineno = 999
}
if !reflect.DeepEqual(ravenSt, expected) {
t.Error("stack traces differ")
}
}
| {
"pile_set_name": "Github"
} |
// UpdateProduce.cpp
#include "StdAfx.h"
#include "UpdateProduce.h"
using namespace NUpdateArchive;
static const char *kUpdateActionSetCollision = "Internal collision in update action set";
void UpdateProduce(
const CRecordVector<CUpdatePair> &updatePairs,
const CActionSet &actionSet,
CRecordVector<CUpdatePair2> &operationChain,
IUpdateProduceCallback *callback)
{
FOR_VECTOR (i, updatePairs)
{
const CUpdatePair &pair = updatePairs[i];
CUpdatePair2 up2;
up2.DirIndex = pair.DirIndex;
up2.ArcIndex = pair.ArcIndex;
up2.NewData = up2.NewProps = true;
up2.UseArcProps = false;
switch (actionSet.StateActions[pair.State])
{
case NPairAction::kIgnore:
/*
if (pair.State != NPairState::kOnlyOnDisk)
IgnoreArchiveItem(m_ArchiveItems[pair.ArcIndex]);
// cout << "deleting";
*/
if (callback)
callback->ShowDeleteFile(pair.ArcIndex);
continue;
case NPairAction::kCopy:
if (pair.State == NPairState::kOnlyOnDisk)
throw kUpdateActionSetCollision;
if (pair.State == NPairState::kOnlyInArchive)
{
if (pair.HostIndex >= 0)
{
/*
ignore alt stream if
1) no such alt stream in Disk
2) there is Host file in disk
*/
if (updatePairs[pair.HostIndex].DirIndex >= 0)
continue;
}
}
up2.NewData = up2.NewProps = false;
up2.UseArcProps = true;
break;
case NPairAction::kCompress:
if (pair.State == NPairState::kOnlyInArchive ||
pair.State == NPairState::kNotMasked)
throw kUpdateActionSetCollision;
break;
case NPairAction::kCompressAsAnti:
up2.IsAnti = true;
up2.UseArcProps = (pair.ArcIndex >= 0);
break;
}
operationChain.Add(up2);
}
operationChain.ReserveDown();
}
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Logger;
/**
* Formats a log message according to the ChromePHP array format
*
* @author Christophe Coevoet <[email protected]>
*/
class ChromePHPFormatter implements FormatterInterface
{
/**
* Translates Monolog log levels to Wildfire levels.
*/
private $logLevels = array(
Logger::DEBUG => 'log',
Logger::INFO => 'info',
Logger::NOTICE => 'info',
Logger::WARNING => 'warn',
Logger::ERROR => 'error',
Logger::CRITICAL => 'error',
Logger::ALERT => 'error',
Logger::EMERGENCY => 'error',
);
/**
* {@inheritdoc}
*/
public function format(array $record)
{
// Retrieve the line and file if set and remove them from the formatted extra
$backtrace = 'unknown';
if (isset($record['extra']['file'], $record['extra']['line'])) {
$backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
unset($record['extra']['file'], $record['extra']['line']);
}
$message = array('message' => $record['message']);
if ($record['context']) {
$message['context'] = $record['context'];
}
if ($record['extra']) {
$message['extra'] = $record['extra'];
}
if (count($message) === 1) {
$message = reset($message);
}
return array(
$record['channel'],
$message,
$backtrace,
$this->logLevels[$record['level']],
);
}
public function formatBatch(array $records)
{
$formatted = array();
foreach ($records as $record) {
$formatted[] = $this->format($record);
}
return $formatted;
}
}
| {
"pile_set_name": "Github"
} |
//
// XYDJViewController.m
// StoryboardTest
//
// Created by mxsm on 16/4/18.
// Copyright © 2016年 mxsm. All rights reserved.
//
#import "XYDJViewController.h"
#import "ZXChatBoxController.h"
#import "ZXChatMessageController.h"
#import "ZXMessageModel.h"
#import "TLUserHelper.h"
@interface XYDJViewController ()<ZXChatMessageControllerDelegate,ZXChatBoxViewControllerDelegate>
{
CGFloat viewHeight;
}
@property(nonatomic,strong)ZXChatMessageController * chatMessageVC;
@property(nonatomic,strong)ZXChatBoxController * chatBoxVC;
@property(nonatomic,strong)UIButton * button;
@end
@implementation XYDJViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem * barButton= [[UIBarButtonItem alloc]initWithCustomView:self.button];
self.navigationItem.leftBarButtonItem = barButton;
// Do any additional setup after loading the view.
[self setAutomaticallyAdjustsScrollViewInsets:NO];
[self.view setBackgroundColor:DEFAULT_BACKGROUND_COLOR];
[self setHidesBottomBarWhenPushed:YES];
// 主屏幕的高度减去导航的高度,减去状态栏的高度。在PCH头文件
viewHeight = HEIGHT_SCREEN - HEIGHT_NAVBAR - HEIGHT_STATUSBAR;
[self.view addSubview:self.chatMessageVC.view];
[self addChildViewController:self.chatMessageVC];
[self.view addSubview:self.chatBoxVC.view];
[self addChildViewController:self.chatBoxVC];
}
- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
/**
* 如果状态栏背景为浅色,应选用黑色字样式(UIStatusBarStyleDefault,默认值),如果背景为深色,则选用白色字样式(UIStatusBarStyleLightContent)。
UIApplication 一个APP只有一个,你在这里可以设置应用级别的设置,就像上面的实例一样,详细见http://www.cnblogs.com/wendingding/p/3766347.html
*/
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
/**
* TLChatMessageViewControllerDelegate 的代理方法
*/
#pragma mark - TLChatMessageViewControllerDelegate
- (void) didTapChatMessageView:(ZXChatMessageController *)chatMessageViewController
{
[self.chatBoxVC resignFirstResponder];
}
/**
* TLChatBoxViewControllerDelegate 的代理方法
*/
#pragma mark - TLChatBoxViewControllerDelegate
- (void)chatBoxViewController:(ZXChatBoxController *)chatboxViewController sendMessage:(ZXMessageModel *)message
{
// TLMessage 发送的消息数据模型
message.from = [TLUserHelper sharedUserHelper].user;
/**
* 这个控制器添加了 chatMessageVC 这个控制器作为子控制器。在这个子控制器上面添加聊天消息的cell
TLChatBox 的代理 TLChatBoxViewController 实现了它的代理方法
TLChatBoxViewController 的代理 TLChatViewController 实现代理方法,去在其中的是子控制器更新消息
*/
[self.chatMessageVC addNewMessage:message];
/**
* TLMessage 是一条消息的数据模型。纪录消息的各种属性
就因为又有下面的这个,所以就有了你发一条,又会多一条的显示效果!!
*/
ZXMessageModel *recMessage = [[ZXMessageModel alloc] init];
recMessage.messageType = message.messageType;
recMessage.ownerTyper = ZXMessageOwnerTypeOther;
recMessage.date = [NSDate date];// 当前时间
recMessage.text = message.text;
recMessage.imagePath = message.imagePath;
recMessage.from = message.from;
[self.chatMessageVC addNewMessage:recMessage];
/**
* 滚动插入的消息,使他始终处于一个可以看得见的位置
*/
[self.chatMessageVC scrollToBottom];
}
-(void)chatBoxViewController:(ZXChatBoxController *)chatboxViewController didChangeChatBoxHeight:(CGFloat)height
{
/**
* 改变BoxController .view 的高度 ,这采取的是重新设置 Frame 值!!
*/
self.chatMessageVC.view.frameHeight = viewHeight - height;
self.chatBoxVC.view.originY = self.chatMessageVC.view.originY + self.chatMessageVC.view.frameHeight;
[self.chatMessageVC scrollToBottom];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}
// 进set 方法设置导航名字
#pragma mark - Getter and Setter
-(void)setUser:(ZXUser *)user
{
_user = user;
[self.navigationItem setTitle:user.username];
}
/**
* 两个聊天界面控制器
*/
-(ZXChatMessageController *)chatMessageVC
{
if (_chatMessageVC == nil) {
_chatMessageVC = [[ZXChatMessageController alloc] init];
[_chatMessageVC.view setFrame:CGRectMake(0, HEIGHT_STATUSBAR + HEIGHT_NAVBAR, WIDTH_SCREEN, viewHeight - HEIGHT_TABBAR)];// 0 状态 + 导航 宽 viweH - tabbarH
[_chatMessageVC setDelegate:self];// 代理
}
return _chatMessageVC;
}
-(ZXChatBoxController *) chatBoxVC
{
if (_chatBoxVC == nil) {
_chatBoxVC = [[ZXChatBoxController alloc] init];
[_chatBoxVC.view setFrame:CGRectMake(0, HEIGHT_SCREEN - HEIGHT_TABBAR, WIDTH_SCREEN, HEIGHT_SCREEN)];
//(origin = (x = 0, y = 618), size = (width = 375, height = 667)) iPhone 6
[_chatBoxVC setDelegate:self];
}
return _chatBoxVC;
}
-(UIButton * )button
{
if (!_button)
{
_button=[UIButton buttonWithType:UIButtonTypeCustom];
[_button setTitle:@"返回" forState:UIControlStateNormal];
_button.titleLabel.font=[UIFont systemFontOfSize:15];
[_button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
_button.frame = CGRectMake(0, 0, 60, 30);
[_button addTarget:self action:@selector(ReturnCick) forControlEvents:UIControlEventTouchUpInside];
}
return _button;
}
-(void)ReturnCick
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gson.internal;
import com.google.gson.internal.$Gson$Preconditions;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Contains static utility methods pertaining to primitive types and their
* corresponding wrapper types.
*
* @author Kevin Bourrillion
*/
public final class Primitives {
private Primitives() {}
/** A map from primitive types to their corresponding wrapper types. */
private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE;
/** A map from wrapper types to their corresponding primitive types. */
private static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE_TYPE;
// Sad that we can't use a BiMap. :(
static {
Map<Class<?>, Class<?>> primToWrap = new HashMap<Class<?>, Class<?>>(16);
Map<Class<?>, Class<?>> wrapToPrim = new HashMap<Class<?>, Class<?>>(16);
add(primToWrap, wrapToPrim, boolean.class, Boolean.class);
add(primToWrap, wrapToPrim, byte.class, Byte.class);
add(primToWrap, wrapToPrim, char.class, Character.class);
add(primToWrap, wrapToPrim, double.class, Double.class);
add(primToWrap, wrapToPrim, float.class, Float.class);
add(primToWrap, wrapToPrim, int.class, Integer.class);
add(primToWrap, wrapToPrim, long.class, Long.class);
add(primToWrap, wrapToPrim, short.class, Short.class);
add(primToWrap, wrapToPrim, void.class, Void.class);
PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap);
WRAPPER_TO_PRIMITIVE_TYPE = Collections.unmodifiableMap(wrapToPrim);
}
private static void add(Map<Class<?>, Class<?>> forward,
Map<Class<?>, Class<?>> backward, Class<?> key, Class<?> value) {
forward.put(key, value);
backward.put(value, key);
}
/**
* Returns true if this type is a primitive.
*/
public static boolean isPrimitive(Type type) {
return PRIMITIVE_TO_WRAPPER_TYPE.containsKey(type);
}
/**
* Returns {@code true} if {@code type} is one of the nine
* primitive-wrapper types, such as {@link Integer}.
*
* @see Class#isPrimitive
*/
public static boolean isWrapperType(Type type) {
return WRAPPER_TO_PRIMITIVE_TYPE.containsKey(
$Gson$Preconditions.checkNotNull(type));
}
/**
* Returns the corresponding wrapper type of {@code type} if it is a primitive
* type; otherwise returns {@code type} itself. Idempotent.
* <pre>
* wrap(int.class) == Integer.class
* wrap(Integer.class) == Integer.class
* wrap(String.class) == String.class
* </pre>
*/
public static <T> Class<T> wrap(Class<T> type) {
// cast is safe: long.class and Long.class are both of type Class<Long>
@SuppressWarnings("unchecked")
Class<T> wrapped = (Class<T>) PRIMITIVE_TO_WRAPPER_TYPE.get(
$Gson$Preconditions.checkNotNull(type));
return (wrapped == null) ? type : wrapped;
}
/**
* Returns the corresponding primitive type of {@code type} if it is a
* wrapper type; otherwise returns {@code type} itself. Idempotent.
* <pre>
* unwrap(Integer.class) == int.class
* unwrap(int.class) == int.class
* unwrap(String.class) == String.class
* </pre>
*/
public static <T> Class<T> unwrap(Class<T> type) {
// cast is safe: long.class and Long.class are both of type Class<Long>
@SuppressWarnings("unchecked")
Class<T> unwrapped = (Class<T>) WRAPPER_TO_PRIMITIVE_TYPE.get(
$Gson$Preconditions.checkNotNull(type));
return (unwrapped == null) ? type : unwrapped;
}
}
| {
"pile_set_name": "Github"
} |
// IIIF Image API 2.1
var iiif = (function () {
var urlReg = new RegExp( // IIIF API image URL
"(https?://[^\"'\\s]+)" + // base
"(?:/info\\.json|" +
"/\\^?(?:full|square|(?:pct:)?\\d+,\\d+,\\d+,\\d+)" + // region
"/(?:full|max|\\d+,|,\\d+|pct:\\d+|!?\\d+,\\d+)" + // size
"/!?[1-3]?[0-9]?[0-9]" + // rotation
"/(?:color|gray|bitonal|default|native)" + // quality
"\\.(?:jpe?g|tiff?|png|gif|jp2|pdf|webp)" + // format
")"
);
var gallicaReg = /https?:\/\/gallica\.bnf\.fr\/ark:\/(\w+\/\w+)(?:\/(f\w+))?/
function extractUrl(text) {
var match = text.match(urlReg);
if (match) return match[1] + "/info.json";
}
return {
"name": "IIIF",
"description": "International Image Interoperability Framework",
"urls": [urlReg, gallicaReg],
"contents": [urlReg],
"findFile": function getInfoFile(baseUrl, callback) {
var gallicaMatch = baseUrl.match(gallicaReg);
if (gallicaMatch) {
baseUrl = 'https://gallica.bnf.fr/iiif/ark:/' +
gallicaMatch[1] + '/' +
(gallicaMatch[2] || 'f1') +
'/info.json';
}
var url = extractUrl(baseUrl);
if (url) return callback(url);
ZoomManager.getFile(baseUrl, { type: "htmltext" }, function (text) {
var url = extractUrl(text);
if (url) return callback(url);
throw new Error("No IIIF URL found.");
});
},
"open": function (url) {
ZoomManager.getFile(url, { type: "json" }, function (data, xhr) {
function min(array) { return Math.min.apply(null, array) }
function searchWithDefault(array, search, defaultValue) {
// Return the searched value if it's in the array.
// Else, return the first value of the array, or defaultValue if the array is empty or invalid
var array = (array && array.length) ? array : [defaultValue];
return ~array.indexOf(search) ? search : array[0];
}
var tiles =
(data.tiles && data.tiles.length)
? data.tiles.reduce(function (red, val) {
return min(red.scaleFactors) < min(val.scaleFactors) ? red : val;
})
: { "width": data.tile_width || 512, "scaleFactors": [1] };
try {
var origin = new URL(data["@id"], url);
if (origin.hostname === "localhost" || origin.hostname === "example.com") {
throw new Error("probably a test host");
}
} catch (e) {
console.log("Rewriting the @id from the manifest: " + e);
var origin = url.replace(/\/info\.json(\?.*)?$/, '');
}
var returned_data = {
"origin": origin.toString(),
"width": parseInt(data.width),
"height": parseInt(data.height),
"tileSize": tiles.width,
"maxZoomLevel": Math.min.apply(null, tiles.scaleFactors),
"quality": searchWithDefault(data.qualities, "native", "default"),
"format": searchWithDefault(data.formats, "png", "jpg")
};
var img = new Image; // Load a tile to find out the real tile size
img.src = getTileURL(0, 0, returned_data.maxZoomLevel, returned_data);
img.addEventListener("load", function () {
returned_data.tileSize = Math.max(img.width, img.height);
ZoomManager.readyToRender(returned_data);
});
img.addEventListener("error", function () {
ZoomManager.readyToRender(returned_data); // Try rendering anyway
ZoomManager.error("Unable to load first tile: " + img.src);
});
});
},
"getTileURL": getTileURL
};
function getTileURL(x, y, zoom, data) {
var s = data.tileSize,
pxX = x * s, pxY = y * s;
//The image size is adjusted for edges
//width
if (pxX + s > data.width) {
sx = data.width - pxX;
} else {
sx = s;
}
//height
if (pxY + s > data.height) {
sy = data.height - pxY;
} else {
sy = s;
}
return data.origin + "/" +
pxX + "," + // source image X
pxY + "," + // source image Y
sx + "," + // source image width
sy + "/" + // source image height
sx + "," + // returned image width
"" + "/" + // returned image height
"0" + "/" + //rotation
data.quality + "." + //quality
data.format; //format
}
})();
ZoomManager.addDezoomer(iiif);
| {
"pile_set_name": "Github"
} |
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
Copyright (C) 2012 Tommi Rantala <[email protected]>
Copyright (C) 2013 Linaro Limited
This file is part of libunwind.
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 "unwind_i.h"
int
unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc)
{
struct cursor *c = (struct cursor *) cursor;
dwarf_loc_t loc;
switch (reg)
{
case UNW_AARCH64_X0:
case UNW_AARCH64_X1:
case UNW_AARCH64_X2:
case UNW_AARCH64_X3:
case UNW_AARCH64_X4:
case UNW_AARCH64_X5:
case UNW_AARCH64_X6:
case UNW_AARCH64_X7:
case UNW_AARCH64_X8:
case UNW_AARCH64_X9:
case UNW_AARCH64_X10:
case UNW_AARCH64_X11:
case UNW_AARCH64_X12:
case UNW_AARCH64_X13:
case UNW_AARCH64_X14:
case UNW_AARCH64_X15:
case UNW_AARCH64_X16:
case UNW_AARCH64_X17:
case UNW_AARCH64_X18:
case UNW_AARCH64_X19:
case UNW_AARCH64_X20:
case UNW_AARCH64_X21:
case UNW_AARCH64_X22:
case UNW_AARCH64_X23:
case UNW_AARCH64_X24:
case UNW_AARCH64_X25:
case UNW_AARCH64_X26:
case UNW_AARCH64_X27:
case UNW_AARCH64_X28:
case UNW_AARCH64_X29:
case UNW_AARCH64_X30:
case UNW_AARCH64_SP:
case UNW_AARCH64_PC:
case UNW_AARCH64_PSTATE:
loc = c->dwarf.loc[reg];
break;
default:
loc = DWARF_NULL_LOC; /* default to "not saved" */
break;
}
memset (sloc, 0, sizeof (*sloc));
if (DWARF_IS_NULL_LOC (loc))
{
sloc->type = UNW_SLT_NONE;
return 0;
}
#if !defined(UNW_LOCAL_ONLY)
if (DWARF_IS_REG_LOC (loc))
{
sloc->type = UNW_SLT_REG;
sloc->u.regnum = DWARF_GET_LOC (loc);
}
else
#endif
{
sloc->type = UNW_SLT_MEMORY;
sloc->u.addr = DWARF_GET_LOC (loc);
}
return 0;
}
| {
"pile_set_name": "Github"
} |
---
title: 'API: head 方法'
description: Nuxt.js 使用了 vue-meta 更新应用的头部标签和html属性。
menu: head
category: pages
position: 23
---
# head 方法
> Nuxt.js 使用了 [`vue-meta`](https://github.com/nuxt/vue-meta) 更新应用的 `头部标签(Head)` 和 `html 属性`。
- **类型:** `Object` 或 `Function`
使用 `head` 方法设置当前页面的头部标签。
在 `head` 方法里可通过 `this` 关键字来获取组件的数据,你可以利用页面组件的数据来设置个性化的 `meta` 标签。
```html
<template>
<h1>{{ title }}</h1>
</template>
<script>
export default {
data() {
return {
title: 'Hello World!'
}
},
head() {
return {
title: this.title,
meta: [
{
hid: 'description',
name: 'description',
content: 'My custom description'
}
]
}
}
}
</script>
```
<div class="Alert Alert--teal">
注意:为了避免子组件中的 meta 标签不能正确覆盖父组件中相同的标签而产生重复的现象,建议利用 `hid` 键为 meta 标签配一个唯一的标识编号。请阅读[关于 `vue-meta` 的更多信息](https://vue-meta.nuxtjs.org/api/#tagidkeyname)。
</div>
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.