text
stringlengths
101
197k
meta
stringlengths
167
272
track gtexRnaSignalSpleenSRR1079046 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1079046.hg19.bigWig shortLabel spleen F XV7Q longLabel GTEx RNA signal from female Spleen (GTEX-XV7Q-0126-SM-4BRVK) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-XV7Q age=40 sex=F hardyScore=0 sample=GTEX-XV7Q-0126-SM-4BRVK \ tissue=spleen autolysisScore=2 rnaIntegrity=8.6 batch=BP-34373 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/14/2012 track gtexRnaSignalSpleenSRR1086983 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1086983.hg19.bigWig shortLabel spleen F T5JW longLabel GTEx RNA signal from female Spleen (GTEX-T5JW-0126-SM-4DM6K) subGroups sex=F age=a20 color 227,184,136 metadata donor=GTEX-T5JW age=20 sex=F hardyScore=0 sample=GTEX-T5JW-0126-SM-4DM6K \ tissue=spleen autolysisScore=1 rnaIntegrity=7.3 batch=BP-25965 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=06/05/2012 track gtexRnaSignalSpleenSRR1090984 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1090984.hg19.bigWig shortLabel spleen F R55G longLabel GTEx RNA signal from female Spleen (GTEX-R55G-0226-SM-48FEI) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-R55G age=40 sex=F hardyScore=0 sample=GTEX-R55G-0226-SM-48FEI \ tissue=spleen autolysisScore=1 rnaIntegrity=7.7 batch=BP-21546 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=01/18/2012 track gtexRnaSignalSpleenSRR1091500 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1091500.hg19.bigWig shortLabel spleen F Q734 longLabel GTEx RNA signal from female Spleen (GTEX-Q734-0226-SM-48U1A) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-Q734 age=40 sex=F hardyScore=0 sample=GTEX-Q734-0226-SM-48U1A \ tissue=spleen autolysisScore=2 rnaIntegrity=7.8 batch=BP-20044 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/10/2011 track gtexRnaSignalSpleenSRR1092257 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1092257.hg19.bigWig shortLabel spleen F POMQ longLabel GTEx RNA signal from female Spleen (GTEX-POMQ-0126-SM-48TD6) subGroups sex=F age=a20 color 227,184,136 metadata donor=GTEX-POMQ age=20 sex=F hardyScore=0 sample=GTEX-POMQ-0126-SM-48TD6 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.3 batch=BP-19350 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=10/12/2011 track gtexRnaSignalSpleenSRR1094073 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1094073.hg19.bigWig shortLabel spleen F PX3G longLabel GTEx RNA signal from female Spleen (GTEX-PX3G-0926-SM-48U12) subGroups sex=F age=a20 color 227,184,136 metadata donor=GTEX-PX3G age=20 sex=F hardyScore=0 sample=GTEX-PX3G-0926-SM-48U12 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.8 batch=BP-19882 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/03/2011 track gtexRnaSignalSpleenSRR1327747 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1327747.hg19.bigWig shortLabel spleen F 11XUK longLabel GTEx RNA signal from female Spleen (GTEX-11XUK-0426-SM-5EQML) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-11XUK age=40 sex=F hardyScore=0 sample=GTEX-11XUK-0426-SM-5EQML \ tissue=spleen autolysisScore=1 rnaIntegrity=6 batch=BP-44312 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/04/2013 track gtexRnaSignalSpleenSRR1348911 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1348911.hg19.bigWig shortLabel spleen F 13VXT longLabel GTEx RNA signal from female Spleen (GTEX-13VXT-1326-SM-5LU3Y) subGroups sex=F age=a20 color 227,184,136 metadata donor=GTEX-13VXT age=20 sex=F hardyScore=0 sample=GTEX-13VXT-1326-SM-5LU3Y \ tissue=spleen autolysisScore=2 rnaIntegrity=6.4 batch=BP-47486 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/17/2013 track gtexRnaSignalSpleenSRR1351857 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1351857.hg19.bigWig shortLabel spleen F 12WSJ longLabel GTEx RNA signal from female Spleen (GTEX-12WSJ-0526-SM-5GCOZ) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-12WSJ age=40 sex=F hardyScore=0 sample=GTEX-12WSJ-0526-SM-5GCOZ \ tissue=spleen autolysisScore=0 rnaIntegrity=5.8 batch=BP-43881 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/23/2013 track gtexRnaSignalSpleenSRR1375549 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1375549.hg19.bigWig shortLabel spleen F ZYWO longLabel GTEx RNA signal from female Spleen (GTEX-ZYWO-0226-SM-5GZX3) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-ZYWO age=40 sex=F hardyScore=0 sample=GTEX-ZYWO-0226-SM-5GZX3 \ tissue=spleen autolysisScore=0 rnaIntegrity=6.9 batch=BP-43693 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/17/2013 track gtexRnaSignalSpleenSRR1378045 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1378045.hg19.bigWig shortLabel spleen F 12WSK longLabel GTEx RNA signal from female Spleen (GTEX-12WSK-0126-SM-5GCO7) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-12WSK age=40 sex=F hardyScore=0 sample=GTEX-12WSK-0126-SM-5GCO7 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.9 batch=BP-44157 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/01/2013 track gtexRnaSignalSpleenSRR1382687 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1382687.hg19.bigWig shortLabel spleen F 1399S longLabel GTEx RNA signal from female Spleen (GTEX-1399S-0226-SM-5IFFG) subGroups sex=F age=a30 color 227,184,136 metadata donor=GTEX-1399S age=30 sex=F hardyScore=0 sample=GTEX-1399S-0226-SM-5IFFG \ tissue=spleen autolysisScore=1 rnaIntegrity=7.1 batch=BP-46680 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/05/2013 track gtexRnaSignalSpleenSRR1391553 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1391553.hg19.bigWig shortLabel spleen F 11VI4 longLabel GTEx RNA signal from female Spleen (GTEX-11VI4-0126-SM-5GU6Z) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-11VI4 age=40 sex=F hardyScore=0 sample=GTEX-11VI4-0126-SM-5GU6Z \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-43753 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/19/2013 track gtexRnaSignalSpleenSRR1392861 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1392861.hg19.bigWig shortLabel spleen F ZV6S longLabel GTEx RNA signal from female Spleen (GTEX-ZV6S-0826-SM-5NQ6Z) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-ZV6S age=40 sex=F hardyScore=0 sample=GTEX-ZV6S-0826-SM-5NQ6Z \ tissue=spleen autolysisScore=1 rnaIntegrity=5.7 batch=BP-43308 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/09/2013 track gtexRnaSignalSpleenSRR1436323 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1436323.hg19.bigWig shortLabel spleen F Y5LM longLabel GTEx RNA signal from female Spleen (GTEX-Y5LM-0326-SM-4VBRN) subGroups sex=F age=a40 color 227,184,136 metadata donor=GTEX-Y5LM age=40 sex=F hardyScore=0 sample=GTEX-Y5LM-0326-SM-4VBRN \ tissue=spleen autolysisScore=1 rnaIntegrity=8.8 batch=BP-35803 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=02/05/2013 track gtexRnaSignalSpleenSRR1471731 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1471731.hg19.bigWig shortLabel spleen F ZP4G longLabel GTEx RNA signal from female Spleen (GTEX-ZP4G-0326-SM-4YCEF) subGroups sex=F age=a20 color 227,184,136 metadata donor=GTEX-ZP4G age=20 sex=F hardyScore=0 sample=GTEX-ZP4G-0326-SM-4YCEF \ tissue=spleen autolysisScore=1 rnaIntegrity=7.8 batch=BP-42869 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=08/29/2013 track gtexRnaSignalSpleenSRR1488111 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1488111.hg19.bigWig shortLabel spleen F 11P81 longLabel GTEx RNA signal from female Spleen (GTEX-11P81-1326-SM-5GU5S) subGroups sex=F age=a30 color 227,184,136 metadata donor=GTEX-11P81 age=30 sex=F hardyScore=0 sample=GTEX-11P81-1326-SM-5GU5S \ tissue=spleen autolysisScore=1 rnaIntegrity=7.1 batch=BP-44312 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/04/2013 track gtexRnaSignalSpleenSRR1077944 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1077944.hg19.bigWig shortLabel spleen F QCQG longLabel GTEx RNA signal from female Spleen (GTEX-QCQG-0226-SM-48U28) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-QCQG age=50 sex=F hardyScore=0 sample=GTEX-QCQG-0226-SM-48U28 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.6 batch=BP-20114 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/15/2011 track gtexRnaSignalSpleenSRR1085087 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1085087.hg19.bigWig shortLabel spleen F UJHI longLabel GTEx RNA signal from female Spleen (GTEX-UJHI-0126-SM-4IHLP) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-UJHI age=50 sex=F hardyScore=0 sample=GTEX-UJHI-0126-SM-4IHLP \ tissue=spleen autolysisScore=1 rnaIntegrity=8.1 batch=BP-25734 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=05/29/2012 track gtexRnaSignalSpleenSRR1318732 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1318732.hg19.bigWig shortLabel spleen F 13FH7 longLabel GTEx RNA signal from female Spleen (GTEX-13FH7-1326-SM-5IFG8) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-13FH7 age=50 sex=F hardyScore=0 sample=GTEX-13FH7-1326-SM-5IFG8 \ tissue=spleen autolysisScore=1 rnaIntegrity=8.1 batch=BP-46925 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/10/2013 track gtexRnaSignalSpleenSRR1327279 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1327279.hg19.bigWig shortLabel spleen F WXYG longLabel GTEx RNA signal from female Spleen (GTEX-WXYG-0126-SM-4OND7) subGroups sex=F age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1396227 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1396227.hg19.bigWig shortLabel spleen F ZLWG longLabel GTEx RNA signal from female Spleen (GTEX-ZLWG-0426-SM-4WWFA) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-ZLWG age=50 sex=F hardyScore=0 sample=GTEX-ZLWG-0426-SM-4WWFA \ tissue=spleen autolysisScore=0 rnaIntegrity=8 batch=BP-43141 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/05/2013 track gtexRnaSignalSpleenSRR1400775 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1400775.hg19.bigWig shortLabel spleen F ZF2S longLabel GTEx RNA signal from female Spleen (GTEX-ZF2S-0326-SM-4WKGD) subGroups sex=F age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1415510 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1415510.hg19.bigWig shortLabel spleen F 13N11 longLabel GTEx RNA signal from female Spleen (GTEX-13N11-0126-SM-5KM2Z) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-13N11 age=50 sex=F hardyScore=0 sample=GTEX-13N11-0126-SM-5KM2Z \ tissue=spleen autolysisScore=0 rnaIntegrity=6.9 batch=BP-47141 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/13/2013 track gtexRnaSignalSpleenSRR1436740 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1436740.hg19.bigWig shortLabel spleen F ZZPU longLabel GTEx RNA signal from female Spleen (GTEX-ZZPU-0126-SM-5E446) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-ZZPU age=50 sex=F hardyScore=0 sample=GTEX-ZZPU-0126-SM-5E446 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.2 batch=BP-43495 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/12/2013 track gtexRnaSignalSpleenSRR1440332 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1440332.hg19.bigWig shortLabel spleen F 147F3 longLabel GTEx RNA signal from female Spleen (GTEX-147F3-0126-SM-5NQBJ) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-147F3 age=50 sex=F hardyScore=0 sample=GTEX-147F3-0126-SM-5NQBJ \ tissue=spleen autolysisScore=1 rnaIntegrity=6.9 batch=BP-47696 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/20/2013 track gtexRnaSignalSpleenSRR1444156 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1444156.hg19.bigWig shortLabel spleen F Y3IK longLabel GTEx RNA signal from female Spleen (GTEX-Y3IK-0126-SM-4WWE9) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-Y3IK age=50 sex=F hardyScore=0 sample=GTEX-Y3IK-0126-SM-4WWE9 \ tissue=spleen autolysisScore=2 rnaIntegrity=8.4 batch=BP-35206 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=01/16/2013 track gtexRnaSignalSpleenSRR1456991 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1456991.hg19.bigWig shortLabel spleen F W5WG longLabel GTEx RNA signal from female Spleen (GTEX-W5WG-0626-SM-4SOID) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-W5WG age=50 sex=F hardyScore=0 sample=GTEX-W5WG-0626-SM-4SOID \ tissue=spleen autolysisScore=1 rnaIntegrity=8 batch=BP-40880 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=07/16/2013 track gtexRnaSignalSpleenSRR1487485 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1487485.hg19.bigWig shortLabel spleen F Y8LW longLabel GTEx RNA signal from female Spleen (GTEX-Y8LW-0126-SM-4VBS1) subGroups sex=F age=a50 color 227,184,136 metadata donor=GTEX-Y8LW age=50 sex=F hardyScore=0 sample=GTEX-Y8LW-0126-SM-4VBS1 \ tissue=spleen autolysisScore=2 rnaIntegrity=7.2 batch=BP-41767 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=08/01/2013 track gtexRnaSignalSpleenSRR1095549 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1095549.hg19.bigWig shortLabel spleen F XUJ4 longLabel GTEx RNA signal from female Spleen (GTEX-XUJ4-0226-SM-4BOP8) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-XUJ4 age=60 sex=F hardyScore=0 sample=GTEX-XUJ4-0226-SM-4BOP8 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-34205 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/11/2012 track gtexRnaSignalSpleenSRR1309597 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1309597.hg19.bigWig shortLabel spleen F 11DXX longLabel GTEx RNA signal from female Spleen (GTEX-11DXX-0726-SM-5H12X) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-11DXX age=60 sex=F hardyScore=0 sample=GTEX-11DXX-0726-SM-5H12X \ tissue=spleen autolysisScore=0 rnaIntegrity=5.8 batch=BP-43783 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/19/2013 track gtexRnaSignalSpleenSRR1311205 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1311205.hg19.bigWig shortLabel spleen F 1122O longLabel GTEx RNA signal from female Spleen (GTEX-1122O-0526-SM-5N9DM) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-1122O age=60 sex=F hardyScore=0 sample=GTEX-1122O-0526-SM-5N9DM \ tissue=spleen autolysisScore=0 rnaIntegrity=7.8 batch=BP-43989 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/26/2013 track gtexRnaSignalSpleenSRR1335875 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1335875.hg19.bigWig shortLabel spleen F 13PL7 longLabel GTEx RNA signal from female Spleen (GTEX-13PL7-1126-SM-5MR5O) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-13PL7 age=60 sex=F hardyScore=0 sample=GTEX-13PL7-1126-SM-5MR5O \ tissue=spleen autolysisScore=1 rnaIntegrity=7.3 batch=BP-47656 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/19/2013 track gtexRnaSignalSpleenSRR1345585 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1345585.hg19.bigWig shortLabel spleen F 146FR longLabel GTEx RNA signal from female Spleen (GTEX-146FR-1926-SM-5NQA6) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-146FR age=60 sex=F hardyScore=0 sample=GTEX-146FR-1926-SM-5NQA6 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.5 batch=BP-47696 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/20/2013 track gtexRnaSignalSpleenSRR1346794 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1346794.hg19.bigWig shortLabel spleen F 13CF3 longLabel GTEx RNA signal from female Spleen (GTEX-13CF3-0226-SM-5J1NW) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-13CF3 age=60 sex=F hardyScore=0 sample=GTEX-13CF3-0226-SM-5J1NW \ tissue=spleen autolysisScore=1 rnaIntegrity=6.5 batch=BP-46482 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/03/2013 track gtexRnaSignalSpleenSRR1405099 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1405099.hg19.bigWig shortLabel spleen F ZF29 longLabel GTEx RNA signal from female Spleen (GTEX-ZF29-0626-SM-4WKHD) subGroups sex=F age=a60 color 227,184,136 track gtexRnaSignalSpleenSRR1441398 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1441398.hg19.bigWig shortLabel spleen F 1211K longLabel GTEx RNA signal from female Spleen (GTEX-1211K-0426-SM-5FQTP) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-1211K age=60 sex=F hardyScore=0 sample=GTEX-1211K-0426-SM-5FQTP \ tissue=spleen autolysisScore=1 rnaIntegrity=7.7 batch=BP-44114 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/30/2013 track gtexRnaSignalSpleenSRR1472929 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1472929.hg19.bigWig shortLabel spleen F 12WSD longLabel GTEx RNA signal from female Spleen (GTEX-12WSD-1726-SM-5GCN4) subGroups sex=F age=a60 color 227,184,136 track gtexRnaSignalSpleenSRR1500495 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1500495.hg19.bigWig shortLabel spleen F 13PVR longLabel GTEx RNA signal from female Spleen (GTEX-13PVR-0326-SM-5RQJY) subGroups sex=F age=a60 color 227,184,136 metadata donor=GTEX-13PVR age=60 sex=F hardyScore=0 sample=GTEX-13PVR-0326-SM-5RQJY \ tissue=spleen autolysisScore=1 rnaIntegrity=7.7 batch=BP-48564 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=01/22/2014 track gtexRnaSignalSpleenSRR1069539 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1069539.hg19.bigWig shortLabel spleen M QLQW longLabel GTEx RNA signal from male Spleen (GTEX-QLQW-0126-SM-447BK) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-QLQW age=30 sex=M hardyScore=0 sample=GTEX-QLQW-0126-SM-447BK \ tissue=spleen autolysisScore=1 rnaIntegrity=6.2 batch=BP-20740 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/12/2011 track gtexRnaSignalSpleenSRR1073947 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1073947.hg19.bigWig shortLabel spleen M PLZ6 longLabel GTEx RNA signal from male Spleen (GTEX-PLZ6-0126-SM-48TC6) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-PLZ6 age=30 sex=M hardyScore=0 sample=GTEX-PLZ6-0126-SM-48TC6 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.9 batch=BP-19254 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=10/05/2011 track gtexRnaSignalSpleenSRR1074526 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1074526.hg19.bigWig shortLabel spleen M NPJ8 longLabel GTEx RNA signal from male Spleen (GTEX-NPJ8-0626-SM-48TBO) subGroups sex=M age=a40 color 227,184,136 track gtexRnaSignalSpleenSRR1075198 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1075198.hg19.bigWig shortLabel spleen M XMK1 longLabel GTEx RNA signal from male Spleen (GTEX-XMK1-0126-SM-4B65F) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-XMK1 age=40 sex=M hardyScore=0 sample=GTEX-XMK1-0126-SM-4B65F \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-32735 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/01/2012 track gtexRnaSignalSpleenSRR1076369 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1076369.hg19.bigWig shortLabel spleen M Q2AH longLabel GTEx RNA signal from male Spleen (GTEX-Q2AH-0226-SM-48U1I) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-Q2AH age=40 sex=M hardyScore=0 sample=GTEX-Q2AH-0226-SM-48U1I \ tissue=spleen autolysisScore=1 rnaIntegrity=6.5 batch=BP-19904 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/04/2011 track gtexRnaSignalSpleenSRR1077549 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1077549.hg19.bigWig shortLabel spleen M WFON longLabel GTEx RNA signal from male Spleen (GTEX-WFON-0126-SM-4LVM9) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-WFON age=40 sex=M hardyScore=0 sample=GTEX-WFON-0126-SM-4LVM9 \ tissue=spleen autolysisScore=1 rnaIntegrity=5.8 batch=BP-27449 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=07/16/2012 track gtexRnaSignalSpleenSRR1084055 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1084055.hg19.bigWig shortLabel spleen M UPK5 longLabel GTEx RNA signal from male Spleen (GTEX-UPK5-1626-SM-4JBHI) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-UPK5 age=40 sex=M hardyScore=0 sample=GTEX-UPK5-1626-SM-4JBHI \ tissue=spleen autolysisScore=1 rnaIntegrity=7.1 batch=BP-29992 center=C1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=08/23/2012 track gtexRnaSignalSpleenSRR1086915 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1086915.hg19.bigWig shortLabel spleen M U4B1 longLabel GTEx RNA signal from male Spleen (GTEX-U4B1-0526-SM-4DXTK) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-U4B1 age=40 sex=M hardyScore=0 sample=GTEX-U4B1-0526-SM-4DXTK \ tissue=spleen autolysisScore=1 rnaIntegrity=6.5 batch=BP-25599 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=05/23/2012 track gtexRnaSignalSpleenSRR1086935 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1086935.hg19.bigWig shortLabel spleen M S4Q7 longLabel GTEx RNA signal from male Spleen (GTEX-S4Q7-0126-SM-4AD5P) subGroups sex=M age=a20 color 227,184,136 track gtexRnaSignalSpleenSRR1089230 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1089230.hg19.bigWig shortLabel spleen M O5YT longLabel GTEx RNA signal from male Spleen (GTEX-O5YT-0926-SM-48TDG) subGroups sex=M age=a20 color 227,184,136 metadata donor=GTEX-O5YT age=20 sex=M hardyScore=0 sample=GTEX-O5YT-0926-SM-48TDG \ tissue=spleen autolysisScore=0 rnaIntegrity=7 batch=BP-17532 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=07/12/2011 track gtexRnaSignalSpleenSRR1093196 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1093196.hg19.bigWig shortLabel spleen M XAJ8 longLabel GTEx RNA signal from male Spleen (GTEX-XAJ8-0126-SM-47JYG) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-XAJ8 age=40 sex=M hardyScore=0 sample=GTEX-XAJ8-0126-SM-47JYG \ tissue=spleen autolysisScore=1 rnaIntegrity=8.1 batch=BP-31440 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=09/25/2012 track gtexRnaSignalSpleenSRR1094312 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1094312.hg19.bigWig shortLabel spleen M PW2O longLabel GTEx RNA signal from male Spleen (GTEX-PW2O-0126-SM-48TC8) subGroups sex=M age=a20 color 227,184,136 metadata donor=GTEX-PW2O age=20 sex=M hardyScore=0 sample=GTEX-PW2O-0126-SM-48TC8 \ tissue=spleen autolysisScore=2 rnaIntegrity=7.8 batch=BP-19458 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=10/19/2011 track gtexRnaSignalSpleenSRR1096291 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1096291.hg19.bigWig shortLabel spleen M QV31 longLabel GTEx RNA signal from male Spleen (GTEX-QV31-0126-SM-447BP) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-QV31 age=30 sex=M hardyScore=0 sample=GTEX-QV31-0126-SM-447BP \ tissue=spleen autolysisScore=2 rnaIntegrity=6.5 batch=BP-20785 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/13/2011 track gtexRnaSignalSpleenSRR1310604 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1310604.hg19.bigWig shortLabel spleen M 11NSD longLabel GTEx RNA signal from male Spleen (GTEX-11NSD-0426-SM-5N9CR) subGroups sex=M age=a20 color 227,184,136 metadata donor=GTEX-11NSD age=20 sex=M hardyScore=0 sample=GTEX-11NSD-0426-SM-5N9CR \ tissue=spleen autolysisScore=1 rnaIntegrity=6.5 batch=BP-43989 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/26/2013 track gtexRnaSignalSpleenSRR1311980 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1311980.hg19.bigWig shortLabel spleen M 11P7K longLabel GTEx RNA signal from male Spleen (GTEX-11P7K-0426-SM-5BC5H) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-11P7K age=30 sex=M hardyScore=0 sample=GTEX-11P7K-0426-SM-5BC5H \ tissue=spleen autolysisScore=1 rnaIntegrity=5.8 batch=BP-44512 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/10/2013 track gtexRnaSignalSpleenSRR1319690 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1319690.hg19.bigWig shortLabel spleen M 14E6E longLabel GTEx RNA signal from male Spleen (GTEX-14E6E-1226-SM-5S2R5) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-14E6E age=30 sex=M hardyScore=0 sample=GTEX-14E6E-1226-SM-5S2R5 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.8 batch=BP-48651 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=01/24/2014 track gtexRnaSignalSpleenSRR1324062 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1324062.hg19.bigWig shortLabel spleen M 11EQ9 longLabel GTEx RNA signal from male Spleen (GTEX-11EQ9-0426-SM-5A5JY) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-11EQ9 age=30 sex=M hardyScore=2 sample=GTEX-11EQ9-0426-SM-5A5JY \ tissue=spleen autolysisScore=1 rnaIntegrity=8.1 batch=BP-44264 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/03/2013 track gtexRnaSignalSpleenSRR1351016 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1351016.hg19.bigWig shortLabel spleen M YFCO longLabel GTEx RNA signal from male Spleen (GTEX-YFCO-0926-SM-5LUA5) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-YFCO age=40 sex=M hardyScore=0 sample=GTEX-YFCO-0926-SM-5LUA5 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.9 batch=BP-41808 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=08/02/2013 track gtexRnaSignalSpleenSRR1352437 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1352437.hg19.bigWig shortLabel spleen M 145MN longLabel GTEx RNA signal from male Spleen (GTEX-145MN-0126-SM-5RQHY) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-145MN age=30 sex=M hardyScore=0 sample=GTEX-145MN-0126-SM-5RQHY \ tissue=spleen autolysisScore=1 rnaIntegrity=7.6 batch=BP-48437 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=01/17/2014 track gtexRnaSignalSpleenSRR1362555 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1362555.hg19.bigWig shortLabel spleen M ZPU1 longLabel GTEx RNA signal from male Spleen (GTEX-ZPU1-1026-SM-4YCEQ) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-ZPU1 age=40 sex=M hardyScore=0 sample=GTEX-ZPU1-1026-SM-4YCEQ \ tissue=spleen autolysisScore=0 rnaIntegrity=7.2 batch=BP-43308 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=09/09/2013 track gtexRnaSignalSpleenSRR1396765 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1396765.hg19.bigWig shortLabel spleen M U3ZH longLabel GTEx RNA signal from male Spleen (GTEX-U3ZH-0126-SM-4DXUK) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-U3ZH age=30 sex=M hardyScore=0 sample=GTEX-U3ZH-0126-SM-4DXUK \ tissue=spleen autolysisScore=1 rnaIntegrity=6.2 batch=BP-25328 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=05/14/2012 track gtexRnaSignalSpleenSRR1401972 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1401972.hg19.bigWig shortLabel spleen M YB5E longLabel GTEx RNA signal from male Spleen (GTEX-YB5E-0426-SM-5IFHR) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-YB5E age=40 sex=M hardyScore=0 sample=GTEX-YB5E-0426-SM-5IFHR \ tissue=spleen autolysisScore=1 rnaIntegrity=7.6 batch=BP-45247 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/29/2013 track gtexRnaSignalSpleenSRR1402109 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1402109.hg19.bigWig shortLabel spleen M 11LCK longLabel GTEx RNA signal from male Spleen (GTEX-11LCK-0126-SM-5A5M5) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-11LCK age=30 sex=M hardyScore=0 sample=GTEX-11LCK-0126-SM-5A5M5 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.5 batch=BP-44512 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/10/2013 track gtexRnaSignalSpleenSRR1409677 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1409677.hg19.bigWig shortLabel spleen M 12WSN longLabel GTEx RNA signal from male Spleen (GTEX-12WSN-0126-SM-5DUX5) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-12WSN age=40 sex=M hardyScore=0 sample=GTEX-12WSN-0126-SM-5DUX5 \ tissue=spleen autolysisScore=0 rnaIntegrity=6.8 batch=BP-44437 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/08/2013 track gtexRnaSignalSpleenSRR1417566 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1417566.hg19.bigWig shortLabel spleen M ZLFU longLabel GTEx RNA signal from male Spleen (GTEX-ZLFU-0526-SM-4WWBN) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-ZLFU age=40 sex=M hardyScore=0 sample=GTEX-ZLFU-0526-SM-4WWBN \ tissue=spleen autolysisScore=1 rnaIntegrity=6.8 batch=BP-42826 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=08/28/2013 track gtexRnaSignalSpleenSRR1429287 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1429287.hg19.bigWig shortLabel spleen M 13S86 longLabel GTEx RNA signal from male Spleen (GTEX-13S86-0126-SM-5S2PI) subGroups sex=M age=a40 color 227,184,136 metadata donor=GTEX-13S86 age=40 sex=M hardyScore=0 sample=GTEX-13S86-0126-SM-5S2PI \ tissue=spleen autolysisScore=1 rnaIntegrity=6.9 batch=BP-48647 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=01/24/2014 track gtexRnaSignalSpleenSRR1499503 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1499503.hg19.bigWig shortLabel spleen M 1399R longLabel GTEx RNA signal from male Spleen (GTEX-1399R-0226-SM-5IJGG) subGroups sex=M age=a30 color 227,184,136 metadata donor=GTEX-1399R age=30 sex=M hardyScore=0 sample=GTEX-1399R-0226-SM-5IJGG \ tissue=spleen autolysisScore=1 rnaIntegrity=7.3 batch=BP-45485 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=11/05/2013 track gtexRnaSignalSpleenSRR2135309 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR2135309.hg19.bigWig shortLabel spleen M WFON longLabel GTEx RNA signal from male Spleen (GTEX-WFON-0126-SM-5CHTF_rep1) subGroups sex=M age=a40 color 227,184,136 track gtexRnaSignalSpleenSRR1069303 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1069303.hg19.bigWig shortLabel spleen M XPVG longLabel GTEx RNA signal from male Spleen (GTEX-XPVG-0626-SM-4B65B) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-XPVG age=50 sex=M hardyScore=0 sample=GTEX-XPVG-0626-SM-4B65B \ tissue=spleen autolysisScore=1 rnaIntegrity=8.8 batch=BP-33777 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/30/2012 track gtexRnaSignalSpleenSRR1069400 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1069400.hg19.bigWig shortLabel spleen M XGQ4 longLabel GTEx RNA signal from male Spleen (GTEX-XGQ4-0126-SM-4AT4H) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-XGQ4 age=50 sex=M hardyScore=0 sample=GTEX-XGQ4-0126-SM-4AT4H \ tissue=spleen autolysisScore=1 rnaIntegrity=6.4 batch=BP-32102 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=10/12/2012 track gtexRnaSignalSpleenSRR1080600 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1080600.hg19.bigWig shortLabel spleen M XXEK longLabel GTEx RNA signal from male Spleen (GTEX-XXEK-0126-SM-4BRVU) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-XXEK age=50 sex=M hardyScore=0 sample=GTEX-XXEK-0126-SM-4BRVU \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-34430 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/17/2012 track gtexRnaSignalSpleenSRR1082447 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1082447.hg19.bigWig shortLabel spleen M QDVN longLabel GTEx RNA signal from male Spleen (GTEX-QDVN-0526-SM-48TZ4) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-QDVN age=50 sex=M hardyScore=0 sample=GTEX-QDVN-0526-SM-48TZ4 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.7 batch=BP-20293 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=11/22/2011 track gtexRnaSignalSpleenSRR1091404 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1091404.hg19.bigWig shortLabel spleen M OIZH longLabel GTEx RNA signal from male Spleen (GTEX-OIZH-0926-SM-48TBR) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-OIZH age=50 sex=M hardyScore=0 sample=GTEX-OIZH-0926-SM-48TBR \ tissue=spleen autolysisScore=2 rnaIntegrity=6.1 batch=BP-18147 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=08/10/2011 track gtexRnaSignalSpleenSRR1097417 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1097417.hg19.bigWig shortLabel spleen M XQ8I longLabel GTEx RNA signal from male Spleen (GTEX-XQ8I-1726-SM-4BOQB) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-XQ8I age=50 sex=M hardyScore=0 sample=GTEX-XQ8I-1726-SM-4BOQB \ tissue=spleen autolysisScore=1 rnaIntegrity=6 batch=BP-34031 center=C1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/07/2012 track gtexRnaSignalSpleenSRR1326225 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1326225.hg19.bigWig shortLabel spleen M QV44 longLabel GTEx RNA signal from male Spleen (GTEX-QV44-0126-SM-4R1KH) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-QV44 age=50 sex=M hardyScore=0 sample=GTEX-QV44-0126-SM-4R1KH \ tissue=spleen autolysisScore=1 rnaIntegrity=7.4 batch=BP-20865 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/15/2011 track gtexRnaSignalSpleenSRR1328339 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1328339.hg19.bigWig shortLabel spleen M 117YX longLabel GTEx RNA signal from male Spleen (GTEX-117YX-2126-SM-5GIEL) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-117YX age=50 sex=M hardyScore=0 sample=GTEX-117YX-2126-SM-5GIEL \ tissue=spleen autolysisScore=1 rnaIntegrity=6.5 batch=BP-44261 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/03/2013 track gtexRnaSignalSpleenSRR1334200 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1334200.hg19.bigWig shortLabel spleen M ZTTD longLabel GTEx RNA signal from male Spleen (GTEX-ZTTD-1726-SM-57WEL) subGroups sex=M age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1345782 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1345782.hg19.bigWig shortLabel spleen M X4LF longLabel GTEx RNA signal from male Spleen (GTEX-X4LF-0226-SM-4QAS8) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-X4LF age=50 sex=M hardyScore=0 sample=GTEX-X4LF-0226-SM-4QAS8 \ tissue=spleen autolysisScore=1 rnaIntegrity=6 batch=BP-30712 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=09/06/2012 track gtexRnaSignalSpleenSRR1352639 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1352639.hg19.bigWig shortLabel spleen M 13111 longLabel GTEx RNA signal from male Spleen (GTEX-13111-0126-SM-5EGHO) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-13111 age=50 sex=M hardyScore=0 sample=GTEX-13111-0126-SM-5EGHO \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-44901 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/22/2013 track gtexRnaSignalSpleenSRR1359238 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1359238.hg19.bigWig shortLabel spleen M 144GN longLabel GTEx RNA signal from male Spleen (GTEX-144GN-2126-SM-5O99D) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-144GN age=50 sex=M hardyScore=0 sample=GTEX-144GN-2126-SM-5O99D \ tissue=spleen autolysisScore=1 rnaIntegrity=6.7 batch=BP-47675 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/19/2013 track gtexRnaSignalSpleenSRR1367896 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1367896.hg19.bigWig shortLabel spleen M WYJK longLabel GTEx RNA signal from male Spleen (GTEX-WYJK-0726-SM-4ONC9) subGroups sex=M age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1370495 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1370495.hg19.bigWig shortLabel spleen M WHWD longLabel GTEx RNA signal from male Spleen (GTEX-WHWD-0126-SM-4OORS) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-WHWD age=50 sex=M hardyScore=0 sample=GTEX-WHWD-0126-SM-4OORS \ tissue=spleen autolysisScore=1 rnaIntegrity=7.5 batch=BP-27512 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=07/17/2012 track gtexRnaSignalSpleenSRR1373879 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1373879.hg19.bigWig shortLabel spleen M Y3I4 longLabel GTEx RNA signal from male Spleen (GTEX-Y3I4-0126-SM-4TT26) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-Y3I4 age=50 sex=M hardyScore=0 sample=GTEX-Y3I4-0126-SM-4TT26 \ tissue=spleen autolysisScore=1 rnaIntegrity=6.9 batch=BP-35758 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=02/04/2013 track gtexRnaSignalSpleenSRR1391961 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1391961.hg19.bigWig shortLabel spleen M X585 longLabel GTEx RNA signal from male Spleen (GTEX-X585-1826-SM-4QAS3) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-X585 age=50 sex=M hardyScore=4 sample=GTEX-X585-1826-SM-4QAS3 \ tissue=spleen autolysisScore=2 rnaIntegrity=5.7 batch=BP-31298 center=C1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=09/19/2012 track gtexRnaSignalSpleenSRR1401933 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1401933.hg19.bigWig shortLabel spleen M 111CU longLabel GTEx RNA signal from male Spleen (GTEX-111CU-0426-SM-5GZY1) subGroups sex=M age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1418145 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1418145.hg19.bigWig shortLabel spleen M QMRM longLabel GTEx RNA signal from male Spleen (GTEX-QMRM-0226-SM-4R1K7) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-QMRM age=50 sex=M hardyScore=0 sample=GTEX-QMRM-0226-SM-4R1K7 \ tissue=spleen autolysisScore=1 rnaIntegrity=7.2 batch=BP-20785 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=12/13/2011 track gtexRnaSignalSpleenSRR1443483 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1443483.hg19.bigWig shortLabel spleen M ZDYS longLabel GTEx RNA signal from male Spleen (GTEX-ZDYS-1026-SM-4WKHC) subGroups sex=M age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1447850 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1447850.hg19.bigWig shortLabel spleen M 139YR longLabel GTEx RNA signal from male Spleen (GTEX-139YR-0426-SM-5IFFV) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-139YR age=50 sex=M hardyScore=0 sample=GTEX-139YR-0426-SM-5IFFV \ tissue=spleen autolysisScore=1 rnaIntegrity=7.8 batch=BP-46925 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=12/10/2013 track gtexRnaSignalSpleenSRR1453549 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1453549.hg19.bigWig shortLabel spleen M 14DAR longLabel GTEx RNA signal from male Spleen (GTEX-14DAR-0326-SM-5S2PS) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-14DAR age=50 sex=M hardyScore=0 sample=GTEX-14DAR-0326-SM-5S2PS \ tissue=spleen autolysisScore=1 rnaIntegrity=7.1 batch=BP-48647 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=01/24/2014 track gtexRnaSignalSpleenSRR1454177 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1454177.hg19.bigWig shortLabel spleen M WY7C longLabel GTEx RNA signal from male Spleen (GTEX-WY7C-0126-SM-4ONCO) subGroups sex=M age=a50 color 227,184,136 track gtexRnaSignalSpleenSRR1477057 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1477057.hg19.bigWig shortLabel spleen M ZAB5 longLabel GTEx RNA signal from male Spleen (GTEX-ZAB5-0526-SM-5CVMU) subGroups sex=M age=a50 color 227,184,136 metadata donor=GTEX-ZAB5 age=50 sex=M hardyScore=0 sample=GTEX-ZAB5-0526-SM-5CVMU \ tissue=spleen autolysisScore=0 rnaIntegrity=7.4 batch=BP-45390 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=11/01/2013 track gtexRnaSignalSpleenSRR1072456 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1072456.hg19.bigWig shortLabel spleen M OOBJ longLabel GTEx RNA signal from male Spleen (GTEX-OOBJ-0926-SM-48TDO) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-OOBJ age=60 sex=M hardyScore=0 sample=GTEX-OOBJ-0926-SM-48TDO \ tissue=spleen autolysisScore=2 rnaIntegrity=7.5 batch=BP-18253 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=08/16/2011 track gtexRnaSignalSpleenSRR1073507 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1073507.hg19.bigWig shortLabel spleen M S4Z8 longLabel GTEx RNA signal from male Spleen (GTEX-S4Z8-0226-SM-4AD5K) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-S4Z8 age=60 sex=M hardyScore=0 sample=GTEX-S4Z8-0226-SM-4AD5K \ tissue=spleen autolysisScore=1 rnaIntegrity=7.4 batch=BP-23077 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=03/13/2012 track gtexRnaSignalSpleenSRR1079782 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1079782.hg19.bigWig shortLabel spleen M VJYA longLabel GTEx RNA signal from male Spleen (GTEX-VJYA-0126-SM-4KL1P) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-VJYA age=60 sex=M hardyScore=0 sample=GTEX-VJYA-0126-SM-4KL1P \ tissue=spleen autolysisScore=1 rnaIntegrity=7.5 batch=BP-26874 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=07/02/2012 track gtexRnaSignalSpleenSRR1085039 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1085039.hg19.bigWig shortLabel spleen M P4QS longLabel GTEx RNA signal from male Spleen (GTEX-P4QS-0926-SM-48TBS) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-P4QS age=60 sex=M hardyScore=0 sample=GTEX-P4QS-0926-SM-48TBS \ tissue=spleen autolysisScore=1 rnaIntegrity=6.7 batch=BP-18727 center=B1 \ isolationMethod=RNA_isolation_PAXgene_Tissue_miRNA isolationDate=09/08/2011 track gtexRnaSignalSpleenSRR1323788 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1323788.hg19.bigWig shortLabel spleen M 12BJ1 longLabel GTEx RNA signal from male Spleen (GTEX-12BJ1-0726-SM-5EGGF) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-12BJ1 age=60 sex=M hardyScore=0 sample=GTEX-12BJ1-0726-SM-5EGGF \ tissue=spleen autolysisScore=1 rnaIntegrity=6.3 batch=BP-44399 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=10/07/2013 track gtexRnaSignalSpleenSRR1334461 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1334461.hg19.bigWig shortLabel spleen M 111FC longLabel GTEx RNA signal from male Spleen (GTEX-111FC-1326-SM-5N9D9) subGroups sex=M age=a60 color 227,184,136 track gtexRnaSignalSpleenSRR1377756 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1377756.hg19.bigWig shortLabel spleen M 132QS longLabel GTEx RNA signal from male Spleen (GTEX-132QS-0226-SM-5IFFZ) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-132QS age=60 sex=M hardyScore=0 sample=GTEX-132QS-0226-SM-5IFFZ \ tissue=spleen autolysisScore=1 rnaIntegrity=6.3 batch=BP-45499 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=11/05/2013 track gtexRnaSignalSpleenSRR1432500 parent gtexRnaSignalSpleen off type bigWig bigDataUrl spleen/gtexRnaSignalSRR1432500.hg19.bigWig shortLabel spleen M ZDTT longLabel GTEx RNA signal from male Spleen (GTEX-ZDTT-1026-SM-5KM19) subGroups sex=M age=a60 color 227,184,136 metadata donor=GTEX-ZDTT age=60 sex=M hardyScore=0 sample=GTEX-ZDTT-1026-SM-5KM19 \ tissue=spleen autolysisScore=0 rnaIntegrity=5.9 batch=BP-45485 center=B1 \ isolationMethod=RNA_Extraction_from_Paxgene-derived_Lysate_Plate_Based isolationDate=11/05/2013
{'repo_name': 'ucscGenomeBrowser/kent', 'stars': '114', 'repo_language': 'C', 'file_name': 'wgEncodeRbpSuper.html', 'mime_type': 'text/html', 'hash': -6545534286293523459, 'source_dataset': 'data'}
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.samza.container.disk; import org.junit.Test; import java.util.Arrays; import java.util.Collections; import java.util.List; import static junit.framework.Assert.assertEquals; public class TestWatermarkDiskQuotaPolicy { @Test public void testNoEntries() { WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(Collections.<WatermarkDiskQuotaPolicy.Entry>emptyList()); assertEquals(1.0, policy.apply(1.0)); assertEquals(1.0, policy.apply(0.5)); assertEquals(1.0, policy.apply(0.0)); } @Test public void testOneEntryUntriggered() { double workFactor = 0.5f; List<WatermarkDiskQuotaPolicy.Entry> entries = Collections.singletonList(new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(1.0, policy.apply(1.0)); assertEquals(1.0, policy.apply(0.75)); assertEquals(1.0, policy.apply(0.5)); } @Test public void testOneEntryTriggered() { double workFactor = 0.5f; List<WatermarkDiskQuotaPolicy.Entry> entries = Collections.singletonList(new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(workFactor, policy.apply(0.25)); } @Test public void testTwoEntriesTriggered() { double workFactor1 = 0.5f; double workFactor2 = 0.25f; List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor1), new WatermarkDiskQuotaPolicy.Entry(0.2, 0.4, workFactor2)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(1.0, policy.apply(0.5)); assertEquals(workFactor1, policy.apply(0.4)); assertEquals(workFactor2, policy.apply(0.1)); } @Test public void testTwoEntriesTriggeredSkipFirst() { double workFactor1 = 0.5f; double workFactor2 = 0.25f; List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor1), new WatermarkDiskQuotaPolicy.Entry(0.2, 0.4, workFactor2)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(workFactor2, policy.apply(0.1)); } @Test public void testTwoEntriesReversedOrder() { // Results should be the same regardless of order as we sort policies at construction time. double workFactor1 = 0.5f; double workFactor2 = 0.25f; List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.2, 0.4, workFactor2), new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor1)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(workFactor2, policy.apply(0.1)); } @Test public void testTriggerEntriesAndRecover() { double workFactor1 = 0.5f; double workFactor2 = 0.25f; List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, workFactor1), new WatermarkDiskQuotaPolicy.Entry(0.2, 0.4, workFactor2)); WatermarkDiskQuotaPolicy policy = new WatermarkDiskQuotaPolicy(entries); assertEquals(workFactor2, policy.apply(0.1)); assertEquals(workFactor1, policy.apply(0.4)); assertEquals(1.0, policy.apply(1.0)); } @Test(expected = IllegalArgumentException.class) public void testWorkFactorTooHigh() { new WatermarkDiskQuotaPolicy( Collections.singletonList(new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, 1.5))); } @Test(expected = IllegalArgumentException.class) public void testWorkFactorTooLow() { new WatermarkDiskQuotaPolicy( Collections.singletonList(new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, -1.0))); } @Test(expected = IllegalArgumentException.class) public void testRaiseWorkFactorWithLowerThreshold() { List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, 0.5), new WatermarkDiskQuotaPolicy.Entry(0.2, 0.4, 0.75)); new WatermarkDiskQuotaPolicy(entries); } @Test(expected = IllegalArgumentException.class) public void testDuplicatedRange() { List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, 0.5), new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, 0.75)); new WatermarkDiskQuotaPolicy(entries); } @Test(expected = IllegalArgumentException.class) public void testFullyOverlappedRange1() { List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 1.0, 0.5), new WatermarkDiskQuotaPolicy.Entry(0.25, 1.0, 0.75)); new WatermarkDiskQuotaPolicy(entries); } @Test(expected = IllegalArgumentException.class) public void testFullyOverlappedRange2() { List<WatermarkDiskQuotaPolicy.Entry> entries = Arrays.asList( new WatermarkDiskQuotaPolicy.Entry(0.5, 0.75, 0.75), new WatermarkDiskQuotaPolicy.Entry(0.25, 1.0, 0.5)); new WatermarkDiskQuotaPolicy(entries); } }
{'repo_name': 'apache/samza', 'stars': '633', 'repo_language': 'Java', 'file_name': 'TestKinesisInputDescriptor.java', 'mime_type': 'text/x-java', 'hash': -5316262962151291606, 'source_dataset': 'data'}
.page-content { padding: 2rem 4rem; h1 { text-align: center; } section { margin-bottom: 2.5rem; h2 { margin-bottom: 0.5rem; } + section { border-top: 1px solid #cdd1d4; padding-top: 1rem; } li { margin-bottom: 0.5rem; } } }
{'repo_name': 'carbon-design-system/carbon-components-react', 'stars': '1032', 'repo_language': 'JavaScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -6970228203476952113, 'source_dataset': 'data'}
/* Copyright 2017 Bitnami. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import Home from './Home' export default Home
{'repo_name': 'kubeless/kubeless-ui', 'stars': '371', 'repo_language': 'JavaScript', 'file_name': 'main.js', 'mime_type': 'text/plain', 'hash': 1474376431437352643, 'source_dataset': 'data'}
fileFormatVersion: 2 guid: 213abbe4462fc3045a3d7aa8d3d0e2f8 TextureImporter: fileIDToRecycleName: {} externalObjects: {} serializedVersion: 7 mipmaps: mipMapMode: 0 enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 mipMapsPreserveCoverage: 0 alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 seamlessCubemap: 0 textureFormat: 1 maxTextureSize: 2048 textureSettings: serializedVersion: 2 filterMode: -1 aniso: -1 mipBias: -100 wrapU: -1 wrapV: -1 wrapW: -1 nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 singleChannelComponent: 0 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 platformSettings: - serializedVersion: 2 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] bones: [] spriteID: vertices: [] indices: edges: [] weights: [] spritePackingTag: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant:
{'repo_name': 'Sandrem/FlyCasual', 'stars': '322', 'repo_language': 'C#', 'file_name': 'PackageManagerSettings.asset', 'mime_type': 'text/plain', 'hash': -8565388086474895936, 'source_dataset': 'data'}
package client // import "github.com/docker/docker/client" import ( "crypto/tls" "net/http" ) // resolveTLSConfig attempts to resolve the TLS configuration from the // RoundTripper. func resolveTLSConfig(transport http.RoundTripper) *tls.Config { switch tr := transport.(type) { case *http.Transport: return tr.TLSClientConfig default: return nil } }
{'repo_name': 'GoogleContainerTools/skaffold', 'stars': '9939', 'repo_language': 'Go', 'file_name': 'skaffold.pb.gw.go', 'mime_type': 'text/plain', 'hash': 3174016839669109814, 'source_dataset': 'data'}
package org.scalaide.core package lexical import org.scalaide.ui.syntax._ import org.scalaide.ui.syntax.ScalaSyntaxClasses._ import testsetup.SDTTestUtils import org.junit.ComparisonFailure import org.junit.Test import scalariform.ScalaVersions import org.scalaide.core.internal.lexical.ScalaCodeTokenizerScalariformBased import org.scalaide.core.lexical.ScalaCodeTokenizer.Token class ScalaCodeScannerTest { /** * Tokenizes the complete content as a Scala source code snippet. * * There is a sequence returned containing tuples where each tuple value * represents a token. The first element is the `ScalaSyntaxClass` specifying * the the type of the token. The second element is the offset of the token * and the last element is its length. */ def tokenize(str: String): Seq[(ScalaSyntaxClass, Int, Int)] = tokenize(str, 0, str.length()) /** * Tokenizes the complete content as a Scala source code snippet. It is * possible to tokenize only a specific range, specified by its offset and * its length. * * There is a sequence returned containing tuples where each tuple value * represents a token. The first element is the `ScalaSyntaxClass` specifying * the the type of the token. The second element is the offset of the token * and the last element is its length. */ def tokenize(str: String, offset: Int, length: Int): Seq[(ScalaSyntaxClass, Int, Int)] = { val scanner = new ScalaCodeTokenizerScalariformBased(ScalaVersions.DEFAULT) val token = scanner.tokenize(str.slice(offset, length), offset) map { case Token(start, length, syntaxClass) => (syntaxClass, start, length) } token.toList } implicit class Assert_===(actual: Seq[(ScalaSyntaxClass, Int, Int)]) { def ===(expected: Seq[(ScalaSyntaxClass, Int, Int)]): Unit = { val a = actual map { case (syntaxClass, start, length) => (syntaxClass.baseName, start, length) } val e = expected map { case (syntaxClass, start, length) => (syntaxClass.baseName, start, length) } if (a != e) throw new ComparisonFailure("", e.toString, a.toString) } } @Test def brackets(): Unit = { "(){}[]" map (x => tokenize(x.toString)) foreach { _ === Seq((BRACKET, 0, 1)) } } @Test def keywords(): Unit = { SDTTestUtils.testWithCompiler("lexical") { compiler => def isAlpha(s: String) = s(0) >= 'a' && s(0) <= 'z' val keywords = compiler.nme.keywords map (_.toString) filter isAlpha /* * Discard some keywords: * - macro - only a keyword in special places * - return - needs special handling, treated in its own test case * - then - not yet a final keyword in 2.10 */ val testableKeywords = keywords filterNot Set("macro", "return", "then") testableKeywords map (x => tokenize(x) -> x) foreach { case (token, x) => token === Seq((KEYWORD, 0, x.length())) } } } @Test def correct_offset(): Unit = { val str = "return" val offset = 3 // arbitrary non-zero number val scanner = new ScalaCodeTokenizerScalariformBased(ScalaVersions.DEFAULT) val token = scanner.tokenize(str, offset) map { case Token(start, length, syntaxClass) => (syntaxClass, start, length) } token.toList == Seq((RETURN, 3, 6)) } @Test def return_keyword(): Unit = { tokenize("return") === Seq((RETURN, 0, 6)) } @Test def single_macro_keyword_in_source_should_not_produce_exception(): Unit = { tokenize("macro") === Seq((DEFAULT, 0, 5)) } @Test def operator_keywords(): Unit = { val xs = "_ : = => <- <: <% >: ⇒ ← . , ; # @" xs split " " map (x => tokenize(x) -> x) foreach { case (token, x) => token === Seq((OPERATOR, 0, x.length())) } } @Test def ascii_operators(): Unit = { val os = """!%&*+-<=>?\^|~/""" map (_.toString) os map tokenize foreach { _ === Seq((OPERATOR, 0, 1)) } } @Test def number_literals(): Unit = { val xs = "1 1.0 1E1 1E-1 1e1 1D 1d 1F 1f 1L 1l 0x1 0X1 01" split " " xs map (x => tokenize(x) -> x) foreach { case (token, x) => token === Seq((NUMBER_LITERAL, 0, x.length())) } } @Test def symbol_literal(): Unit = { tokenize("'symbol") === Seq((SYMBOL, 0, 7)) } @Test def requires_is_no_keyword(): Unit = { tokenize("requires") === Seq((DEFAULT, 0, 8)) } }
{'repo_name': 'scala-ide/scala-ide', 'stars': '495', 'repo_language': 'Scala', 'file_name': 'pom.xml', 'mime_type': 'text/xml', 'hash': -3962435634310860862, 'source_dataset': 'data'}
{ "OnCreated/Cursor":{ "type":"intarray", "value":[8,9] }, "OnCreated/IsExpr":{ "type":"bool", "value":false }, "OnCreated/IsPython":{ "type":"bool", "value":true }, "OnCreated/IsScript":{ "type":"bool", "value":true }, "OnCreated/Source":{ "type":"string", "value":"" }, "PythonModule/Cursor":{ "type":"intarray", "value":[1,1] }, "PythonModule/IsExpr":{ "type":"bool", "value":false }, "PythonModule/IsPython":{ "type":"bool", "value":true }, "PythonModule/IsScript":{ "type":"bool", "value":true }, "PythonModule/Source":{ "type":"string", "value":"" } }
{'repo_name': 'sideeffects/GameDevelopmentToolset', 'stars': '768', 'repo_language': 'Python', 'file_name': 'VAT_utilities.h', 'mime_type': 'text/plain', 'hash': 5845949547320913740, 'source_dataset': 'data'}
package generate import ( "context" "fmt" "go/ast" "go/build" "go/parser" "go/token" "io/ioutil" "log" "os" "os/exec" "path" "path/filepath" "reflect" "strings" "github.com/d4l3k/go-pry/pry" "github.com/pkg/errors" ) type Generator struct { contexts []pryContext debug bool Build build.Context } func NewGenerator(debug bool) *Generator { return &Generator{ debug: debug, Build: build.Default, } } // Debug prints debug statements if debug is true. func (g Generator) Debug(templ string, k ...interface{}) { if g.debug { log.Printf(templ, k...) } } // ExecuteGoCmd runs the 'go' command with certain parameters. func (g *Generator) ExecuteGoCmd(ctx context.Context, args []string, env []string) error { binary, err := exec.LookPath("go") if err != nil { return err } cmd := exec.CommandContext(ctx, binary, args...) cmd.Env = append(os.Environ(), env...) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Stdin = os.Stdin return cmd.Run() } // InjectPry walks the scope and replaces pry.Pry with pry.Apply(pry.Scope{...}). func (g *Generator) InjectPry(filePath string) (string, error) { g.Debug("Prying into %s\n", filePath) filePath, err := filepath.Abs(filePath) if err != nil { return "", nil } g.contexts = make([]pryContext, 0) fset := token.NewFileSet() // positions are relative to fset // Parse the file containing this very example // but stop after processing the imports. f, err := parser.ParseFile(fset, filePath, nil, 0) if err != nil { return "", err } packagePairs := []string{} for _, imp := range f.Imports { importStr := imp.Path.Value[1 : len(imp.Path.Value)-1] if importStr != "../pry" { dir := filepath.Dir(filePath) pkg, err := g.Build.Import(importStr, dir, build.AllowBinary) if err != nil { return "", err } importName := pkg.Name if imp.Name != nil { importName = imp.Name.Name } pkgAst, err := parser.ParseDir(fset, pkg.Dir, nil, parser.ParseComments) if err != nil { return "", err } pair := "\"" + importName + "\": pry.Package{Name: \"" + pkg.Name + "\", Functions: map[string]interface{}{" added := make(map[string]bool) for _, nPkg := range pkgAst { exports, err := g.GetExports(importName, nPkg, added) if err != nil { return "", err } pair += exports } pair += "}}, " packagePairs = append(packagePairs, pair) } } var funcs []*ast.FuncDecl var vars []string // Print the imports from the file's AST. for k, v := range f.Scope.Objects { switch decl := v.Decl.(type) { case *ast.FuncDecl: funcs = append(funcs, decl) case *ast.ValueSpec: vars = append(vars, k) } } for _, f := range funcs { vars = append(vars, f.Name.Name) if f.Recv != nil { vars = g.extractFields(vars, f.Recv.List) } if f.Type != nil { if f.Type.Params != nil { vars = g.extractFields(vars, f.Type.Params.List) } if f.Type.Results != nil { vars = g.extractFields(vars, f.Type.Results.List) } } vars = g.extractVariables(vars, f.Body.List) } fileTextBytes, err := ioutil.ReadFile(filePath) if err != nil { return "", nil } fileText := (string)(fileTextBytes) offset := 0 if len(g.contexts) == 0 { return "", nil } g.Debug(" :: Found %d pry statements.\n", len(g.contexts)) for _, context := range g.contexts { filteredVars := filterVars(context.Vars) obj := "&pry.Scope{Vals:map[string]interface{}{ " for _, v := range filteredVars { obj += "\"" + v + "\": " + v + ", " } obj += strings.Join(packagePairs, "") obj += "}}" text := "pry.Apply(" + obj + ")" fileText = fileText[0:context.Start+offset] + text + fileText[context.End+offset:] offset = len(text) - (context.End - context.Start) } newPath := filepath.Dir(filePath) + "/." + filepath.Base(filePath) + "pry" err = os.Rename(filePath, newPath) if err != nil { return "", err } ioutil.WriteFile(filePath, ([]byte)(fileText), 0644) return filePath, nil } // GetExports returns a string of gocode that represents the exports (constants/functions) of an ast.Package. func (g *Generator) GetExports(importName string, pkg *ast.Package, added map[string]bool) (string, error) { if pkg.Name == "main" { return "", nil } vars := "" for name, file := range pkg.Files { if strings.HasSuffix(name, "_test.go") { continue } match, err := g.Build.MatchFile(path.Dir(name), path.Base(name)) if err != nil { return "", err } if !match { continue } // Print the imports from the file's AST. scope := pry.NewScope() for k, obj := range file.Scope.Objects { if added[k] { continue } added[k] = true firstLetter := k[0:1] if firstLetter == strings.ToUpper(firstLetter) && firstLetter != "_" { isType := false switch stmt := obj.Decl.(type) { /* case *ast.ValueSpec: if len(stmt.Values) > 0 { out, err := pry.InterpretExpr(scope, stmt.Values[0]) if err != nil { fmt.Println("ERR", err) //continue } else { scope[obj.Name] = out } } */ case *ast.TypeSpec: switch typ := stmt.Type.(type) { case *ast.StructType: isType = true scope.Set(obj.Name, typ) default: out, err := scope.Interpret(stmt.Type) if err != nil { g.Debug("TypeSpec ERR %s\n", err.Error()) //continue } else { scope.Set(obj.Name, out) isType = true } } } if obj.Kind != ast.Typ || isType { path := importName + "." + k vars += "\"" + k + "\": " if isType { out, _ := scope.Get(obj.Name) switch v := out.(type) { case reflect.Type: zero := reflect.Zero(v).Interface() val := fmt.Sprintf("%#v", zero) if zero == nil { val = "nil" } vars += fmt.Sprintf("pry.Type(%s(%s))", path, val) case *ast.StructType: vars += fmt.Sprintf("pry.Type(%s{})", path) default: log.Fatalf("got unknown type: %T %+v", out, out) } // TODO Fix hack for very large constants } else if path == "math.MaxUint64" || path == "crc64.ISO" || path == "crc64.ECMA" { vars += fmt.Sprintf("uint64(%s)", path) } else { vars += path } vars += "," if g.debug { vars += "\n" } } } } } return vars, nil } // GenerateFile generates a injected file. func (g *Generator) GenerateFile(imports []string, extraStatements, path string) error { file := "package main\nimport (\n\t\"github.com/d4l3k/go-pry/pry\"\n\n" for _, imp := range imports { if len(imp) == 0 { continue } file += fmt.Sprintf("\t%#v\n", imp) } file += ")\nfunc main() {\n\t" + extraStatements + "\n\tpry.Pry()\n}\n" if err := ioutil.WriteFile(path, []byte(file), 0644); err != nil { return err } _, err := g.InjectPry(path) return err } // GenerateAndExecuteFile generates and executes a temp file with the given imports func (g *Generator) GenerateAndExecuteFile(ctx context.Context, imports []string, extraStatements string) error { dir, err := ioutil.TempDir("", "pry") if err != nil { return err } defer func() { if err := os.RemoveAll(dir); err != nil { log.Fatal(err) } }() newPath := dir + "/main.go" if err := g.GenerateFile(imports, extraStatements, newPath); err != nil { return err } if err := g.ExecuteGoCmd(ctx, []string{"run", newPath}, nil); err != nil { return err } return nil } // RevertPry reverts the changes made by InjectPry. func (g *Generator) RevertPry(modifiedFiles []string) error { fmt.Println("Reverting files") for _, file := range modifiedFiles { newPath := filepath.Dir(file) + "/." + filepath.Base(file) + "pry" if _, err := os.Stat(newPath); os.IsNotExist(err) { return errors.Errorf("no such file or directory: %s", newPath) } err := os.Remove(file) if err != nil { return err } err = os.Rename(newPath, file) if err != nil { return err } } return nil } func filterVars(vars []string) (fVars []string) { for _, v := range vars { if v != "_" { fVars = append(fVars, v) } } return } func (g *Generator) extractVariables(vars []string, l []ast.Stmt) []string { for _, s := range l { vars = g.handleStatement(vars, s) } return vars } func (g *Generator) extractFields(vars []string, l []*ast.Field) []string { for _, s := range l { vars = g.handleIdents(vars, s.Names) } return vars } func (g *Generator) handleStatement(vars []string, s ast.Stmt) []string { switch stmt := s.(type) { case *ast.ExprStmt: vars = g.handleExpr(vars, stmt.X) case *ast.AssignStmt: lhsStatements := (*stmt).Lhs for _, v := range lhsStatements { vars = g.handleExpr(vars, v) } case *ast.GoStmt: g.handleExpr(vars, stmt.Call) case *ast.IfStmt: g.handleIfStmt(vars, stmt) case *ast.DeclStmt: decl := stmt.Decl.(*ast.GenDecl) if decl.Tok == token.VAR { for _, spec := range decl.Specs { valSpec := spec.(*ast.ValueSpec) vars = g.handleIdents(vars, valSpec.Names) } } case *ast.BlockStmt: vars = g.handleBlockStmt(vars, stmt) case *ast.RangeStmt: g.handleRangeStmt(vars, stmt) case *ast.ForStmt: vars = g.handleForStmt(vars, stmt) default: g.Debug("Unknown %T\n", stmt) } return vars } func (g *Generator) handleIfStmt(vars []string, stmt *ast.IfStmt) []string { vars = g.handleStatement(vars, stmt.Init) vars = g.handleStatement(vars, stmt.Body) return vars } func (g *Generator) handleRangeStmt(vars []string, stmt *ast.RangeStmt) []string { vars = g.handleExpr(vars, stmt.Key) vars = g.handleExpr(vars, stmt.Value) vars = g.handleStatement(vars, stmt.Body) return vars } func (g *Generator) handleForStmt(vars []string, stmt *ast.ForStmt) []string { vars = g.handleStatement(vars, stmt.Init) vars = g.handleStatement(vars, stmt.Body) return vars } func (g *Generator) handleBlockStmt(vars []string, stmt *ast.BlockStmt) []string { vars = g.extractVariables(vars, stmt.List) return vars } func (g *Generator) handleIdents(vars []string, idents []*ast.Ident) []string { for _, i := range idents { vars = append(vars, i.Name) } return vars } func (g *Generator) handleExpr(vars []string, v ast.Expr) []string { switch expr := v.(type) { case *ast.Ident: varMap := make(map[string]bool) for _, v := range vars { varMap[v] = true } if !varMap[expr.Name] { vars = append(vars, expr.Name) } case *ast.CallExpr: switch fun := expr.Fun.(type) { case *ast.SelectorExpr: funcName := fun.Sel.Name if funcName == "Pry" || funcName == "Apply" { g.contexts = append(g.contexts, pryContext{(int)(expr.Pos() - 1), (int)(expr.End() - 1), vars}) } //handleExpr(vars, fun.X) case *ast.FuncLit: g.handleExpr(vars, fun) default: g.Debug("Unknown function type %T\n", fun) } for _, arg := range expr.Args { g.handleExpr(vars, arg) } case *ast.FuncLit: if expr.Type.Params != nil { for _, param := range expr.Type.Params.List { for _, name := range param.Names { vars = g.handleExpr(vars, name) } } } if expr.Type.Results != nil { for _, param := range expr.Type.Results.List { for _, name := range param.Names { vars = g.handleExpr(vars, name) } } } g.handleStatement(vars, expr.Body) default: g.Debug("Unknown %T\n", expr) } return vars } type pryContext struct { Start, End int Vars []string }
{'repo_name': 'd4l3k/go-pry', 'stars': '2603', 'repo_language': 'Go', 'file_name': 'server.go', 'mime_type': 'text/x-c', 'hash': -3373167075365849092, 'source_dataset': 'data'}
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py import dsz import dsz.cmd import dsz.data import dsz.lp class Environment(dsz.data.Task): def __init__(self, cmd=None): dsz.data.Task.__init__(self, cmd) def _LoadData(self): try: self.TaskingInfo = Environment.TaskingInfo(dsz.cmd.data.Get('TaskingInfo', dsz.TYPE_OBJECT)[0]) except: self.TaskingInfo = None try: self.Environment = Environment.Environment(dsz.cmd.data.Get('Environment', dsz.TYPE_OBJECT)[0]) except: self.Environment = None return class TaskingInfo(dsz.data.DataBean): def __init__(self, obj): self.SearchMask = list() try: for x in dsz.cmd.data.ObjectGet(obj, 'SearchMask', dsz.TYPE_OBJECT): self.SearchMask.append(Environment.TaskingInfo.SearchMask(x)) except: pass try: self.Recursive = dsz.cmd.data.ObjectGet(obj, 'Recursive', dsz.TYPE_BOOL)[0] except: self.Recursive = None return class SearchMask(dsz.data.DataBean): def __init__(self, obj): try: self.value = dsz.cmd.data.ObjectGet(obj, 'value', dsz.TYPE_STRING)[0] except: self.value = None return class Environment(dsz.data.DataBean): def __init__(self, obj): try: self.Action = dsz.cmd.data.ObjectGet(obj, 'Action', dsz.TYPE_STRING)[0] except: self.Action = None self.Value = list() try: for x in dsz.cmd.data.ObjectGet(obj, 'Value', dsz.TYPE_OBJECT): self.Value.append(Environment.Environment.Value(x)) except: pass return class Value(dsz.data.DataBean): def __init__(self, obj): try: self.Value = dsz.cmd.data.ObjectGet(obj, 'Value', dsz.TYPE_STRING)[0] except: self.Value = None try: self.Name = dsz.cmd.data.ObjectGet(obj, 'Name', dsz.TYPE_STRING)[0] except: self.Name = None return dsz.data.RegisterCommand('Environment', Environment) ENVIRONMENT = Environment environment = Environment
{'repo_name': 'mdiazcl/fuzzbunch-debian', 'stars': '124', 'repo_language': 'Python', 'file_name': 'Eternalchampion-2.0.0.fb', 'mime_type': 'text/xml', 'hash': -7316799529326752544, 'source_dataset': 'data'}
To simplify installation process, you can deploy a container (~virtual machine) with all dependencies pre-installed. _tl;dr [dockerhub url](https://hub.docker.com/r/justheuristic/practical_rl/)_ ## Install Docker We recommend you to use either native docker (recommended for linux) or kitematic(recommended for windows). * Installing [kitematic](https://kitematic.com/), a simple interface to docker (all platforms) * Pure docker: Guide for [windows](https://docs.docker.com/docker-for-windows/), [linux](https://docs.docker.com/engine/installation/), or [macOS](https://docs.docker.com/docker-for-mac/). * If you want to use your GPU make sure you have [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) and [NVidia driver](https://www.nvidia.com/en-us/drivers/unix/) + [CUDA 10.2](https://developer.nvidia.com/cuda-downloads) installed Below are the instructions for both approaches. ## Kitematic Find dmittov/practical_rl in the search menu. Download and launch the container. Click on "web preview" screen in the top-right __or__ go to settings, ports and find at which port your jupyter is located, usually 32***. ## Native `docker run --rm -it -v /path/to/your/repo:/notebooks -p <local_port>:8888 dmittov/practical_rl:spring2020-cpu` For example, ```docker run --rm -it -v /home/myuser/Documents/practical_rl:/notebooks -p 8888:8888 dmittov/practical_rl:spring2020-cpu``` Then you can access your jupyter in a browser at `localhost:<local_port>/?token=<token_you_see_in_container_logs>`, e.g. `localhost:8888/?token=ad1a5a0aab43efb47a9a805388fcf508d0b5f84a16e4542b&token=ad1a5a0aab43efb47a9a805388fcf508d0b5f84a16e4542b` #### GPU `docker run --rm -it -v /path/to/your/repo:/notebooks -p <local_port>:8888 --gpus all dmittov/practical_rl:spring2020-cuda-10.2` ## Manual Build container `docker build -t practical_rl --build-arg device=cpu .` to build GPU version `docker build -t practical_rl --build-arg device=gpu .` Run it `$ docker run --rm -it -v <local_dir>:/notebooks -p <local_port>:8888 practical_rl` to run GPU version `$ docker run --rm -it -v <local_dir>:/notebooks -p <local_port>:8888 --gpus all practical_rl` examples: ```$ docker run --rm -it -v `pwd`:/notebooks -p 8888:8888 practical_rl``` Copy the token from console and run http://localhost:8888/?token=<token>
{'repo_name': 'yandexdataschool/Practical_RL', 'stars': '4029', 'repo_language': 'Jupyter Notebook', 'file_name': 'seminar_TRPO_theano.ipynb', 'mime_type': 'text/plain', 'hash': 1182266962784955163, 'source_dataset': 'data'}
/* Generated data (by gimp-mkenums) */ #include "config.h" #include <gio/gio.h> #include "libgimpbase/gimpbase.h" #include "text-enums.h" #include "gimp-intl.h" /* enumerations from "text-enums.h" */ GType gimp_text_box_mode_get_type (void) { static const GEnumValue values[] = { { GIMP_TEXT_BOX_DYNAMIC, "GIMP_TEXT_BOX_DYNAMIC", "dynamic" }, { GIMP_TEXT_BOX_FIXED, "GIMP_TEXT_BOX_FIXED", "fixed" }, { 0, NULL, NULL } }; static const GimpEnumDesc descs[] = { { GIMP_TEXT_BOX_DYNAMIC, NC_("text-box-mode", "Dynamic"), NULL }, { GIMP_TEXT_BOX_FIXED, NC_("text-box-mode", "Fixed"), NULL }, { 0, NULL, NULL } }; static GType type = 0; if (G_UNLIKELY (! type)) { type = g_enum_register_static ("GimpTextBoxMode", values); gimp_type_set_translation_context (type, "text-box-mode"); gimp_enum_set_value_descriptions (type, descs); } return type; } GType gimp_text_outline_get_type (void) { static const GEnumValue values[] = { { GIMP_TEXT_OUTLINE_NONE, "GIMP_TEXT_OUTLINE_NONE", "none" }, { GIMP_TEXT_OUTLINE_STROKE_ONLY, "GIMP_TEXT_OUTLINE_STROKE_ONLY", "stroke-only" }, { GIMP_TEXT_OUTLINE_STROKE_FILL, "GIMP_TEXT_OUTLINE_STROKE_FILL", "stroke-fill" }, { 0, NULL, NULL } }; static const GimpEnumDesc descs[] = { { GIMP_TEXT_OUTLINE_NONE, "GIMP_TEXT_OUTLINE_NONE", NULL }, { GIMP_TEXT_OUTLINE_STROKE_ONLY, "GIMP_TEXT_OUTLINE_STROKE_ONLY", NULL }, { GIMP_TEXT_OUTLINE_STROKE_FILL, "GIMP_TEXT_OUTLINE_STROKE_FILL", NULL }, { 0, NULL, NULL } }; static GType type = 0; if (G_UNLIKELY (! type)) { type = g_enum_register_static ("GimpTextOutline", values); gimp_type_set_translation_context (type, "text-outline"); gimp_enum_set_value_descriptions (type, descs); } return type; } /* Generated data ends here */
{'repo_name': 'glimpse-editor/Glimpse', 'stars': '924', 'repo_language': 'C', 'file_name': 'sr@latin.po', 'mime_type': 'text/x-po', 'hash': -6135311821011853161, 'source_dataset': 'data'}
import os from CTFd.utils.encoding import hexencode def generate_nonce(): return hexencode(os.urandom(32))
{'repo_name': 'CTFd/CTFd', 'stars': '2802', 'repo_language': 'Python', 'file_name': 'b295b033364d_add_ondelete_cascade_to_foreign_keys.py', 'mime_type': 'text/x-python', 'hash': -923338481599311830, 'source_dataset': 'data'}
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_LOADER_WEB_URL_REQUEST_UTIL_H_ #define CONTENT_RENDERER_LOADER_WEB_URL_REQUEST_UTIL_H_ #include <string> #include "content/common/content_export.h" #include "content/public/common/request_context_type.h" #include "content/public/common/resource_type.h" #include "net/http/http_request_headers.h" #include "services/network/public/cpp/resource_request_body.h" #include "services/network/public/mojom/request_context_frame_type.mojom.h" #include "third_party/blink/public/mojom/blob/blob_registry.mojom.h" #include "third_party/blink/public/platform/web_mixed_content_context_type.h" #include "third_party/blink/public/platform/web_url_request.h" namespace blink { class WebHTTPBody; } namespace content { ResourceType WebURLRequestContextToResourceType( blink::WebURLRequest::RequestContext request_context); CONTENT_EXPORT ResourceType WebURLRequestToResourceType( const blink::WebURLRequest& request); net::HttpRequestHeaders GetWebURLRequestHeaders( const blink::WebURLRequest& request); std::string GetWebURLRequestHeadersAsString( const blink::WebURLRequest& request); int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request); // Takes a ResourceRequestBody and converts into WebHTTPBody. blink::WebHTTPBody GetWebHTTPBodyForRequestBody( const network::ResourceRequestBody& input); // Takes a ResourceRequestBody with additional |blob_ptrs| which corresponds to // each Blob entries, and converts into WebHTTPBody. // TODO(kinuko): Remove this once Network Service is shipped. blink::WebHTTPBody GetWebHTTPBodyForRequestBodyWithBlobPtrs( const network::ResourceRequestBody& input, std::vector<blink::mojom::BlobPtrInfo> blob_ptrs); // Takes a ResourceRequestBody and gets blob pointers for Blob entries. // Used only in non-NetworkService cases but with S13nServiceWorker. // TODO(kinuko): Remove this once Network Service is shipped. std::vector<blink::mojom::BlobPtrInfo> GetBlobPtrsForRequestBody( const network::ResourceRequestBody& input); // Takes a WebHTTPBody and converts into a ResourceRequestBody. scoped_refptr<network::ResourceRequestBody> GetRequestBodyForWebHTTPBody( const blink::WebHTTPBody& httpBody); // Takes a WebURLRequest and sets the appropriate information // in a ResourceRequestBody structure. Returns an empty scoped_refptr // if the request body is not present. scoped_refptr<network::ResourceRequestBody> GetRequestBodyForWebURLRequest( const blink::WebURLRequest& request); // Helper functions to convert enums from the blink type to the content // type. std::string GetFetchIntegrityForWebURLRequest( const blink::WebURLRequest& request); RequestContextType GetRequestContextTypeForWebURLRequest( const blink::WebURLRequest& request); blink::WebMixedContentContextType GetMixedContentContextTypeForWebURLRequest( const blink::WebURLRequest& request); } // namespace content #endif // CONTENT_RENDERER_LOADER_WEB_URL_REQUEST_UTIL_H_
{'repo_name': 'kiwibrowser/src', 'stars': '728', 'repo_language': 'None', 'file_name': '3db76d1dd7d3a759dccc3f8fa7f68675c080cb095e4881063a6b850fdd68b8bc.pem', 'mime_type': 'text/plain', 'hash': 3113288600675560777, 'source_dataset': 'data'}
{ "images": [ { "filename": "ic_note_add_18pt.png", "idiom": "universal", "scale": "1x" }, { "filename": "ic_note_add_18pt_2x.png", "idiom": "universal", "scale": "2x" }, { "filename": "ic_note_add_18pt_3x.png", "idiom": "universal", "scale": "3x" } ], "info": { "author": "xcode", "version": 1 } }
{'repo_name': 'thomaspark/glyphsearch', 'stars': '439', 'repo_language': 'JavaScript', 'file_name': 'icons-material.json', 'mime_type': 'text/plain', 'hash': 44494347714658004, 'source_dataset': 'data'}
/* * 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.facebook.presto.orc.stream; import io.airlift.slice.BasicSliceInput; import io.airlift.slice.Slices; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OperationsPerInvocation; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import static com.facebook.presto.orc.stream.TestingBitPackingUtils.unpackGeneric; @SuppressWarnings("MethodMayBeStatic") @State(Scope.Thread) @Fork(2) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.NANOSECONDS) @BenchmarkMode(Mode.AverageTime) public class BenchmarkLongBitPacker { @Benchmark public Object baselineLength1(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 1, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(2) public Object baselineLength2(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 2, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(3) public Object baselineLength3(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 3, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(4) public Object baselineLength4(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 4, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(5) public Object baselineLength5(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 5, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(6) public Object baselineLength6(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 6, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(7) public Object baselineLength7(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 7, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(256) public Object baselineLength256(BenchmarkData data) throws Throwable { data.input.setPosition(0); unpackGeneric(data.buffer, 0, 256, data.bits, data.input); return data.buffer; } @Benchmark public Object optimizedLength1(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 1, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(2) public Object optimizedLength2(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 2, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(3) public Object optimizedLength3(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 3, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(4) public Object optimizedLength4(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 4, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(5) public Object optimizedLength5(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 5, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(6) public Object optimizedLength6(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 6, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(7) public Object optimizedLength7(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 7, data.bits, data.input); return data.buffer; } @Benchmark @OperationsPerInvocation(256) public Object optimizedLength256(BenchmarkData data) throws Throwable { data.input.setPosition(0); data.packer.unpack(data.buffer, 0, 256, data.bits, data.input); return data.buffer; } @SuppressWarnings("FieldMayBeFinal") @State(Scope.Thread) public static class BenchmarkData { private final long[] buffer = new long[256]; private final LongBitPacker packer = new LongBitPacker(); @Param({"1", "2", "4", "8", "16", "24", "32", "40", "48", "56", "64"}) private int bits; private BasicSliceInput input; @Setup public void setup() { byte[] bytes = new byte[256 * 64]; ThreadLocalRandom.current().nextBytes(bytes); input = Slices.wrappedBuffer(bytes).getInput(); } } public static void main(String[] args) throws Throwable { // assure the benchmarks are valid before running BenchmarkData data = new BenchmarkData(); data.setup(); new BenchmarkLongBitPacker().baselineLength256(data); Options options = new OptionsBuilder() .verbosity(VerboseMode.NORMAL) .include(".*" + BenchmarkLongBitPacker.class.getSimpleName() + ".*") .build(); new Runner(options).run(); } }
{'repo_name': 'prestodb/presto', 'stars': '10854', 'repo_language': 'Java', 'file_name': 'TestAlluxioCachingFileSystem.java', 'mime_type': 'text/x-java', 'hash': 2331331582246614595, 'source_dataset': 'data'}
--TEST-- Test > operator : different types --FILE-- <?php $valid_true = array(1, "1", "true", 1.0, array(1)); $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; $valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); $valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4); $invalid_int1 = array(679, "679"); $invalid_int2 = array(-67835, "-67835"); $float1 = 57385.45835; $float2 = -67345.76567; $valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); $valid_float2 = array("-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); $invalid_float1 = array(57385.45835, 5.738545835e4); $invalid_float2 = array(-67345.76567, -6.734576567E4); $toCompare = array( // boolean test will result in both sides being converted to boolean so !0 = true and true is not > true for example // also note that a string of "0" is converted to false but a string of "0.0" is converted to true // false cannot be tested as 0 can never be > 0 or 1 true, $valid_false, $valid_true, $int1, $valid_int1, $invalid_int1, $int2, $valid_int2, $invalid_int2, $float1, $valid_float1, $invalid_float1, $float2, $valid_float2, $invalid_float2 ); $failed = false; for ($i = 0; $i < count($toCompare); $i +=3) { $typeToTest = $toCompare[$i]; $valid_compares = $toCompare[$i + 1]; $invalid_compares = $toCompare[$i + 2]; foreach($valid_compares as $compareVal) { if ($typeToTest > $compareVal) { // do nothing } else { echo "FAILED: '$typeToTest' <= '$compareVal'\n"; $failed = true; } } foreach($invalid_compares as $compareVal) { if ($typeToTest > $compareVal) { echo "FAILED: '$typeToTest' > '$compareVal'\n"; $failed = true; } } } if ($failed == false) { echo "Test Passed\n"; } ?> ===DONE=== --EXPECT-- Test Passed ===DONE===
{'repo_name': 'MagicalTux/goro', 'stars': '659', 'repo_language': 'PHP', 'file_name': 'compatibility.md', 'mime_type': 'text/plain', 'hash': 8460741207141823052, 'source_dataset': 'data'}
/* * Copyright (c) 2015-2018, Intel Corporation * * 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 Intel Corporation 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. */ /** \file * \brief Multibit: fast bitset structure, main runtime. * * *Structure* * * For sizes <= MMB_FLAT_MAX_BITS, a flat bit vector is used, stored as N * 64-bit blocks followed by one "runt block". * * In larger cases, we use a sequence of blocks forming a tree. Each bit in an * internal block indicates whether its child block contains valid data. Every * level bar the last is complete. The last level is just a basic bit vector. * * ----------------------------------------------------------------------------- * WARNING: * * mmbit code assumes that it is legal to load 8 bytes before the end of the * mmbit. This means that for small mmbits (< 8byte), data may be read from * before the base pointer. It is the user's responsibility to ensure that this * is possible. * ----------------------------------------------------------------------------- */ #ifndef MULTIBIT_H #define MULTIBIT_H #include "config.h" #include "ue2common.h" #include "bitutils.h" #include "partial_store.h" #include "unaligned.h" #include "multibit_internal.h" #include <string.h> #ifdef __cplusplus extern "C" { #endif #define MMB_ONE (1ULL) #define MMB_ALL_ONES (0xffffffffffffffffULL) /** \brief Number of bits in a block. */ #define MMB_KEY_BITS (sizeof(MMB_TYPE) * 8) #define MMB_KEY_MASK (MMB_KEY_BITS - 1) // Key structure defines #define MMB_KEY_SHIFT 6 /** \brief Max size of a flat multibit. */ #define MMB_FLAT_MAX_BITS 256 // Utility functions and data // see multibit.c for contents extern const u8 mmbit_keyshift_lut[32]; extern const u8 mmbit_maxlevel_from_keyshift_lut[32]; extern const u8 mmbit_maxlevel_direct_lut[32]; extern const u32 mmbit_root_offset_from_level[7]; extern const u64a mmbit_zero_to_lut[65]; static really_inline MMB_TYPE mmb_load(const u8 * bits) { return unaligned_load_u64a(bits); } static really_inline void mmb_store(u8 *bits, MMB_TYPE val) { unaligned_store_u64a(bits, val); } static really_inline void mmb_store_partial(u8 *bits, MMB_TYPE val, u32 block_bits) { assert(block_bits <= MMB_KEY_BITS); partial_store_u64a(bits, val, ROUNDUP_N(block_bits, 8U) / 8U); } static really_inline MMB_TYPE mmb_single_bit(u32 bit) { assert(bit < MMB_KEY_BITS); return MMB_ONE << bit; } static really_inline MMB_TYPE mmb_mask_zero_to(u32 bit) { assert(bit <= MMB_KEY_BITS); #ifdef ARCH_32_BIT return mmbit_zero_to_lut[bit]; #else if (bit == MMB_KEY_BITS) { return MMB_ALL_ONES; } else { return mmb_single_bit(bit) - MMB_ONE; } #endif } /** \brief Returns a mask of set bits up to position \a bit. Does not handle * the case where bit == MMB_KEY_BITS. */ static really_inline MMB_TYPE mmb_mask_zero_to_nocheck(u32 bit) { assert(bit < MMB_KEY_BITS); #ifdef ARCH_32_BIT return mmbit_zero_to_lut[bit]; #else return mmb_single_bit(bit) - MMB_ONE; #endif } static really_inline u32 mmb_test(MMB_TYPE val, u32 bit) { assert(bit < MMB_KEY_BITS); return (val >> bit) & MMB_ONE; } static really_inline void mmb_set(MMB_TYPE * val, u32 bit) { assert(bit < MMB_KEY_BITS); *val |= mmb_single_bit(bit); } static really_inline void mmb_clear(MMB_TYPE * val, u32 bit) { assert(bit < MMB_KEY_BITS); *val &= ~mmb_single_bit(bit); } static really_inline u32 mmb_ctz(MMB_TYPE val) { return ctz64(val); } static really_inline u32 mmb_popcount(MMB_TYPE val) { return popcount64(val); } #ifndef MMMB_DEBUG #define MDEBUG_PRINTF(x, ...) do { } while(0) #else #define MDEBUG_PRINTF DEBUG_PRINTF #endif // Switch the following define on to trace writes to multibit. //#define MMB_TRACE_WRITES #ifdef MMB_TRACE_WRITES #define MMB_TRACE(format, ...) \ printf("mmb [%u bits @ %p] " format, total_bits, bits, ##__VA_ARGS__) #else #define MMB_TRACE(format, ...) \ do { \ } while (0) #endif static really_inline u32 mmbit_keyshift(u32 total_bits) { assert(total_bits > 1); u32 n = clz32(total_bits - 1); // subtract one as we're rounding down return mmbit_keyshift_lut[n]; } static really_inline u32 mmbit_maxlevel(u32 total_bits) { assert(total_bits > 1); u32 n = clz32(total_bits - 1); // subtract one as we're rounding down u32 max_level = mmbit_maxlevel_direct_lut[n]; assert(max_level <= MMB_MAX_LEVEL); return max_level; } static really_inline u32 mmbit_maxlevel_from_keyshift(u32 ks) { assert(ks <= 30); assert(ks % MMB_KEY_SHIFT == 0); u32 max_level = mmbit_maxlevel_from_keyshift_lut[ks]; assert(max_level <= MMB_MAX_LEVEL); return max_level; } /** \brief get our keyshift for the current level */ static really_inline u32 mmbit_get_ks(u32 max_level, u32 level) { assert(max_level <= MMB_MAX_LEVEL); assert(level <= max_level); return (max_level - level) * MMB_KEY_SHIFT; } /** \brief get our key value for the current level */ static really_inline u32 mmbit_get_key_val(u32 max_level, u32 level, u32 key) { return (key >> mmbit_get_ks(max_level, level)) & MMB_KEY_MASK; } /** \brief get the level root for the current level */ static really_inline u8 *mmbit_get_level_root(u8 *bits, u32 level) { assert(level < ARRAY_LENGTH(mmbit_root_offset_from_level)); return bits + mmbit_root_offset_from_level[level] * sizeof(MMB_TYPE); } /** \brief get the level root for the current level as const */ static really_inline const u8 *mmbit_get_level_root_const(const u8 *bits, u32 level) { assert(level < ARRAY_LENGTH(mmbit_root_offset_from_level)); return bits + mmbit_root_offset_from_level[level] * sizeof(MMB_TYPE); } /** \brief get the block for this key on the current level as a u8 ptr */ static really_inline u8 *mmbit_get_block_ptr(u8 *bits, u32 max_level, u32 level, u32 key) { u8 *level_root = mmbit_get_level_root(bits, level); u32 ks = mmbit_get_ks(max_level, level); return level_root + ((u64a)key >> (ks + MMB_KEY_SHIFT)) * sizeof(MMB_TYPE); } /** \brief get the block for this key on the current level as a const u8 ptr */ static really_inline const u8 *mmbit_get_block_ptr_const(const u8 *bits, u32 max_level, u32 level, u32 key) { const u8 *level_root = mmbit_get_level_root_const(bits, level); u32 ks = mmbit_get_ks(max_level, level); return level_root + ((u64a)key >> (ks + MMB_KEY_SHIFT)) * sizeof(MMB_TYPE); } /** \brief get the _byte_ for this key on the current level as a u8 ptr */ static really_inline u8 *mmbit_get_byte_ptr(u8 *bits, u32 max_level, u32 level, u32 key) { u8 *level_root = mmbit_get_level_root(bits, level); u32 ks = mmbit_get_ks(max_level, level); return level_root + ((u64a)key >> (ks + MMB_KEY_SHIFT - 3)); } /** \brief get our key value for the current level */ static really_inline u32 mmbit_get_key_val_byte(u32 max_level, u32 level, u32 key) { return (key >> (mmbit_get_ks(max_level, level))) & 0x7; } /** \brief Load a flat bitvector block corresponding to N bits. */ static really_inline MMB_TYPE mmbit_get_flat_block(const u8 *bits, u32 n_bits) { assert(n_bits <= MMB_KEY_BITS); u32 n_bytes = ROUNDUP_N(n_bits, 8) / 8; switch (n_bytes) { case 1: return *bits; case 2: return unaligned_load_u16(bits); case 3: case 4: { u32 rv; assert(n_bytes <= sizeof(rv)); memcpy(&rv, bits + n_bytes - sizeof(rv), sizeof(rv)); rv >>= (sizeof(rv) - n_bytes) * 8; /* need to shift to get things in * the right position and remove * junk */ assert(rv == partial_load_u32(bits, n_bytes)); return rv; } default: { u64a rv; assert(n_bytes <= sizeof(rv)); memcpy(&rv, bits + n_bytes - sizeof(rv), sizeof(rv)); rv >>= (sizeof(rv) - n_bytes) * 8; /* need to shift to get things in * the right position and remove * junk */ assert(rv == partial_load_u64a(bits, n_bytes)); return rv; } } } /** \brief True if this multibit is small enough to use a flat model */ static really_inline u32 mmbit_is_flat_model(u32 total_bits) { return total_bits <= MMB_FLAT_MAX_BITS; } static really_inline u32 mmbit_flat_size(u32 total_bits) { assert(mmbit_is_flat_model(total_bits)); return ROUNDUP_N(total_bits, 8) / 8; } static really_inline u32 mmbit_flat_select_byte(u32 key, UNUSED u32 total_bits) { return key / 8; } /** \brief returns the dense index of the bit in the given mask. */ static really_inline u32 mmbit_mask_index(u32 bit, MMB_TYPE mask) { assert(bit < MMB_KEY_BITS); assert(mmb_test(mask, bit)); mask &= mmb_mask_zero_to(bit); if (mask == 0ULL) { return 0; // Common case. } return mmb_popcount(mask); } /** \brief Clear all bits. */ static really_inline void mmbit_clear(u8 *bits, u32 total_bits) { MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); MMB_TRACE("CLEAR\n"); if (!total_bits) { return; } if (mmbit_is_flat_model(total_bits)) { memset(bits, 0, mmbit_flat_size(total_bits)); return; } mmb_store(bits, 0); } /** \brief Specialisation of \ref mmbit_set for flat models. */ static really_inline char mmbit_set_flat(u8 *bits, u32 total_bits, u32 key) { bits += mmbit_flat_select_byte(key, total_bits); u8 mask = 1U << (key % 8); char was_set = !!(*bits & mask); *bits |= mask; return was_set; } static really_inline char mmbit_set_big(u8 *bits, u32 total_bits, u32 key) { const u32 max_level = mmbit_maxlevel(total_bits); u32 level = 0; do { u8 * byte_ptr = mmbit_get_byte_ptr(bits, max_level, level, key); u8 keymask = 1U << mmbit_get_key_val_byte(max_level, level, key); u8 byte = *byte_ptr; if (likely(!(byte & keymask))) { *byte_ptr = byte | keymask; while (level++ != max_level) { u8 *block_ptr_1 = mmbit_get_block_ptr(bits, max_level, level, key); MMB_TYPE keymask_1 = mmb_single_bit(mmbit_get_key_val(max_level, level, key)); mmb_store(block_ptr_1, keymask_1); } return 0; } } while (level++ != max_level); return 1; } /** Internal version of \ref mmbit_set without MMB_TRACE, so it can be used by * \ref mmbit_sparse_iter_dump. */ static really_inline char mmbit_set_i(u8 *bits, u32 total_bits, u32 key) { assert(key < total_bits); if (mmbit_is_flat_model(total_bits)) { return mmbit_set_flat(bits, total_bits, key); } else { return mmbit_set_big(bits, total_bits, key); } } static really_inline char mmbit_isset(const u8 *bits, u32 total_bits, u32 key); /** \brief Sets the given key in the multibit. Returns 0 if the key was NOT * already set, 1 otherwise. */ static really_inline char mmbit_set(u8 *bits, u32 total_bits, u32 key) { MDEBUG_PRINTF("%p total_bits %u key %u\n", bits, total_bits, key); char status = mmbit_set_i(bits, total_bits, key); MMB_TRACE("SET %u (prev status: %d)\n", key, (int)status); assert(mmbit_isset(bits, total_bits, key)); return status; } /** \brief Specialisation of \ref mmbit_isset for flat models. */ static really_inline char mmbit_isset_flat(const u8 *bits, u32 total_bits, u32 key) { bits += mmbit_flat_select_byte(key, total_bits); return !!(*bits & (1U << (key % 8U))); } static really_inline char mmbit_isset_big(const u8 *bits, u32 total_bits, u32 key) { const u32 max_level = mmbit_maxlevel(total_bits); u32 level = 0; do { const u8 *block_ptr = mmbit_get_block_ptr_const(bits, max_level, level, key); MMB_TYPE block = mmb_load(block_ptr); if (!mmb_test(block, mmbit_get_key_val(max_level, level, key))) { return 0; } } while (level++ != max_level); return 1; } /** \brief Returns whether the given key is set. */ static really_inline char mmbit_isset(const u8 *bits, u32 total_bits, u32 key) { MDEBUG_PRINTF("%p total_bits %u key %u\n", bits, total_bits, key); assert(key < total_bits); if (mmbit_is_flat_model(total_bits)) { return mmbit_isset_flat(bits, total_bits, key); } else { return mmbit_isset_big(bits, total_bits, key); } } /** \brief Specialisation of \ref mmbit_unset for flat models. */ static really_inline void mmbit_unset_flat(u8 *bits, u32 total_bits, u32 key) { bits += mmbit_flat_select_byte(key, total_bits); *bits &= ~(1U << (key % 8U)); } // TODO: // build two versions of this - unset_dangerous that doesn't clear the summary // block and a regular unset that actually clears ALL the way up the levels if // possible - might make a utility function for the clear static really_inline void mmbit_unset_big(u8 *bits, u32 total_bits, u32 key) { /* This function is lazy as it does not clear the summary block * entry if the child becomes empty. This is not a correctness problem as the * summary block entries are used to mean that their children are valid * rather than that they have a set child. */ const u32 max_level = mmbit_maxlevel(total_bits); u32 level = 0; do { u8 *block_ptr = mmbit_get_block_ptr(bits, max_level, level, key); u32 key_val = mmbit_get_key_val(max_level, level, key); MMB_TYPE block = mmb_load(block_ptr); if (!mmb_test(block, key_val)) { return; } if (level == max_level) { mmb_clear(&block, key_val); mmb_store(block_ptr, block); } } while (level++ != max_level); } /** \brief Switch off a given key. */ static really_inline void mmbit_unset(u8 *bits, u32 total_bits, u32 key) { MDEBUG_PRINTF("%p total_bits %u key %u\n", bits, total_bits, key); assert(key < total_bits); MMB_TRACE("UNSET %u (prev status: %d)\n", key, (int)mmbit_isset(bits, total_bits, key)); if (mmbit_is_flat_model(total_bits)) { mmbit_unset_flat(bits, total_bits, key); } else { mmbit_unset_big(bits, total_bits, key); } } /** \brief Specialisation of \ref mmbit_iterate for flat models. */ static really_inline u32 mmbit_iterate_flat(const u8 *bits, u32 total_bits, u32 it_in) { // Short cut for single-block cases. if (total_bits <= MMB_KEY_BITS) { MMB_TYPE block = mmbit_get_flat_block(bits, total_bits); if (it_in != MMB_INVALID) { it_in++; assert(it_in < total_bits); block &= ~mmb_mask_zero_to(it_in); } if (block) { return mmb_ctz(block); } return MMB_INVALID; } const u32 last_block = total_bits / MMB_KEY_BITS; u32 start; // starting block index if (it_in != MMB_INVALID) { it_in++; assert(it_in < total_bits); start = (ROUNDUP_N(it_in, MMB_KEY_BITS) / MMB_KEY_BITS) - 1; u32 start_key = start * MMB_KEY_BITS; u32 block_size = MIN(MMB_KEY_BITS, total_bits - start_key); MMB_TYPE block = mmbit_get_flat_block(bits + (start * sizeof(MMB_TYPE)), block_size); block &= ~mmb_mask_zero_to(it_in - start_key); if (block) { return start_key + mmb_ctz(block); } else if (start_key + MMB_KEY_BITS >= total_bits) { return MMB_INVALID; // That was the final block. } start++; } else { start = 0; } // Remaining full-sized blocks. for (; start < last_block; start++) { MMB_TYPE block = mmb_load(bits + (start * sizeof(MMB_TYPE))); if (block) { return (start * MMB_KEY_BITS) + mmb_ctz(block); } } // We may have a final, smaller than full-sized, block to deal with at the // end. if (total_bits % MMB_KEY_BITS) { u32 start_key = start * MMB_KEY_BITS; u32 block_size = MIN(MMB_KEY_BITS, total_bits - start_key); MMB_TYPE block = mmbit_get_flat_block(bits + (start * sizeof(MMB_TYPE)), block_size); if (block) { return start_key + mmb_ctz(block); } } return MMB_INVALID; } static really_inline u32 mmbit_iterate_big(const u8 * bits, u32 total_bits, u32 it_in) { const u32 max_level = mmbit_maxlevel(total_bits); u32 level = 0; u32 key = 0; u32 key_rem = 0; if (it_in != MMB_INVALID) { // We're continuing a previous iteration, so we need to go // to max_level so we can pick up where we left off. // NOTE: assumes that we're valid down the whole tree key = it_in >> MMB_KEY_SHIFT; key_rem = (it_in & MMB_KEY_MASK) + 1; level = max_level; } while (1) { if (key_rem < MMB_KEY_BITS) { const u8 *block_ptr = mmbit_get_level_root_const(bits, level) + key * sizeof(MMB_TYPE); MMB_TYPE block = mmb_load(block_ptr) & ~mmb_mask_zero_to_nocheck(key_rem); if (block) { key = (key << MMB_KEY_SHIFT) + mmb_ctz(block); if (level++ == max_level) { break; } key_rem = 0; continue; // jump the rootwards step if we found a 'tree' non-zero bit } } // rootwards step (block is zero or key_rem == MMB_KEY_BITS) if (level-- == 0) { return MMB_INVALID; // if we don't find anything and we're at the top level, we're done } key_rem = (key & MMB_KEY_MASK) + 1; key >>= MMB_KEY_SHIFT; } assert(key < total_bits); assert(mmbit_isset(bits, total_bits, key)); return key; } /** \brief Unbounded iterator. Returns the index of the next set bit after \a * it_in, or MMB_INVALID. * * Note: assumes that if you pass in a value of it_in other than MMB_INVALID, * that bit must be on (assumes all its summary blocks are set). */ static really_inline u32 mmbit_iterate(const u8 *bits, u32 total_bits, u32 it_in) { MDEBUG_PRINTF("%p total_bits %u it_in %u\n", bits, total_bits, it_in); assert(it_in < total_bits || it_in == MMB_INVALID); if (!total_bits) { return MMB_INVALID; } if (it_in == total_bits - 1) { return MMB_INVALID; // it_in is the last key. } u32 key; if (mmbit_is_flat_model(total_bits)) { key = mmbit_iterate_flat(bits, total_bits, it_in); } else { key = mmbit_iterate_big(bits, total_bits, it_in); } assert(key == MMB_INVALID || mmbit_isset(bits, total_bits, key)); return key; } /** \brief Specialisation of \ref mmbit_any and \ref mmbit_any_precise for flat * models. */ static really_inline char mmbit_any_flat(const u8 *bits, u32 total_bits) { if (total_bits <= MMB_KEY_BITS) { return !!mmbit_get_flat_block(bits, total_bits); } const u8 *end = bits + mmbit_flat_size(total_bits); for (const u8 *last = end - sizeof(MMB_TYPE); bits < last; bits += sizeof(MMB_TYPE)) { if (mmb_load(bits)) { return 1; } } // Overlapping load at the end. return !!mmb_load(end - sizeof(MMB_TYPE)); } /** \brief True if any keys are (or might be) on in the given multibit. * * NOTE: mmbit_any is sloppy (may return true when only summary bits are set). * Use \ref mmbit_any_precise if you need/want a correct answer. */ static really_inline char mmbit_any(const u8 *bits, u32 total_bits) { MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); if (!total_bits) { return 0; } if (mmbit_is_flat_model(total_bits)) { return mmbit_any_flat(bits, total_bits); } return !!mmb_load(bits); } /** \brief True if there are any keys on. Guaranteed precise. */ static really_inline char mmbit_any_precise(const u8 *bits, u32 total_bits) { MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); if (!total_bits) { return 0; } if (mmbit_is_flat_model(total_bits)) { return mmbit_any_flat(bits, total_bits); } return mmbit_iterate_big(bits, total_bits, MMB_INVALID) != MMB_INVALID; } static really_inline char mmbit_all_flat(const u8 *bits, u32 total_bits) { while (total_bits > MMB_KEY_BITS) { if (mmb_load(bits) != MMB_ALL_ONES) { return 0; } bits += sizeof(MMB_TYPE); total_bits -= MMB_KEY_BITS; } while (total_bits > 8) { if (*bits != 0xff) { return 0; } bits++; total_bits -= 8; } u8 mask = (u8)mmb_mask_zero_to_nocheck(total_bits); return (*bits & mask) == mask; } static really_inline char mmbit_all_big(const u8 *bits, u32 total_bits) { u32 ks = mmbit_keyshift(total_bits); u32 level = 0; for (;;) { // Number of bits we expect to see switched on on this level. u32 level_bits; if (ks != 0) { u32 next_level_width = MMB_KEY_BITS << (ks - MMB_KEY_SHIFT); level_bits = ROUNDUP_N(total_bits, next_level_width) >> ks; } else { level_bits = total_bits; } const u8 *block_ptr = mmbit_get_level_root_const(bits, level); // All full-size blocks should be all-ones. while (level_bits >= MMB_KEY_BITS) { MMB_TYPE block = mmb_load(block_ptr); if (block != MMB_ALL_ONES) { return 0; } block_ptr += sizeof(MMB_TYPE); level_bits -= MMB_KEY_BITS; } // If we have bits remaining, we have a runt block on the end. if (level_bits > 0) { MMB_TYPE block = mmb_load(block_ptr); MMB_TYPE mask = mmb_mask_zero_to_nocheck(level_bits); if ((block & mask) != mask) { return 0; } } if (ks == 0) { break; } ks -= MMB_KEY_SHIFT; level++; } return 1; } /** \brief True if all keys are on. Guaranteed precise. */ static really_inline char mmbit_all(const u8 *bits, u32 total_bits) { MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); if (mmbit_is_flat_model(total_bits)) { return mmbit_all_flat(bits, total_bits); } return mmbit_all_big(bits, total_bits); } static really_inline MMB_TYPE get_flat_masks(u32 base, u32 it_start, u32 it_end) { if (it_end <= base) { return 0; } u32 udiff = it_end - base; MMB_TYPE mask = udiff < 64 ? mmb_mask_zero_to_nocheck(udiff) : MMB_ALL_ONES; if (it_start >= base) { u32 ldiff = it_start - base; MMB_TYPE lmask = ldiff < 64 ? ~mmb_mask_zero_to_nocheck(ldiff) : 0; mask &= lmask; } return mask; } /** \brief Specialisation of \ref mmbit_iterate_bounded for flat models. */ static really_inline u32 mmbit_iterate_bounded_flat(const u8 *bits, u32 total_bits, u32 begin, u32 end) { // Short cut for single-block cases. if (total_bits <= MMB_KEY_BITS) { MMB_TYPE block = mmbit_get_flat_block(bits, total_bits); block &= get_flat_masks(0, begin, end); if (block) { return mmb_ctz(block); } return MMB_INVALID; } const u32 last_block = ROUNDDOWN_N(total_bits, MMB_KEY_BITS); // Iterate over full-sized blocks. for (u32 i = ROUNDDOWN_N(begin, MMB_KEY_BITS), e = MIN(end, last_block); i < e; i += MMB_KEY_BITS) { const u8 *block_ptr = bits + i / 8; MMB_TYPE block = mmb_load(block_ptr); block &= get_flat_masks(i, begin, end); if (block) { return i + mmb_ctz(block); } } // Final block, which is less than full-sized. if (end > last_block) { const u8 *block_ptr = bits + last_block / 8; u32 num_bits = total_bits - last_block; MMB_TYPE block = mmbit_get_flat_block(block_ptr, num_bits); block &= get_flat_masks(last_block, begin, end); if (block) { return last_block + mmb_ctz(block); } } return MMB_INVALID; } static really_inline MMB_TYPE get_lowhi_masks(u32 level, u32 max_level, u64a block_min, u64a block_max, u64a block_base) { const u32 level_shift = (max_level - level) * MMB_KEY_SHIFT; u64a lshift = (block_min - block_base) >> level_shift; u64a ushift = (block_max - block_base) >> level_shift; MMB_TYPE lmask = lshift < 64 ? ~mmb_mask_zero_to_nocheck(lshift) : 0; MMB_TYPE umask = ushift < 63 ? mmb_mask_zero_to_nocheck(ushift + 1) : MMB_ALL_ONES; return lmask & umask; } static really_inline u32 mmbit_iterate_bounded_big(const u8 *bits, u32 total_bits, u32 it_start, u32 it_end) { u64a key = 0; u32 ks = mmbit_keyshift(total_bits); const u32 max_level = mmbit_maxlevel_from_keyshift(ks); u32 level = 0; --it_end; // make end-limit inclusive for (;;) { assert(level <= max_level); u64a block_width = MMB_KEY_BITS << ks; u64a block_base = key * block_width; u64a block_min = MAX(it_start, block_base); u64a block_max = MIN(it_end, block_base + block_width - 1); const u8 *block_ptr = mmbit_get_level_root_const(bits, level) + key * sizeof(MMB_TYPE); MMB_TYPE block = mmb_load(block_ptr); block &= get_lowhi_masks(level, max_level, block_min, block_max, block_base); if (block) { // Found a bit, go down a level key = (key << MMB_KEY_SHIFT) + mmb_ctz(block); if (level++ == max_level) { return key; } ks -= MMB_KEY_SHIFT; } else { // No bit found, go up a level // we know that this block didn't have any answers, so we can push // our start iterator forward. u64a next_start = block_base + block_width; if (next_start > it_end) { break; } if (level-- == 0) { break; } it_start = next_start; key >>= MMB_KEY_SHIFT; ks += MMB_KEY_SHIFT; } } return MMB_INVALID; } /** \brief Bounded iterator. Returns the index of the first set bit between * it_start (inclusive) and it_end (exclusive) or MMB_INVALID if no bits are * set in that range. */ static really_inline u32 mmbit_iterate_bounded(const u8 *bits, u32 total_bits, u32 it_start, u32 it_end) { MDEBUG_PRINTF("%p total_bits %u it_start %u it_end %u\n", bits, total_bits, it_start, it_end); assert(it_start <= it_end); assert(it_end <= total_bits); if (!total_bits || it_end == it_start) { return MMB_INVALID; } assert(it_start < total_bits); u32 key; if (mmbit_is_flat_model(total_bits)) { key = mmbit_iterate_bounded_flat(bits, total_bits, it_start, it_end); } else { key = mmbit_iterate_bounded_big(bits, total_bits, it_start, it_end); } assert(key == MMB_INVALID || mmbit_isset(bits, total_bits, key)); return key; } /** \brief Specialisation of \ref mmbit_unset_range for flat models. */ static really_inline void mmbit_unset_range_flat(u8 *bits, u32 total_bits, u32 begin, u32 end) { const u32 last_block = ROUNDDOWN_N(total_bits, MMB_KEY_BITS); // Iterate over full-sized blocks. for (u32 i = ROUNDDOWN_N(begin, MMB_KEY_BITS), e = MIN(end, last_block); i < e; i += MMB_KEY_BITS) { u8 *block_ptr = bits + i / 8; MMB_TYPE block = mmb_load(block_ptr); MMB_TYPE mask = get_flat_masks(i, begin, end); mmb_store(block_ptr, block & ~mask); } // Final block, which is less than full-sized. if (end > last_block) { u8 *block_ptr = bits + last_block / 8; u32 num_bits = total_bits - last_block; MMB_TYPE block = mmbit_get_flat_block(block_ptr, num_bits); MMB_TYPE mask = get_flat_masks(last_block, begin, end); mmb_store_partial(block_ptr, block & ~mask, num_bits); } } static really_inline void mmbit_unset_range_big(u8 *bits, const u32 total_bits, u32 begin, u32 end) { // TODO: combine iterator and unset operation; completely replace this u32 i = begin; for (;;) { i = mmbit_iterate_bounded(bits, total_bits, i, end); if (i == MMB_INVALID) { break; } mmbit_unset_big(bits, total_bits, i); if (++i == end) { break; } } } /** \brief Unset a whole range of bits. Ensures that all bits between \a begin * (inclusive) and \a end (exclusive) are switched off. */ static really_inline void mmbit_unset_range(u8 *bits, const u32 total_bits, u32 begin, u32 end) { MDEBUG_PRINTF("%p total_bits %u begin %u end %u\n", bits, total_bits, begin, end); assert(begin <= end); assert(end <= total_bits); if (mmbit_is_flat_model(total_bits)) { mmbit_unset_range_flat(bits, total_bits, begin, end); } else { mmbit_unset_range_big(bits, total_bits, begin, end); } // No bits are on in [begin, end) once we're done. assert(MMB_INVALID == mmbit_iterate_bounded(bits, total_bits, begin, end)); } /** \brief Specialisation of \ref mmbit_init_range for flat models. */ static really_inline void mmbit_init_range_flat(u8 *bits, const u32 total_bits, u32 begin, u32 end) { const u32 last_block = ROUNDDOWN_N(total_bits, MMB_KEY_BITS); // Iterate over full-sized blocks. for (u32 i = 0; i < last_block; i += MMB_KEY_BITS) { mmb_store(bits + i / 8, get_flat_masks(i, begin, end)); } // Final block, which is less than full-sized. if (total_bits % MMB_KEY_BITS) { u32 num_bits = total_bits - last_block; MMB_TYPE block = get_flat_masks(last_block, begin, end); mmb_store_partial(bits + last_block / 8, block, num_bits); } } static really_inline void mmbit_init_range_big(u8 *bits, const u32 total_bits, u32 begin, u32 end) { u32 ks = mmbit_keyshift(total_bits); u32 level = 0; for (;;) { u8 *block = mmbit_get_level_root(bits, level); u32 k1 = begin >> ks, k2 = end >> ks; // Summary blocks need to account for the runt block on the end. if ((k2 << ks) != end) { k2++; } // Partial block to deal with beginning. block += (k1 / MMB_KEY_BITS) * sizeof(MMB_TYPE); if (k1 % MMB_KEY_BITS) { u32 idx = k1 / MMB_KEY_BITS; u32 block_end = (idx + 1) * MMB_KEY_BITS; // Because k1 % MMB_KEY_BITS != 0, we can avoid checking edge cases // here (see the branch in mmb_mask_zero_to). MMB_TYPE mask = MMB_ALL_ONES << (k1 % MMB_KEY_BITS); if (k2 < block_end) { assert(k2 % MMB_KEY_BITS); mask &= mmb_mask_zero_to_nocheck(k2 % MMB_KEY_BITS); mmb_store(block, mask); goto next_level; } else { mmb_store(block, mask); k1 = block_end; block += sizeof(MMB_TYPE); } } // Write blocks filled with ones until we get to the last block. for (; k1 < (k2 & ~MMB_KEY_MASK); k1 += MMB_KEY_BITS) { mmb_store(block, MMB_ALL_ONES); block += sizeof(MMB_TYPE); } // Final block. if (likely(k1 < k2)) { // Again, if k2 was at a block boundary, it would have been handled // by the previous loop, so we know k2 % MMB_KEY_BITS != 0 and can // avoid the branch in mmb_mask_zero_to here. assert(k2 % MMB_KEY_BITS); MMB_TYPE mask = mmb_mask_zero_to_nocheck(k2 % MMB_KEY_BITS); mmb_store(block, mask); } next_level: if (ks == 0) { break; // Last level is done, finished. } ks -= MMB_KEY_SHIFT; level++; } } /** \brief Initialises the multibit so that only the given range of bits are * set. * * Ensures that all bits between \a begin (inclusive) and \a end (exclusive) * are switched on. */ static really_inline void mmbit_init_range(u8 *bits, const u32 total_bits, u32 begin, u32 end) { MDEBUG_PRINTF("%p total_bits %u begin %u end %u\n", bits, total_bits, begin, end); assert(begin <= end); assert(end <= total_bits); if (!total_bits) { return; } // Short cut for cases where we're not actually setting any bits; just // clear the multibit. if (begin == end) { mmbit_clear(bits, total_bits); return; } if (mmbit_is_flat_model(total_bits)) { mmbit_init_range_flat(bits, total_bits, begin, end); } else { mmbit_init_range_big(bits, total_bits, begin, end); } assert(begin == end || mmbit_iterate(bits, total_bits, MMB_INVALID) == begin); assert(!end || begin == end || mmbit_iterate(bits, total_bits, end - 1) == MMB_INVALID); } /** \brief Determine the number of \ref mmbit_sparse_state elements required. * */ static really_inline u32 mmbit_sparse_iter_state_size(u32 total_bits) { if (mmbit_is_flat_model(total_bits)) { return 2; } u32 levels = mmbit_maxlevel(total_bits); return levels + 1; } #ifdef DUMP_SUPPORT // Dump function, defined in multibit.c. void mmbit_sparse_iter_dump(const struct mmbit_sparse_iter *it, u32 total_bits); #endif /** Internal: common loop used by mmbit_sparse_iter_{begin,next}_big. Returns * matching next key given starting state, or MMB_INVALID. */ static really_inline u32 mmbit_sparse_iter_exec(const u8 *bits, u32 key, u32 *idx, u32 level, const u32 max_level, struct mmbit_sparse_state *s, const struct mmbit_sparse_iter *it_root, const struct mmbit_sparse_iter *it) { for (;;) { MMB_TYPE block = s[level].mask; if (block) { u32 bit = mmb_ctz(block); key = (key << MMB_KEY_SHIFT) + bit; u32 bit_idx = mmbit_mask_index(bit, it->mask); if (level++ == max_level) { // we've found a key *idx = it->val + bit_idx; return key; } else { // iterator record is the start of the level (current it->val) // plus N, where N is the dense index of the bit in the current // level's itmask u32 iter_key = it->val + bit_idx; it = it_root + iter_key; MMB_TYPE nextblock = mmb_load(mmbit_get_level_root_const(bits, level) + key * sizeof(MMB_TYPE)); s[level].mask = nextblock & it->mask; s[level].itkey = iter_key; } } else { // No bits set in this block if (level-- == 0) { break; // no key available } key >>= MMB_KEY_SHIFT; // Update state mask and iterator s[level].mask &= (s[level].mask - 1); it = it_root + s[level].itkey; } } return MMB_INVALID; } static really_inline u32 mmbit_sparse_iter_begin_big(const u8 *bits, u32 total_bits, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { const struct mmbit_sparse_iter *it = it_root; u32 key = 0; MMB_TYPE block = mmb_load(bits) & it->mask; if (!block) { return MMB_INVALID; } // Load first block into top level state. const u32 max_level = mmbit_maxlevel(total_bits); s[0].mask = block; s[0].itkey = 0; return mmbit_sparse_iter_exec(bits, key, idx, 0, max_level, s, it_root, it); } /** \brief Specialisation of \ref mmbit_sparse_iter_begin for flat models. */ static really_inline u32 mmbit_sparse_iter_begin_flat(const u8 *bits, u32 total_bits, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { // Small cases have everything in the root iterator mask. if (total_bits <= MMB_KEY_BITS) { MMB_TYPE block = mmbit_get_flat_block(bits, total_bits); block &= it_root->mask; if (!block) { return MMB_INVALID; } s->mask = block; u32 key = mmb_ctz(block); *idx = mmbit_mask_index(key, it_root->mask); return key; } // Otherwise, the root iterator mask tells us which blocks (which we lay out // linearly in the flat model) could contain keys. assert(mmbit_maxlevel(total_bits) == 1); // Should only be two levels MMB_TYPE root = it_root->mask; for (; root; root &= (root - 1)) { u32 bit = mmb_ctz(root); u32 bit_idx = mmbit_mask_index(bit, it_root->mask); u32 iter_key = it_root->val + bit_idx; const struct mmbit_sparse_iter *it = it_root + iter_key; u32 block_key_min = bit * MMB_KEY_BITS; u32 block_key_max = block_key_min + MMB_KEY_BITS; MMB_TYPE block; if (block_key_max > total_bits) { block_key_max = total_bits; block = mmbit_get_flat_block(bits + (bit * sizeof(MMB_TYPE)), block_key_max - block_key_min); } else { block = mmb_load(bits + (bit * sizeof(MMB_TYPE))); } block &= it->mask; if (block) { s[0].mask = root; s[1].mask = block; s[1].itkey = iter_key; u32 key = mmb_ctz(block); *idx = it->val + mmbit_mask_index(key, it->mask); return key + block_key_min; } } return MMB_INVALID; } /** \brief Sparse iterator, find first key. * * Returns the first of the bits specified by the iterator \a it_root that is * on, and initialises the state \a s. If none of the bits specified by the * iterator are on, returns MMB_INVALID. */ static really_inline u32 mmbit_sparse_iter_begin(const u8 *bits, u32 total_bits, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { assert(ISALIGNED_N(it_root, alignof(struct mmbit_sparse_iter))); // Our state _may_ be on the stack #ifndef _WIN32 assert(ISALIGNED_N(s, alignof(struct mmbit_sparse_state))); #else assert(ISALIGNED_N(s, 4)); #endif MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); // iterator should have _something_ at the root level assert(it_root->mask != 0); u32 key; if (mmbit_is_flat_model(total_bits)) { key = mmbit_sparse_iter_begin_flat(bits, total_bits, idx, it_root, s); } else { key = mmbit_sparse_iter_begin_big(bits, total_bits, idx, it_root, s); } if (key != MMB_INVALID) { assert(key < total_bits); assert(mmbit_isset(bits, total_bits, key)); } return key; } static really_inline u32 mmbit_sparse_iter_next_big(const u8 *bits, u32 total_bits, u32 last_key, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { const u32 max_level = mmbit_maxlevel(total_bits); u32 key = last_key >> MMB_KEY_SHIFT; s[max_level].mask &= (s[max_level].mask - 1); const struct mmbit_sparse_iter *it = it_root + s[max_level].itkey; return mmbit_sparse_iter_exec(bits, key, idx, max_level, max_level, s, it_root, it); } /** \brief Specialisation of \ref mmbit_sparse_iter_next for flat models. */ static really_inline u32 mmbit_sparse_iter_next_flat(const u8 *bits, const u32 total_bits, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { if (total_bits <= MMB_KEY_BITS) { // All of our data is already in the s->mask, so we just need to scrape // off the next match. s->mask &= (s->mask - 1); if (s->mask) { u32 key = mmb_ctz(s->mask); *idx = mmbit_mask_index(key, it_root->mask); return key; } } else { assert(s[0].mask); s[1].mask &= (s[1].mask - 1); // Remove previous key from iter state. u32 bit = mmb_ctz(s[0].mask); // Flat block currently being accessed. for (;;) { if (s[1].mask) { u32 key = mmb_ctz(s[1].mask); const struct mmbit_sparse_iter *it = it_root + s[1].itkey; *idx = it->val + mmbit_mask_index(key, it->mask); key += (bit * MMB_KEY_BITS); return key; } // Otherwise, we have no keys left in this block. Consult the root // mask and find the next one. s[0].mask &= s[0].mask - 1; if (!s[0].mask) { break; } bit = mmb_ctz(s[0].mask); u32 bit_idx = mmbit_mask_index(bit, it_root->mask); u32 iter_key = it_root->val + bit_idx; const struct mmbit_sparse_iter *it = it_root + iter_key; u32 block_key_min = bit * MMB_KEY_BITS; u32 block_key_max = block_key_min + MMB_KEY_BITS; MMB_TYPE block; if (block_key_max > total_bits) { block_key_max = total_bits; block = mmbit_get_flat_block(bits + (bit * sizeof(MMB_TYPE)), block_key_max - block_key_min); } else { block = mmb_load(bits + (bit * sizeof(MMB_TYPE))); } s[1].mask = block & it->mask; s[1].itkey = iter_key; } } return MMB_INVALID; } /** \brief Sparse iterator, find next key. * * Takes in a sparse iterator tree structure \a it_root and a state array, and * finds the next on bit (from the set of bits specified in the iterator). * * NOTE: The sparse iterator stores copies of the multibit blocks in its state, * so it is not necessarily safe to set or unset bits in the multibit while * iterating: the changes you make may or may not be taken into account * by the iterator. */ static really_inline u32 mmbit_sparse_iter_next(const u8 *bits, u32 total_bits, u32 last_key, u32 *idx, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { assert(ISALIGNED_N(it_root, alignof(struct mmbit_sparse_iter))); // Our state _may_ be on the stack #ifndef _WIN32 assert(ISALIGNED_N(s, alignof(struct mmbit_sparse_state))); #else assert(ISALIGNED_N(s, 4)); #endif MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); MDEBUG_PRINTF("NEXT (total_bits=%u, last_key=%u)\n", total_bits, last_key); UNUSED u32 last_idx = *idx; // for assertion at the end // our iterator should have _something_ at the root level assert(it_root->mask != 0); assert(last_key < total_bits); u32 key; if (mmbit_is_flat_model(total_bits)) { key = mmbit_sparse_iter_next_flat(bits, total_bits, idx, it_root, s); } else { key = mmbit_sparse_iter_next_big(bits, total_bits, last_key, idx, it_root, s); } if (key != MMB_INVALID) { MDEBUG_PRINTF("END NEXT: key=%u, idx=%u\n", key, *idx); assert(key < total_bits); assert(key > last_key); assert(mmbit_isset(bits, total_bits, key)); assert(*idx > last_idx); } else { MDEBUG_PRINTF("END NEXT: no more keys\n"); } return key; } /** \brief Specialisation of \ref mmbit_sparse_iter_unset for flat models. */ static really_inline void mmbit_sparse_iter_unset_flat(u8 *bits, u32 total_bits, const struct mmbit_sparse_iter *it_root) { if (total_bits <= MMB_KEY_BITS) { // Everything is in the root mask: we can just mask those bits off. MMB_TYPE block = mmbit_get_flat_block(bits, total_bits); block &= ~it_root->mask; mmb_store_partial(bits, block, total_bits); return; } // Larger case, we have two iterator levels to worry about. u32 bit_idx = 0; for (MMB_TYPE root = it_root->mask; root; root &= (root - 1), bit_idx++) { u32 bit = mmb_ctz(root); u32 block_key_min = bit * MMB_KEY_BITS; u32 block_key_max = block_key_min + MMB_KEY_BITS; u8 *block_ptr = bits + (bit * sizeof(MMB_TYPE)); u32 iter_key = it_root->val + bit_idx; const struct mmbit_sparse_iter *it = it_root + iter_key; if (block_key_max <= total_bits) { // Full-sized block. MMB_TYPE block = mmb_load(block_ptr); block &= ~it->mask; mmb_store(block_ptr, block); } else { // Runt (final) block. u32 num_bits = total_bits - block_key_min; MMB_TYPE block = mmbit_get_flat_block(block_ptr, num_bits); block &= ~it->mask; mmb_store_partial(block_ptr, block, num_bits); break; // We know this is the last block. } } } static really_inline void mmbit_sparse_iter_unset_big(u8 *bits, u32 total_bits, const struct mmbit_sparse_iter *it_root, struct mmbit_sparse_state *s) { const struct mmbit_sparse_iter *it = it_root; MMB_TYPE block = mmb_load(bits) & it->mask; if (!block) { return; } u32 key = 0; const u32 max_level = mmbit_maxlevel(total_bits); u32 level = 0; // Load first block into top level state s[level].mask = block; s[level].itkey = 0; for (;;) { block = s[level].mask; if (block) { if (level == max_level) { // bottom level block: we want to mask out the bits specified // by the iterator mask and then go back up a level. u8 *block_ptr = mmbit_get_level_root(bits, level) + key * sizeof(MMB_TYPE); MMB_TYPE real_block = mmb_load(block_ptr); real_block &= ~(it->mask); mmb_store(block_ptr, real_block); goto uplevel; // still cheap and nasty } else { u32 bit = mmb_ctz(block); key = (key << MMB_KEY_SHIFT) + bit; level++; // iterator record is the start of the level (current it->val) // plus N, where N is the dense index of the bit in the current // level's itmask u32 iter_key = it->val + mmbit_mask_index(bit, it->mask); it = it_root + iter_key; MMB_TYPE nextblock = mmb_load(mmbit_get_level_root_const(bits, level) + key * sizeof(MMB_TYPE)); s[level].mask = nextblock & it->mask; s[level].itkey = iter_key; } } else { uplevel: // No bits set in this block if (level == 0) { return; // we are done } u8 *block_ptr = mmbit_get_level_root(bits, level) + key * sizeof(MMB_TYPE); MMB_TYPE real_block = mmb_load(block_ptr); key >>= MMB_KEY_SHIFT; level--; if (real_block == 0) { // If we've zeroed our block For Real (unmasked by iterator), // we can clear the parent bit that led us to it, so that // we don't go down this particular garden path again later. u32 bit = mmb_ctz(s[level].mask); u8 *parent_ptr = mmbit_get_level_root(bits, level) + key * sizeof(MMB_TYPE); MMB_TYPE parent_block = mmb_load(parent_ptr); mmb_clear(&parent_block, bit); mmb_store(parent_ptr, parent_block); } // Update state mask and iterator s[level].mask &= (s[level].mask - 1); it = it_root + s[level].itkey; } } } /** \brief Sparse iterator, unset all bits. * * Takes in a sparse iterator tree structure and switches off any entries found * therein. */ static really_inline void mmbit_sparse_iter_unset(u8 *bits, u32 total_bits, const struct mmbit_sparse_iter *it, struct mmbit_sparse_state *s) { assert(ISALIGNED_N(it, alignof(struct mmbit_sparse_iter))); // Our state _may_ be on the stack #ifndef _WIN32 assert(ISALIGNED_N(s, alignof(struct mmbit_sparse_state))); #else assert(ISALIGNED_N(s, 4)); #endif MDEBUG_PRINTF("%p total_bits %u\n", bits, total_bits); #ifdef MMB_TRACE_WRITES MMB_TRACE("ITER-UNSET iter=["); mmbit_sparse_iter_dump(it, total_bits); printf("] actually on=["); struct mmbit_sparse_state tmp[MAX_SPARSE_ITER_STATES]; u32 idx = 0; u32 i = mmbit_sparse_iter_begin(bits, total_bits, &idx, it, tmp); for (; i != MMB_INVALID; i = mmbit_sparse_iter_next(bits, total_bits, i, &idx, it, tmp)) { printf(" %u", i); } printf("]\n"); #endif if (mmbit_is_flat_model(total_bits)) { mmbit_sparse_iter_unset_flat(bits, total_bits, it); } else { mmbit_sparse_iter_unset_big(bits, total_bits, it, s); } } #ifdef __cplusplus } // extern "C" #endif #endif // MULTIBIT_H
{'repo_name': 'intel/hyperscan', 'stars': '2800', 'repo_language': 'C++', 'file_name': 'config.h.in', 'mime_type': 'text/x-c', 'hash': 244104557868812469, 'source_dataset': 'data'}
namespace ClassLib017 { public class Class073 { public static string Property => "ClassLib017"; } }
{'repo_name': 'dotnet/performance', 'stars': '329', 'repo_language': 'C#', 'file_name': 'Class067.cs', 'mime_type': 'text/plain', 'hash': 2944485411767146044, 'source_dataset': 'data'}
//------------- blank.js -------------// $(document).ready(function() { //get object with colros from plugin and store it. var objColors = $('body').data('appStart').getColors(); var colours = { white: objColors.white, dark: objColors.dark, red : objColors.red, blue: objColors.blue, green : objColors.green, yellow: objColors.yellow, brown: objColors.brown, orange : objColors.orange, purple : objColors.purple, pink : objColors.pink, lime : objColors.lime, magenta: objColors.magenta, teal: objColors.teal, textcolor: '#5a5e63', gray: objColors.gray } //------------- Vector maps -------------// $('#world-map-markers').vectorMap({ map: 'world_mill_en', scaleColors: [colours.teal, colours.blue], normalizeFunction: 'polynomial', hoverOpacity: 0.7, hoverColor: false, focusOn:{ x: 0.5, y: 0.5, scale: 2.0 }, zoomMin:0.85, markerStyle: { initial: { fill: colours.red, stroke: colours.red } }, backgroundColor: colours.white, regionStyle:{ initial: { fill: colours.teal, "fill-opacity": 1, stroke: colours.teal, "stroke-width": 0, "stroke-opacity": 0 }, hover: { "fill-opacity": 0.8 }, selected: { fill: 'yellow' } }, markers: [ {latLng: [41.90, 12.45], name: 'Vatican City'}, {latLng: [43.73, 7.41], name: 'Monaco'}, {latLng: [-0.52, 166.93], name: 'Nauru'}, {latLng: [-8.51, 179.21], name: 'Tuvalu'}, {latLng: [43.93, 12.46], name: 'San Marino'}, {latLng: [47.14, 9.52], name: 'Liechtenstein'}, {latLng: [7.11, 171.06], name: 'Marshall Islands'}, {latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis'}, {latLng: [3.2, 73.22], name: 'Maldives'}, {latLng: [35.88, 14.5], name: 'Malta'}, {latLng: [12.05, -61.75], name: 'Grenada'}, {latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines'}, {latLng: [13.16, -59.55], name: 'Barbados'}, {latLng: [17.11, -61.85], name: 'Antigua and Barbuda'}, {latLng: [-4.61, 55.45], name: 'Seychelles'}, {latLng: [7.35, 134.46], name: 'Palau'}, {latLng: [42.5, 1.51], name: 'Andorra'}, {latLng: [14.01, -60.98], name: 'Saint Lucia'}, {latLng: [6.91, 158.18], name: 'Federated States of Micronesia'}, {latLng: [1.3, 103.8], name: 'Singapore'}, {latLng: [1.46, 173.03], name: 'Kiribati'}, {latLng: [-21.13, -175.2], name: 'Tonga'}, {latLng: [15.3, -61.38], name: 'Dominica'}, {latLng: [-20.2, 57.5], name: 'Mauritius'}, {latLng: [26.02, 50.55], name: 'Bahrain'}, {latLng: [0.33, 6.73], name: 'São Tomé and Príncipe'} ] }); });
{'repo_name': 'project-store/theme', 'stars': '366', 'repo_language': 'HTML', 'file_name': 'table-responsive.css', 'mime_type': 'text/plain', 'hash': 4398037491820079559, 'source_dataset': 'data'}
/* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, * version 2 with the GNU Classpath Exception, which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ package com.sun.gjc.util; import com.sun.enterprise.util.i18n.StringManager; import com.sun.gjc.monitoring.StatementLeakProbeProvider; import com.sun.logging.LogDomains; import org.glassfish.resourcebase.resources.api.PoolInfo; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import java.util.logging.Level; import java.util.logging.Logger; /** * Statement leak detector that prints the stack trace of the thread when a * statement object is leaked. Once the leak timeout expires, a statement leak * is assumed and the caller stack trace is printed. When statement-leak-reclaim * is set to true, the statement object is reclaimed. * * @author Shalini M */ public class StatementLeakDetector { private HashMap<Statement, StackTraceElement[]> statementLeakThreadStackHashMap; private HashMap<Statement, StatementLeakTask> statementLeakTimerTaskHashMap; private PoolInfo poolInfo; private boolean statementLeakTracing; private long statementLeakTimeoutInMillis; private boolean statementLeakReclaim; //Lock on HashMap to trace statement leaks private final Object statementLeakLock; private Map<Statement, StatementLeakListener> listeners; private final static Logger _logger = LogDomains.getLogger( StatementLeakDetector.class, LogDomains.RSR_LOGGER); private final static StringManager localStrings = StringManager.getManager(StatementLeakDetector.class); private Timer timer; private StatementLeakProbeProvider stmtLeakProbeProvider = null; public StatementLeakDetector(PoolInfo poolInfo, boolean leakTracing, long leakTimeoutInMillis, boolean leakReclaim, Timer timer) { this.poolInfo = poolInfo; statementLeakThreadStackHashMap = new HashMap<Statement, StackTraceElement[]>(); statementLeakTimerTaskHashMap = new HashMap<Statement, StatementLeakTask>(); listeners = new HashMap<Statement, StatementLeakListener>(); statementLeakLock = new Object(); statementLeakTracing = leakTracing; statementLeakTimeoutInMillis = leakTimeoutInMillis; statementLeakReclaim = leakReclaim; this.timer = timer; stmtLeakProbeProvider = new StatementLeakProbeProvider(); } public void reset(boolean leakTracing, long leakTimeoutInMillis, boolean leakReclaim) { if (!statementLeakTracing && leakTracing) { clearAllStatementLeakTasks(); } statementLeakTracing = leakTracing; statementLeakTimeoutInMillis = leakTimeoutInMillis; statementLeakReclaim = leakReclaim; } private void registerListener(Statement stmt, StatementLeakListener listener) { listeners.put(stmt, listener); } private void unRegisterListener(Statement stmt) { listeners.remove(stmt); } /** * Starts statement leak tracing * * @param stmt Statement which needs to be traced * @param listener Leak Listener */ public void startStatementLeakTracing(Statement stmt, StatementLeakListener listener) { synchronized (statementLeakLock) { if (!statementLeakThreadStackHashMap.containsKey(stmt)) { statementLeakThreadStackHashMap.put(stmt, Thread.currentThread().getStackTrace()); StatementLeakTask statementLeakTask = new StatementLeakTask(stmt); statementLeakTimerTaskHashMap.put(stmt, statementLeakTask); registerListener(stmt, listener); if (timer != null) { timer.schedule(statementLeakTask, statementLeakTimeoutInMillis); if(_logger.isLoggable(Level.FINEST)) { _logger.finest("Scheduled Statement leak tracing timer task"); } } } } } /** * Stops statement leak tracing * * @param stmt Statement which needs to be traced * @param listener Leak Listener */ public void stopStatementLeakTracing(Statement stmt, StatementLeakListener listener) { synchronized (statementLeakLock) { if (statementLeakThreadStackHashMap.containsKey(stmt)) { statementLeakThreadStackHashMap.remove(stmt); StatementLeakTask statementLeakTask = statementLeakTimerTaskHashMap.remove(stmt); statementLeakTask.cancel(); timer.purge(); if(_logger.isLoggable(Level.FINEST)) { _logger.finest("Stopped Statement leak tracing timer task"); } unRegisterListener(stmt); } } } /** * Logs the potential statement leaks * * @param stmt Statement that is not closed by application */ private void potentialStatementLeakFound(Statement stmt) { synchronized (statementLeakLock) { if (statementLeakThreadStackHashMap.containsKey(stmt)) { StackTraceElement[] threadStack = statementLeakThreadStackHashMap.remove(stmt); StatementLeakListener stmtLeakListener = listeners.get(stmt); stmtLeakProbeProvider.potentialStatementLeakEvent(poolInfo.getName(), poolInfo.getApplicationName(), poolInfo.getModuleName()); printStatementLeakTrace(threadStack); statementLeakTimerTaskHashMap.remove(stmt); if (statementLeakReclaim) { try { stmtLeakListener.reclaimStatement(); } catch (SQLException ex) { Object[] params = new Object[]{poolInfo, ex}; _logger.log(Level.WARNING, "statement.leak.detector_reclaim_statement_failure", params); } } //Unregister here as the listeners would still be present in the map. unRegisterListener(stmt); } } } /** * Prints the stack trace of thread leaking statement to server logs * * @param threadStackTrace Application(caller) thread stack trace */ private void printStatementLeakTrace(StackTraceElement[] threadStackTrace) { StringBuffer stackTrace = new StringBuffer(); String msg = localStrings.getStringWithDefault( "potential.statement.leak.msg", "A potential statement leak detected for connection pool " + poolInfo + ". The stack trace of the thread is provided below : ", new Object[]{poolInfo}); stackTrace.append(msg); stackTrace.append("\n"); for (int i = 2; i < threadStackTrace.length; i++) { stackTrace.append(threadStackTrace[i].toString()); stackTrace.append("\n"); } _logger.log(Level.WARNING, stackTrace.toString(), "ConnectionPoolName=" + poolInfo); } /** * Clear all statement leak tracing tasks in case of statement leak * tracing being turned off */ public void clearAllStatementLeakTasks() { synchronized (statementLeakLock) { Iterator<Map.Entry<Statement, StatementLeakTask>> entryIterator = statementLeakTimerTaskHashMap.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<Statement,StatementLeakTask> entry = entryIterator.next(); StatementLeakTask statementLeakTask = entry.getValue(); statementLeakTask.cancel(); } if (timer != null) timer.purge(); statementLeakThreadStackHashMap.clear(); statementLeakTimerTaskHashMap.clear(); } } private class StatementLeakTask extends TimerTask { private Statement statement; StatementLeakTask(Statement stmt) { this.statement = stmt; } public void run() { potentialStatementLeakFound(statement); } } }
{'repo_name': 'eclipse-ee4j/glassfish', 'stars': '178', 'repo_language': 'Java', 'file_name': 'build.xml', 'mime_type': 'text/plain', 'hash': 7010976047205418809, 'source_dataset': 'data'}
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = require('../utils/Class'); var GetValue = require('../utils/object/GetValue'); var NOOP = require('../utils/NOOP'); var RequestAnimationFrame = require('../dom/RequestAnimationFrame'); // http://www.testufo.com/#test=animation-time-graph /** * @classdesc * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid * this situation, all you can do is use the visibility events the browser, and Phaser, provide to detect when * it has happened and then gracefully recover. * * @class TimeStep * @memberof Phaser.Core * @constructor * @since 3.0.0 * * @param {Phaser.Game} game - A reference to the Phaser.Game instance that owns this Time Step. * @param {Phaser.Types.Core.FPSConfig} config */ var TimeStep = new Class({ initialize: function TimeStep (game, config) { /** * A reference to the Phaser.Game instance. * * @name Phaser.Core.TimeStep#game * @type {Phaser.Game} * @readonly * @since 3.0.0 */ this.game = game; /** * The Request Animation Frame DOM Event handler. * * @name Phaser.Core.TimeStep#raf * @type {Phaser.DOM.RequestAnimationFrame} * @readonly * @since 3.0.0 */ this.raf = new RequestAnimationFrame(); /** * A flag that is set once the TimeStep has started running and toggled when it stops. * * @name Phaser.Core.TimeStep#started * @type {boolean} * @readonly * @default false * @since 3.0.0 */ this.started = false; /** * A flag that is set once the TimeStep has started running and toggled when it stops. * The difference between this value and `started` is that `running` is toggled when * the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if * the TimeStep is actually stopped, not just paused. * * @name Phaser.Core.TimeStep#running * @type {boolean} * @readonly * @default false * @since 3.0.0 */ this.running = false; /** * The minimum fps rate you want the Time Step to run at. * * @name Phaser.Core.TimeStep#minFps * @type {integer} * @default 5 * @since 3.0.0 */ this.minFps = GetValue(config, 'min', 5); /** * The target fps rate for the Time Step to run at. * * Setting this value will not actually change the speed at which the browser runs, that is beyond * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step * is spiraling out of control. * * @name Phaser.Core.TimeStep#targetFps * @type {integer} * @default 60 * @since 3.0.0 */ this.targetFps = GetValue(config, 'target', 60); /** * The minFps value in ms. * Defaults to 200ms between frames (i.e. super slow!) * * @name Phaser.Core.TimeStep#_min * @type {number} * @private * @since 3.0.0 */ this._min = 1000 / this.minFps; /** * The targetFps value in ms. * Defaults to 16.66ms between frames (i.e. normal) * * @name Phaser.Core.TimeStep#_target * @type {number} * @private * @since 3.0.0 */ this._target = 1000 / this.targetFps; /** * An exponential moving average of the frames per second. * * @name Phaser.Core.TimeStep#actualFps * @type {integer} * @readonly * @default 60 * @since 3.0.0 */ this.actualFps = this.targetFps; /** * The time at which the next fps rate update will take place. * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate * @type {integer} * @readonly * @default 0 * @since 3.0.0 */ this.nextFpsUpdate = 0; /** * The number of frames processed this second. * * @name Phaser.Core.TimeStep#framesThisSecond * @type {integer} * @readonly * @default 0 * @since 3.0.0 */ this.framesThisSecond = 0; /** * A callback to be invoked each time the Time Step steps. * * @name Phaser.Core.TimeStep#callback * @type {Phaser.Types.Core.TimeStepCallback} * @default NOOP * @since 3.0.0 */ this.callback = NOOP; /** * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. * * @name Phaser.Core.TimeStep#forceSetTimeOut * @type {boolean} * @readonly * @default false * @since 3.0.0 */ this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false); /** * The time, calculated at the start of the current step, as smoothed by the delta value. * * @name Phaser.Core.TimeStep#time * @type {number} * @default 0 * @since 3.0.0 */ this.time = 0; /** * The time at which the game started running. This value is adjusted if the game is then * paused and resumes. * * @name Phaser.Core.TimeStep#startTime * @type {number} * @default 0 * @since 3.0.0 */ this.startTime = 0; /** * The time, as returned by `performance.now` of the previous step. * * @name Phaser.Core.TimeStep#lastTime * @type {number} * @default 0 * @since 3.0.0 */ this.lastTime = 0; /** * The current frame the game is on. This counter is incremented once every game step, regardless of how much * time has passed and is unaffected by delta smoothing. * * @name Phaser.Core.TimeStep#frame * @type {integer} * @readonly * @default 0 * @since 3.0.0 */ this.frame = 0; /** * Is the browser currently considered in focus by the Page Visibility API? * This value is set in the `blur` method, which is called automatically by the Game instance. * * @name Phaser.Core.TimeStep#inFocus * @type {boolean} * @readonly * @default true * @since 3.0.0 */ this.inFocus = true; /** * The timestamp at which the game became paused, as determined by the Page Visibility API. * * @name Phaser.Core.TimeStep#_pauseTime * @type {number} * @private * @default 0 * @since 3.0.0 */ this._pauseTime = 0; /** * An internal counter to allow for the browser 'cooling down' after coming back into focus. * * @name Phaser.Core.TimeStep#_coolDown * @type {integer} * @private * @default 0 * @since 3.0.0 */ this._coolDown = 0; /** * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. * * @name Phaser.Core.TimeStep#delta * @type {integer} * @default 0 * @since 3.0.0 */ this.delta = 0; /** * Internal index of the delta history position. * * @name Phaser.Core.TimeStep#deltaIndex * @type {integer} * @default 0 * @since 3.0.0 */ this.deltaIndex = 0; /** * Internal array holding the previous delta values, used for delta smoothing. * * @name Phaser.Core.TimeStep#deltaHistory * @type {integer[]} * @since 3.0.0 */ this.deltaHistory = []; /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax * @type {integer} * @default 10 * @since 3.0.0 */ this.deltaSmoothingMax = GetValue(config, 'deltaHistory', 10); /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax * @type {integer} * @default 120 * @since 3.0.0 */ this.panicMax = GetValue(config, 'panicMax', 120); /** * The actual elapsed time in ms between one update and the next. * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. * * @name Phaser.Core.TimeStep#rawDelta * @type {number} * @default 0 * @since 3.0.0 */ this.rawDelta = 0; /** * The time, as returned by `performance.now` at the very start of the current step. * This can differ from the `time` value in that it isn't calculated based on the delta value. * * @name Phaser.Core.TimeStep#now * @type {number} * @default 0 * @since 3.18.0 */ this.now = 0; /** * Apply smoothing to the delta value used within Phasers internal calculations? * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config * `smoothStep` value), to allow you to easily disable it, should you require. * * @name Phaser.Core.TimeStep#smoothStep * @type {boolean} * @since 3.22.0 */ this.smoothStep = GetValue(config, 'smoothStep', true); }, /** * Called by the Game instance when the DOM window.onBlur event triggers. * * @method Phaser.Core.TimeStep#blur * @since 3.0.0 */ blur: function () { this.inFocus = false; }, /** * Called by the Game instance when the DOM window.onFocus event triggers. * * @method Phaser.Core.TimeStep#focus * @since 3.0.0 */ focus: function () { this.inFocus = true; this.resetDelta(); }, /** * Called when the visibility API says the game is 'hidden' (tab switch out of view, etc) * * @method Phaser.Core.TimeStep#pause * @since 3.0.0 */ pause: function () { this._pauseTime = window.performance.now(); }, /** * Called when the visibility API says the game is 'visible' again (tab switch back into view, etc) * * @method Phaser.Core.TimeStep#resume * @since 3.0.0 */ resume: function () { this.resetDelta(); this.startTime += this.time - this._pauseTime; }, /** * Resets the time, lastTime, fps averages and delta history. * Called automatically when a browser sleeps them resumes. * * @method Phaser.Core.TimeStep#resetDelta * @since 3.0.0 */ resetDelta: function () { var now = window.performance.now(); this.time = now; this.lastTime = now; this.nextFpsUpdate = now + 1000; this.framesThisSecond = 0; // Pre-populate smoothing array for (var i = 0; i < this.deltaSmoothingMax; i++) { this.deltaHistory[i] = Math.min(this._target, this.deltaHistory[i]); } this.delta = 0; this.deltaIndex = 0; this._coolDown = this.panicMax; }, /** * Starts the Time Step running, if it is not already doing so. * Called automatically by the Game Boot process. * * @method Phaser.Core.TimeStep#start * @since 3.0.0 * * @param {Phaser.Types.Core.TimeStepCallback} callback - The callback to be invoked each time the Time Step steps. */ start: function (callback) { if (this.started) { return this; } this.started = true; this.running = true; for (var i = 0; i < this.deltaSmoothingMax; i++) { this.deltaHistory[i] = this._target; } this.resetDelta(); this.startTime = window.performance.now(); this.callback = callback; this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target); }, /** * The main step method. This is called each time the browser updates, either by Request Animation Frame, * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. * You generally should never call this method directly. * * @method Phaser.Core.TimeStep#step * @since 3.0.0 */ step: function () { // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in, // not the actual time now, and as we want to compare this time value against Event timeStamps and the like, we need a // more accurate one: var time = window.performance.now(); this.now = time; var before = time - this.lastTime; if (before < 0) { // Because, Chrome. before = 0; } this.rawDelta = before; var idx = this.deltaIndex; var history = this.deltaHistory; var max = this.deltaSmoothingMax; // delta time (time is in ms) var dt = before; // Delta Average var avg = before; // When a browser switches tab, then comes back again, it takes around 10 frames before // the delta time settles down so we employ a 'cooling down' period before we start // trusting the delta values again, to avoid spikes flooding through our delta average if (this.smoothStep) { if (this._coolDown > 0 || !this.inFocus) { this._coolDown--; dt = Math.min(dt, this._target); } if (dt > this._min) { // Probably super bad start time or browser tab context loss, // so use the last 'sane' dt value dt = history[idx]; // Clamp delta to min (in case history has become corrupted somehow) dt = Math.min(dt, this._min); } // Smooth out the delta over the previous X frames // add the delta to the smoothing array history[idx] = dt; // adjusts the delta history array index based on the smoothing count // this stops the array growing beyond the size of deltaSmoothingMax this.deltaIndex++; if (this.deltaIndex > max) { this.deltaIndex = 0; } // Loop the history array, adding the delta values together avg = 0; for (var i = 0; i < max; i++) { avg += history[i]; } // Then divide by the array length to get the average delta avg /= max; } // Set as the world delta value this.delta = avg; // Real-world timer advance this.time += this.rawDelta; // Update the estimate of the frame rate, `fps`. Every second, the number // of frames that occurred in that second are included in an exponential // moving average of all frames per second, with an alpha of 0.25. This // means that more recent seconds affect the estimated frame rate more than // older seconds. // // When a browser window is NOT minimized, but is covered up (i.e. you're using // another app which has spawned a window over the top of the browser), then it // will start to throttle the raf callback time. It waits for a while, and then // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. // So if the game was running at 60fps, and the player opens a new window, then // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. // // When they make the game visible again, the frame rate is increased at a rate of // approx. 8fps, back up to 60fps (or the max it can obtain) // // There is no easy way to determine if this drop in frame rate is because the // browser is throttling raf, or because the game is struggling with performance // because you're asking it to do too much on the device. if (time > this.nextFpsUpdate) { // Compute the new exponential moving average with an alpha of 0.25. this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; this.nextFpsUpdate = time + 1000; this.framesThisSecond = 0; } this.framesThisSecond++; // Interpolation - how far between what is expected and where we are? var interpolation = avg / this._target; this.callback(time, avg, interpolation); // Shift time value over this.lastTime = time; this.frame++; }, /** * Manually calls `TimeStep.step`. * * @method Phaser.Core.TimeStep#tick * @since 3.0.0 */ tick: function () { this.step(); }, /** * Sends the TimeStep to sleep, stopping Request Animation Frame (or SetTimeout) and toggling the `running` flag to false. * * @method Phaser.Core.TimeStep#sleep * @since 3.0.0 */ sleep: function () { if (this.running) { this.raf.stop(); this.running = false; } }, /** * Wakes-up the TimeStep, restarting Request Animation Frame (or SetTimeout) and toggling the `running` flag to true. * The `seamless` argument controls if the wake-up should adjust the start time or not. * * @method Phaser.Core.TimeStep#wake * @since 3.0.0 * * @param {boolean} [seamless=false] - Adjust the startTime based on the lastTime values. */ wake: function (seamless) { if (this.running) { return; } else if (seamless) { this.startTime += -this.lastTime + (this.lastTime + window.performance.now()); } this.raf.start(this.step.bind(this), this.useRAF); this.running = true; this.step(); }, /** * Gets the duration which the game has been running, in seconds. * * @method Phaser.Core.TimeStep#getDuration * @since 3.17.0 * * @return {number} The duration in seconds. */ getDuration: function () { return Math.round(this.lastTime - this.startTime) / 1000; }, /** * Gets the duration which the game has been running, in ms. * * @method Phaser.Core.TimeStep#getDurationMS * @since 3.17.0 * * @return {number} The duration in ms. */ getDurationMS: function () { return Math.round(this.lastTime - this.startTime); }, /** * Stops the TimeStep running. * * @method Phaser.Core.TimeStep#stop * @since 3.0.0 * * @return {this} The TimeStep object. */ stop: function () { this.running = false; this.started = false; this.raf.stop(); return this; }, /** * Destroys the TimeStep. This will stop Request Animation Frame, stop the step, clear the callbacks and null * any objects. * * @method Phaser.Core.TimeStep#destroy * @since 3.0.0 */ destroy: function () { this.stop(); this.callback = NOOP; this.raf = null; this.game = null; } }); module.exports = TimeStep;
{'repo_name': 'photonstorm/phaser', 'stars': '27782', 'repo_language': 'JavaScript', 'file_name': 'Product.js', 'mime_type': 'text/plain', 'hash': 5315389716874826672, 'source_dataset': 'data'}
{ "images": [ { "filename": "ic_fluent_speaker_20_filled.pdf", "idiom": "universal" } ], "info": { "author": "xcode", "version": 1 }, "properties": { "preserves-vector-representation": true, "template-rendering-intent": "template" } }
{'repo_name': 'microsoft/fluentui-system-icons', 'stars': '1333', 'repo_language': 'Swift', 'file_name': 'build-ios.yml', 'mime_type': 'text/plain', 'hash': -5305590189220896191, 'source_dataset': 'data'}
### Reverse a singly linked list Q: Given the pointer/reference to the head of a singly linked list, reverse it and return the pointer/reference to the head of reversed linked list.
{'repo_name': 'lightningtgc/JavaScript-Algorithms', 'stars': '193', 'repo_language': 'JavaScript', 'file_name': 'dynamic-programming.md', 'mime_type': 'text/plain', 'hash': -7529757503954807626, 'source_dataset': 'data'}
import React, {Component} from 'react'; import StyleButton from "./styleButton" const AlignmentControls = (props) => { const {editorState,lang} = props; const selection = editorState.getSelection(); const blockType = editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType(); const BLOCK_TYPES = [ { text:lang.alignLeft, label: "editor_alignment_left", style: 'left' }, { text:lang.alignCenter, label: "editor_alignment_center", style: 'center' }, { text:lang.alignRight, label: "editor_alignment_right", style: 'right' }, { text:lang.alignJustify, label: "editor_alignment_justify", style: 'justify' } ]; return ( <div className="RichEditor-controls"> {BLOCK_TYPES.map((type, i) => { let button = <StyleButton key={type.style} text={type.text} active={type.style === blockType} label={type.label} onToggle={props.onToggle} style={type.style}/> return button; })} </div> ); }; module.exports = AlignmentControls;
{'repo_name': 'leejaen/react-lz-editor', 'stars': '857', 'repo_language': 'JavaScript', 'file_name': 'getQiniuUptoken.java', 'mime_type': 'text/plain', 'hash': 529238035984024858, 'source_dataset': 'data'}
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>乌云搜索|搜索结果</title> <link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="//lib.baomitu.com/jquery/3.1.0/jquery.min.js"></script> <script type="text/javascript" src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> <style type="text/css"> .container{ width: auto; max-width: 1500px; margin: 0 auto; position: relative; top: 50px; padding-bottom: 50px; } </style> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="navbar-left"> <a class="navbar-brand" href="#">search from wooyun.org</a> </div> <div class="navbar-right"> <ul class="nav navbar-nav"> <li><a href="./index.html">home</a></li> <li><a href="#">about</a></li> <li><a href=""></a></li> </ul> </div> </nav> <div class="container"> <?php require './config.php'; #接受参数 if (!isset($_GET['keywords'])) { header("Location: index.html"); exit; } else { $keywords = preg_replace("/[^a-zA-Z0-9\x{4e00}-\x{9fff}]+/u", "", $_GET['keywords']); } if (!isset($_GET['page'])) { $page = 1; } else { $page = intval($_GET['page']); } if (!isset($_GET['kind'])) { $kind = 'bugs'; } else { if ($_GET['kind'] === 'bugs' || $_GET['kind'] === 'drops' || $_GET['kind'] === 'author') { $kind = $_GET['kind']; } else { $kind = 'bugs'; } } echo "<h3 style=\"display:inline-block;\">关键词<strong>【{$keywords}】</strong>的搜索结果:</h3>"; //pdo连接mysql try { $conn = new PDO("mysql:host={$config['host']};dbname={$config['database']};port={$config['port']};charset=utf8", $config['user'], $config['passwd']); //echo "mysql:host={$config['host']};dbname={$config['database']}"; } catch (PDOException $pe) { die("Could not connect to the database $dbname :" . $pe->getMessage()); } //查询数目 if ($kind === 'author') { $query0 = "SELECT count(*) FROM `bugs` WHERE author LIKE '%{$keywords}%'"; $query1 = "SELECT count(*) FROM `drops` WHERE author LIKE '%{$keywords}%'"; $res0 = $conn->query($query0); $res1 = $conn->query($query1); $row = $res0->fetch(PDO::FETCH_NUM)[0] + $res1->fetch(PDO::FETCH_NUM)[0]; } else { $query0="SELECT count(*) FROM `{$kind}` WHERE `title` LIKE '%{$keywords}%'"; $res0 = $conn->query($query0); $row = $res0->fetch(PDO::FETCH_NUM)[0]; } //得到总页数 $p if ($row % 15 != 0) { $p = intval($row / 15) + 1; } else { $p = $row / 15; } if ($row == 0) $p = 1; if ($page > $p || $page <1 ) $page = 1; echo "<h4 style=\"display:inline-block;\">共 {$row} 条记录</h4>"; $start = ($page - 1) * 15; if ($kind === 'author') { $query = "(SELECT doc,dates,title,type,author FROM `bugs` WHERE `author` LIKE '%{$keywords}%') UNION ALL (SELECT doc,dates,title,type,author FROM `drops` WHERE `author` LIKE '%{$keywords}%')ORDER BY dates DESC LIMIT {$start},15"; } else { $query = "SELECT * FROM `{$kind}` WHERE `title` LIKE '%{$keywords}%' ORDER BY dates DESC LIMIT {$start},15"; } $res = $conn->query($query); $resulte = $res->fetchAll(PDO::FETCH_ASSOC); //var_dump($resulte); //输出结果 echo '<div><table class="table table-striped table-hover">'; echo '<tr><td>提交时间</td><td>标题</td><td>漏洞类型</td><td>提交者</td><tr>'; foreach ($resulte as $rrr){ if ($kind != "author") { echo "<tr onclick=\"window.open('./{$kind}/{$rrr['doc']}');\" style=\"cursor:pointer;\">"; } else { if (array_key_exists($rrr['type'], $drops)) { echo "<tr onclick=\"window.open('./drops/{$rrr['doc']}');\" style=\"cursor:pointer;\">"; } else { echo "<tr onclick=\"window.open('./bugs/{$rrr['doc']}');\" style=\"cursor:pointer;\">"; } } $time0 = str_split($rrr['dates'], 10); echo "<td>{$time0[0]}</td>"; echo "<td style=\"color:#01a8ff;\">{$rrr['title']}</td>"; if (array_key_exists($rrr['type'], $drops)) { echo "<td style=\"color:#01a8ff;\">{$drops[$rrr['type']]}</td>"; } else { echo "<td style=\"color:#01a8ff;\">{$rrr['type']}</td>"; } echo "<td>{$rrr['author']}</td>"; echo "</tr>"; } echo "</table></div>"; $conn = null; //分页 echo '<ul class="pagination pagination-lg">'; //首 if ($page==1) { echo '<li class="disabled"><a href="#">&laquo;</a></li>'; } else { echo "<li><a href=\"search.php?kind={$kind}&keywords={$keywords}&page={($page-1)}\">&laquo;</a></li>"; } //中间处理 if ($p > 17) { if ($page < 9) { $i=1; } elseif ($page >= 9 && $page + 8 < $p) { $i = $page-8; } elseif ($page + 8 >= $p) { $i = $p-8; } $j = $i + 17; } else { $i = 1; $j = $p; } //echo $p; for (;$i <= $j;$i++) { if ($page == $i) { echo "<li class=\"disabled\"><a href=\"search.php?kind={$kind}&keywords={$keywords}&page={$i}\">{$i}</a></li>"; } else { echo "<li><a href=\"search.php?kind={$kind}&keywords={$keywords}&page={$i}\">{$i}</a></li>"; } } //尾 if ($page == $p || $p ==0) { echo '<li class="disabled"><a href="#">&raquo;</a></li>'; } else { echo "<li><a href=\"search.php?kind={$kind}&keywords={$keywords}&page={($page+1)}\">&raquo;</a></li>"; } echo "</ul>"; ?> </div> <nav class="navbar navbar-default navbar-fixed-bottom" role="navigation"> <p class="navbar-text navbar-left">公开漏洞、知识库等数据来自于wooyun.org</p> <!--<p class="navbar-text navbar-right">written by grt1st</p> --> </nav> </body> </html>
{'repo_name': 'grt1st/wooyun_search', 'stars': '337', 'repo_language': 'PHP', 'file_name': 'index.html', 'mime_type': 'text/html', 'hash': 5751533847265433807, 'source_dataset': 'data'}
# -*- coding: utf-8 -*- # # PyTorch documentation build configuration file, created by # sphinx-quickstart on Fri Dec 23 13:31:47 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os # sys.path.insert(0, os.path.abspath('.')) import textwrap # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.6' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.intersphinx', 'breathe', 'exhale' ] intersphinx_mapping = { 'pytorch': ('https://pytorch.org/docs/master', None) } # Setup absolute paths for communicating with breathe / exhale where # items are expected / should be trimmed by. # This file is {repo_root}/docs/cpp/source/conf.py this_file_dir = os.path.abspath(os.path.dirname(__file__)) doxygen_xml_dir = os.path.join( os.path.dirname(this_file_dir), # {repo_root}/docs/cpp 'build', # {repo_root}/docs/cpp/build 'xml' # {repo_root}/docs/cpp/build/xml ) repo_root = os.path.dirname( # {repo_root} os.path.dirname( # {repo_root}/docs os.path.dirname( # {repo_root}/docs/cpp this_file_dir # {repo_root}/docs/cpp/source ) ) ) breathe_projects = {"PyTorch": doxygen_xml_dir} breathe_default_project = "PyTorch" # Setup the exhale extension exhale_args = { ############################################################################ # These arguments are required. # ############################################################################ "containmentFolder": "./api", "rootFileName": "library_root.rst", "rootFileTitle": "Library API", "doxygenStripFromPath": repo_root, ############################################################################ # Suggested optional arguments. # ############################################################################ "createTreeView": True, "exhaleExecutesDoxygen": True, "exhaleUseDoxyfile": True, "verboseBuild": True, ############################################################################ # HTML Theme specific configurations. # ############################################################################ # Fix broken Sphinx RTD Theme 'Edit on GitHub' links # Search for 'Edit on GitHub' on the FAQ: # http://exhale.readthedocs.io/en/latest/faq.html "pageLevelConfigMeta": ":github_url: https://github.com/pytorch/pytorch", ############################################################################ # Individual page layout example configuration. # ############################################################################ # Example of adding contents directives on custom kinds with custom title "contentsTitle": "Page Contents", "kindsWithContentsDirectives": ["class", "file", "namespace", "struct"], # Exclude PIMPL files from class hierarchy tree and namespace pages. "listingExclude": [r".*Impl$"], ############################################################################ # Main library page layout example configuration. # ############################################################################ "afterTitleDescription": textwrap.dedent(u''' Welcome to the developer reference for the PyTorch C++ API. '''), } # Tell sphinx what the primary language being documented is. primary_domain = 'cpp' # Tell sphinx what the pygments highlight language should be. highlight_language = 'cpp' # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'PyTorch' copyright = '2019, Torch Contributors' author = 'Torch Contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. # TODO: change to [:2] at v1.0 version = 'master' # The full version, including alpha/beta/rc tags. # TODO: verify this works as expected release = 'master' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'pytorch_sphinx_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = { 'canonical_url': 'https://pytorch.org/docs/stable/', 'pytorch_project': 'docs', 'collapse_navigation': False, 'display_version': True, 'logo_only': True, } # NOTE: sharing python docs resources html_logo = os.path.join( repo_root, 'docs', 'source', '_static', 'img', 'pytorch-logo-dark-unstable.png' ) # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # NOTE: sharing python docs resources html_static_path = [os.path.join(repo_root, 'docs', 'cpp', 'source', '_static')] # Called automatically by Sphinx, making this `conf.py` an "extension". def setup(app): # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value # and can be moved outside of this function (and the setup(app) function # can be deleted). html_css_files = ['cpp_theme.css'] # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is # `add_stylesheet` (deprecated in 1.8). add_css = getattr(app, 'add_css_file', app.add_stylesheet) for css_file in html_css_files: add_css(css_file) # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. # htmlhelp_basename = 'PyTorchdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'pytorch.tex', 'PyTorch Documentation', 'Torch Contributors', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'PyTorch', 'PyTorch Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'PyTorch', 'PyTorch Documentation', author, 'PyTorch', 'One line description of project.', 'Miscellaneous'), ]
{'repo_name': 'pytorch/pytorch', 'stars': '40242', 'repo_language': 'C++', 'file_name': 'example2.c', 'mime_type': 'text/x-c', 'hash': -7435521001121044124, 'source_dataset': 'data'}
/* * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * Libavfilter multithreading support */ #include "config.h" #include "libavutil/common.h" #include "libavutil/cpu.h" #include "libavutil/mem.h" #include "libavutil/thread.h" #include "libavutil/slicethread.h" #include "avfilter.h" #include "internal.h" #include "thread.h" typedef struct ThreadContext { AVFilterGraph *graph; AVSliceThread *thread; avfilter_action_func *func; /* per-execute parameters */ AVFilterContext *ctx; void *arg; int *rets; } ThreadContext; static void worker_func(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads) { ThreadContext *c = priv; int ret = c->func(c->ctx, c->arg, jobnr, nb_jobs); if (c->rets) c->rets[jobnr] = ret; } static void slice_thread_uninit(ThreadContext *c) { avpriv_slicethread_free(&c->thread); } static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs) { ThreadContext *c = ctx->graph->internal->thread; if (nb_jobs <= 0) return 0; c->ctx = ctx; c->arg = arg; c->func = func; c->rets = ret; avpriv_slicethread_execute(c->thread, nb_jobs, 0); return 0; } static int thread_init_internal(ThreadContext *c, int nb_threads) { nb_threads = avpriv_slicethread_create(&c->thread, c, worker_func, NULL, nb_threads); if (nb_threads <= 1) avpriv_slicethread_free(&c->thread); return FFMAX(nb_threads, 1); } int ff_graph_thread_init(AVFilterGraph *graph) { int ret; if (graph->nb_threads == 1) { graph->thread_type = 0; return 0; } graph->internal->thread = av_mallocz(sizeof(ThreadContext)); if (!graph->internal->thread) return AVERROR(ENOMEM); ret = thread_init_internal(graph->internal->thread, graph->nb_threads); if (ret <= 1) { av_freep(&graph->internal->thread); graph->thread_type = 0; graph->nb_threads = 1; return (ret < 0) ? ret : 0; } graph->nb_threads = ret; graph->internal->thread_execute = thread_execute; return 0; } void ff_graph_thread_free(AVFilterGraph *graph) { if (graph->internal->thread) slice_thread_uninit(graph->internal->thread); av_freep(&graph->internal->thread); }
{'repo_name': 'TelegramMessenger/Telegram-iOS', 'stars': '1614', 'repo_language': 'Swift', 'file_name': 'prepare_buck_source.sh', 'mime_type': 'text/x-shellscript', 'hash': -667688053238817686, 'source_dataset': 'data'}
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="en"> <context> <name>AboutDialog</name> <message> <location filename="../dialogs/aboutdialog.ui" line="23"/> <source>QtADB - Your android manager</source> <extracomment>About dialog title</extracomment> <translation>QtADB - Your android manager</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="117"/> <source>Created by 7ymekk &amp; mozarcik</source> <translation>Created by 7ymekk &amp; mozarcik</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="124"/> <source>Version</source> <translation>Version</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="141"/> <source>Questions?? Suggestions??</source> <translation>Questions?? Suggestions??</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="148"/> <source>Feel free to contact us:</source> <translation>Feel free to contact us:</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="172"/> <source>Website:</source> <translation>Website:</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="193"/> <source>Icons in app are from:</source> <translation>Icons in app are from:</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="214"/> <source>and</source> <translation>and</translation> </message> <message> <location filename="../dialogs/aboutdialog.ui" line="280"/> <source>Ok</source> <translation>Ok</translation> </message> </context> <context> <name>AppTableModel</name> <message> <location filename="../classes/models/apptablemodel.cpp" line="163"/> <source>Name</source> <comment>application table name</comment> <translation>Name</translation> </message> <message> <location filename="../classes/models/apptablemodel.cpp" line="165"/> <source>Version</source> <comment>application table version</comment> <translation>Version</translation> </message> <message> <location filename="../classes/models/apptablemodel.cpp" line="167"/> <source>Size</source> <comment>applications table size</comment> <translation>Size</translation> </message> <message> <location filename="../classes/models/apptablemodel.cpp" line="169"/> <source>Package</source> <comment>application table package</comment> <translation>Package</translation> </message> <message> <location filename="../classes/models/apptablemodel.cpp" line="171"/> <source>File</source> <comment>application table file</comment> <translation>File</translation> </message> <message> <location filename="../classes/models/apptablemodel.cpp" line="173"/> <source>Location</source> <comment>application table location</comment> <translation>Location</translation> </message> </context> <context> <name>AppWidget</name> <message> <location filename="../widgets/appwidget.ui" line="69"/> <source>applications</source> <translation>Applications</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="74"/> <source>backups</source> <translation>Backups</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="79"/> <source>system apps</source> <translation>System applications</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="89"/> <source>filter</source> <translation>filter</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="167"/> <source>App name</source> <extracomment>app name label</extracomment> <translation>Application name</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="181"/> <source>App version</source> <extracomment>version label</extracomment> <translation>Applications version</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="195"/> <source>File name</source> <extracomment>file name label</extracomment> <translation>File name</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="209"/> <source>File Size</source> <extracomment>size label</extracomment> <translation>File size</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="253"/> <source>Package name</source> <extracomment>package label</extracomment> <translation>Package name</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="287"/> <source>Location</source> <extracomment>location label</extracomment> <translation>Location</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="334"/> <source>Latest version</source> <extracomment>latest version label</extracomment> <translation>Latest version</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="368"/> <location filename="../widgets/appwidget.cpp" line="778"/> <source>uninstall</source> <extracomment>uninstall apps</extracomment> <translation>Uninstall</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="400"/> <location filename="../widgets/appwidget.cpp" line="661"/> <source>backup</source> <extracomment>backup apps</extracomment> <translation>Backup</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="446"/> <location filename="../widgets/appwidget.cpp" line="860"/> <source>restore</source> <extracomment>restore backup</extracomment> <translation>Restore</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="478"/> <source>remove</source> <extracomment>remove backup</extracomment> <translation>Remove</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="509"/> <source>Refresh</source> <extracomment>refresh apps/backups</extracomment> <translation>Refresh</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="535"/> <source>Open in Market (Phone)</source> <translation>Open in Market (Phone)</translation> </message> <message> <location filename="../widgets/appwidget.ui" line="561"/> <source>Open in Market (PC)</source> <translation>Open in Market (PC)</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="151"/> <source>Choose where You want to save selected apps</source> <translation>Choose where You want to save selected apps</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="595"/> <source>Missing aapt</source> <translation>Missing aapt</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="72"/> <source>backup</source> <comment>backup menu title</comment> <translation>Backup</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="74"/> <source>app</source> <comment>backup menu action</comment> <translation>App</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="75"/> <source>data</source> <comment>backup menu action</comment> <translation>Data</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="76"/> <source>app + data</source> <comment>backup menu action</comment> <translation>Application and data</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="84"/> <source>restore</source> <comment>restore menu title</comment> <translation>Restore</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="86"/> <source>app</source> <comment>restore menu action</comment> <translation>App</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="87"/> <source>data</source> <comment>restore menu action</comment> <translation>Data</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="88"/> <source>app + data</source> <comment>restore menu action</comment> <translation>Application and data</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="172"/> <source>uninstall</source> <comment>right click apps menu</comment> <translation>Uninstall</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="173"/> <source>copy to PC</source> <comment>right click apps menu</comment> <translation>Copy to PC</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="174"/> <source>Get apps info</source> <comment>right click apps menu</comment> <translation>Get apps info</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="175"/> <source>Get apps version from internet</source> <comment>right click apps menu</comment> <translation>Get app version from internet</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="191"/> <source>remove</source> <comment>right click backups menu</comment> <translation>Remove</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="216"/> <source>selected</source> <comment>selected label below table</comment> <translation>selected</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="353"/> <location filename="../widgets/appwidget.cpp" line="426"/> <source>App name</source> <comment>combo apps filter</comment> <translation>Application name</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="354"/> <location filename="../widgets/appwidget.cpp" line="427"/> <source>Package name</source> <comment>combo apps filter</comment> <translation>Package name</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="355"/> <location filename="../widgets/appwidget.cpp" line="428"/> <source>File path</source> <comment>combo apps filter</comment> <translation>File path</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="356"/> <location filename="../widgets/appwidget.cpp" line="429"/> <source>Location</source> <comment>combo apps filter</comment> <translation>Location</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="392"/> <source>App name</source> <comment>combo backups filter</comment> <translation>Application name</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="393"/> <source>Package name</source> <comment>combo backups filter</comment> <translation>Package name</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="595"/> <source>QtADB did not found aapt. Download it and place in one directory with adb. After You place it in correct directory click Refresh button</source> <translation>QtADB did not found aapt. Download it and place in one directory with adb. After You place it in correct directory click Refresh button</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="596"/> <source>Download</source> <comment>missing aapt message button</comment> <translation>Download</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="597"/> <source>Cancel</source> <comment>missing aapt message button</comment> <translation>Cancel</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="662"/> <location filename="../widgets/appwidget.cpp" line="778"/> <location filename="../widgets/appwidget.cpp" line="810"/> <location filename="../widgets/appwidget.cpp" line="860"/> <source>are you sure???</source> <translation>Are you sure???</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="715"/> <source>select apps to install</source> <translation>Select apps to install</translation> </message> <message> <location filename="../widgets/appwidget.cpp" line="810"/> <source>remove backup</source> <translation>Remove backup</translation> </message> </context> <context> <name>BackupTableModel</name> <message> <location filename="../classes/models/backuptablemodel.cpp" line="127"/> <location filename="../classes/models/backuptablemodel.cpp" line="132"/> <source>yes</source> <translation>yes</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="129"/> <location filename="../classes/models/backuptablemodel.cpp" line="134"/> <source>no</source> <translation>no</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="153"/> <source>Name</source> <comment>backup table header app name</comment> <translation>Name</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="155"/> <source>Version</source> <comment>backup table header app version</comment> <translation>Version</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="157"/> <source>Size</source> <comment>backup table header app size</comment> <translation>Size</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="159"/> <source>Package</source> <comment>backup table header app package</comment> <translation>Package</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="161"/> <source>App</source> <comment>backup table header apk file</comment> <translation>Apk</translation> </message> <message> <location filename="../classes/models/backuptablemodel.cpp" line="163"/> <source>Data</source> <comment>backup table header data</comment> <translation>Data</translation> </message> </context> <context> <name>ConnectWifi</name> <message> <location filename="../dialogs/connectWifi.ui" line="20"/> <location filename="../dialogs/connectWifi.ui" line="116"/> <source>Connect</source> <extracomment>Connect wifi dialog title</extracomment> <translation>Connect</translation> </message> <message> <location filename="../dialogs/connectWifi.ui" line="44"/> <source>Address</source> <translation>Address</translation> </message> <message> <location filename="../dialogs/connectWifi.ui" line="79"/> <source>Port</source> <translation>Port</translation> </message> <message> <location filename="../dialogs/connectWifi.ui" line="123"/> <source>Cancel</source> <translation>Cancel</translation> </message> </context> <context> <name>FastbootWidget</name> <message> <location filename="../widgets/fastbootwidget.ui" line="32"/> <source>Flash SPL</source> <translation>Flash SPL</translation> </message> <message> <location filename="../widgets/fastbootwidget.ui" line="55"/> <source>Flash recovery</source> <translation>Flash recovery</translation> </message> <message> <location filename="../widgets/fastbootwidget.ui" line="65"/> <source>Flash radio</source> <translation>Flash radio</translation> </message> <message> <location filename="../widgets/fastbootwidget.ui" line="75"/> <source>Boot IMG</source> <translation>Boot IMG</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="52"/> <source>Choose img file...</source> <translation>Choose img file...</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="52"/> <location filename="../widgets/fastbootwidget.cpp" line="82"/> <location filename="../widgets/fastbootwidget.cpp" line="117"/> <location filename="../widgets/fastbootwidget.cpp" line="152"/> <source>IMG File </source> <translation>IMG file</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="82"/> <source>Choose hboot img file...</source> <translation>Choose hboot img file...</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="89"/> <location filename="../widgets/fastbootwidget.cpp" line="95"/> <location filename="../widgets/fastbootwidget.cpp" line="124"/> <location filename="../widgets/fastbootwidget.cpp" line="130"/> <location filename="../widgets/fastbootwidget.cpp" line="159"/> <location filename="../widgets/fastbootwidget.cpp" line="165"/> <source>Error!</source> <translation>Error!</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="91"/> <location filename="../widgets/fastbootwidget.cpp" line="126"/> <location filename="../widgets/fastbootwidget.cpp" line="161"/> <source>Success!</source> <translation>Success!</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="95"/> <location filename="../widgets/fastbootwidget.cpp" line="130"/> <location filename="../widgets/fastbootwidget.cpp" line="165"/> <source>Operation cancelled!</source> <translation>Operation cancelled!</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="117"/> <source>Choose radio img file...</source> <translation>Choose radio img file...</translation> </message> <message> <location filename="../widgets/fastbootwidget.cpp" line="152"/> <source>Choose recovery img file...</source> <translation>Choose recovery img file...</translation> </message> </context> <context> <name>FileTableModel</name> <message> <location filename="../classes/models/filetablemodel.cpp" line="187"/> <source>Name</source> <comment>file table file name</comment> <translation>Name</translation> </message> <message> <location filename="../classes/models/filetablemodel.cpp" line="189"/> <source>Size</source> <comment>file table file size</comment> <translation>Size</translation> </message> <message> <location filename="../classes/models/filetablemodel.cpp" line="191"/> <source>Date</source> <comment>file table file date</comment> <translation>Date</translation> </message> </context> <context> <name>FileWidget</name> <message> <location filename="../widgets/filewidget.ui" line="35"/> <source>computer</source> <extracomment>table title</extracomment> <translation>computer</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="116"/> <location filename="../widgets/filewidget.ui" line="224"/> <source>filter</source> <translation>filter</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="45"/> <source>phone</source> <extracomment>table title</extracomment> <translation>phone</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="264"/> <source>F2 rename</source> <extracomment>rename button</extracomment> <translation>F2 rename</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="278"/> <source>F3 select all/none</source> <extracomment>select button</extracomment> <translation>F3 select all/none</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="292"/> <source>F4 install</source> <extracomment>install button</extracomment> <translation>F4 install</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="306"/> <source>F5 copy</source> <extracomment>copy button</extracomment> <translation>F5 copy</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="320"/> <source>F6 new dir</source> <extracomment>new dir button</extracomment> <translation>F6 new dir</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="334"/> <source>F7 refresh</source> <extracomment>refresh files button</extracomment> <translation>F7 refresh</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="348"/> <source>F8 delete</source> <extracomment>delete button</extracomment> <translation>F8 delete</translation> </message> <message> <location filename="../widgets/filewidget.ui" line="362"/> <source>F9 hidden files</source> <extracomment>hidden button</extracomment> <translation>F9 hidden files</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1909"/> <source>install</source> <translation>Install</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="566"/> <location filename="../widgets/filewidget.cpp" line="608"/> <location filename="../widgets/filewidget.cpp" line="1234"/> <location filename="../widgets/filewidget.cpp" line="1301"/> <source>select some files first</source> <translation>Select some files first</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="570"/> <location filename="../widgets/filewidget.cpp" line="1238"/> <location filename="../widgets/filewidget.cpp" line="2052"/> <location filename="../widgets/filewidget.cpp" line="2096"/> <location filename="../widgets/filewidget.cpp" line="2146"/> <source>copying</source> <translation>Copying</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="570"/> <location filename="../widgets/filewidget.cpp" line="612"/> <location filename="../widgets/filewidget.cpp" line="1238"/> <location filename="../widgets/filewidget.cpp" line="1305"/> <location filename="../widgets/filewidget.cpp" line="1909"/> <location filename="../widgets/filewidget.cpp" line="2052"/> <location filename="../widgets/filewidget.cpp" line="2096"/> <location filename="../widgets/filewidget.cpp" line="2146"/> <source>are you sure???</source> <translation>Are you sure???</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="584"/> <location filename="../widgets/filewidget.cpp" line="1252"/> <location filename="../widgets/filewidget.cpp" line="2066"/> <location filename="../widgets/filewidget.cpp" line="2114"/> <location filename="../widgets/filewidget.cpp" line="2162"/> <source>theres nothing to copy. Maybe selected dirs are empty</source> <translation>There&apos;s nothing to copy. Maybe selected dirs are empty</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="612"/> <location filename="../widgets/filewidget.cpp" line="1305"/> <source>deleting</source> <translation>Deleting</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="630"/> <location filename="../widgets/filewidget.cpp" line="1338"/> <location filename="../widgets/filewidget.cpp" line="1347"/> <source>getting files...</source> <translation>getting files...</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="726"/> <location filename="../widgets/filewidget.cpp" line="1471"/> <source>error</source> <translation>Error</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="727"/> <location filename="../widgets/filewidget.cpp" line="1471"/> <source>dir was not created. Make sure that you are allowed to do this</source> <translation>Dir was not created. Make sure that you are allowed to do this</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1715"/> <source>selected</source> <translation>selected</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1601"/> <source>searching...</source> <translation>searching...</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="512"/> <source>rename</source> <comment>computer right click menu</comment> <translation>Rename</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="514"/> <source>select all</source> <comment>computer right click menu</comment> <translation>Select all</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="516"/> <source>select none</source> <comment>computer right click menu</comment> <translation>Select none</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="518"/> <source>copy</source> <comment>computer right click menu</comment> <translation>Copy</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="520"/> <source>new dir</source> <comment>computer right click menu</comment> <translation>New dir</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="522"/> <source>refresh</source> <comment>computer right click menu</comment> <translation>Refresh</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="524"/> <source>delete</source> <comment>computer right click menu</comment> <translation>Delete</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="526"/> <source>hidden files</source> <comment>computer right click menu</comment> <translation>Hidden files</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="528"/> <source>install</source> <comment>computer right click menu</comment> <translation>Install</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="530"/> <source>Show app info</source> <comment>computer right click menu</comment> <translation>Show app info</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="532"/> <source>open in new tab</source> <comment>computer right click menu</comment> <translation>Open in new tab</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="941"/> <source>selected</source> <comment>selected label below table</comment> <translation>selected</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1122"/> <location filename="../widgets/filewidget.cpp" line="1154"/> <source>rename</source> <comment>phone right click menu</comment> <translation>Rename</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1124"/> <location filename="../widgets/filewidget.cpp" line="1156"/> <source>select all</source> <comment>phone right click menu</comment> <translation>Select all</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1126"/> <location filename="../widgets/filewidget.cpp" line="1158"/> <source>select none</source> <comment>phone right click menu</comment> <translation>Select none</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1128"/> <location filename="../widgets/filewidget.cpp" line="1160"/> <source>copy</source> <comment>phone right click menu</comment> <translation>Copy</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1130"/> <location filename="../widgets/filewidget.cpp" line="1162"/> <source>new dir</source> <comment>phone right click menu</comment> <translation>New dir</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1132"/> <location filename="../widgets/filewidget.cpp" line="1164"/> <source>refresh</source> <comment>phone right click menu</comment> <translation>Refresh</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1134"/> <location filename="../widgets/filewidget.cpp" line="1166"/> <source>delete</source> <comment>phone right click menu</comment> <translation>Delete</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1136"/> <location filename="../widgets/filewidget.cpp" line="1168"/> <source>hidden files</source> <comment>phone right click menu</comment> <translation>Hidden files</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1170"/> <source>open in new tab</source> <comment>phone right click menu</comment> <translation>Open in new tab</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1772"/> <source>information</source> <translation>Information</translation> </message> <message> <location filename="../widgets/filewidget.cpp" line="1772"/> <source>It&apos;s not an application</source> <translation>It&apos;s not an application</translation> </message> </context> <context> <name>LogcatDialog</name> <message> <location filename="../dialogs/logcatdialog.ui" line="14"/> <source>Logcat</source> <translation>Logcat</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="29"/> <source>Debug</source> <translation>Debug</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="39"/> <source>Warning</source> <translation>Warning</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="49"/> <source>Information</source> <translation>Information</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="59"/> <source>Error</source> <translation>Error</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="113"/> <source>Verbose</source> <translation>Verbose</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="123"/> <source>filter</source> <translation>Filter</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="131"/> <source>Sender</source> <translation>Sender</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="136"/> <source>Message</source> <translation>Message</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="235"/> <source>autoscroll</source> <translation>autoscroll</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="245"/> <source>clear</source> <translation>clear</translation> </message> <message> <location filename="../dialogs/logcatdialog.ui" line="228"/> <source>Buffer limit</source> <translation>Buffer limit</translation> </message> <message> <location filename="../dialogs/logcatdialog.cpp" line="20"/> <source>clear logcat</source> <translation>clear logcat</translation> </message> <message> <location filename="../dialogs/logcatdialog.cpp" line="21"/> <source>copy selected to clipboard</source> <translation>copy selected to clipboard</translation> </message> <message> <location filename="../dialogs/logcatdialog.cpp" line="22"/> <source>export selected to file</source> <translation>export selected to file</translation> </message> <message> <location filename="../dialogs/logcatdialog.cpp" line="259"/> <source>Save File...</source> <translation>Save file...</translation> </message> <message> <location filename="../dialogs/logcatdialog.cpp" line="259"/> <source>txt file</source> <translation>txt file</translation> </message> </context> <context> <name>LogcatModel</name> <message> <location filename="../classes/models/logcatmodel.cpp" line="138"/> <source>Time</source> <comment>logcat header</comment> <translation>Time</translation> </message> <message> <location filename="../classes/models/logcatmodel.cpp" line="140"/> <source>Type</source> <comment>logcat header</comment> <translation>Type</translation> </message> <message> <location filename="../classes/models/logcatmodel.cpp" line="142"/> <source>Sender</source> <comment>logcat header</comment> <translation>Sender</translation> </message> <message> <location filename="../classes/models/logcatmodel.cpp" line="144"/> <source>Pid</source> <comment>logcat header</comment> <translation>Pid</translation> </message> <message> <location filename="../classes/models/logcatmodel.cpp" line="146"/> <source>Message</source> <comment>logcat header</comment> <translation>Message</translation> </message> </context> <context> <name>MainWindow</name> <message> <location filename="../dialogs/mainwindow.ui" line="107"/> <source>Refresh</source> <extracomment>refresh state when disconnected</extracomment> <translation>Refresh</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="287"/> <source>check for updates</source> <translation>Check for updates</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="97"/> <source>CONNECT YOUR PHONE</source> <translation>CONNECT YOUR PHONE</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="22"/> <source>QtADB - Your android manager</source> <extracomment>Main window title</extracomment> <translation>QtADB - Your android manager</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="172"/> <source>&amp;Connection</source> <translation>&amp;Connection</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="179"/> <source>&amp;Help</source> <translation>&amp;Help</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="187"/> <source>&amp;Tools</source> <translation>&amp;Tools</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="191"/> <source>Adb</source> <translation>Adb</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="200"/> <source>Fastboot</source> <translation>Fastboot</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="232"/> <source>usb</source> <translation>Usb</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="237"/> <source>wifi</source> <translation>Wifi</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="242"/> <source>about</source> <translation>About</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="247"/> <source>polski</source> <translation>Język polski</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="252"/> <location filename="../dialogs/mainwindow.ui" line="267"/> <source>Reboot</source> <translation>Reboot</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="257"/> <location filename="../dialogs/mainwindow.ui" line="272"/> <source>Reboot bootloader</source> <translation>Reboot bootloader</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="262"/> <source>Reboot recovery</source> <translation>Reboot recovery</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="277"/> <location filename="../dialogs/mainwindow.ui" line="282"/> <source>Power off</source> <translation>Power off</translation> </message> <message> <location filename="../dialogs/mainwindow.ui" line="292"/> <source>enter register key</source> <translation>Enter register key</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="42"/> <source>Logcat</source> <comment>action in system tray menu</comment> <translation>Logcat</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="44"/> <source>exit</source> <comment>action in system tray menu</comment> <translation>Exit</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="71"/> <source>Files</source> <comment>files button</comment> <translation>Files</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="72"/> <source>Apps</source> <comment>apps button</comment> <translation>Apps</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="73"/> <source>Recovery</source> <comment>recovery button</comment> <translation>Recovery</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="74"/> <source>Fastboot</source> <comment>fastbot button</comment> <translation>Fastboot</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="75"/> <source>Phone info</source> <comment>phone info button</comment> <translation>Phone info</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="76"/> <source>Screenshot</source> <comment>screenshot button</comment> <translation>Screenshot</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="77"/> <source>Settings</source> <comment>settings button</comment> <translation>Settings</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="78"/> <source>Shell</source> <comment>shell button</comment> <translation>Shell</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="79"/> <source>Messages</source> <comment>messages button</comment> <translation>Messages</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="81"/> <source>Logcat</source> <comment>logcat button</comment> <translation>Logcat</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="677"/> <source>Attention!</source> <translation>Attention!</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="678"/> <source>To use message manager You have to turn on WiFi.</source> <translation>To use message manager You have to turn on WiFi.</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="807"/> <source>Sms from </source> <comment>system tray bubble</comment> <translation>SMS from </translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="812"/> <source>Sms result</source> <comment>system tray bubble</comment> <translation>Sms result</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="866"/> <source>New updates</source> <translation>New updates</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="866"/> <source>New update is available </source> <translation>New update is available </translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="867"/> <location filename="../dialogs/mainwindow.cpp" line="890"/> <source>Your version: </source> <translation>Your version: </translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="867"/> <location filename="../dialogs/mainwindow.cpp" line="890"/> <source> Latest version: </source> <translation> Latest version: </translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="868"/> <source>Download</source> <translation>Download</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="869"/> <source>Close</source> <translation>Close</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="885"/> <source>error</source> <translation>Error</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="885"/> <source>There was problem while checking for updates</source> <translation>There was problem while checking for updates</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="889"/> <source>No updates</source> <translation>No updates</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="889"/> <source>Your version is up to date </source> <translation>Your version is up to date </translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="1008"/> <source>Donate</source> <translation>Donate</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="1009"/> <source>It seems that you are using QtADB for a while now. Maybe consider a donation to a project...</source> <translation>It seems that you are using QtADB for a while now. Maybe consider a donation to a project...</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="1010"/> <source>Yes, I want to donate</source> <translation>Yes, I want to donate</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="1011"/> <source>Remaind me later</source> <translation>Remaind me later</translation> </message> <message> <location filename="../dialogs/mainwindow.cpp" line="1012"/> <source>Do not bother me again</source> <translation>Do not bother me again</translation> </message> </context> <context> <name>MessageWidget</name> <message> <location filename="../widgets/messagewidget.ui" line="87"/> <source>refresh list</source> <extracomment>refresh messages button</extracomment> <translation>Refresh list</translation> </message> </context> <context> <name>PhoneInfoWidget</name> <message> <location filename="../widgets/phoneinfowidget.ui" line="50"/> <source>Model</source> <translation>Model</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="67"/> <source>Operator</source> <translation>Operator</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="84"/> <source>Serial number</source> <translation>Serial number</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="101"/> <source>Bootloader</source> <translation>Bootloader</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="118"/> <source>Rom</source> <translation>Rom</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="144"/> <source>Radio</source> <translation>Radio</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="161"/> <source>Battery level</source> <translation>Battery level</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="375"/> <location filename="../widgets/phoneinfowidget.ui" line="382"/> <location filename="../widgets/phoneinfowidget.ui" line="389"/> <location filename="../widgets/phoneinfowidget.ui" line="396"/> <source>available:</source> <translation>available:</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="443"/> <location filename="../widgets/phoneinfowidget.ui" line="450"/> <location filename="../widgets/phoneinfowidget.ui" line="457"/> <location filename="../widgets/phoneinfowidget.ui" line="464"/> <source>used:</source> <translation>used:</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="511"/> <location filename="../widgets/phoneinfowidget.ui" line="518"/> <location filename="../widgets/phoneinfowidget.ui" line="525"/> <location filename="../widgets/phoneinfowidget.ui" line="532"/> <source>size:</source> <translation>size:</translation> </message> <message> <location filename="../widgets/phoneinfowidget.ui" line="690"/> <source>refresh</source> <translation>Refresh</translation> </message> </context> <context> <name>QObject</name> <message> <location filename="../main.cpp" line="139"/> <location filename="../main.cpp" line="172"/> <location filename="../main.cpp" line="186"/> <source>error</source> <translation>Error</translation> </message> <message> <location filename="../main.cpp" line="118"/> <source>Choose path to dir with adb and aapt binaries</source> <translation>Choose path to dir with adb and aapt binaries</translation> </message> <message> <location filename="../main.cpp" line="139"/> <source>there is no adb binary in here!</source> <translation>There is no adb binary in here!</translation> </message> <message> <location filename="../main.cpp" line="140"/> <source>Choose path</source> <translation>Choose path</translation> </message> <message> <location filename="../main.cpp" line="141"/> <source>Close</source> <translation>Close</translation> </message> <message> <location filename="../main.cpp" line="172"/> <source>It seems that adb is not working properly</source> <translation>It seems that adb is not working properly</translation> </message> <message> <location filename="../main.cpp" line="187"/> <source>adbd cannot run as root in production builds so You can&apos;t do anything with /system partition. Run anyway? (press save to run QtADB and disable this message)</source> <translation>adbd cannot run as root in production builds so You can&apos;t do anything with /system partition. Run anyway? (press save to run QtADB and disable this message)</translation> </message> </context> <context> <name>RecoveryWidget</name> <message> <location filename="../widgets/recoverywidget.ui" line="51"/> <source>Nandroid backup</source> <translation>Nandroid backup</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="64"/> <source>Bart backup</source> <translation></translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="77"/> <source>Clear battery stats</source> <translation>Clear battery stats</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="84"/> <location filename="../widgets/recoverywidget.cpp" line="517"/> <source>Wipe data</source> <translation>Wipe data</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="97"/> <source>Mount SDcard to computer</source> <translation>Mount SDcard to computer</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="107"/> <source>Nandroid restore</source> <translation>Nandroid restore</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="120"/> <source>Bart restore</source> <translation>Bart restore</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="133"/> <source>Fix UID mismatches</source> <translation>Fix UID mismatches</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="143"/> <source>Flash zip</source> <translation>Flash zip</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="198"/> <source>Substring</source> <translation>Substring</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="214"/> <source>Backup</source> <translation>Backup</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="234"/> <source>Path</source> <translation>Path</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="416"/> <source>Restore</source> <translation>Restore</translation> </message> <message> <location filename="../widgets/recoverywidget.ui" line="839"/> <source>Choose one of options above</source> <translation>Choose one of options above</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="135"/> <source>Fix UID finished!</source> <translation>Fix UID finished!</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="135"/> <source>Fixing UID mismatches is finished.</source> <translation>Fixing UID mismatches is finished.</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="155"/> <source>Flash Zip</source> <translation>Flash Zip</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="155"/> <location filename="../widgets/recoverywidget.cpp" line="517"/> <source>Are you sure??</source> <translation>Are you sure??</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="157"/> <source>Open ROM File</source> <translation>Open ROM file</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="157"/> <source>Zip files (*.zip)</source> <translation>Zip files (*.zip)</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="192"/> <location filename="../widgets/recoverywidget.cpp" line="522"/> <source>Writing commands....</source> <translation>Writing commands....</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="199"/> <location filename="../widgets/recoverywidget.cpp" line="533"/> <source>Rebooting....</source> <translation>Rebooting....</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="217"/> <source>USB mounted</source> <translation>USB mounted</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="217"/> <source>SD card is mounted as usb drive</source> <translation>SD card is mounted as usb drive</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="221"/> <source>USB unmounted</source> <translation>USB unmounted</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="221"/> <source>SD card is unmounted</source> <translation>SD card is unmounted</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="225"/> <source>Error</source> <translation>Error</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="281"/> <source>Backup finished!</source> <translation>Backup finished!</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="281"/> <source>Nandroid backup is finished.</source> <translation>Nandroid backup is finished.</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="437"/> <source>Restore finished!</source> <translation>Restore finished!</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="437"/> <source>Nandroid restore is finished.</source> <translation>Nandroid restore is finished.</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="469"/> <source>Finished</source> <translation>Finished</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="472"/> <source>Finished Choose one backup from combo above to restore it</source> <translation>Finished Choose one backup from combo above to restore it</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="494"/> <source>Looking for backups...</source> <translation>Looking for backups...</translation> </message> <message> <location filename="../widgets/recoverywidget.cpp" line="512"/> <source>Information</source> <translation>Information</translation> </message> </context> <context> <name>RegisterDialog</name> <message> <location filename="../dialogs/registerdialog.ui" line="32"/> <source>Register</source> <translation type="unfinished"></translation> </message> <message> <location filename="../dialogs/registerdialog.ui" line="53"/> <source>insert key</source> <translation>insert key</translation> </message> <message> <location filename="../dialogs/registerdialog.ui" line="128"/> <source>Insert registration key:</source> <translation>Insert registration key:</translation> </message> <message> <location filename="../dialogs/registerdialog.ui" line="137"/> <source>don&apos;t have a key? consider donation: </source> <translation>don&apos;t have a key? consider donation:</translation> </message> <message> <location filename="../dialogs/registerdialog.ui" line="187"/> <source>cancel</source> <translation>cancel</translation> </message> </context> <context> <name>ScreenshotWidget</name> <message> <location filename="../widgets/screenshotwidget.ui" line="76"/> <source>Refresh</source> <extracomment>refresh screenshot button</extracomment> <translation>Refresh</translation> </message> <message> <location filename="../widgets/screenshotwidget.ui" line="87"/> <source>Save</source> <extracomment>save screenshot button</extracomment> <translation>Save</translation> </message> <message> <location filename="../widgets/screenshotwidget.ui" line="98"/> <source>Rotate left</source> <extracomment>rotate screenshot</extracomment> <translation>Rotate left</translation> </message> <message> <location filename="../widgets/screenshotwidget.ui" line="109"/> <source>Rotate right</source> <extracomment>rotate screenshot</extracomment> <translation>Rotate right</translation> </message> <message> <location filename="../widgets/screenshotwidget.cpp" line="108"/> <source>Save File...</source> <translation>Save file...</translation> </message> <message> <location filename="../widgets/screenshotwidget.cpp" line="108"/> <source>Png file</source> <translation>Png file</translation> </message> </context> <context> <name>SettingsWidget</name> <message> <location filename="../widgets/settingswidget.ui" line="190"/> <source>Save position and size of window on exit</source> <translation>Save position and size of window on exit</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="197"/> <source>Always close copy window after finished</source> <translation>Always close copy window after finished</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="204"/> <source>Show modal copy window</source> <translation>Show modal copy window</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="217"/> <source>App font:</source> <translation>App font:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="243"/> <location filename="../widgets/settingswidget.ui" line="282"/> <location filename="../widgets/settingswidget.ui" line="315"/> <source>Change font</source> <translation>Change font</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="256"/> <source>Tables font:</source> <translation>Tables font:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="289"/> <source>Shell font:</source> <translation>Shell font:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="370"/> <source>Kill demon on exit</source> <translation>Kill daemon on exit</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="390"/> <source>Check for updates on start</source> <translation>Check for updates on start</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="940"/> <source>Coloring files</source> <translation>Color files</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="410"/> <source>Set toolBar style:</source> <translation>Set button bar style:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="117"/> <source>Shell</source> <translation>Shell</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="417"/> <source>Set toolBar icon size:</source> <translation>Set button bar icon size:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="424"/> <source>Set hide/disable buttons on toolBar:</source> <translation>Set hide/disable buttons on button bar:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="432"/> <source>Icon only</source> <translation>Icon only</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="437"/> <source>Text only</source> <translation>Text only</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="442"/> <source>Text beside icon</source> <translation>Text beside icon</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="447"/> <source>Text under icon</source> <translation>Text under icon</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="456"/> <source>Hide buttons</source> <translation>Hide buttons</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="461"/> <source>Disable buttons</source> <translation>Disable buttons</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="483"/> <source>Left</source> <translation>Left</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="488"/> <source>Right</source> <translation>Right</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="493"/> <source>Top</source> <translation>Top</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="498"/> <source>Bottom</source> <translation>Bottom</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="506"/> <source>Area of toolBar:</source> <translation>Area of button bar:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="514"/> <source>Left to right</source> <translation>Left to right</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="519"/> <source>Right to left</source> <translation>Right to left</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="527"/> <source>App layout:</source> <translation>App layout direction:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="554"/> <source>Computer</source> <translation>Computer</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="575"/> <location filename="../widgets/settingswidget.ui" line="797"/> <source>Set path on start:</source> <translation>Set path on start:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="598"/> <location filename="../widgets/settingswidget.ui" line="820"/> <source>Remember path on exit</source> <translation>Remember path on exit</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="611"/> <location filename="../widgets/settingswidget.ui" line="833"/> <source>Show hidden files</source> <translation>Show hidden files</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="627"/> <location filename="../widgets/settingswidget.ui" line="849"/> <source>Show table columns headers</source> <translation>Show table columns headers</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="688"/> <source>Show app icon instead default</source> <translation>Show app icon instead of default</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="701"/> <source>Instead of file name show:</source> <translation>Instead of file name show:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="714"/> <source>Available variables: &lt;appName&gt; &lt;appVersion&gt; &lt;packageName&gt;</source> <translation>Available variables: &lt;appName&gt; &lt;appVersion&gt; &lt;packageName&gt;</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="743"/> <source>Show/hide computer files columns:</source> <translation>Show/hide computer files columns:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="776"/> <source>Phone</source> <translation>Phone</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="917"/> <source>Show/hide phone files columns:</source> <translation>Show/hide phone files columns:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="978"/> <source>Default action on backup:</source> <translation>Default action on backup:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="989"/> <source>Backup only apk</source> <translation>Backup only apk file</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="994"/> <source>Backup only data</source> <translation>Backup only data</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="999"/> <source>Backup apk + data</source> <translation>Backup apk file and data</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1007"/> <source>Default action on restore:</source> <translation>Default action on restore:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1018"/> <source>Restore only apk</source> <translation>Restore only apk file</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1023"/> <source>Restore only data</source> <translation>Restore only data</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1028"/> <source>Restore apk + data</source> <translation>Restore apk file and data</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1036"/> <source>Sort by column:</source> <translation>Sort by column:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1044"/> <source>App name</source> <translation>Application name</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1049"/> <source>App version</source> <translation>Applications version</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1054"/> <source>App size</source> <translation>Application size</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1059"/> <source>App package name</source> <translation>Application package name</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1067"/> <source>Get backups:</source> <translation>Get backups:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1075"/> <location filename="../widgets/settingswidget.ui" line="1089"/> <location filename="../widgets/settingswidget.ui" line="1181"/> <source>only on start</source> <translation>Only on start</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1080"/> <source>every time before show</source> <translation>Every time before showing</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1094"/> <location filename="../widgets/settingswidget.ui" line="1186"/> <source>every time on show</source> <translation>Every time before showing</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1166"/> <source>Get applications:</source> <translation>Get application info:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1173"/> <source>Get system applications:</source> <translation>Get system applications:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1207"/> <source>Check app version on internet</source> <translation>Check app version on internet</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1227"/> <source>Show/hide apps columns:</source> <translation>Show/hide apps columns:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1234"/> <source>Show/hide backups columns:</source> <translation>Show/hide backups columns:</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1243"/> <source>sd ext folder</source> <translation>sd ext folder</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1253"/> <source>Detect</source> <translation>Detect</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1284"/> <source>Enable animations</source> <translation>Enable animations</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1294"/> <source>Duration (in miliseconds)</source> <translation>Duration (in miliseconds)</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1485"/> <source>Change background color</source> <translation>Change background color</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1492"/> <source>Change font color</source> <translation>Change font color</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1575"/> <source>Color files</source> <translation>Color files</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1315"/> <source>UpToDown</source> <translation>From up to down</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1320"/> <source>DownToUp</source> <translation>From down to up</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1325"/> <source>LeftToRight</source> <translation>From left to right</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1330"/> <source>RightToLeft</source> <translation>From right to left</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="1433"/> <source>Direction</source> <translation>Direction</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="97"/> <source>General</source> <translation>General</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="102"/> <source>File manager</source> <translation>File manager</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="107"/> <source>App manager</source> <translation>App manager</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="112"/> <source>Animations</source> <translation>Animations</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="125"/> <source>Remove settings from system</source> <translation>Remove settings from system</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="138"/> <source>Set defaults</source> <translation>Set defaults</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="151"/> <source>Save Settings</source> <translation>Save Settings</translation> </message> <message> <location filename="../widgets/settingswidget.ui" line="167"/> <source>Associate apk files with QtADB</source> <translation>Associate apk files with QtADB</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="152"/> <source>Reset settings??</source> <translation>Reset settings??</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="152"/> <source>Are you sure you want restore settings to defaults???</source> <translation>Are you sure you want restore settings to defaults???</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="583"/> <source>Icon</source> <comment>icon app column</comment> <translation>Icon</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="602"/> <source>Icon</source> <comment>icon backup column</comment> <translation>Icon</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="620"/> <source>Icon</source> <comment>icon computer column</comment> <translation>Icon</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="637"/> <source>Icon</source> <comment>icon phone column</comment> <translation>Icon</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="732"/> <source>Associate??</source> <translation>Associate?</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="732"/> <source>Are you sure you want to associate *.apk files with QtADB???</source> <translation>Are you sure you want to associate *.apk files with QtADB???</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="744"/> <source>Install apk</source> <translation>Install apk</translation> </message> <message> <location filename="../widgets/settingswidget.cpp" line="815"/> <source>&lt;Not Found&gt;</source> <translation>&lt;Not Found&gt;</translation> </message> </context> <context> <name>ShellWidget</name> <message> <location filename="../widgets/shellwidget.cpp" line="216"/> <source> QtADB shell help </source> <translation> QtADB shell help</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="217"/> <source>CTRL+C - interrupt executing command</source> <translation>CTRL+C - interrupt executing command</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="218"/> <source>ESC - interrupt executing command</source> <translation>ESC - interrupt executing command</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="219"/> <source>Shift+CTRL+C - copy selected text to clipboard</source> <translation>Shift+CTRL+C - copy selected text to clipboard</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="220"/> <source>Shift+CTRL+V - paste text from clipboard</source> <translation>Shift+CTRL+V - paste text from clipboard</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="221"/> <source>Enter/Return - execute command</source> <translation>Enter/Return - execute command</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="222"/> <source>Up (arrow) - display previous executed command</source> <translation>Up (arrow) - display previous executed command</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="223"/> <source>Down (arrow) - display next executed command</source> <translation>Down (arrow) - display next executed command</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="224"/> <source>Left(arrow) - move cursor to the left</source> <translation>Left(arrow) - move cursor to the left</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="225"/> <source>Right(arrow) - move cursor to the right</source> <translation>Right(arrow) - move cursor to the right</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="226"/> <source>CTRL+Left(arrow) - move cursor to the left skipping over the word</source> <translation>CTRL+Left(arrow) - move cursor to the left skipping over the word</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="227"/> <source>CTRL+Right(arrow) - move cursor to the right skipping over the word</source> <translation>CTRL+Right(arrow) - move cursor to the right skipping over the word</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="228"/> <source>Delete - delete next char</source> <translation>Delete - delete next char</translation> </message> <message> <location filename="../widgets/shellwidget.cpp" line="229"/> <source>Backspace - delete previous char</source> <translation>Backspace - delete previous char</translation> </message> </context> <context> <name>ThreadBackup</name> <message> <location filename="../dialogs/appdialog.cpp" line="457"/> <source>SUCCESS</source> <translation>SUCCESS</translation> </message> </context> <context> <name>ThreadInstall</name> <message> <location filename="../dialogs/appdialog.cpp" line="586"/> <source>FAILURE</source> <translation>FAILURE</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="590"/> <source>SUCCESS</source> <translation>SUCCESS</translation> </message> </context> <context> <name>ThreadRestore</name> <message> <location filename="../dialogs/appdialog.cpp" line="496"/> <location filename="../dialogs/appdialog.cpp" line="526"/> <location filename="../dialogs/appdialog.cpp" line="559"/> <source>FAILURE</source> <translation>FAILURE</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="522"/> <location filename="../dialogs/appdialog.cpp" line="530"/> <location filename="../dialogs/appdialog.cpp" line="555"/> <source>SUCCESS</source> <translation>SUCCESS</translation> </message> </context> <context> <name>ThreadUninstall</name> <message> <location filename="../dialogs/appdialog.cpp" line="641"/> <source>FAILURE</source> <translation>FAILURE</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="645"/> <location filename="../dialogs/appdialog.cpp" line="649"/> <source>SUCCESS</source> <translation>SUCCESS</translation> </message> </context> <context> <name>appDialog</name> <message> <location filename="../dialogs/appdialog.ui" line="106"/> <source>app</source> <translation>App</translation> </message> <message> <location filename="../dialogs/appdialog.ui" line="111"/> <source>state</source> <translation>State</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="28"/> <location filename="../dialogs/appdialog.cpp" line="29"/> <source>Install</source> <translation>Install</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="34"/> <location filename="../dialogs/appdialog.cpp" line="35"/> <source>Uninstall</source> <translation>Uninstall</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="40"/> <location filename="../dialogs/appdialog.cpp" line="41"/> <location filename="../dialogs/appdialog.cpp" line="122"/> <location filename="../dialogs/appdialog.cpp" line="123"/> <source>Reinstall</source> <translation>Reinstall</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="48"/> <location filename="../dialogs/appdialog.cpp" line="49"/> <source>Backup apps</source> <translation>Backup apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="53"/> <location filename="../dialogs/appdialog.cpp" line="54"/> <source>Backup data</source> <translation>Backup data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="58"/> <location filename="../dialogs/appdialog.cpp" line="59"/> <source>Backup apps and data</source> <translation>Backup apps and data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="67"/> <location filename="../dialogs/appdialog.cpp" line="68"/> <source>Restore apps</source> <translation>Restore apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="72"/> <location filename="../dialogs/appdialog.cpp" line="73"/> <source>Restore data</source> <translation>Restore data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="77"/> <location filename="../dialogs/appdialog.cpp" line="78"/> <location filename="../dialogs/appdialog.cpp" line="159"/> <source>Restore apps and data</source> <translation>Restore apps and data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="110"/> <source>Install</source> <comment>apd dialog title</comment> <translation>Install</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="111"/> <source>Install</source> <comment>label text</comment> <translation>Install</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="116"/> <source>Uninstall</source> <comment>apd dialog title</comment> <translation>Uninstall</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="117"/> <source>Uninstall</source> <comment>label text</comment> <translation>Uninstall</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="130"/> <source>Backup apps</source> <comment>apd dialog title</comment> <translation>Backup apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="131"/> <source>Backup apps</source> <comment>label text</comment> <translation>Backup apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="135"/> <source>Backup data</source> <comment>apd dialog title</comment> <translation>Backup data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="136"/> <source>Backup data</source> <comment>label text</comment> <translation>Backup data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="140"/> <source>Backup apps and data</source> <comment>apd dialog title</comment> <translation>Backup apps and data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="141"/> <source>Backup apps and data</source> <comment>label text</comment> <translation>Backup apps and data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="149"/> <source>Restore apps</source> <comment>apd dialog title</comment> <translation>Restore apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="150"/> <source>Restore apps</source> <comment>label text</comment> <translation>Restore apps</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="154"/> <source>Restore data</source> <comment>apd dialog title</comment> <translation>Restore data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="155"/> <source>Restore data</source> <comment>label text</comment> <translation>Restore data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="160"/> <source>Restore apps and data</source> <comment>label text</comment> <translation>Restore apps and data</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="224"/> <source>Cancel operation??</source> <translation>Cancel operation??</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="224"/> <source>Are you sure You want to cancel operation??</source> <translation>Do You really want to cancel this operation??</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="340"/> <source>Install finished</source> <translation>Installation finished</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="344"/> <source>Uninstall finished</source> <translation>Uninstallation finished</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="348"/> <source>Reinstall finished</source> <translation>Reinstall finished</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="352"/> <source>Backup finished</source> <translation>Backup finished</translation> </message> <message> <location filename="../dialogs/appdialog.cpp" line="356"/> <source>Restore finished</source> <translation>Restore finished</translation> </message> </context> <context> <name>appInfo</name> <message> <location filename="../dialogs/appinfo.ui" line="14"/> <source>App info</source> <extracomment>app info dialog title</extracomment> <translation>App info</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="87"/> <source>App name</source> <translation>Application name</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="111"/> <source>App version</source> <translation>Applications version</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="135"/> <source>Package name</source> <translation>Package name</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="159"/> <source>File name</source> <translation>File name</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="173"/> <source>File Size</source> <translation>File size</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="263"/> <source>Open in Market (PC)</source> <translation>Open in Market (PC)</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="274"/> <source>Open in Market (Phone)</source> <translation>Open in Market (Phone)</translation> </message> <message> <location filename="../dialogs/appinfo.ui" line="285"/> <source>Install</source> <translation>Install</translation> </message> <message> <location filename="../dialogs/appinfo.cpp" line="38"/> <location filename="../dialogs/appinfo.cpp" line="83"/> <source>Reinstall</source> <translation>Reinstall</translation> </message> <message> <location filename="../dialogs/appinfo.cpp" line="111"/> <source>install</source> <translation>Install</translation> </message> <message> <location filename="../dialogs/appinfo.cpp" line="111"/> <source>are you sure???</source> <translation>Are you sure???</translation> </message> <message> <location filename="../dialogs/appinfo.cpp" line="111"/> <source>reinstall</source> <translation>Przeinstaluj</translation> </message> </context> <context> <name>dialogKopiuj</name> <message> <location filename="../dialogs/dialogkopiuj.ui" line="14"/> <source>Copying</source> <extracomment>Copy dialog title</extracomment> <translation>Copying</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="29"/> <source>file:</source> <translation>File:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="43"/> <source>from:</source> <translation>From:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="57"/> <source>to:</source> <translation>To:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="71"/> <source>items remaining:</source> <translation>Items remaining:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="87"/> <source>File:</source> <translation>File:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="174"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="198"/> <source>close after finished</source> <translation>Close after finished</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.ui" line="218"/> <source>Cancel</source> <translation>Cancel</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.cpp" line="109"/> <source>Close??</source> <translation>Cancel operation??</translation> </message> <message> <location filename="../dialogs/dialogkopiuj.cpp" line="109"/> <source>Are you sure??</source> <translation>Are you sure??</translation> </message> </context> </TS>
{'repo_name': 'triochi/QtAdb', 'stars': '146', 'repo_language': 'C++', 'file_name': 'logcatmodel.h', 'mime_type': 'text/x-c++', 'hash': -3162651317935773151, 'source_dataset': 'data'}
<template> <div> <form novalidate class="md-layout" @submit.prevent="validateUser"> <md-card class="md-layout-item md-size-50 md-small-size-100"> <md-card-header> <div class="md-title">Users</div> </md-card-header> <md-card-content> <div class="md-layout md-gutter"> <div class="md-layout-item md-small-size-100"> <md-field :class="getValidationClass('firstName')"> <label for="first-name">First Name</label> <md-input name="first-name" id="first-name" autocomplete="given-name" v-model="form.firstName" :disabled="sending" /> <span class="md-error" v-if="!$v.form.firstName.required">The first name is required</span> <span class="md-error" v-else-if="!$v.form.firstName.minlength">Invalid first name</span> </md-field> </div> <div class="md-layout-item md-small-size-100"> <md-field :class="getValidationClass('lastName')"> <label for="last-name">Last Name</label> <md-input name="last-name" id="last-name" autocomplete="family-name" v-model="form.lastName" :disabled="sending" /> <span class="md-error" v-if="!$v.form.lastName.required">The last name is required</span> <span class="md-error" v-else-if="!$v.form.lastName.minlength">Invalid last name</span> </md-field> </div> </div> <div class="md-layout md-gutter"> <div class="md-layout-item md-small-size-100"> <md-field :class="getValidationClass('gender')"> <label for="gender">Gender</label> <md-select name="gender" id="gender" v-model="form.gender" md-dense :disabled="sending"> <md-option></md-option> <md-option value="M">M</md-option> <md-option value="F">F</md-option> </md-select> <span class="md-error">The gender is required</span> </md-field> </div> <div class="md-layout-item md-small-size-100"> <md-field :class="getValidationClass('age')"> <label for="age">Age</label> <md-input type="number" id="age" name="age" autocomplete="age" v-model="form.age" :disabled="sending" /> <span class="md-error" v-if="!$v.form.age.required">The age is required</span> <span class="md-error" v-else-if="!$v.form.age.maxlength">Invalid age</span> </md-field> </div> </div> <md-field :class="getValidationClass('email')"> <label for="email">Email</label> <md-input type="email" name="email" id="email" autocomplete="email" v-model="form.email" :disabled="sending" /> <span class="md-error" v-if="!$v.form.email.required">The email is required</span> <span class="md-error" v-else-if="!$v.form.email.email">Invalid email</span> </md-field> </md-card-content> <md-progress-bar md-mode="indeterminate" v-if="sending" /> <md-card-actions> <md-button type="submit" class="md-primary" :disabled="sending">Create user</md-button> </md-card-actions> </md-card> <md-snackbar :md-active.sync="userSaved">The user {{ lastUser }} was saved with success!</md-snackbar> </form> </div> </template> <script> import { validationMixin } from 'vuelidate' import { required, email, minLength, maxLength } from 'vuelidate/lib/validators' export default { name: 'FormValidation', mixins: [validationMixin], data: () => ({ form: { firstName: null, lastName: null, gender: null, age: null, email: null, }, userSaved: false, sending: false, lastUser: null }), validations: { form: { firstName: { required, minLength: minLength(3) }, lastName: { required, minLength: minLength(3) }, age: { required, maxLength: maxLength(3) }, gender: { required }, email: { required, email } } }, methods: { getValidationClass (fieldName) { const field = this.$v.form[fieldName] if (field) { return { 'md-invalid': field.$invalid && field.$dirty } } }, clearForm () { this.$v.$reset() this.form.firstName = null this.form.lastName = null this.form.age = null this.form.gender = null this.form.email = null }, saveUser () { this.sending = true // Instead of this timeout, here you can call your API window.setTimeout(() => { this.lastUser = `${this.form.firstName} ${this.form.lastName}` this.userSaved = true this.sending = false this.clearForm() }, 1500) }, validateUser () { this.$v.$touch() if (!this.$v.$invalid) { this.saveUser() } } } } </script> <style lang="scss" scoped> .md-progress-bar { position: absolute; top: 0; right: 0; left: 0; } </style>
{'repo_name': 'vuematerial/vue-material', 'stars': '8852', 'repo_language': 'Vue', 'file_name': 'theme.scss', 'mime_type': 'text/plain', 'hash': -5827824407723082925, 'source_dataset': 'data'}
import colander from webob.multidict import MultiDict from h.schemas.base import ValidationError def _colander_exception_msg(exc): """ Combine error messages from a :class:`colander.Invalid` exception. :type exc: colander.Invalid :rtype: str """ msg_dict = exc.asdict() for child in exc.children: msg_dict.update(child.asdict()) msg_list = ["{}: {}".format(field, err) for field, err in msg_dict.items()] return "\n".join(msg_list) def _multidict_to_dict(schema, multidict): """ Combine or drop repeated fields in a ``MultiDict`` according to a schema. Prepare a query param ``MultiDict`` for validation against a schema by converting repeated fields to lists or keeping only the last value. """ dict_ = multidict.dict_of_lists() for key, values in dict_.items(): node = schema.get(key) if not node or not isinstance(node.typ, colander.Sequence): dict_[key] = values[-1] return dict_ def _dict_to_multidict(dict_): """Convert a validated query param dict back to a ``MultiDict``.""" result = MultiDict() for key, value in dict_.items(): if isinstance(value, list): for item in value: result.add(key, item) else: result.add(key, value) return result def validate_query_params(schema, params): """ Validate query parameters using a Colander schema. Repeated fields in the input are either preserved or discarded except for the last value depending on whether the corresponding schema node is a sequence. :param schema: Colander schema to validate data with. :type schema: colander.Schema :param params: Query parameter dict, usually `request.params`. :type params: webob.multidict.MultiDict :rtype: webob.multidict.MultiDict :raises ValidationError: """ param_dict = _multidict_to_dict(schema, params) try: parsed = schema.deserialize(param_dict) except colander.Invalid as exc: raise ValidationError(_colander_exception_msg(exc)) return _dict_to_multidict(parsed)
{'repo_name': 'hypothesis/h', 'stars': '1818', 'repo_language': 'Python', 'file_name': 'requirements.in', 'mime_type': 'text/plain', 'hash': 3799532853046246617, 'source_dataset': 'data'}
[ { "id": "t_tree_birch", "fg": [ "t_tree_birch" ], "bg": [ "t_dirt_giant" ] }, { "id": "t_tree_birch_season_summer", "fg": [ "t_tree_birch" ], "bg": [ "t_dirt_summer_giant" ] }, { "id": "t_tree_birch_season_winter", "fg": [ "t_tree_birch_winter" ], "bg": [ "snow_shallow_giant" ] }, { "id": "t_tree_birch_season_autumn", "fg": [ { "weight": 1, "sprite": "t_tree_birch_autumn_1" }, { "weight": 1, "sprite": "t_tree_birch_autumn_2" } ], "bg": [ "t_dirt_autumn_giant" ] } ]
{'repo_name': 'I-am-Erk/CDDA-Tilesets', 'stars': '106', 'repo_language': 'Python', 'file_name': 'autotiles.md', 'mime_type': 'text/plain', 'hash': 3204408140219025821, 'source_dataset': 'data'}
from django.core.exceptions import ValidationError from django.test import TestCase class ValidationTestCase(TestCase): def assertFailsValidation(self, clean, failed_fields, **kwargs): with self.assertRaises(ValidationError) as cm: clean(**kwargs) self.assertEqual(sorted(failed_fields), sorted(cm.exception.message_dict)) def assertFieldFailsValidationWithMessage(self, clean, field_name, message): with self.assertRaises(ValidationError) as cm: clean() self.assertIn(field_name, cm.exception.message_dict) self.assertEqual(message, cm.exception.message_dict[field_name])
{'repo_name': 'nesdis/djongo', 'stars': '938', 'repo_language': 'Python', 'file_name': 'test_sqlparsing.py', 'mime_type': 'text/x-python', 'hash': 7293335897331570584, 'source_dataset': 'data'}
/** * Copyright (C) 2013 Eric Van Dewoestine * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.eclim.plugin.pydev.command.project; import org.eclim.annotation.Command; import org.eclim.command.CommandLine; import org.eclim.command.Options; import org.eclim.plugin.core.command.AbstractCommand; import org.eclim.plugin.core.util.ProjectUtils; import org.eclipse.core.resources.IProject; import org.python.pydev.core.IInterpreterInfo; import org.python.pydev.plugin.nature.PythonNature; /** * Command to get the python interpreter for the specified project. * * @author Eric Van Dewoestine */ @Command( name = "python_interpreter", options = "REQUIRED p project ARG" ) public class InterpreterCommand extends AbstractCommand { @Override public Object execute(CommandLine commandLine) throws Exception { String projectName = commandLine.getValue(Options.PROJECT_OPTION); IProject project = ProjectUtils.getProject(projectName); PythonNature nature = PythonNature.getPythonNature(project); IInterpreterInfo interpreter = nature.getProjectInterpreter(); if (interpreter != null){ return interpreter.getExecutableOrJar(); } return null; } }
{'repo_name': 'ervandew/eclim', 'stars': '1027', 'repo_language': 'Java', 'file_name': 'MANIFEST.MF', 'mime_type': 'text/plain', 'hash': -4807974551653918297, 'source_dataset': 'data'}
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize!
{'repo_name': 'igorkasyanchuk/rails_db', 'stars': '1249', 'repo_language': 'JavaScript', 'file_name': 'update.js.erb', 'mime_type': 'text/plain', 'hash': -2612833456206195240, 'source_dataset': 'data'}
/* * Copyright (c) 2012, 2018, 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. */ /* * COPYRIGHT AND PERMISSION NOTICE * * Copyright (C) 1991-2016 Unicode, Inc. All rights reserved. * Distributed under the Terms of Use in * http://www.unicode.org/copyright.html. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of the Unicode data files and any associated documentation * (the "Data Files") or Unicode software and any associated documentation * (the "Software") to deal in the Data Files or Software * without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, and/or sell copies of * the Data Files or Software, and to permit persons to whom the Data Files * or Software are furnished to do so, provided that * (a) this copyright and permission notice appear with all copies * of the Data Files or Software, * (b) this copyright and permission notice appear in associated * documentation, and * (c) there is clear notice in each modified Data File or in the Software * as well as in the documentation associated with the Data File(s) or * Software that the data or software has been modified. * * THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, * use or other dealings in these Data Files or Software without prior * written authorization of the copyright holder. */ package sun.text.resources.cldr.ext; import java.util.ListResourceBundle; public class FormatData_ta_MY extends ListResourceBundle { @Override protected final Object[][] getContents() { final Object[][] data = new Object[][] { { "NumberPatterns", new String[] { "#,##0.###", "\u00a4\u00a0#,##0.00", "#,##0%", } }, }; return data; } }
{'repo_name': 'kangjianwei/LearningJDK', 'stars': '587', 'repo_language': 'Java', 'file_name': 'PKCS11Exception.java', 'mime_type': 'text/html', 'hash': -5264944340990412506, 'source_dataset': 'data'}
""" Exponential Moving Average for model parameters. """ class EMA(): def __init__(self, mu): self.mu = mu self.shadow = {} self.original = {} def register(self, model): for name, param in model.named_parameters(): if param.requires_grad: self.shadow[name] = param.data.clone() def __call__(self, model, num_updates): decay = min(self.mu, (1.0 + num_updates) / (10.0 + num_updates)) for name, param in model.named_parameters(): if param.requires_grad: assert name in self.shadow new_average = \ (1.0 - decay) * param.data + decay * self.shadow[name] self.shadow[name] = new_average.clone() def assign(self, model): for name, param in model.named_parameters(): if param.requires_grad: assert name in self.shadow self.original[name] = param.data.clone() param.data = self.shadow[name] def resume(self, model): for name, param in model.named_parameters(): if param.requires_grad: assert name in self.shadow param.data = self.original[name]
{'repo_name': 'BangLiu/ArticlePairMatching', 'stars': '157', 'repo_language': 'Python', 'file_name': 'stopwords-en.txt', 'mime_type': 'text/plain', 'hash': -1331747106573036949, 'source_dataset': 'data'}
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> </pickle> <pickle> <dictionary> <item> <key> <string>id</string> </key> <value> <string>my_ledger</string> </value> </item> <item> <key> <string>message_values</string> </key> <value> <dictionary> <item> <key> <string>external_validator_failed</string> </key> <value> <string>The input failed the external validator.</string> </value> </item> </dictionary> </value> </item> <item> <key> <string>overrides</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>tales</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>values</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string>my_view_mode_ledger</string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string>Base_viewTradeFieldLibrary</string> </value> </item> </dictionary> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{'repo_name': 'Nexedi/erp5', 'stars': '116', 'repo_language': 'JavaScript', 'file_name': 'base_category_list.xml', 'mime_type': 'text/plain', 'hash': 4140198629869941778, 'source_dataset': 'data'}
//===- InlineCost.cpp - Cost analysis for inliner -------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements inline cost analysis. // //===----------------------------------------------------------------------===// #include "llvm/Analysis/InlineCost.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/BlockFrequencyInfo.h" #include "llvm/Analysis/CodeMetrics.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/ProfileSummaryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/GetElementPtrTypeIterator.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/InstVisitor.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Operator.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; #define DEBUG_TYPE "inline-cost" STATISTIC(NumCallsAnalyzed, "Number of call sites analyzed"); static cl::opt<int> InlineThreshold( "inline-threshold", cl::Hidden, cl::init(225), cl::ZeroOrMore, cl::desc("Control the amount of inlining to perform (default = 225)")); static cl::opt<int> HintThreshold( "inlinehint-threshold", cl::Hidden, cl::init(325), cl::desc("Threshold for inlining functions with inline hint")); static cl::opt<int> ColdCallSiteThreshold("inline-cold-callsite-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining cold callsites")); // We introduce this threshold to help performance of instrumentation based // PGO before we actually hook up inliner with analysis passes such as BPI and // BFI. static cl::opt<int> ColdThreshold( "inlinecold-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining functions with cold attribute")); static cl::opt<int> HotCallSiteThreshold("hot-callsite-threshold", cl::Hidden, cl::init(3000), cl::ZeroOrMore, cl::desc("Threshold for hot callsites ")); static cl::opt<int> ColdCallSiteRelFreq( "cold-callsite-rel-freq", cl::Hidden, cl::init(2), cl::ZeroOrMore, cl::desc("Maxmimum block frequency, expressed as a percentage of caller's " "entry frequency, for a callsite to be cold in the absence of " "profile information.")); namespace { class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> { typedef InstVisitor<CallAnalyzer, bool> Base; friend class InstVisitor<CallAnalyzer, bool>; /// The TargetTransformInfo available for this compilation. const TargetTransformInfo &TTI; /// Getter for the cache of @llvm.assume intrinsics. std::function<AssumptionCache &(Function &)> &GetAssumptionCache; /// Getter for BlockFrequencyInfo Optional<function_ref<BlockFrequencyInfo &(Function &)>> &GetBFI; /// Profile summary information. ProfileSummaryInfo *PSI; /// The called function. Function &F; // Cache the DataLayout since we use it a lot. const DataLayout &DL; /// The candidate callsite being analyzed. Please do not use this to do /// analysis in the caller function; we want the inline cost query to be /// easily cacheable. Instead, use the cover function paramHasAttr. CallSite CandidateCS; /// Tunable parameters that control the analysis. const InlineParams &Params; int Threshold; int Cost; bool IsCallerRecursive; bool IsRecursiveCall; bool ExposesReturnsTwice; bool HasDynamicAlloca; bool ContainsNoDuplicateCall; bool HasReturn; bool HasIndirectBr; bool HasFrameEscape; /// Number of bytes allocated statically by the callee. uint64_t AllocatedSize; unsigned NumInstructions, NumVectorInstructions; int FiftyPercentVectorBonus, TenPercentVectorBonus; int VectorBonus; /// While we walk the potentially-inlined instructions, we build up and /// maintain a mapping of simplified values specific to this callsite. The /// idea is to propagate any special information we have about arguments to /// this call through the inlinable section of the function, and account for /// likely simplifications post-inlining. The most important aspect we track /// is CFG altering simplifications -- when we prove a basic block dead, that /// can cause dramatic shifts in the cost of inlining a function. DenseMap<Value *, Constant *> SimplifiedValues; /// Keep track of the values which map back (through function arguments) to /// allocas on the caller stack which could be simplified through SROA. DenseMap<Value *, Value *> SROAArgValues; /// The mapping of caller Alloca values to their accumulated cost savings. If /// we have to disable SROA for one of the allocas, this tells us how much /// cost must be added. DenseMap<Value *, int> SROAArgCosts; /// Keep track of values which map to a pointer base and constant offset. DenseMap<Value *, std::pair<Value *, APInt>> ConstantOffsetPtrs; // Custom simplification helper routines. bool isAllocaDerivedArg(Value *V); bool lookupSROAArgAndCost(Value *V, Value *&Arg, DenseMap<Value *, int>::iterator &CostIt); void disableSROA(DenseMap<Value *, int>::iterator CostIt); void disableSROA(Value *V); void accumulateSROACost(DenseMap<Value *, int>::iterator CostIt, int InstructionCost); bool isGEPFree(GetElementPtrInst &GEP); bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset); bool simplifyCallSite(Function *F, CallSite CS); template <typename Callable> bool simplifyInstruction(Instruction &I, Callable Evaluate); ConstantInt *stripAndComputeInBoundsConstantOffsets(Value *&V); /// Return true if the given argument to the function being considered for /// inlining has the given attribute set either at the call site or the /// function declaration. Primarily used to inspect call site specific /// attributes since these can be more precise than the ones on the callee /// itself. bool paramHasAttr(Argument *A, Attribute::AttrKind Attr); /// Return true if the given value is known non null within the callee if /// inlined through this particular callsite. bool isKnownNonNullInCallee(Value *V); /// Update Threshold based on callsite properties such as callee /// attributes and callee hotness for PGO builds. The Callee is explicitly /// passed to support analyzing indirect calls whose target is inferred by /// analysis. void updateThreshold(CallSite CS, Function &Callee); /// Return true if size growth is allowed when inlining the callee at CS. bool allowSizeGrowth(CallSite CS); /// Return true if \p CS is a cold callsite. bool isColdCallSite(CallSite CS, BlockFrequencyInfo *CallerBFI); // Custom analysis routines. bool analyzeBlock(BasicBlock *BB, SmallPtrSetImpl<const Value *> &EphValues); // Disable several entry points to the visitor so we don't accidentally use // them by declaring but not defining them here. void visit(Module *); void visit(Module &); void visit(Function *); void visit(Function &); void visit(BasicBlock *); void visit(BasicBlock &); // Provide base case for our instruction visit. bool visitInstruction(Instruction &I); // Our visit overrides. bool visitAlloca(AllocaInst &I); bool visitPHI(PHINode &I); bool visitGetElementPtr(GetElementPtrInst &I); bool visitBitCast(BitCastInst &I); bool visitPtrToInt(PtrToIntInst &I); bool visitIntToPtr(IntToPtrInst &I); bool visitCastInst(CastInst &I); bool visitUnaryInstruction(UnaryInstruction &I); bool visitCmpInst(CmpInst &I); bool visitSub(BinaryOperator &I); bool visitBinaryOperator(BinaryOperator &I); bool visitLoad(LoadInst &I); bool visitStore(StoreInst &I); bool visitExtractValue(ExtractValueInst &I); bool visitInsertValue(InsertValueInst &I); bool visitCallSite(CallSite CS); bool visitReturnInst(ReturnInst &RI); bool visitBranchInst(BranchInst &BI); bool visitSwitchInst(SwitchInst &SI); bool visitIndirectBrInst(IndirectBrInst &IBI); bool visitResumeInst(ResumeInst &RI); bool visitCleanupReturnInst(CleanupReturnInst &RI); bool visitCatchReturnInst(CatchReturnInst &RI); bool visitUnreachableInst(UnreachableInst &I); public: CallAnalyzer(const TargetTransformInfo &TTI, std::function<AssumptionCache &(Function &)> &GetAssumptionCache, Optional<function_ref<BlockFrequencyInfo &(Function &)>> &GetBFI, ProfileSummaryInfo *PSI, Function &Callee, CallSite CSArg, const InlineParams &Params) : TTI(TTI), GetAssumptionCache(GetAssumptionCache), GetBFI(GetBFI), PSI(PSI), F(Callee), DL(F.getParent()->getDataLayout()), CandidateCS(CSArg), Params(Params), Threshold(Params.DefaultThreshold), Cost(0), IsCallerRecursive(false), IsRecursiveCall(false), ExposesReturnsTwice(false), HasDynamicAlloca(false), ContainsNoDuplicateCall(false), HasReturn(false), HasIndirectBr(false), HasFrameEscape(false), AllocatedSize(0), NumInstructions(0), NumVectorInstructions(0), FiftyPercentVectorBonus(0), TenPercentVectorBonus(0), VectorBonus(0), NumConstantArgs(0), NumConstantOffsetPtrArgs(0), NumAllocaArgs(0), NumConstantPtrCmps(0), NumConstantPtrDiffs(0), NumInstructionsSimplified(0), SROACostSavings(0), SROACostSavingsLost(0) {} bool analyzeCall(CallSite CS); int getThreshold() { return Threshold; } int getCost() { return Cost; } // Keep a bunch of stats about the cost savings found so we can print them // out when debugging. unsigned NumConstantArgs; unsigned NumConstantOffsetPtrArgs; unsigned NumAllocaArgs; unsigned NumConstantPtrCmps; unsigned NumConstantPtrDiffs; unsigned NumInstructionsSimplified; unsigned SROACostSavings; unsigned SROACostSavingsLost; void dump(); }; } // namespace /// \brief Test whether the given value is an Alloca-derived function argument. bool CallAnalyzer::isAllocaDerivedArg(Value *V) { return SROAArgValues.count(V); } /// \brief Lookup the SROA-candidate argument and cost iterator which V maps to. /// Returns false if V does not map to a SROA-candidate. bool CallAnalyzer::lookupSROAArgAndCost( Value *V, Value *&Arg, DenseMap<Value *, int>::iterator &CostIt) { if (SROAArgValues.empty() || SROAArgCosts.empty()) return false; DenseMap<Value *, Value *>::iterator ArgIt = SROAArgValues.find(V); if (ArgIt == SROAArgValues.end()) return false; Arg = ArgIt->second; CostIt = SROAArgCosts.find(Arg); return CostIt != SROAArgCosts.end(); } /// \brief Disable SROA for the candidate marked by this cost iterator. /// /// This marks the candidate as no longer viable for SROA, and adds the cost /// savings associated with it back into the inline cost measurement. void CallAnalyzer::disableSROA(DenseMap<Value *, int>::iterator CostIt) { // If we're no longer able to perform SROA we need to undo its cost savings // and prevent subsequent analysis. Cost += CostIt->second; SROACostSavings -= CostIt->second; SROACostSavingsLost += CostIt->second; SROAArgCosts.erase(CostIt); } /// \brief If 'V' maps to a SROA candidate, disable SROA for it. void CallAnalyzer::disableSROA(Value *V) { Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(V, SROAArg, CostIt)) disableSROA(CostIt); } /// \brief Accumulate the given cost for a particular SROA candidate. void CallAnalyzer::accumulateSROACost(DenseMap<Value *, int>::iterator CostIt, int InstructionCost) { CostIt->second += InstructionCost; SROACostSavings += InstructionCost; } /// \brief Accumulate a constant GEP offset into an APInt if possible. /// /// Returns false if unable to compute the offset for any reason. Respects any /// simplified values known during the analysis of this callsite. bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { unsigned IntPtrWidth = DL.getPointerSizeInBits(); assert(IntPtrWidth == Offset.getBitWidth()); for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP); GTI != GTE; ++GTI) { ConstantInt *OpC = dyn_cast<ConstantInt>(GTI.getOperand()); if (!OpC) if (Constant *SimpleOp = SimplifiedValues.lookup(GTI.getOperand())) OpC = dyn_cast<ConstantInt>(SimpleOp); if (!OpC) return false; if (OpC->isZero()) continue; // Handle a struct index, which adds its field offset to the pointer. if (StructType *STy = GTI.getStructTypeOrNull()) { unsigned ElementIdx = OpC->getZExtValue(); const StructLayout *SL = DL.getStructLayout(STy); Offset += APInt(IntPtrWidth, SL->getElementOffset(ElementIdx)); continue; } APInt TypeSize(IntPtrWidth, DL.getTypeAllocSize(GTI.getIndexedType())); Offset += OpC->getValue().sextOrTrunc(IntPtrWidth) * TypeSize; } return true; } /// \brief Use TTI to check whether a GEP is free. /// /// Respects any simplified values known during the analysis of this callsite. bool CallAnalyzer::isGEPFree(GetElementPtrInst &GEP) { SmallVector<Value *, 4> Indices; for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) if (Constant *SimpleOp = SimplifiedValues.lookup(*I)) Indices.push_back(SimpleOp); else Indices.push_back(*I); return TargetTransformInfo::TCC_Free == TTI.getGEPCost(GEP.getSourceElementType(), GEP.getPointerOperand(), Indices); } bool CallAnalyzer::visitAlloca(AllocaInst &I) { // Check whether inlining will turn a dynamic alloca into a static // alloca and handle that case. if (I.isArrayAllocation()) { Constant *Size = SimplifiedValues.lookup(I.getArraySize()); if (auto *AllocSize = dyn_cast_or_null<ConstantInt>(Size)) { Type *Ty = I.getAllocatedType(); AllocatedSize = SaturatingMultiplyAdd( AllocSize->getLimitedValue(), DL.getTypeAllocSize(Ty), AllocatedSize); return Base::visitAlloca(I); } } // Accumulate the allocated size. if (I.isStaticAlloca()) { Type *Ty = I.getAllocatedType(); AllocatedSize = SaturatingAdd(DL.getTypeAllocSize(Ty), AllocatedSize); } // We will happily inline static alloca instructions. if (I.isStaticAlloca()) return Base::visitAlloca(I); // FIXME: This is overly conservative. Dynamic allocas are inefficient for // a variety of reasons, and so we would like to not inline them into // functions which don't currently have a dynamic alloca. This simply // disables inlining altogether in the presence of a dynamic alloca. HasDynamicAlloca = true; return false; } bool CallAnalyzer::visitPHI(PHINode &I) { // FIXME: We should potentially be tracking values through phi nodes, // especially when they collapse to a single value due to deleted CFG edges // during inlining. // FIXME: We need to propagate SROA *disabling* through phi nodes, even // though we don't want to propagate it's bonuses. The idea is to disable // SROA if it *might* be used in an inappropriate manner. // Phi nodes are always zero-cost. return true; } bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) { Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; bool SROACandidate = lookupSROAArgAndCost(I.getPointerOperand(), SROAArg, CostIt); // Try to fold GEPs of constant-offset call site argument pointers. This // requires target data and inbounds GEPs. if (I.isInBounds()) { // Check if we have a base + offset for the pointer. Value *Ptr = I.getPointerOperand(); std::pair<Value *, APInt> BaseAndOffset = ConstantOffsetPtrs.lookup(Ptr); if (BaseAndOffset.first) { // Check if the offset of this GEP is constant, and if so accumulate it // into Offset. if (!accumulateGEPOffset(cast<GEPOperator>(I), BaseAndOffset.second)) { // Non-constant GEPs aren't folded, and disable SROA. if (SROACandidate) disableSROA(CostIt); return isGEPFree(I); } // Add the result as a new mapping to Base + Offset. ConstantOffsetPtrs[&I] = BaseAndOffset; // Also handle SROA candidates here, we already know that the GEP is // all-constant indexed. if (SROACandidate) SROAArgValues[&I] = SROAArg; return true; } } // Lambda to check whether a GEP's indices are all constant. auto IsGEPOffsetConstant = [&](GetElementPtrInst &GEP) { for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) if (!isa<Constant>(*I) && !SimplifiedValues.lookup(*I)) return false; return true; }; if (IsGEPOffsetConstant(I)) { if (SROACandidate) SROAArgValues[&I] = SROAArg; // Constant GEPs are modeled as free. return true; } // Variable GEPs will require math and will disable SROA. if (SROACandidate) disableSROA(CostIt); return isGEPFree(I); } /// Simplify \p I if its operands are constants and update SimplifiedValues. /// \p Evaluate is a callable specific to instruction type that evaluates the /// instruction when all the operands are constants. template <typename Callable> bool CallAnalyzer::simplifyInstruction(Instruction &I, Callable Evaluate) { SmallVector<Constant *, 2> COps; for (Value *Op : I.operands()) { Constant *COp = dyn_cast<Constant>(Op); if (!COp) COp = SimplifiedValues.lookup(Op); if (!COp) return false; COps.push_back(COp); } auto *C = Evaluate(COps); if (!C) return false; SimplifiedValues[&I] = C; return true; } bool CallAnalyzer::visitBitCast(BitCastInst &I) { // Propagate constants through bitcasts. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getBitCast(COps[0], I.getType()); })) return true; // Track base/offsets through casts std::pair<Value *, APInt> BaseAndOffset = ConstantOffsetPtrs.lookup(I.getOperand(0)); // Casts don't change the offset, just wrap it up. if (BaseAndOffset.first) ConstantOffsetPtrs[&I] = BaseAndOffset; // Also look for SROA candidates here. Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(I.getOperand(0), SROAArg, CostIt)) SROAArgValues[&I] = SROAArg; // Bitcasts are always zero cost. return true; } bool CallAnalyzer::visitPtrToInt(PtrToIntInst &I) { // Propagate constants through ptrtoint. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getPtrToInt(COps[0], I.getType()); })) return true; // Track base/offset pairs when converted to a plain integer provided the // integer is large enough to represent the pointer. unsigned IntegerSize = I.getType()->getScalarSizeInBits(); if (IntegerSize >= DL.getPointerSizeInBits()) { std::pair<Value *, APInt> BaseAndOffset = ConstantOffsetPtrs.lookup(I.getOperand(0)); if (BaseAndOffset.first) ConstantOffsetPtrs[&I] = BaseAndOffset; } // This is really weird. Technically, ptrtoint will disable SROA. However, // unless that ptrtoint is *used* somewhere in the live basic blocks after // inlining, it will be nuked, and SROA should proceed. All of the uses which // would block SROA would also block SROA if applied directly to a pointer, // and so we can just add the integer in here. The only places where SROA is // preserved either cannot fire on an integer, or won't in-and-of themselves // disable SROA (ext) w/o some later use that we would see and disable. Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(I.getOperand(0), SROAArg, CostIt)) SROAArgValues[&I] = SROAArg; return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I); } bool CallAnalyzer::visitIntToPtr(IntToPtrInst &I) { // Propagate constants through ptrtoint. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getIntToPtr(COps[0], I.getType()); })) return true; // Track base/offset pairs when round-tripped through a pointer without // modifications provided the integer is not too large. Value *Op = I.getOperand(0); unsigned IntegerSize = Op->getType()->getScalarSizeInBits(); if (IntegerSize <= DL.getPointerSizeInBits()) { std::pair<Value *, APInt> BaseAndOffset = ConstantOffsetPtrs.lookup(Op); if (BaseAndOffset.first) ConstantOffsetPtrs[&I] = BaseAndOffset; } // "Propagate" SROA here in the same manner as we do for ptrtoint above. Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(Op, SROAArg, CostIt)) SROAArgValues[&I] = SROAArg; return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I); } bool CallAnalyzer::visitCastInst(CastInst &I) { // Propagate constants through ptrtoint. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getCast(I.getOpcode(), COps[0], I.getType()); })) return true; // Disable SROA in the face of arbitrary casts we don't whitelist elsewhere. disableSROA(I.getOperand(0)); return TargetTransformInfo::TCC_Free == TTI.getUserCost(&I); } bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) { Value *Operand = I.getOperand(0); if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantFoldInstOperands(&I, COps[0], DL); })) return true; // Disable any SROA on the argument to arbitrary unary operators. disableSROA(Operand); return false; } bool CallAnalyzer::paramHasAttr(Argument *A, Attribute::AttrKind Attr) { return CandidateCS.paramHasAttr(A->getArgNo(), Attr); } bool CallAnalyzer::isKnownNonNullInCallee(Value *V) { // Does the *call site* have the NonNull attribute set on an argument? We // use the attribute on the call site to memoize any analysis done in the // caller. This will also trip if the callee function has a non-null // parameter attribute, but that's a less interesting case because hopefully // the callee would already have been simplified based on that. if (Argument *A = dyn_cast<Argument>(V)) if (paramHasAttr(A, Attribute::NonNull)) return true; // Is this an alloca in the caller? This is distinct from the attribute case // above because attributes aren't updated within the inliner itself and we // always want to catch the alloca derived case. if (isAllocaDerivedArg(V)) // We can actually predict the result of comparisons between an // alloca-derived value and null. Note that this fires regardless of // SROA firing. return true; return false; } bool CallAnalyzer::allowSizeGrowth(CallSite CS) { // If the normal destination of the invoke or the parent block of the call // site is unreachable-terminated, there is little point in inlining this // unless there is literally zero cost. // FIXME: Note that it is possible that an unreachable-terminated block has a // hot entry. For example, in below scenario inlining hot_call_X() may be // beneficial : // main() { // hot_call_1(); // ... // hot_call_N() // exit(0); // } // For now, we are not handling this corner case here as it is rare in real // code. In future, we should elaborate this based on BPI and BFI in more // general threshold adjusting heuristics in updateThreshold(). Instruction *Instr = CS.getInstruction(); if (InvokeInst *II = dyn_cast<InvokeInst>(Instr)) { if (isa<UnreachableInst>(II->getNormalDest()->getTerminator())) return false; } else if (isa<UnreachableInst>(Instr->getParent()->getTerminator())) return false; return true; } bool CallAnalyzer::isColdCallSite(CallSite CS, BlockFrequencyInfo *CallerBFI) { // If global profile summary is available, then callsite's coldness is // determined based on that. if (PSI->hasProfileSummary()) return PSI->isColdCallSite(CS, CallerBFI); if (!CallerBFI) return false; // In the absence of global profile summary, determine if the callsite is cold // relative to caller's entry. We could potentially cache the computation of // scaled entry frequency, but the added complexity is not worth it unless // this scaling shows up high in the profiles. const BranchProbability ColdProb(ColdCallSiteRelFreq, 100); auto CallSiteBB = CS.getInstruction()->getParent(); auto CallSiteFreq = CallerBFI->getBlockFreq(CallSiteBB); auto CallerEntryFreq = CallerBFI->getBlockFreq(&(CS.getCaller()->getEntryBlock())); return CallSiteFreq < CallerEntryFreq * ColdProb; } void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) { // If no size growth is allowed for this inlining, set Threshold to 0. if (!allowSizeGrowth(CS)) { Threshold = 0; return; } Function *Caller = CS.getCaller(); // return min(A, B) if B is valid. auto MinIfValid = [](int A, Optional<int> B) { return B ? std::min(A, B.getValue()) : A; }; // return max(A, B) if B is valid. auto MaxIfValid = [](int A, Optional<int> B) { return B ? std::max(A, B.getValue()) : A; }; // Use the OptMinSizeThreshold or OptSizeThreshold knob if they are available // and reduce the threshold if the caller has the necessary attribute. if (Caller->optForMinSize()) Threshold = MinIfValid(Threshold, Params.OptMinSizeThreshold); else if (Caller->optForSize()) Threshold = MinIfValid(Threshold, Params.OptSizeThreshold); // Adjust the threshold based on inlinehint attribute and profile based // hotness information if the caller does not have MinSize attribute. if (!Caller->optForMinSize()) { if (Callee.hasFnAttribute(Attribute::InlineHint)) Threshold = MaxIfValid(Threshold, Params.HintThreshold); if (PSI) { BlockFrequencyInfo *CallerBFI = GetBFI ? &((*GetBFI)(*Caller)) : nullptr; // FIXME: After switching to the new passmanager, simplify the logic below // by checking only the callsite hotness/coldness. The check for CallerBFI // exists only because we do not have BFI available with the old PM. // // Use callee's hotness information only if we have no way of determining // callsite's hotness information. Callsite hotness can be determined if // sample profile is used (which adds hotness metadata to calls) or if // caller's BlockFrequencyInfo is available. if (CallerBFI || PSI->hasSampleProfile()) { if (PSI->isHotCallSite(CS, CallerBFI)) { DEBUG(dbgs() << "Hot callsite.\n"); Threshold = Params.HotCallSiteThreshold.getValue(); } else if (isColdCallSite(CS, CallerBFI)) { DEBUG(dbgs() << "Cold callsite.\n"); Threshold = MinIfValid(Threshold, Params.ColdCallSiteThreshold); } } else { if (PSI->isFunctionEntryHot(&Callee)) { DEBUG(dbgs() << "Hot callee.\n"); // If callsite hotness can not be determined, we may still know // that the callee is hot and treat it as a weaker hint for threshold // increase. Threshold = MaxIfValid(Threshold, Params.HintThreshold); } else if (PSI->isFunctionEntryCold(&Callee)) { DEBUG(dbgs() << "Cold callee.\n"); Threshold = MinIfValid(Threshold, Params.ColdThreshold); } } } } // Finally, take the target-specific inlining threshold multiplier into // account. Threshold *= TTI.getInliningThresholdMultiplier(); } bool CallAnalyzer::visitCmpInst(CmpInst &I) { Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); // First try to handle simplified comparisons. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getCompare(I.getPredicate(), COps[0], COps[1]); })) return true; if (I.getOpcode() == Instruction::FCmp) return false; // Otherwise look for a comparison between constant offset pointers with // a common base. Value *LHSBase, *RHSBase; APInt LHSOffset, RHSOffset; std::tie(LHSBase, LHSOffset) = ConstantOffsetPtrs.lookup(LHS); if (LHSBase) { std::tie(RHSBase, RHSOffset) = ConstantOffsetPtrs.lookup(RHS); if (RHSBase && LHSBase == RHSBase) { // We have common bases, fold the icmp to a constant based on the // offsets. Constant *CLHS = ConstantInt::get(LHS->getContext(), LHSOffset); Constant *CRHS = ConstantInt::get(RHS->getContext(), RHSOffset); if (Constant *C = ConstantExpr::getICmp(I.getPredicate(), CLHS, CRHS)) { SimplifiedValues[&I] = C; ++NumConstantPtrCmps; return true; } } } // If the comparison is an equality comparison with null, we can simplify it // if we know the value (argument) can't be null if (I.isEquality() && isa<ConstantPointerNull>(I.getOperand(1)) && isKnownNonNullInCallee(I.getOperand(0))) { bool IsNotEqual = I.getPredicate() == CmpInst::ICMP_NE; SimplifiedValues[&I] = IsNotEqual ? ConstantInt::getTrue(I.getType()) : ConstantInt::getFalse(I.getType()); return true; } // Finally check for SROA candidates in comparisons. Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(I.getOperand(0), SROAArg, CostIt)) { if (isa<ConstantPointerNull>(I.getOperand(1))) { accumulateSROACost(CostIt, InlineConstants::InstrCost); return true; } disableSROA(CostIt); } return false; } bool CallAnalyzer::visitSub(BinaryOperator &I) { // Try to handle a special case: we can fold computing the difference of two // constant-related pointers. Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); Value *LHSBase, *RHSBase; APInt LHSOffset, RHSOffset; std::tie(LHSBase, LHSOffset) = ConstantOffsetPtrs.lookup(LHS); if (LHSBase) { std::tie(RHSBase, RHSOffset) = ConstantOffsetPtrs.lookup(RHS); if (RHSBase && LHSBase == RHSBase) { // We have common bases, fold the subtract to a constant based on the // offsets. Constant *CLHS = ConstantInt::get(LHS->getContext(), LHSOffset); Constant *CRHS = ConstantInt::get(RHS->getContext(), RHSOffset); if (Constant *C = ConstantExpr::getSub(CLHS, CRHS)) { SimplifiedValues[&I] = C; ++NumConstantPtrDiffs; return true; } } } // Otherwise, fall back to the generic logic for simplifying and handling // instructions. return Base::visitSub(I); } bool CallAnalyzer::visitBinaryOperator(BinaryOperator &I) { Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); auto Evaluate = [&](SmallVectorImpl<Constant *> &COps) { Value *SimpleV = nullptr; if (auto FI = dyn_cast<FPMathOperator>(&I)) SimpleV = SimplifyFPBinOp(I.getOpcode(), COps[0], COps[1], FI->getFastMathFlags(), DL); else SimpleV = SimplifyBinOp(I.getOpcode(), COps[0], COps[1], DL); return dyn_cast_or_null<Constant>(SimpleV); }; if (simplifyInstruction(I, Evaluate)) return true; // Disable any SROA on arguments to arbitrary, unsimplified binary operators. disableSROA(LHS); disableSROA(RHS); return false; } bool CallAnalyzer::visitLoad(LoadInst &I) { Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(I.getPointerOperand(), SROAArg, CostIt)) { if (I.isSimple()) { accumulateSROACost(CostIt, InlineConstants::InstrCost); return true; } disableSROA(CostIt); } return false; } bool CallAnalyzer::visitStore(StoreInst &I) { Value *SROAArg; DenseMap<Value *, int>::iterator CostIt; if (lookupSROAArgAndCost(I.getPointerOperand(), SROAArg, CostIt)) { if (I.isSimple()) { accumulateSROACost(CostIt, InlineConstants::InstrCost); return true; } disableSROA(CostIt); } return false; } bool CallAnalyzer::visitExtractValue(ExtractValueInst &I) { // Constant folding for extract value is trivial. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getExtractValue(COps[0], I.getIndices()); })) return true; // SROA can look through these but give them a cost. return false; } bool CallAnalyzer::visitInsertValue(InsertValueInst &I) { // Constant folding for insert value is trivial. if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) { return ConstantExpr::getInsertValue(/*AggregateOperand*/ COps[0], /*InsertedValueOperand*/ COps[1], I.getIndices()); })) return true; // SROA can look through these but give them a cost. return false; } /// \brief Try to simplify a call site. /// /// Takes a concrete function and callsite and tries to actually simplify it by /// analyzing the arguments and call itself with instsimplify. Returns true if /// it has simplified the callsite to some other entity (a constant), making it /// free. bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) { // FIXME: Using the instsimplify logic directly for this is inefficient // because we have to continually rebuild the argument list even when no // simplifications can be performed. Until that is fixed with remapping // inside of instsimplify, directly constant fold calls here. if (!canConstantFoldCallTo(CS, F)) return false; // Try to re-map the arguments to constants. SmallVector<Constant *, 4> ConstantArgs; ConstantArgs.reserve(CS.arg_size()); for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) { Constant *C = dyn_cast<Constant>(*I); if (!C) C = dyn_cast_or_null<Constant>(SimplifiedValues.lookup(*I)); if (!C) return false; // This argument doesn't map to a constant. ConstantArgs.push_back(C); } if (Constant *C = ConstantFoldCall(CS, F, ConstantArgs)) { SimplifiedValues[CS.getInstruction()] = C; return true; } return false; } bool CallAnalyzer::visitCallSite(CallSite CS) { if (CS.hasFnAttr(Attribute::ReturnsTwice) && !F.hasFnAttribute(Attribute::ReturnsTwice)) { // This aborts the entire analysis. ExposesReturnsTwice = true; return false; } if (CS.isCall() && cast<CallInst>(CS.getInstruction())->cannotDuplicate()) ContainsNoDuplicateCall = true; if (Function *F = CS.getCalledFunction()) { // When we have a concrete function, first try to simplify it directly. if (simplifyCallSite(F, CS)) return true; // Next check if it is an intrinsic we know about. // FIXME: Lift this into part of the InstVisitor. if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction())) { switch (II->getIntrinsicID()) { default: return Base::visitCallSite(CS); case Intrinsic::load_relative: // This is normally lowered to 4 LLVM instructions. Cost += 3 * InlineConstants::InstrCost; return false; case Intrinsic::memset: case Intrinsic::memcpy: case Intrinsic::memmove: // SROA can usually chew through these intrinsics, but they aren't free. return false; case Intrinsic::localescape: HasFrameEscape = true; return false; } } if (F == CS.getInstruction()->getParent()->getParent()) { // This flag will fully abort the analysis, so don't bother with anything // else. IsRecursiveCall = true; return false; } if (TTI.isLoweredToCall(F)) { // We account for the average 1 instruction per call argument setup // here. Cost += CS.arg_size() * InlineConstants::InstrCost; // Everything other than inline ASM will also have a significant cost // merely from making the call. if (!isa<InlineAsm>(CS.getCalledValue())) Cost += InlineConstants::CallPenalty; } return Base::visitCallSite(CS); } // Otherwise we're in a very special case -- an indirect function call. See // if we can be particularly clever about this. Value *Callee = CS.getCalledValue(); // First, pay the price of the argument setup. We account for the average // 1 instruction per call argument setup here. Cost += CS.arg_size() * InlineConstants::InstrCost; // Next, check if this happens to be an indirect function call to a known // function in this inline context. If not, we've done all we can. Function *F = dyn_cast_or_null<Function>(SimplifiedValues.lookup(Callee)); if (!F) return Base::visitCallSite(CS); // If we have a constant that we are calling as a function, we can peer // through it and see the function target. This happens not infrequently // during devirtualization and so we want to give it a hefty bonus for // inlining, but cap that bonus in the event that inlining wouldn't pan // out. Pretend to inline the function, with a custom threshold. auto IndirectCallParams = Params; IndirectCallParams.DefaultThreshold = InlineConstants::IndirectCallThreshold; CallAnalyzer CA(TTI, GetAssumptionCache, GetBFI, PSI, *F, CS, IndirectCallParams); if (CA.analyzeCall(CS)) { // We were able to inline the indirect call! Subtract the cost from the // threshold to get the bonus we want to apply, but don't go below zero. Cost -= std::max(0, CA.getThreshold() - CA.getCost()); } return Base::visitCallSite(CS); } bool CallAnalyzer::visitReturnInst(ReturnInst &RI) { // At least one return instruction will be free after inlining. bool Free = !HasReturn; HasReturn = true; return Free; } bool CallAnalyzer::visitBranchInst(BranchInst &BI) { // We model unconditional branches as essentially free -- they really // shouldn't exist at all, but handling them makes the behavior of the // inliner more regular and predictable. Interestingly, conditional branches // which will fold away are also free. return BI.isUnconditional() || isa<ConstantInt>(BI.getCondition()) || dyn_cast_or_null<ConstantInt>( SimplifiedValues.lookup(BI.getCondition())); } bool CallAnalyzer::visitSwitchInst(SwitchInst &SI) { // We model unconditional switches as free, see the comments on handling // branches. if (isa<ConstantInt>(SI.getCondition())) return true; if (Value *V = SimplifiedValues.lookup(SI.getCondition())) if (isa<ConstantInt>(V)) return true; // Assume the most general case where the switch is lowered into // either a jump table, bit test, or a balanced binary tree consisting of // case clusters without merging adjacent clusters with the same // destination. We do not consider the switches that are lowered with a mix // of jump table/bit test/binary search tree. The cost of the switch is // proportional to the size of the tree or the size of jump table range. // // NB: We convert large switches which are just used to initialize large phi // nodes to lookup tables instead in simplify-cfg, so this shouldn't prevent // inlining those. It will prevent inlining in cases where the optimization // does not (yet) fire. // Maximum valid cost increased in this function. int CostUpperBound = INT_MAX - InlineConstants::InstrCost - 1; // Exit early for a large switch, assuming one case needs at least one // instruction. // FIXME: This is not true for a bit test, but ignore such case for now to // save compile-time. int64_t CostLowerBound = std::min((int64_t)CostUpperBound, (int64_t)SI.getNumCases() * InlineConstants::InstrCost + Cost); if (CostLowerBound > Threshold) { Cost = CostLowerBound; return false; } unsigned JumpTableSize = 0; unsigned NumCaseCluster = TTI.getEstimatedNumberOfCaseClusters(SI, JumpTableSize); // If suitable for a jump table, consider the cost for the table size and // branch to destination. if (JumpTableSize) { int64_t JTCost = (int64_t)JumpTableSize * InlineConstants::InstrCost + 4 * InlineConstants::InstrCost; Cost = std::min((int64_t)CostUpperBound, JTCost + Cost); return false; } // Considering forming a binary search, we should find the number of nodes // which is same as the number of comparisons when lowered. For a given // number of clusters, n, we can define a recursive function, f(n), to find // the number of nodes in the tree. The recursion is : // f(n) = 1 + f(n/2) + f (n - n/2), when n > 3, // and f(n) = n, when n <= 3. // This will lead a binary tree where the leaf should be either f(2) or f(3) // when n > 3. So, the number of comparisons from leaves should be n, while // the number of non-leaf should be : // 2^(log2(n) - 1) - 1 // = 2^log2(n) * 2^-1 - 1 // = n / 2 - 1. // Considering comparisons from leaf and non-leaf nodes, we can estimate the // number of comparisons in a simple closed form : // n + n / 2 - 1 = n * 3 / 2 - 1 if (NumCaseCluster <= 3) { // Suppose a comparison includes one compare and one conditional branch. Cost += NumCaseCluster * 2 * InlineConstants::InstrCost; return false; } int64_t ExpectedNumberOfCompare = 3 * (int64_t)NumCaseCluster / 2 - 1; int64_t SwitchCost = ExpectedNumberOfCompare * 2 * InlineConstants::InstrCost; Cost = std::min((int64_t)CostUpperBound, SwitchCost + Cost); return false; } bool CallAnalyzer::visitIndirectBrInst(IndirectBrInst &IBI) { // We never want to inline functions that contain an indirectbr. This is // incorrect because all the blockaddress's (in static global initializers // for example) would be referring to the original function, and this // indirect jump would jump from the inlined copy of the function into the // original function which is extremely undefined behavior. // FIXME: This logic isn't really right; we can safely inline functions with // indirectbr's as long as no other function or global references the // blockaddress of a block within the current function. HasIndirectBr = true; return false; } bool CallAnalyzer::visitResumeInst(ResumeInst &RI) { // FIXME: It's not clear that a single instruction is an accurate model for // the inline cost of a resume instruction. return false; } bool CallAnalyzer::visitCleanupReturnInst(CleanupReturnInst &CRI) { // FIXME: It's not clear that a single instruction is an accurate model for // the inline cost of a cleanupret instruction. return false; } bool CallAnalyzer::visitCatchReturnInst(CatchReturnInst &CRI) { // FIXME: It's not clear that a single instruction is an accurate model for // the inline cost of a catchret instruction. return false; } bool CallAnalyzer::visitUnreachableInst(UnreachableInst &I) { // FIXME: It might be reasonably to discount the cost of instructions leading // to unreachable as they have the lowest possible impact on both runtime and // code size. return true; // No actual code is needed for unreachable. } bool CallAnalyzer::visitInstruction(Instruction &I) { // Some instructions are free. All of the free intrinsics can also be // handled by SROA, etc. if (TargetTransformInfo::TCC_Free == TTI.getUserCost(&I)) return true; // We found something we don't understand or can't handle. Mark any SROA-able // values in the operand list as no longer viable. for (User::op_iterator OI = I.op_begin(), OE = I.op_end(); OI != OE; ++OI) disableSROA(*OI); return false; } /// \brief Analyze a basic block for its contribution to the inline cost. /// /// This method walks the analyzer over every instruction in the given basic /// block and accounts for their cost during inlining at this callsite. It /// aborts early if the threshold has been exceeded or an impossible to inline /// construct has been detected. It returns false if inlining is no longer /// viable, and true if inlining remains viable. bool CallAnalyzer::analyzeBlock(BasicBlock *BB, SmallPtrSetImpl<const Value *> &EphValues) { for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { // FIXME: Currently, the number of instructions in a function regardless of // our ability to simplify them during inline to constants or dead code, // are actually used by the vector bonus heuristic. As long as that's true, // we have to special case debug intrinsics here to prevent differences in // inlining due to debug symbols. Eventually, the number of unsimplified // instructions shouldn't factor into the cost computation, but until then, // hack around it here. if (isa<DbgInfoIntrinsic>(I)) continue; // Skip ephemeral values. if (EphValues.count(&*I)) continue; ++NumInstructions; if (isa<ExtractElementInst>(I) || I->getType()->isVectorTy()) ++NumVectorInstructions; // If the instruction is floating point, and the target says this operation // is expensive or the function has the "use-soft-float" attribute, this may // eventually become a library call. Treat the cost as such. if (I->getType()->isFloatingPointTy()) { // If the function has the "use-soft-float" attribute, mark it as // expensive. if (TTI.getFPOpCost(I->getType()) == TargetTransformInfo::TCC_Expensive || (F.getFnAttribute("use-soft-float").getValueAsString() == "true")) Cost += InlineConstants::CallPenalty; } // If the instruction simplified to a constant, there is no cost to this // instruction. Visit the instructions using our InstVisitor to account for // all of the per-instruction logic. The visit tree returns true if we // consumed the instruction in any way, and false if the instruction's base // cost should count against inlining. if (Base::visit(&*I)) ++NumInstructionsSimplified; else Cost += InlineConstants::InstrCost; // If the visit this instruction detected an uninlinable pattern, abort. if (IsRecursiveCall || ExposesReturnsTwice || HasDynamicAlloca || HasIndirectBr || HasFrameEscape) return false; // If the caller is a recursive function then we don't want to inline // functions which allocate a lot of stack space because it would increase // the caller stack usage dramatically. if (IsCallerRecursive && AllocatedSize > InlineConstants::TotalAllocaSizeRecursiveCaller) return false; // Check if we've past the maximum possible threshold so we don't spin in // huge basic blocks that will never inline. if (Cost > Threshold) return false; } return true; } /// \brief Compute the base pointer and cumulative constant offsets for V. /// /// This strips all constant offsets off of V, leaving it the base pointer, and /// accumulates the total constant offset applied in the returned constant. It /// returns 0 if V is not a pointer, and returns the constant '0' if there are /// no constant offsets applied. ConstantInt *CallAnalyzer::stripAndComputeInBoundsConstantOffsets(Value *&V) { if (!V->getType()->isPointerTy()) return nullptr; unsigned IntPtrWidth = DL.getPointerSizeInBits(); APInt Offset = APInt::getNullValue(IntPtrWidth); // Even though we don't look through PHI nodes, we could be called on an // instruction in an unreachable block, which may be on a cycle. SmallPtrSet<Value *, 4> Visited; Visited.insert(V); do { if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { if (!GEP->isInBounds() || !accumulateGEPOffset(*GEP, Offset)) return nullptr; V = GEP->getPointerOperand(); } else if (Operator::getOpcode(V) == Instruction::BitCast) { V = cast<Operator>(V)->getOperand(0); } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { if (GA->isInterposable()) break; V = GA->getAliasee(); } else { break; } assert(V->getType()->isPointerTy() && "Unexpected operand type!"); } while (Visited.insert(V).second); Type *IntPtrTy = DL.getIntPtrType(V->getContext()); return cast<ConstantInt>(ConstantInt::get(IntPtrTy, Offset)); } /// \brief Analyze a call site for potential inlining. /// /// Returns true if inlining this call is viable, and false if it is not /// viable. It computes the cost and adjusts the threshold based on numerous /// factors and heuristics. If this method returns false but the computed cost /// is below the computed threshold, then inlining was forcibly disabled by /// some artifact of the routine. bool CallAnalyzer::analyzeCall(CallSite CS) { ++NumCallsAnalyzed; // Perform some tweaks to the cost and threshold based on the direct // callsite information. // We want to more aggressively inline vector-dense kernels, so up the // threshold, and we'll lower it if the % of vector instructions gets too // low. Note that these bonuses are some what arbitrary and evolved over time // by accident as much as because they are principled bonuses. // // FIXME: It would be nice to remove all such bonuses. At least it would be // nice to base the bonus values on something more scientific. assert(NumInstructions == 0); assert(NumVectorInstructions == 0); // Update the threshold based on callsite properties updateThreshold(CS, F); FiftyPercentVectorBonus = 3 * Threshold / 2; TenPercentVectorBonus = 3 * Threshold / 4; // Track whether the post-inlining function would have more than one basic // block. A single basic block is often intended for inlining. Balloon the // threshold by 50% until we pass the single-BB phase. bool SingleBB = true; int SingleBBBonus = Threshold / 2; // Speculatively apply all possible bonuses to Threshold. If cost exceeds // this Threshold any time, and cost cannot decrease, we can stop processing // the rest of the function body. Threshold += (SingleBBBonus + FiftyPercentVectorBonus); // Give out bonuses for the callsite, as the instructions setting them up // will be gone after inlining. Cost -= getCallsiteCost(CS, DL); // If there is only one call of the function, and it has internal linkage, // the cost of inlining it drops dramatically. bool OnlyOneCallAndLocalLinkage = F.hasLocalLinkage() && F.hasOneUse() && &F == CS.getCalledFunction(); if (OnlyOneCallAndLocalLinkage) Cost -= InlineConstants::LastCallToStaticBonus; // If this function uses the coldcc calling convention, prefer not to inline // it. if (F.getCallingConv() == CallingConv::Cold) Cost += InlineConstants::ColdccPenalty; // Check if we're done. This can happen due to bonuses and penalties. if (Cost > Threshold) return false; if (F.empty()) return true; Function *Caller = CS.getInstruction()->getParent()->getParent(); // Check if the caller function is recursive itself. for (User *U : Caller->users()) { CallSite Site(U); if (!Site) continue; Instruction *I = Site.getInstruction(); if (I->getParent()->getParent() == Caller) { IsCallerRecursive = true; break; } } // Populate our simplified values by mapping from function arguments to call // arguments with known important simplifications. CallSite::arg_iterator CAI = CS.arg_begin(); for (Function::arg_iterator FAI = F.arg_begin(), FAE = F.arg_end(); FAI != FAE; ++FAI, ++CAI) { assert(CAI != CS.arg_end()); if (Constant *C = dyn_cast<Constant>(CAI)) SimplifiedValues[&*FAI] = C; Value *PtrArg = *CAI; if (ConstantInt *C = stripAndComputeInBoundsConstantOffsets(PtrArg)) { ConstantOffsetPtrs[&*FAI] = std::make_pair(PtrArg, C->getValue()); // We can SROA any pointer arguments derived from alloca instructions. if (isa<AllocaInst>(PtrArg)) { SROAArgValues[&*FAI] = PtrArg; SROAArgCosts[PtrArg] = 0; } } } NumConstantArgs = SimplifiedValues.size(); NumConstantOffsetPtrArgs = ConstantOffsetPtrs.size(); NumAllocaArgs = SROAArgValues.size(); // FIXME: If a caller has multiple calls to a callee, we end up recomputing // the ephemeral values multiple times (and they're completely determined by // the callee, so this is purely duplicate work). SmallPtrSet<const Value *, 32> EphValues; CodeMetrics::collectEphemeralValues(&F, &GetAssumptionCache(F), EphValues); // The worklist of live basic blocks in the callee *after* inlining. We avoid // adding basic blocks of the callee which can be proven to be dead for this // particular call site in order to get more accurate cost estimates. This // requires a somewhat heavyweight iteration pattern: we need to walk the // basic blocks in a breadth-first order as we insert live successors. To // accomplish this, prioritizing for small iterations because we exit after // crossing our threshold, we use a small-size optimized SetVector. typedef SetVector<BasicBlock *, SmallVector<BasicBlock *, 16>, SmallPtrSet<BasicBlock *, 16>> BBSetVector; BBSetVector BBWorklist; BBWorklist.insert(&F.getEntryBlock()); // Note that we *must not* cache the size, this loop grows the worklist. for (unsigned Idx = 0; Idx != BBWorklist.size(); ++Idx) { // Bail out the moment we cross the threshold. This means we'll under-count // the cost, but only when undercounting doesn't matter. if (Cost > Threshold) break; BasicBlock *BB = BBWorklist[Idx]; if (BB->empty()) continue; // Disallow inlining a blockaddress. A blockaddress only has defined // behavior for an indirect branch in the same function, and we do not // currently support inlining indirect branches. But, the inliner may not // see an indirect branch that ends up being dead code at a particular call // site. If the blockaddress escapes the function, e.g., via a global // variable, inlining may lead to an invalid cross-function reference. if (BB->hasAddressTaken()) return false; // Analyze the cost of this block. If we blow through the threshold, this // returns false, and we can bail on out. if (!analyzeBlock(BB, EphValues)) return false; TerminatorInst *TI = BB->getTerminator(); // Add in the live successors by first checking whether we have terminator // that may be simplified based on the values simplified by this call. if (BranchInst *BI = dyn_cast<BranchInst>(TI)) { if (BI->isConditional()) { Value *Cond = BI->getCondition(); if (ConstantInt *SimpleCond = dyn_cast_or_null<ConstantInt>(SimplifiedValues.lookup(Cond))) { BBWorklist.insert(BI->getSuccessor(SimpleCond->isZero() ? 1 : 0)); continue; } } } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) { Value *Cond = SI->getCondition(); if (ConstantInt *SimpleCond = dyn_cast_or_null<ConstantInt>(SimplifiedValues.lookup(Cond))) { BBWorklist.insert(SI->findCaseValue(SimpleCond)->getCaseSuccessor()); continue; } } // If we're unable to select a particular successor, just count all of // them. for (unsigned TIdx = 0, TSize = TI->getNumSuccessors(); TIdx != TSize; ++TIdx) BBWorklist.insert(TI->getSuccessor(TIdx)); // If we had any successors at this point, than post-inlining is likely to // have them as well. Note that we assume any basic blocks which existed // due to branches or switches which folded above will also fold after // inlining. if (SingleBB && TI->getNumSuccessors() > 1) { // Take off the bonus we applied to the threshold. Threshold -= SingleBBBonus; SingleBB = false; } } // If this is a noduplicate call, we can still inline as long as // inlining this would cause the removal of the caller (so the instruction // is not actually duplicated, just moved). if (!OnlyOneCallAndLocalLinkage && ContainsNoDuplicateCall) return false; // We applied the maximum possible vector bonus at the beginning. Now, // subtract the excess bonus, if any, from the Threshold before // comparing against Cost. if (NumVectorInstructions <= NumInstructions / 10) Threshold -= FiftyPercentVectorBonus; else if (NumVectorInstructions <= NumInstructions / 2) Threshold -= (FiftyPercentVectorBonus - TenPercentVectorBonus); return Cost < std::max(1, Threshold); } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) /// \brief Dump stats about this call's analysis. LLVM_DUMP_METHOD void CallAnalyzer::dump() { #define DEBUG_PRINT_STAT(x) dbgs() << " " #x ": " << x << "\n" DEBUG_PRINT_STAT(NumConstantArgs); DEBUG_PRINT_STAT(NumConstantOffsetPtrArgs); DEBUG_PRINT_STAT(NumAllocaArgs); DEBUG_PRINT_STAT(NumConstantPtrCmps); DEBUG_PRINT_STAT(NumConstantPtrDiffs); DEBUG_PRINT_STAT(NumInstructionsSimplified); DEBUG_PRINT_STAT(NumInstructions); DEBUG_PRINT_STAT(SROACostSavings); DEBUG_PRINT_STAT(SROACostSavingsLost); DEBUG_PRINT_STAT(ContainsNoDuplicateCall); DEBUG_PRINT_STAT(Cost); DEBUG_PRINT_STAT(Threshold); #undef DEBUG_PRINT_STAT } #endif /// \brief Test that there are no attribute conflicts between Caller and Callee /// that prevent inlining. static bool functionsHaveCompatibleAttributes(Function *Caller, Function *Callee, TargetTransformInfo &TTI) { return TTI.areInlineCompatible(Caller, Callee) && AttributeFuncs::areInlineCompatible(*Caller, *Callee); } int llvm::getCallsiteCost(CallSite CS, const DataLayout &DL) { int Cost = 0; for (unsigned I = 0, E = CS.arg_size(); I != E; ++I) { if (CS.isByValArgument(I)) { // We approximate the number of loads and stores needed by dividing the // size of the byval type by the target's pointer size. PointerType *PTy = cast<PointerType>(CS.getArgument(I)->getType()); unsigned TypeSize = DL.getTypeSizeInBits(PTy->getElementType()); unsigned PointerSize = DL.getPointerSizeInBits(); // Ceiling division. unsigned NumStores = (TypeSize + PointerSize - 1) / PointerSize; // If it generates more than 8 stores it is likely to be expanded as an // inline memcpy so we take that as an upper bound. Otherwise we assume // one load and one store per word copied. // FIXME: The maxStoresPerMemcpy setting from the target should be used // here instead of a magic number of 8, but it's not available via // DataLayout. NumStores = std::min(NumStores, 8U); Cost += 2 * NumStores * InlineConstants::InstrCost; } else { // For non-byval arguments subtract off one instruction per call // argument. Cost += InlineConstants::InstrCost; } } // The call instruction also disappears after inlining. Cost += InlineConstants::InstrCost + InlineConstants::CallPenalty; return Cost; } InlineCost llvm::getInlineCost( CallSite CS, const InlineParams &Params, TargetTransformInfo &CalleeTTI, std::function<AssumptionCache &(Function &)> &GetAssumptionCache, Optional<function_ref<BlockFrequencyInfo &(Function &)>> GetBFI, ProfileSummaryInfo *PSI) { return getInlineCost(CS, CS.getCalledFunction(), Params, CalleeTTI, GetAssumptionCache, GetBFI, PSI); } InlineCost llvm::getInlineCost( CallSite CS, Function *Callee, const InlineParams &Params, TargetTransformInfo &CalleeTTI, std::function<AssumptionCache &(Function &)> &GetAssumptionCache, Optional<function_ref<BlockFrequencyInfo &(Function &)>> GetBFI, ProfileSummaryInfo *PSI) { // Cannot inline indirect calls. if (!Callee) return llvm::InlineCost::getNever(); // Calls to functions with always-inline attributes should be inlined // whenever possible. if (CS.hasFnAttr(Attribute::AlwaysInline)) { if (isInlineViable(*Callee)) return llvm::InlineCost::getAlways(); return llvm::InlineCost::getNever(); } // Never inline functions with conflicting attributes (unless callee has // always-inline attribute). if (!functionsHaveCompatibleAttributes(CS.getCaller(), Callee, CalleeTTI)) return llvm::InlineCost::getNever(); // Don't inline this call if the caller has the optnone attribute. if (CS.getCaller()->hasFnAttribute(Attribute::OptimizeNone)) return llvm::InlineCost::getNever(); // Don't inline functions which can be interposed at link-time. Don't inline // functions marked noinline or call sites marked noinline. // Note: inlining non-exact non-interposable functions is fine, since we know // we have *a* correct implementation of the source level function. if (Callee->isInterposable() || Callee->hasFnAttribute(Attribute::NoInline) || CS.isNoInline()) return llvm::InlineCost::getNever(); DEBUG(llvm::dbgs() << " Analyzing call of " << Callee->getName() << "...\n"); CallAnalyzer CA(CalleeTTI, GetAssumptionCache, GetBFI, PSI, *Callee, CS, Params); bool ShouldInline = CA.analyzeCall(CS); DEBUG(CA.dump()); // Check if there was a reason to force inlining or no inlining. if (!ShouldInline && CA.getCost() < CA.getThreshold()) return InlineCost::getNever(); if (ShouldInline && CA.getCost() >= CA.getThreshold()) return InlineCost::getAlways(); return llvm::InlineCost::get(CA.getCost(), CA.getThreshold()); } bool llvm::isInlineViable(Function &F) { bool ReturnsTwice = F.hasFnAttribute(Attribute::ReturnsTwice); for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) { // Disallow inlining of functions which contain indirect branches or // blockaddresses. if (isa<IndirectBrInst>(BI->getTerminator()) || BI->hasAddressTaken()) return false; for (auto &II : *BI) { CallSite CS(&II); if (!CS) continue; // Disallow recursive calls. if (&F == CS.getCalledFunction()) return false; // Disallow calls which expose returns-twice to a function not previously // attributed as such. if (!ReturnsTwice && CS.isCall() && cast<CallInst>(CS.getInstruction())->canReturnTwice()) return false; // Disallow inlining functions that call @llvm.localescape. Doing this // correctly would require major changes to the inliner. if (CS.getCalledFunction() && CS.getCalledFunction()->getIntrinsicID() == llvm::Intrinsic::localescape) return false; } } return true; } // APIs to create InlineParams based on command line flags and/or other // parameters. InlineParams llvm::getInlineParams(int Threshold) { InlineParams Params; // This field is the threshold to use for a callee by default. This is // derived from one or more of: // * optimization or size-optimization levels, // * a value passed to createFunctionInliningPass function, or // * the -inline-threshold flag. // If the -inline-threshold flag is explicitly specified, that is used // irrespective of anything else. if (InlineThreshold.getNumOccurrences() > 0) Params.DefaultThreshold = InlineThreshold; else Params.DefaultThreshold = Threshold; // Set the HintThreshold knob from the -inlinehint-threshold. Params.HintThreshold = HintThreshold; // Set the HotCallSiteThreshold knob from the -hot-callsite-threshold. Params.HotCallSiteThreshold = HotCallSiteThreshold; // Set the ColdCallSiteThreshold knob from the -inline-cold-callsite-threshold. Params.ColdCallSiteThreshold = ColdCallSiteThreshold; // Set the OptMinSizeThreshold and OptSizeThreshold params only if the // -inlinehint-threshold commandline option is not explicitly given. If that // option is present, then its value applies even for callees with size and // minsize attributes. // If the -inline-threshold is not specified, set the ColdThreshold from the // -inlinecold-threshold even if it is not explicitly passed. If // -inline-threshold is specified, then -inlinecold-threshold needs to be // explicitly specified to set the ColdThreshold knob if (InlineThreshold.getNumOccurrences() == 0) { Params.OptMinSizeThreshold = InlineConstants::OptMinSizeThreshold; Params.OptSizeThreshold = InlineConstants::OptSizeThreshold; Params.ColdThreshold = ColdThreshold; } else if (ColdThreshold.getNumOccurrences() > 0) { Params.ColdThreshold = ColdThreshold; } return Params; } InlineParams llvm::getInlineParams() { return getInlineParams(InlineThreshold); } // Compute the default threshold for inlining based on the opt level and the // size opt level. static int computeThresholdFromOptLevels(unsigned OptLevel, unsigned SizeOptLevel) { if (OptLevel > 2) return InlineConstants::OptAggressiveThreshold; if (SizeOptLevel == 1) // -Os return InlineConstants::OptSizeThreshold; if (SizeOptLevel == 2) // -Oz return InlineConstants::OptMinSizeThreshold; return InlineThreshold; } InlineParams llvm::getInlineParams(unsigned OptLevel, unsigned SizeOptLevel) { return getInlineParams(computeThresholdFromOptLevels(OptLevel, SizeOptLevel)); }
{'repo_name': 'root-project/root', 'stars': '1194', 'repo_language': 'C++', 'file_name': '__init__.py', 'mime_type': 'text/plain', 'hash': 3714228168544889910, 'source_dataset': 'data'}
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0"> <path android:fillColor="?android:attr/colorControlNormal" android:pathData="M5,16h3v3h2v-5L5,14v2zM8,8L5,8v2h5L10,5L8,5v3zM14,19h2v-3h3v-2h-5v5zM16,8L16,5h-2v5h5L19,8h-3z" /> </vector>
{'repo_name': 'aosp-mirror/platform_frameworks_support', 'stars': '1569', 'repo_language': 'Java', 'file_name': 'Nullable.java', 'mime_type': 'text/x-java', 'hash': -7026954237362066240, 'source_dataset': 'data'}
<!--- Copyright (c) 2014 Tom Gidden, 2015 Luwar. See the file LICENSE for copying permission. --> HTU21D Temperature and RH Sensor ================================ <span style="color:red">:warning: **Please view the correctly rendered version of this page at https://www.espruino.com/HTU21D. Links, lists, videos, search, and other features will not work correctly when viewed on GitHub** :warning:</span> * KEYWORDS: Module,I2C,HTU21D,temperature,humidity The HTU21D is a low-cost, easy to use, highly accurate, digital humidity and temperature sensor. Use the [HTU21D](/modules/HTU21D.js) ([About Modules](/Modules)) module for it. You can wire this up as follows: | Device Pin | Espruino | | ---------- | -------- | | GND / - | GND | | VCC / + | 3.3 | | SCL | B6 | | SDA | B7 | **Note:** - On Adafruit's board, don't connect the 3.3v line and instead connect VCC on the breakout board to Espruino's 3.3v → https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity-sensor/wiring-and-test - On some Sparkfun's board, the pull up resistors are not connected by default. You need to bridge the solder jumper on the board → https://learn.sparkfun.com/tutorials/htu21d-humidity-sensor-hookup-guide Use cases --------- Read the temperature and humidity and wait until the measurement is completed. This blocks the I2C bus and the cpu for at most 50ms: ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); console.log( "Temperature = " + htu.readTemperature() + " °C" ); console.log( "Humidity = " + htu.readHumidity() + " %" ); ``` If you want to work asynchronously then you have to use the getTemperature() and getHumidity(). ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); var temperature; var humidity; function startMeasuring() { htu.getTemperature( function(temp) { htu.getHumidity( function(hum) { temperature = temp; humidity = hum; startMeasuring(); // start the next measuring cycle }); } ); } startMeasuring(); // It's forbidden to call a HTU21D method while measuring asynchronously! // e.g. htu.readTemperature() would here throw an exception. // After 50 ms the temperature and humidity are always up-to-date. setInterval( function() { console.log( "T = " + temperature.toFixed(2) + " °C, " + "RH = " + humidity.toFixed(2) + " %" ); }, 100 ); ``` **Note** It's important to make sure that the sensor will not be used during an asynchronous measuring. This is an incorrect usage: ```JavaScript I2C1.setup( {scl: B8, sda: B9, bitrate: 50000 } ); var htu = require('HTU21D').connect( I2C1 ); htu.getTemperature( function (temp) { console.log(temp); } ); // This will throw an error "Sensor is measuring" ! htu.getHumidity( function( humidity ) { } ); ``` The humidity is slightly temperature dependent but you can compensate this dependency if you have the current temperature: ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); var temp = htu.readTemperature(); var humidity = htu.readHumidity(); humdity = htu.getCompensatedHumidity( humidity, temp ); // improve accuracy console.log("Temperature = " + temp.toFixed(2) + " °C" ); console.log("Humidity = " + humidity.toFixed(2) + " %" ); console.log("Dew point = " + htu.getDewPoint(temp,humidity).toFixed(2) + " °C"); ``` Sometime it is not required to work with the highest resolution. With a lower resolution the measuring time is decreasing and so the power consumption: ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); // 12 instead of 14 bits but only 13 ms instead of 50 ms htu.setResolution( htu.RH_8_BITS_TEMP_12_BITS ); // This call takes only 13 ms instead of 50 ms. var temperature = htu.readTemperature(); console.log( "T = " + temperature ); ``` Possible resolutions are: | | RH | Measuring Time | Temperature | Measuring Time | | ----------------------- | ------- | -------------- | ----------- | -------------- | | RH_12_BITS_TEMP_14_BITS | 12 bits | max. 16 ms | 14 bits | 50 ms | | RH_8_BITS_TEMP_12_BITS | 8 bits | max. 3 ms | 12 bits | 13 ms | | RH_10_BITS_TEMP_13_BITS | 10 bits | max. 5 ms | 13 bits | 25 ms | | RH_11_BITS_TEMP_11_BITS | 11 bits | max. 8 ms | 11 bits | 7 ms | Every HTU21D sensor has a unique chip identification number. Maybe you wants to tag your delivered devices? ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); console.log( "0x" + htu.getSerialNumber().toString(16) ); // → e.g. 0x2ee38a18 ``` The internal heater can be used for checking the operation and for preventing condensation: ```JavaScript I2C1.setup( {scl: B8, sda: B9 } ); var htu = require('HTU21D').connect( I2C1 ); console.log( "Heater = " + htu.isHeaterOn() ); // → false htu.setHeaterOn( true ); console.log( "Heater = " + htu.isHeaterOn() ); // → true htu.setHeaterOn( false ); console.log( "Heater = " + htu.isHeaterOn() ); // → false ``` You can reboot the sensor to initial state (maximal resolution, heater off) with a soft reset: ```JavaScript htu.setHeaterOn( true ); htu.setResolution( htu.RH_8_BITS_TEMP_12_BITS ); htu.softReset(); console.log( "Heater = " + htu.isHeaterOn() ); // → false console.log( "max. resolution = " + (htu.getResolution() === htu.RH_8_BITS_TEMP_12_BITS ) ); // → false console.log( "max. resolution = " + (htu.getResolution() === htu.RH_12_BITS_TEMP_14_BITS ) ); // → true ``` The sensor operates from 1.5V to 3.6V. Its possible to detect a voltage supply less than 2.25V: ```JavaScript console.log( "End of battery = " + htu.isEndOfBattery() ); // → false ``` Troubleshooting --------------- **The humidity returned is -6** The HTU21D datasheet states that this response (equivalent to an actual reading of 0 from the sensor) means that the humidity sensor is open circuit (eg. broken). The temperature will probably still work but you'll need to get a new sensor if you need to measure humidity. Buying ----- * [AdaFruit breakout board](https://www.adafruit.com/products/1899) * [SparkFun Breakout](https://www.sparkfun.com/products/12064) * .. or cheaper from EBay Links ----- * Manufacturer MEAS http://www.meas-spec.com/product/humidity/HTU21D.aspx * Datasheet http://www.meas-spec.com/downloads/HTU21D.pdf * HTU2X Serial Number Reading http://www.meas-spec.com/downloads/HTU2X_Serial_Number_Reading.pdf
{'repo_name': 'espruino/EspruinoDocs', 'stars': '191', 'repo_language': 'JavaScript', 'file_name': 'nb_iot_explorer.md', 'mime_type': 'text/plain', 'hash': -6614488726584969784, 'source_dataset': 'data'}
<?php /* * Copyright 2014 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. */ class Google_Service_Iam_CreateServiceAccountKeyRequest extends Google_Model { public $keyAlgorithm; public $privateKeyType; public function setKeyAlgorithm($keyAlgorithm) { $this->keyAlgorithm = $keyAlgorithm; } public function getKeyAlgorithm() { return $this->keyAlgorithm; } public function setPrivateKeyType($privateKeyType) { $this->privateKeyType = $privateKeyType; } public function getPrivateKeyType() { return $this->privateKeyType; } }
{'repo_name': 'WWBN/AVideo', 'stars': '1149', 'repo_language': 'PHP', 'file_name': 'design_themes.php', 'mime_type': 'text/html', 'hash': -7966731545886123477, 'source_dataset': 'data'}
package com.salesmanager.shop.model.catalog.product.inventory; import com.salesmanager.shop.model.entity.Entity; public class InventoryEntity extends Entity { /** * */ private static final long serialVersionUID = 1L; private int quantity; private String region; private String regionVariant; private String owner; private String dateAvailable; private boolean available; private int productQuantityOrderMin = 0; private int productQuantityOrderMax = 0; public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public String getRegion() { return region; } public void setRegion(String region) { this.region = region; } public String getRegionVariant() { return regionVariant; } public void setRegionVariant(String regionVariant) { this.regionVariant = regionVariant; } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public boolean isAvailable() { return available; } public void setAvailable(boolean available) { this.available = available; } public int getProductQuantityOrderMin() { return productQuantityOrderMin; } public void setProductQuantityOrderMin(int productQuantityOrderMin) { this.productQuantityOrderMin = productQuantityOrderMin; } public int getProductQuantityOrderMax() { return productQuantityOrderMax; } public void setProductQuantityOrderMax(int productQuantityOrderMax) { this.productQuantityOrderMax = productQuantityOrderMax; } public String getDateAvailable() { return dateAvailable; } public void setDateAvailable(String dateAvailable) { this.dateAvailable = dateAvailable; } }
{'repo_name': 'shopizer-ecommerce/shopizer', 'stars': '1660', 'repo_language': 'Java', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -4641705464341916207, 'source_dataset': 'data'}
import { useEffect, useState } from "react"; import { isAddress } from "@ethersproject/address"; const useContractExistsAtAddress = (provider, contractAddress) => { const [contractIsDeployed, setContractIsDeployed] = useState(false); // We can look at the blockchain and see what's stored at `contractAddress` // If we find code then we know that a contract exists there. // If we find nothing (0x0) then there is no contract deployed to that address useEffect(() => { // eslint-disable-next-line consistent-return const checkDeployment = async () => { if (!isAddress(contractAddress)) return false; const bytecode = await provider.getCode(contractAddress); setContractIsDeployed(bytecode !== "0x0"); }; if (provider) checkDeployment(); }, [provider, contractAddress]); return contractIsDeployed; }; export default useContractExistsAtAddress;
{'repo_name': 'austintgriffith/scaffold-eth', 'stars': '136', 'repo_language': 'JavaScript', 'file_name': 'myTest.js', 'mime_type': 'text/plain', 'hash': -7832539720100577564, 'source_dataset': 'data'}
# test_Ltas_reportSpectralTilt.praat # djmw 20130813, 2017 appendInfoLine: "test_Ltas_reportSpectralTilt" for k to 10 @ltas endfor procedure ltas .s [1] = Create Sound from formula: "sineWithNoise", 1, 0, 1, 44100, "randomGauss(0,0.1)" .s [2] = Filter (de-emphasis): 50 # some of the following values are rough guesses, if the assertion failes adapt the values somewhat .slope [1] = 0 ; dB/Hz (this value is exact) .slopemargin[1] = 0.5 ; approximate .slope [2] = -20 ; dB/decade (this value is exact) .slopemargin[2] = 1.5 ; approximate .offset [1] = 30.8 ; dB approximate .offsetmargin[1] = 3 ; approximate .offset [2] = 95 ; dB ; approximate .offsetmargin [2] = 4 ; approximate for .i to 2 selectObject: .s [.i] .ltas = To Ltas: 100 .info$ = Report spectral tilt: 100, 10000, "Logarithmic", "Robust" .slope = extractNumber (.info$, "Slope:") .offset = extractNumber (.info$, "Offset:") .slopediff = (.slope - .slope [.i]) .offsetdiffr = (.offset - .offset [.i]) / .offset appendInfoLine: tab$, "Slope difference = ", .slopediff, " (slope [", .i, "] = ", .slope [.i], ")" appendInfoLine: tab$, "Rel. offset diff = ", .offsetdiffr, " (Offset [", .i, "] = ", .offset [.i], ")" removeObject: .s [.i], .ltas endfor endproc appendInfoLine ("test_Ltas_reportSpectralTilt OK")
{'repo_name': 'YannickJadoul/Parselmouth', 'stars': '343', 'repo_language': 'C++', 'file_name': 'postBuild', 'mime_type': 'text/x-shellscript', 'hash': -4239964808859845113, 'source_dataset': 'data'}
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.atmosphere</groupId> <artifactId>wasync-project</artifactId> <version>2.1.8-SNAPSHOT</version> <relativePath>../</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.atmosphere</groupId> <artifactId>wasync</artifactId> <name>wasync</name> <version>2.1.8-SNAPSHOT</version> <packaging>bundle</packaging> <description> wAsync: A WebSockets/HTTP Client Library </description> <dependencies> <dependency> <groupId>com.ning</groupId> <artifactId>async-http-client</artifactId> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>14.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.atmosphere</groupId> <artifactId>nettosphere</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.atmosphere</groupId> <artifactId>atmosphere-runtime</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.1.2</version> <scope>test</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.1.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <version>2.5.3</version> <configuration> <instructions> <Bundle-SymbolicName>org.atmosphere.wasync</Bundle-SymbolicName> <Export-Package> org.atmosphere.wasync.* </Export-Package> </instructions> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>all</shadedClassifierName> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" /> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>org.atmosphere.wasync.util.WebSocketLoader</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
{'repo_name': 'Atmosphere/wasync', 'stars': '158', 'repo_language': 'Java', 'file_name': 'javadoc.sh', 'mime_type': 'text/x-shellscript', 'hash': 7862545732076430992, 'source_dataset': 'data'}
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <libraryInfos> <libraryInfo home="/usr/lib/jvm/java-7-openjdk-amd64/jre" version="1.7.0_65"> <bootpath> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/classes"/> </bootpath> <extensionDirs> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext"/> <entry path="/usr/java/packages/lib/ext"/> </extensionDirs> <endorsedDirs> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed"/> </endorsedDirs> </libraryInfo> <libraryInfo home="/usr/local/lib/java/jdk1.7.0_71" version="1.7.0_71"> <bootpath> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/resources.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/rt.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/sunrsasign.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jsse.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jce.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/charsets.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/jfr.jar"/> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/classes"/> </bootpath> <extensionDirs> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/ext"/> <entry path="/usr/java/packages/lib/ext"/> </extensionDirs> <endorsedDirs> <entry path="/usr/local/lib/java/jdk1.7.0_71/jre/lib/endorsed"/> </endorsedDirs> </libraryInfo> <libraryInfo home="/usr/local/lib/java/jdk1.8.0_25/jre" version="1.8.0_25"> <bootpath> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/resources.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/rt.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/sunrsasign.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jsse.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jce.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/charsets.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/jfr.jar"/> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/classes"/> </bootpath> <extensionDirs> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/ext"/> <entry path="/usr/java/packages/lib/ext"/> </extensionDirs> <endorsedDirs> <entry path="/usr/local/lib/java/jdk1.8.0_25/jre/lib/endorsed"/> </endorsedDirs> </libraryInfo> <libraryInfo home="/usr/lib/jvm/java-7-openjdk-amd64" version="1.7.0_65"> <bootpath> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar"/> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/classes"/> </bootpath> <extensionDirs> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext"/> <entry path="/usr/java/packages/lib/ext"/> </extensionDirs> <endorsedDirs> <entry path="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed"/> </endorsedDirs> </libraryInfo> </libraryInfos>
{'repo_name': 'sics-sse/moped', 'stars': '109', 'repo_language': 'Java', 'file_name': 'dialog_settings.xml', 'mime_type': 'text/xml', 'hash': -7796590021651022841, 'source_dataset': 'data'}
'use strict'; module.exports.definition = { set: function (v) { this._setProperty('stroke-linejoin', v); }, get: function () { return this.getPropertyValue('stroke-linejoin'); }, enumerable: true, configurable: true };
{'repo_name': 'tartanguru/alexa-google-search', 'stars': '207', 'repo_language': 'JavaScript', 'file_name': 'SEARCH.txt', 'mime_type': 'text/plain', 'hash': 7402911111314559053, 'source_dataset': 'data'}
// Copyright 2012-2014 Charles Banning. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file package mxj import ( "bytes" "encoding/json" "fmt" "io" "time" ) // ------------------------------ write JSON ----------------------- // Just a wrapper on json.Marshal. // If option safeEncoding is'true' then safe encoding of '<', '>' and '&' // is preserved. (see encoding/json#Marshal, encoding/json#Encode) func (mv Map) Json(safeEncoding ...bool) ([]byte, error) { var s bool if len(safeEncoding) == 1 { s = safeEncoding[0] } b, err := json.Marshal(mv) if !s { b = bytes.Replace(b, []byte("\\u003c"), []byte("<"), -1) b = bytes.Replace(b, []byte("\\u003e"), []byte(">"), -1) b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1) } return b, err } // Just a wrapper on json.MarshalIndent. // If option safeEncoding is'true' then safe encoding of '<' , '>' and '&' // is preserved. (see encoding/json#Marshal, encoding/json#Encode) func (mv Map) JsonIndent(prefix, indent string, safeEncoding ...bool) ([]byte, error) { var s bool if len(safeEncoding) == 1 { s = safeEncoding[0] } b, err := json.MarshalIndent(mv, prefix, indent) if !s { b = bytes.Replace(b, []byte("\\u003c"), []byte("<"), -1) b = bytes.Replace(b, []byte("\\u003e"), []byte(">"), -1) b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1) } return b, err } // The following implementation is provided for symmetry with NewMapJsonReader[Raw] // The names will also provide a key for the number of return arguments. // Writes the Map as JSON on the Writer. // If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved. func (mv Map) JsonWriter(jsonWriter io.Writer, safeEncoding ...bool) error { b, err := mv.Json(safeEncoding...) if err != nil { return err } _, err = jsonWriter.Write(b) return err } // Writes the Map as JSON on the Writer. []byte is the raw JSON that was written. // If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved. func (mv Map) JsonWriterRaw(jsonWriter io.Writer, safeEncoding ...bool) ([]byte, error) { b, err := mv.Json(safeEncoding...) if err != nil { return b, err } _, err = jsonWriter.Write(b) return b, err } // Writes the Map as pretty JSON on the Writer. // If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved. func (mv Map) JsonIndentWriter(jsonWriter io.Writer, prefix, indent string, safeEncoding ...bool) error { b, err := mv.JsonIndent(prefix, indent, safeEncoding...) if err != nil { return err } _, err = jsonWriter.Write(b) return err } // Writes the Map as pretty JSON on the Writer. []byte is the raw JSON that was written. // If 'safeEncoding' is 'true', then "safe" encoding of '<', '>' and '&' is preserved. func (mv Map) JsonIndentWriterRaw(jsonWriter io.Writer, prefix, indent string, safeEncoding ...bool) ([]byte, error) { b, err := mv.JsonIndent(prefix, indent, safeEncoding...) if err != nil { return b, err } _, err = jsonWriter.Write(b) return b, err } // --------------------------- read JSON ----------------------------- // Decode numericvalues as json.Number type Map values - see encoding/json#Number. // NOTE: this is for decoding JSON into a Map with NewMapJson(), NewMapJsonReader(), // etc.; it does not affect NewMapXml(), etc. The XML encoders mv.Xml() and mv.XmlIndent() // do recognize json.Number types; a JSON object can be decoded to a Map with json.Number // value types and the resulting Map can be correctly encoded into a XML object. var JsonUseNumber bool // Just a wrapper on json.Unmarshal // Converting JSON to XML is a simple as: // ... // mapVal, merr := mxj.NewMapJson(jsonVal) // if merr != nil { // // handle error // } // xmlVal, xerr := mapVal.Xml() // if xerr != nil { // // handle error // } // NOTE: as a special case, passing a list, e.g., [{"some-null-value":"", "a-non-null-value":"bar"}], // will be interpreted as having the root key 'object' prepended - {"object":[ ... ]} - to unmarshal to a Map. // See mxj/j2x/j2x_test.go. func NewMapJson(jsonVal []byte) (Map, error) { // empty or nil begets empty if len(jsonVal) == 0 { m := make(map[string]interface{}, 0) return m, nil } // handle a goofy case ... if jsonVal[0] == '[' { jsonVal = []byte(`{"object":` + string(jsonVal) + `}`) } m := make(map[string]interface{}) // err := json.Unmarshal(jsonVal, &m) buf := bytes.NewReader(jsonVal) dec := json.NewDecoder(buf) if JsonUseNumber { dec.UseNumber() } err := dec.Decode(&m) return m, err } // Retrieve a Map value from an io.Reader. // NOTE: The raw JSON off the reader is buffered to []byte using a ByteReader. If the io.Reader is an // os.File, there may be significant performance impact. If the io.Reader is wrapping a []byte // value in-memory, however, such as http.Request.Body you CAN use it to efficiently unmarshal // a JSON object. func NewMapJsonReader(jsonReader io.Reader) (Map, error) { jb, err := getJson(jsonReader) if err != nil || len(*jb) == 0 { return nil, err } // Unmarshal the 'presumed' JSON string return NewMapJson(*jb) } // Retrieve a Map value and raw JSON - []byte - from an io.Reader. // NOTE: The raw JSON off the reader is buffered to []byte using a ByteReader. If the io.Reader is an // os.File, there may be significant performance impact. If the io.Reader is wrapping a []byte // value in-memory, however, such as http.Request.Body you CAN use it to efficiently unmarshal // a JSON object and retrieve the raw JSON in a single call. func NewMapJsonReaderRaw(jsonReader io.Reader) (Map, []byte, error) { jb, err := getJson(jsonReader) if err != nil || len(*jb) == 0 { return nil, *jb, err } // Unmarshal the 'presumed' JSON string m, merr := NewMapJson(*jb) return m, *jb, merr } // Pull the next JSON string off the stream: just read from first '{' to its closing '}'. // Returning a pointer to the slice saves 16 bytes - maybe unnecessary, but internal to package. func getJson(rdr io.Reader) (*[]byte, error) { bval := make([]byte, 1) jb := make([]byte, 0) var inQuote, inJson bool var parenCnt int var previous byte // scan the input for a matched set of {...} // json.Unmarshal will handle syntax checking. for { _, err := rdr.Read(bval) if err != nil { if err == io.EOF && inJson && parenCnt > 0 { return &jb, fmt.Errorf("no closing } for JSON string: %s", string(jb)) } return &jb, err } switch bval[0] { case '{': if !inQuote { parenCnt++ inJson = true } case '}': if !inQuote { parenCnt-- } if parenCnt < 0 { return nil, fmt.Errorf("closing } without opening {: %s", string(jb)) } case '"': if inQuote { if previous == '\\' { break } inQuote = false } else { inQuote = true } case '\n', '\r', '\t', ' ': if !inQuote { continue } } if inJson { jb = append(jb, bval[0]) if parenCnt == 0 { break } } previous = bval[0] } return &jb, nil } // ------------------------------- JSON Reader handler via Map values ----------------------- // Default poll delay to keep Handler from spinning on an open stream // like sitting on os.Stdin waiting for imput. var jhandlerPollInterval = time.Duration(1e6) // While unnecessary, we make HandleJsonReader() have the same signature as HandleXmlReader(). // This avoids treating one or other as a special case and discussing the underlying stdlib logic. // Bulk process JSON using handlers that process a Map value. // 'rdr' is an io.Reader for the JSON (stream). // 'mapHandler' is the Map processing handler. Return of 'false' stops io.Reader processing. // 'errHandler' is the error processor. Return of 'false' stops io.Reader processing and returns the error. // Note: mapHandler() and errHandler() calls are blocking, so reading and processing of messages is serialized. // This means that you can stop reading the file on error or after processing a particular message. // To have reading and handling run concurrently, pass argument to a go routine in handler and return 'true'. func HandleJsonReader(jsonReader io.Reader, mapHandler func(Map) bool, errHandler func(error) bool) error { var n int for { m, merr := NewMapJsonReader(jsonReader) n++ // handle error condition with errhandler if merr != nil && merr != io.EOF { merr = fmt.Errorf("[jsonReader: %d] %s", n, merr.Error()) if ok := errHandler(merr); !ok { // caused reader termination return merr } continue } // pass to maphandler if len(m) != 0 { if ok := mapHandler(m); !ok { break } } else if merr != io.EOF { <-time.After(jhandlerPollInterval) } if merr == io.EOF { break } } return nil } // Bulk process JSON using handlers that process a Map value and the raw JSON. // 'rdr' is an io.Reader for the JSON (stream). // 'mapHandler' is the Map and raw JSON - []byte - processor. Return of 'false' stops io.Reader processing. // 'errHandler' is the error and raw JSON processor. Return of 'false' stops io.Reader processing and returns the error. // Note: mapHandler() and errHandler() calls are blocking, so reading and processing of messages is serialized. // This means that you can stop reading the file on error or after processing a particular message. // To have reading and handling run concurrently, pass argument(s) to a go routine in handler and return 'true'. func HandleJsonReaderRaw(jsonReader io.Reader, mapHandler func(Map, []byte) bool, errHandler func(error, []byte) bool) error { var n int for { m, raw, merr := NewMapJsonReaderRaw(jsonReader) n++ // handle error condition with errhandler if merr != nil && merr != io.EOF { merr = fmt.Errorf("[jsonReader: %d] %s", n, merr.Error()) if ok := errHandler(merr, raw); !ok { // caused reader termination return merr } continue } // pass to maphandler if len(m) != 0 { if ok := mapHandler(m, raw); !ok { break } } else if merr != io.EOF { <-time.After(jhandlerPollInterval) } if merr == io.EOF { break } } return nil }
{'repo_name': 'clbanning/mxj', 'stars': '386', 'repo_language': 'Go', 'file_name': 'x2j_valuesAt.go', 'mime_type': 'text/plain', 'hash': -4739224342193486258, 'source_dataset': 'data'}
platform :osx, '10.10' use_frameworks! install! 'cocoapods', :generate_multiple_pod_projects => true target 'CriolloServerStats' do pod 'Criollo', :git => '../../', :submodules => true pod 'CSSystemInfoHelper', '~> 1.4' end
{'repo_name': 'thecatalinstan/Criollo', 'stars': '210', 'repo_language': 'Objective-C', 'file_name': 'CRHTTPResponse.h', 'mime_type': 'text/x-objective-c', 'hash': -483712832240863090, 'source_dataset': 'data'}
import React, { InputHTMLAttributes, useEffect, useRef } from 'react'; import { useField } from '../../lib'; interface Props extends InputHTMLAttributes<HTMLInputElement> { name: string; label?: string; } export default function Input({ name, label, ...rest }: Props) { const ref = useRef<HTMLInputElement>(null); const { fieldName, registerField, defaultValue, error } = useField(name); useEffect(() => { if (ref.current) { registerField({ name: fieldName, ref: ref.current, path: 'value', clearValue: (inputRef: HTMLInputElement) => { inputRef.value = 'test'; }, }); } }, [fieldName, registerField]); return ( <> {label && <label htmlFor={fieldName}>{label}</label>} <input {...rest} ref={ref} id={fieldName} name={fieldName} aria-label={fieldName} defaultValue={defaultValue} /> {error && <span>{error}</span>} </> ); }
{'repo_name': 'Rocketseat/unform', 'stars': '3562', 'repo_language': 'TypeScript', 'file_name': 'Input.tsx', 'mime_type': 'text/x-java', 'hash': 9078803256097546820, 'source_dataset': 'data'}
// Copyright 2007, 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. // // Utilities for testing Google Test itself and code that uses Google Test // (e.g. frameworks built on top of Google Test). // GOOGLETEST_CM0004 DO NOT DELETE #ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ #define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ #include "gtest/gtest.h" GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ /* class A needs to have dll-interface to be used by clients of class B */) namespace testing { // This helper class can be used to mock out Google Test failure reporting // so that we can test Google Test or code that builds on Google Test. // // An object of this class appends a TestPartResult object to the // TestPartResultArray object given in the constructor whenever a Google Test // failure is reported. It can either intercept only failures that are // generated in the same thread that created this object or it can intercept // all generated failures. The scope of this mock object can be controlled with // the second argument to the two arguments constructor. class GTEST_API_ ScopedFakeTestPartResultReporter : public TestPartResultReporterInterface { public: // The two possible mocking modes of this object. enum InterceptMode { INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. INTERCEPT_ALL_THREADS // Intercepts all failures. }; // The c'tor sets this object as the test part result reporter used // by Google Test. The 'result' parameter specifies where to report the // results. This reporter will only catch failures generated in the current // thread. DEPRECATED explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); // Same as above, but you can choose the interception scope of this object. ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, TestPartResultArray* result); // The d'tor restores the previous test part result reporter. virtual ~ScopedFakeTestPartResultReporter(); // Appends the TestPartResult object to the TestPartResultArray // received in the constructor. // // This method is from the TestPartResultReporterInterface // interface. virtual void ReportTestPartResult(const TestPartResult& result); private: void Init(); const InterceptMode intercept_mode_; TestPartResultReporterInterface* old_reporter_; TestPartResultArray* const result_; GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); }; namespace internal { // A helper class for implementing EXPECT_FATAL_FAILURE() and // EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given // TestPartResultArray contains exactly one failure that has the given // type and contains the given substring. If that's not the case, a // non-fatal failure will be generated. class GTEST_API_ SingleFailureChecker { public: // The constructor remembers the arguments. SingleFailureChecker(const TestPartResultArray* results, TestPartResult::Type type, const std::string& substr); ~SingleFailureChecker(); private: const TestPartResultArray* const results_; const TestPartResult::Type type_; const std::string substr_; GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); }; } // namespace internal } // namespace testing GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 // A set of macros for testing Google Test assertions or code that's expected // to generate Google Test fatal failures. It verifies that the given // statement will cause exactly one fatal Google Test failure with 'substr' // being part of the failure message. // // There are two different versions of this macro. EXPECT_FATAL_FAILURE only // affects and considers failures generated in the current thread and // EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. // // The verification of the assertion is done correctly even when the statement // throws an exception or aborts the current function. // // Known restrictions: // - 'statement' cannot reference local non-static variables or // non-static members of the current object. // - 'statement' cannot return a value. // - You cannot stream a failure message to this macro. // // Note that even though the implementations of the following two // macros are much alike, we cannot refactor them to use a common // helper macro, due to some peculiarity in how the preprocessor // works. The AcceptsMacroThatExpandsToUnprotectedComma test in // gtest_unittest.cc will fail to compile if we do that. #define EXPECT_FATAL_FAILURE(statement, substr) \ do { \ class GTestExpectFatalFailureHelper {\ public:\ static void Execute() { statement; }\ };\ ::testing::TestPartResultArray gtest_failures;\ ::testing::internal::SingleFailureChecker gtest_checker(\ &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ {\ ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ ::testing::ScopedFakeTestPartResultReporter:: \ INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\ GTestExpectFatalFailureHelper::Execute();\ }\ } while (::testing::internal::AlwaysFalse()) #define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ do { \ class GTestExpectFatalFailureHelper {\ public:\ static void Execute() { statement; }\ };\ ::testing::TestPartResultArray gtest_failures;\ ::testing::internal::SingleFailureChecker gtest_checker(\ &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ {\ ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ ::testing::ScopedFakeTestPartResultReporter:: \ INTERCEPT_ALL_THREADS, &gtest_failures);\ GTestExpectFatalFailureHelper::Execute();\ }\ } while (::testing::internal::AlwaysFalse()) // A macro for testing Google Test assertions or code that's expected to // generate Google Test non-fatal failures. It asserts that the given // statement will cause exactly one non-fatal Google Test failure with 'substr' // being part of the failure message. // // There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only // affects and considers failures generated in the current thread and // EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. // // 'statement' is allowed to reference local variables and members of // the current object. // // The verification of the assertion is done correctly even when the statement // throws an exception or aborts the current function. // // Known restrictions: // - You cannot stream a failure message to this macro. // // Note that even though the implementations of the following two // macros are much alike, we cannot refactor them to use a common // helper macro, due to some peculiarity in how the preprocessor // works. If we do that, the code won't compile when the user gives // EXPECT_NONFATAL_FAILURE() a statement that contains a macro that // expands to code containing an unprotected comma. The // AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc // catches that. // // For the same reason, we have to write // if (::testing::internal::AlwaysTrue()) { statement; } // instead of // GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) // to avoid an MSVC warning on unreachable code. #define EXPECT_NONFATAL_FAILURE(statement, substr) \ do {\ ::testing::TestPartResultArray gtest_failures;\ ::testing::internal::SingleFailureChecker gtest_checker(\ &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \ (substr));\ {\ ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ ::testing::ScopedFakeTestPartResultReporter:: \ INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\ if (::testing::internal::AlwaysTrue()) { statement; }\ }\ } while (::testing::internal::AlwaysFalse()) #define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ do {\ ::testing::TestPartResultArray gtest_failures;\ ::testing::internal::SingleFailureChecker gtest_checker(\ &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \ (substr));\ {\ ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \ &gtest_failures);\ if (::testing::internal::AlwaysTrue()) { statement; }\ }\ } while (::testing::internal::AlwaysFalse()) #endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_
{'repo_name': 'MoonchildProductions/UXP', 'stars': '338', 'repo_language': 'None', 'file_name': 'copyimage.h', 'mime_type': 'text/x-c++', 'hash': 8960607494042306608, 'source_dataset': 'data'}
// // fiware // (function(hello) { function formatError(o, headers) { var code = headers ? headers.statusCode : (o && "meta" in o && "status" in o.meta && o.meta.status); if ((code === 401 || code === 403)) { o.error = { code: "access_denied", message: o.message || (o.data ? o.data.message : "Could not get response") }; delete o.message; } } function formatUser(o) { if (o.id) { o.thumbnail = o.picture = o.avatar_url; o.name = o.displayName; } } function paging(res, headers, req) { if (res.data && res.data.length && headers && headers.Link) { var next = headers.Link.match(/&page=([0-9]+)/); if (next) { res.paging = { next: "?page=" + next[1] }; } } } hello.init({ fiware: { name: 'FIWare', oauth: { version: 2, auth: 'https://account.lab.fi-ware.org/authorize', grant: 'https://account.lab.fi-ware.org/access_token' }, base: 'https://account.lab.fi-ware.org/', get: { 'me': 'user' }, wrap: { me: function(o, headers) { formatError(o, headers); formatUser(o); return o; }, "default": function(o, headers, req) { formatError(o, headers); if (Object.prototype.toString.call(o) === '[object Array]') { o = { data: o }; paging(o, headers, req); for (var i = 0; i < o.data.length; i++) { formatUser(o.data[i]); } } return o; } } } }); })(hello);
{'repo_name': 'pixelpark/ppnet', 'stars': '118', 'repo_language': 'JavaScript', 'file_name': 'Dockerfile-couchdb', 'mime_type': 'text/plain', 'hash': -3580546483560746216, 'source_dataset': 'data'}
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package mocktarget import ( gomock "github.com/golang/mock/gomock" labels "k8s.io/apimachinery/pkg/labels" vpa_types "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1" ) // MockVpaTargetSelectorFetcher is a mock of VpaTargetSelectorFetcher interface type MockVpaTargetSelectorFetcher struct { ctrl *gomock.Controller recorder *_MockVpaTargetSelectorFetcherRecorder } // Recorder for MockVpaTargetSelectorFetcher (not exported) type _MockVpaTargetSelectorFetcherRecorder struct { mock *MockVpaTargetSelectorFetcher } // NewMockVpaTargetSelectorFetcher returns mock instance of a mock of VpaTargetSelectorFetcher func NewMockVpaTargetSelectorFetcher(ctrl *gomock.Controller) *MockVpaTargetSelectorFetcher { mock := &MockVpaTargetSelectorFetcher{ctrl: ctrl} mock.recorder = &_MockVpaTargetSelectorFetcherRecorder{mock} return mock } // EXPECT enables configuring expectaions func (_m *MockVpaTargetSelectorFetcher) EXPECT() *_MockVpaTargetSelectorFetcherRecorder { return _m.recorder } // Fetch enables configuring expectations on Fetch method func (_m *MockVpaTargetSelectorFetcher) Fetch(vpa *vpa_types.VerticalPodAutoscaler) (labels.Selector, error) { ret := _m.ctrl.Call(_m, "Fetch", vpa) ret0, _ := ret[0].(labels.Selector) ret1, _ := ret[1].(error) return ret0, ret1 } func (_mr *_MockVpaTargetSelectorFetcherRecorder) Fetch(arg0 interface{}) *gomock.Call { return _mr.mock.ctrl.RecordCall(_mr.mock, "Fetch", arg0) }
{'repo_name': 'kubernetes/autoscaler', 'stars': '3328', 'repo_language': 'Go', 'file_name': 'PATENTS', 'mime_type': 'text/plain', 'hash': -2480200838157932475, 'source_dataset': 'data'}
@comment $NetBSD: PLIST,v 1.7 2016/04/21 23:38:28 prlw1 Exp $ bin/gnome-autogen.sh share/aclocal/ax_check_enable_debug.m4 share/aclocal/ax_code_coverage.m4 share/aclocal/gnome-code-coverage.m4 share/aclocal/gnome-common.m4 share/aclocal/gnome-compiler-flags.m4
{'repo_name': 'NetBSD/pkgsrc', 'stars': '152', 'repo_language': 'None', 'file_name': 'patch-CoinMP-configure', 'mime_type': 'text/x-diff', 'hash': 8311314870968808550, 'source_dataset': 'data'}
/* * Copyright (C) 2014 by Array Systems Computing Inc. http://www.array.ca * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) * any later version. * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, see http://www.gnu.org/licenses/ */ package org.esa.s1tbx.dat.layers.maptools; import org.esa.snap.core.datamodel.RasterDataNode; import org.esa.snap.rcp.SnapApp; import org.esa.snap.ui.layer.AbstractLayerSourceAssistantPage; import org.esa.snap.ui.layer.LayerSource; import org.esa.snap.ui.layer.LayerSourcePageContext; /** */ public class MapToolsLayerSource implements LayerSource { public boolean isApplicable(LayerSourcePageContext pageContext) { return true; } public boolean hasFirstPage() { return true; } public AbstractLayerSourceAssistantPage getFirstPage(LayerSourcePageContext pageContext) { return new MapToolsAssistantPage(); } public boolean canFinish(LayerSourcePageContext pageContext) { return false; } public boolean performFinish(LayerSourcePageContext pageContext) { return false; } public void cancel(LayerSourcePageContext pageContext) { } public static void createLayer(final LayerSourcePageContext pageContext, final MapToolsOptions options) { final RasterDataNode raster = SnapApp.getDefault().getSelectedProductSceneView().getRaster(); final MapToolsLayer geoLayer = MapToolsLayerType.createLayer(raster, options); pageContext.getLayerContext().getRootLayer().getChildren().add(0, geoLayer); } }
{'repo_name': 'senbox-org/s1tbx', 'stars': '115', 'repo_language': 'Java', 'file_name': 'RemoveAntennaPatternOpUI.java', 'mime_type': 'text/x-java', 'hash': 8756917232469445893, 'source_dataset': 'data'}
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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. */ #ifndef ZORBA_RSTRING_REP_PROXY_H #define ZORBA_RSTRING_REP_PROXY_H #include <cassert> #include <zorba/config.h> #include <zorba/internal/cxx_util.h> namespace zorba { namespace rstring_classes { /** * A proxy for either default_rep or ptr_rep. */ template<class RepType> class rep_proxy { public: typedef typename RepType::allocator_type allocator_type; typedef typename RepType::difference_type difference_type; typedef typename RepType::size_type size_type; typedef typename RepType::traits_type traits_type; typedef typename RepType::value_type value_type; typedef typename RepType::pointer pointer; typedef typename RepType::const_pointer const_pointer; typedef typename RepType::reference reference; typedef typename RepType::const_reference const_reference; typedef typename RepType::iterator iterator; typedef typename RepType::const_iterator const_iterator; typedef typename RepType::reverse_iterator reverse_iterator; typedef typename RepType::const_reverse_iterator const_reverse_iterator; typedef rep_proxy<typename RepType::result_rep_type> result_rep_type; enum { takes_pointer_ownership = RepType::takes_pointer_ownership }; /** * Constructs a %rep_proxy. */ rep_proxy() { set_rep( RepType::empty_rep() ); } /** * Destroys a %rep_proxy. */ ~rep_proxy() { assert( rep_ == RepType::empty_rep() ); } /** * Disposes of this %rep_proxy and its associated string representation. * * @param a The allocator that was used to allocate the string * representation. */ void dispose( allocator_type const &a ) { if ( rep_ ) rep_->dispose( a ); set_rep( RepType::empty_rep() ); } /** * Makes the representation unsharable if necessary. If it is currently * shared, it must be cloned. */ void make_unsharable_if_necessary( allocator_type const &a ) { if ( rep_ != RepType::empty_rep() ) { typename RepType::count_type const count = rep_->count(); if ( RepType::is_sharable( count ) ) { if ( RepType::is_shared( count ) ) { RepType *const new_rep = rep_->clone( a ); rep_->dispose( a ); set_rep( new_rep ); } rep_->set_unsharable(); } } } /** * This method is used only in the mutate method of rstring, when * copy-on-write is necessary. It creates a representation with zero length * and capacity >= to the given capacity. The actual capacity is computed * internally, taking into account the given "old" capacity. */ void realloc( size_type cap, size_type old_cap, allocator_type const &a ) { assert( rep_ == RepType::empty_rep() ); set_rep( RepType::alloc( a, cap, old_cap ) ); rep_->set_length( 0 ); } /** * Shares 2 string representations. * * @param that The %rep_proxy of the representation to share. * @param this_alloc This allocator. * @param that_alloc The allocator used by \a that. */ void share( rep_proxy const &that, allocator_type const &this_alloc, allocator_type const &that_alloc ) { dispose( this_alloc ); if ( that.rep_->is_sharable() && this_alloc == that_alloc ) { if ( that.rep_ != RepType::empty_rep() ) that.rep_->inc(); set_rep( that.rep_ ); } else { set_rep( that.rep_->clone( this_alloc ) ); } } /** * Swaps this string representation for another. * * @param that The %rep_proxy to swap with. */ void swap( rep_proxy &that ) { RepType *const tmp = rep_; set_rep( that.rep_ ); that.set_rep( tmp ); } /** * Performs a destructive assignment. * * @param that The %rep_proxy to copy from. It is set to the empty string. * @param this_alloc This allocator. * @param that_allor The allocator used by \a that. */ void take( rep_proxy &that, allocator_type const &this_alloc, allocator_type const &that_alloc ) { if ( *this != that ) { dispose( this_alloc ); if ( this_alloc == that_alloc ) { set_rep( that.rep_ ); that.set_rep( RepType::empty_rep() ); } else { set_rep( that.rep_->clone( this_alloc ) ); } } } /** * Compares 2 %rep_proxy objects for equality. * * @param i The first %rep_proxy. * @param j The second %rep_proxy. * @return Returns \c true only if they're equal. */ friend bool operator==( rep_proxy const &i, rep_proxy const &j ) { return i.rep_ == j.rep_; } /** * Compares 2 %rep_proxy objects for inequality. * * @param i The first %rep_proxy. * @param j The second %rep_proxy. * @return Returns \c true only if they're not equal. */ friend bool operator!=( rep_proxy const &i, rep_proxy const &j ) { return !(i == j); } ////////// Delegate member functions //////////////////////////////////////// size_type capacity() const { return rep_->capacity(); } void construct( size_type size, value_type c, allocator_type const &a ) { assert( rep_ == RepType::empty_rep() ); set_rep( RepType::construct( size, c, a ) ); } template<class IteratorType> void construct( IteratorType begin, IteratorType end, allocator_type const &a ) { assert( rep_ == RepType::empty_rep() ); set_rep( RepType::construct( begin, end, a ) ); } pointer data() const { return rep_->data(); } bool is_sharable() { return rep_->is_sharable(); } bool is_shared() const { return rep_->is_shared(); } size_type length() const { return rep_->length(); } void reserve( size_type cap, allocator_type const &a ) { set_rep( rep_->reserve( cap, a ) ); } void set_length( size_type n ) { rep_->set_length( n ); } void set_sharable() { rep_->set_sharable(); } void set_unsharable() { rep_->set_unsharable(); } ///////////////////////////////////////////////////////////////////////////// private: RepType *rep_; #ifdef ZORBA_DEBUG_STRING const_pointer debug_str_; #endif /* ZORBA_DEBUG_STRING */ void set_rep( RepType *r ) { rep_ = r; #ifdef ZORBA_DEBUG_STRING debug_str_ = rep_ ? data() : nullptr; #endif /* ZORBA_DEBUG_STRING */ } // forbid these rep_proxy( rep_proxy const& ); rep_proxy& operator=( rep_proxy const& ); }; } // rstring_classes } // zorba #endif /* ZORBA_RSTRING_REP_PROXY_H */ /* * Local variables: * mode: c++ * End: */ /* vim:set et sw=2 ts=2: */
{'repo_name': '28msec/zorba', 'stars': '113', 'repo_language': 'C++', 'file_name': 'zorba_architecture.txt', 'mime_type': 'text/x-c++', 'hash': 3682100502763441118, 'source_dataset': 'data'}
/* * W.J. van der Laan 2011-2012 */ #include <QApplication> #include "bitcoingui.h" #include "clientmodel.h" #include "walletmodel.h" #include "optionsmodel.h" #include "guiutil.h" #include "guiconstants.h" #include "init.h" #include "util.h" #include "wallet.h" #include "ui_interface.h" #include "paymentserver.h" #ifdef Q_OS_MAC #include "macdockiconhandler.h" #endif #include <QMessageBox> #include <QTextCodec> #include <QLocale> #include <QTimer> #include <QTranslator> #include <QSplashScreen> #include <QLibraryInfo> #if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED) #define _BITCOIN_QT_PLUGINS_INCLUDED #define __INSURE__ #include <QtPlugin> Q_IMPORT_PLUGIN(qcncodecs) Q_IMPORT_PLUGIN(qjpcodecs) Q_IMPORT_PLUGIN(qtwcodecs) Q_IMPORT_PLUGIN(qkrcodecs) Q_IMPORT_PLUGIN(qtaccessiblewidgets) #endif // Need a global reference for the notifications to find the GUI static BitcoinGUI *guiref; static QSplashScreen *splashref; static void ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { // Message from network thread if(guiref) { bool modal = (style & CClientUIInterface::MODAL); // In case of modal message, use blocking connection to wait for user to click a button QMetaObject::invokeMethod(guiref, "message", modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(caption)), Q_ARG(QString, QString::fromStdString(message)), Q_ARG(bool, modal), Q_ARG(unsigned int, style)); } else { LogPrintf("%s: %s\n", caption, message); fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str()); } } static bool ThreadSafeAskFee(int64_t nFeeRequired, const std::string& strCaption) { if(!guiref) return false; if(nFeeRequired < MIN_TX_FEE || nFeeRequired <= nTransactionFee || fDaemon) return true; bool payFee = false; QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(), Q_ARG(qint64, nFeeRequired), Q_ARG(bool*, &payFee)); return payFee; } static void InitMessage(const std::string &message) { if(splashref) { splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(232,186,63)); QApplication::instance()->processEvents(); } LogPrintf("init message: %s\n", message); } /* Translate string to current locale using Qt. */ static std::string Translate(const char* psz) { return QCoreApplication::translate("bitcoin-core", psz).toStdString(); } /* Handle runaway exceptions. Shows a message box with the problem and quits the program. */ static void handleRunawayException(std::exception *e) { PrintExceptionContinue(e, "Runaway exception"); QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. HShare can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); exit(1); } /* qDebug() message handler --> debug.log */ #if QT_VERSION < 0x050000 void DebugMessageHandler(QtMsgType type, const char * msg) { const char *category = (type == QtDebugMsg) ? "qt" : NULL; LogPrint(category, "GUI: %s\n", msg); } #else void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg) { const char *category = (type == QtDebugMsg) ? "qt" : NULL; LogPrint(category, "GUI: %s\n", msg.toStdString()); } #endif #ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { fHaveGUI = true; // Command-line options take precedence: ParseParameters(argc, argv); #if QT_VERSION < 0x050000 // Internal string conversion is all UTF-8 QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForTr()); #endif Q_INIT_RESOURCE(bitcoin); QApplication app(argc, argv); // Do this early as we don't want to bother initializing if we are just calling IPC // ... but do it after creating app, so QCoreApplication::arguments is initialized: if (PaymentServer::ipcSendCommandLine()) exit(0); PaymentServer* paymentServer = new PaymentServer(&app); // Install global event filter that makes sure that long tooltips can be word-wrapped app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); // Install qDebug() message handler to route to debug.log #if QT_VERSION < 0x050000 qInstallMsgHandler(DebugMessageHandler); #else qInstallMessageHandler(DebugMessageHandler); #endif // Command-line options take precedence: ParseParameters(argc, argv); // ... then bitcoin.conf: if (!boost::filesystem::is_directory(GetDataDir(false))) { // This message can not be translated, as translation is not initialized yet // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory) QMessageBox::critical(0, "HShare", QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } ReadConfigFile(mapArgs, mapMultiArgs); // Application identification (must be set before OptionsModel is initialized, // as it is used to locate QSettings) app.setOrganizationName("HShare"); //XXX app.setOrganizationDomain(""); if(GetBoolArg("-testnet", false)) // Separate UI settings for testnet app.setApplicationName("HShare-Qt-testnet"); else app.setApplicationName("HShare-Qt"); // ... then GUI settings: OptionsModel optionsModel; // Get desired locale (e.g. "de_DE") from command line or use system locale QString lang_territory = QString::fromStdString(GetArg("-lang", QLocale::system().name().toStdString())); QString lang = lang_territory; // Convert to "de" only by truncating "_DE" lang.truncate(lang_territory.lastIndexOf('_')); QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator; // Load language files for configured locale: // - First load the translator for the base language, without territory // - Then load the more specific locale translator // Load e.g. qt_de.qm if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(&qtTranslatorBase); // Load e.g. qt_de_DE.qm if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(&qtTranslator); // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc) if (translatorBase.load(lang, ":/translations/")) app.installTranslator(&translatorBase); // Load e.g. bitcoin_de_DE.qm (shortcut "de_DE" needs to be defined in bitcoin.qrc) if (translator.load(lang_territory, ":/translations/")) app.installTranslator(&translator); // Subscribe to global signals from core uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox); uiInterface.ThreadSafeAskFee.connect(ThreadSafeAskFee); uiInterface.InitMessage.connect(InitMessage); uiInterface.Translate.connect(Translate); // Show help message immediately after parsing command-line options (for "-lang") and setting locale, // but before showing splash screen. if (mapArgs.count("-?") || mapArgs.count("--help")) { GUIUtil::HelpMessageBox help; help.showOrPrint(); return 1; } #ifdef Q_OS_MAC // on mac, also change the icon now because it would look strange to have a testnet splash (green) and a std app icon (orange) if(GetBoolArg("-testnet", false)) { MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); } #endif QSplashScreen splash(QPixmap(":/images/splash"), 0); if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false)) { splash.show(); splashref = &splash; } app.processEvents(); app.setQuitOnLastWindowClosed(false); try { if (fUseBlackTheme) GUIUtil::SetBlackThemeQSS(app); // Regenerate startup link, to fix links to old versions if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(true); boost::thread_group threadGroup; BitcoinGUI window; guiref = &window; QTimer* pollShutdownTimer = new QTimer(guiref); QObject::connect(pollShutdownTimer, SIGNAL(timeout()), guiref, SLOT(detectShutdown())); pollShutdownTimer->start(200); if(AppInit2(threadGroup)) { { // Put this in a block, so that the Model objects are cleaned up before // calling Shutdown(). paymentServer->setOptionsModel(&optionsModel); if (splashref) splash.finish(&window); ClientModel clientModel(&optionsModel); WalletModel walletModel(pwalletMain, &optionsModel); window.setClientModel(&clientModel); window.setWalletModel(&walletModel); // If -min option passed, start window minimized. if(GetBoolArg("-min", false)) { window.showMinimized(); } else { window.show(); } // Now that initialization/startup is done, process any command-line // bitcoin: URIs QObject::connect(paymentServer, SIGNAL(receivedURI(QString)), &window, SLOT(handleURI(QString))); QTimer::singleShot(100, paymentServer, SLOT(uiReady())); app.exec(); window.hide(); window.setClientModel(0); window.setWalletModel(0); guiref = 0; } // Shutdown the core and its threads, but don't exit Bitcoin-Qt here threadGroup.interrupt_all(); threadGroup.join_all(); Shutdown(); } else { threadGroup.interrupt_all(); threadGroup.join_all(); Shutdown(); return 1; } } catch (std::exception& e) { handleRunawayException(&e); } catch (...) { handleRunawayException(NULL); } return 0; } #endif // BITCOIN_QT_TEST
{'repo_name': 'HcashOrg/Hshare', 'stars': '420', 'repo_language': 'C', 'file_name': 'Doxyfile', 'mime_type': 'text/plain', 'hash': 5956506253819882470, 'source_dataset': 'data'}
.tooltip { position: relative; display: inline-block; line-height: 18px; vertical-align: middle; margin-right: 6px; > span { display: inline; font-family: 'Icons'; cursor: pointer; } > div { position: absolute; display: block; float: left; pointer-events: none; background: var(--box-bg); padding: 12px; border-radius: 4px; bottom: calc(100% + 4px); left: 100%; min-width: 300px; line-height: 24px; font-size: 14px; opacity: 0; transition: opacity 0.1s ease-out; em, strong { display: block; font-style: normal; columns: var(--box-body); text-align: left; } strong { white-space: nowrap; color: var(--primary); margin-bottom: 8px; } } &:hover > div { opacity: 1; } }
{'repo_name': 'iotaledger/trinity-wallet', 'stars': '367', 'repo_language': 'JavaScript', 'file_name': 'post-merge-githook.sh', 'mime_type': 'text/x-shellscript', 'hash': 915555895330807671, 'source_dataset': 'data'}
.\objects\system_stm32f10x.o: RTE\Device\STM32F103C8\system_stm32f10x.c .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h .\objects\system_stm32f10x.o: D:\Git\arm-tutorial\stm32f103-keil\gpio-register\RTE\RTE_Components.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cm3.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmInstr.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmFunc.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\system_stm32f10x.h .\objects\system_stm32f10x.o: D:\Git\arm-tutorial\stm32f103-keil\gpio-register\RTE\Device\STM32F103C8\stm32f10x_conf.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_gpio.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_rcc.h .\objects\system_stm32f10x.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\misc.h
{'repo_name': 'yohanes-erwin/stm32f103-keil', 'stars': '139', 'repo_language': 'C', 'file_name': 'led-matrix-8x8-scrolling-text.map', 'mime_type': 'text/plain', 'hash': -3262770722638888481, 'source_dataset': 'data'}
package org.broadinstitute.hellbender.tools.walkers.varianteval; import htsjdk.samtools.SAMSequenceRecord; import htsjdk.samtools.reference.IndexedFastaSequenceFile; import htsjdk.samtools.reference.ReferenceSequenceFile; import htsjdk.tribble.Feature; import htsjdk.variant.variantcontext.Allele; import htsjdk.variant.variantcontext.VariantContext; import htsjdk.variant.variantcontext.VariantContextBuilder; import htsjdk.variant.variantcontext.VariantContextUtils; import htsjdk.variant.vcf.VCFHeader; import org.apache.logging.log4j.Logger; import org.broadinstitute.barclay.argparser.*; import org.broadinstitute.barclay.help.DocumentedFeature; import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions; import org.broadinstitute.hellbender.cmdline.argumentcollections.DbsnpArgumentCollection; import org.broadinstitute.hellbender.cmdline.argumentcollections.MultiVariantInputArgumentCollection; import org.broadinstitute.hellbender.engine.*; import org.broadinstitute.hellbender.exceptions.GATKException; import org.broadinstitute.hellbender.exceptions.UserException; import org.broadinstitute.hellbender.tools.walkers.varianteval.evaluators.*; import org.broadinstitute.hellbender.tools.walkers.varianteval.stratifications.AlleleFrequency.*; import org.broadinstitute.hellbender.tools.walkers.varianteval.stratifications.IntervalStratification; import org.broadinstitute.hellbender.tools.walkers.varianteval.stratifications.VariantStratifier; import org.broadinstitute.hellbender.tools.walkers.varianteval.stratifications.manager.StratificationManager; import org.broadinstitute.hellbender.tools.walkers.varianteval.util.EvaluationContext; import org.broadinstitute.hellbender.tools.walkers.varianteval.util.SortableJexlVCMatchExp; import org.broadinstitute.hellbender.tools.walkers.varianteval.util.VariantEvalUtils; import org.broadinstitute.hellbender.utils.SimpleInterval; import org.broadinstitute.hellbender.utils.Utils; import org.broadinstitute.hellbender.utils.io.IOUtils; import org.broadinstitute.hellbender.utils.samples.PedigreeValidationType; import org.broadinstitute.hellbender.utils.samples.SampleDB; import org.broadinstitute.hellbender.utils.samples.SampleDBBuilder; import org.broadinstitute.hellbender.utils.variant.GATKVariantContextUtils; import picard.cmdline.programgroups.VariantEvaluationProgramGroup; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; /** * * * <p> * Given a variant callset, it is common to calculate various quality control metrics. These metrics include the number of * raw or filtered SNP counts; ratio of transition mutations to transversions; concordance of a particular sample's calls * to a genotyping chip; number of s per sample; etc. Furthermore, it is often useful to stratify these metrics * by various criteria like functional class (missense, nonsense, silent), whether the site is CpG site, the amino acid * degeneracy of the site, etc. VariantEval facilitates these calculations in two ways: by providing several built-in * evaluation and stratification modules, and by providing a framework that permits the easy development of new evaluation * and stratification modules. * </p> * * <h3>Input</h3> * <p> * One or more variant sets to evaluate plus any number of comparison sets. * </p> * * <h3>Output</h3> * <p> * Evaluation tables detailing the results of the eval modules which were applied. * For example: * </p> * <pre> * output.eval.grp: * ##:GATKReport.v0.1 CountVariants : Counts different classes of variants in the sample * CountVariants CompFeatureInput CpG EvalFeatureInput JexlExpression Novelty nProcessedLoci nCalledLoci nRefLoci nVariantLoci variantRate ... * CountVariants dbsnp CpG eval none all 65900028 135770 0 135770 0.00206024 ... * CountVariants dbsnp CpG eval none known 65900028 47068 0 47068 0.00071423 ... * CountVariants dbsnp CpG eval none novel 65900028 88702 0 88702 0.00134601 ... * CountVariants dbsnp all eval none all 65900028 330818 0 330818 0.00502000 ... * CountVariants dbsnp all eval none known 65900028 120685 0 120685 0.00183133 ... * CountVariants dbsnp all eval none novel 65900028 210133 0 210133 0.00318866 ... * CountVariants dbsnp non_CpG eval none all 65900028 195048 0 195048 0.00295976 ... * CountVariants dbsnp non_CpG eval none known 65900028 73617 0 73617 0.00111710 ... * CountVariants dbsnp non_CpG eval none novel 65900028 121431 0 121431 0.00184265 ... * ... * </pre> * </p> * * <h3>Usage examples</h3> * <pre> * gatk VariantEval \ * -R reference.fasta \ * -O output.eval.grp \ * --eval set1:set1.vcf \ * --eval set2:set2.vcf \ * [--comp comp.vcf] * </pre> * * Count Mendelian violations for each family in a callset with multiple families (and provided pedigree) * <pre> * gatk VariantEval \ * -R reference.fasta \ * -O output.MVs.byFamily.table \ * --eval multiFamilyCallset.vcf \ * -no-ev -noST \ * -ST Family \ * -EV MendelianViolationEvaluator * </pre> * * <h3>Caveat</h3> * * <p>Some stratifications and evaluators are incompatible with each other due to their respective memory requirements, * such as AlleleCount and VariantSummary, or Sample and VariantSummary. If you specify such a combination, the program * will output an error message and ask you to disable one of these options. We do not currently provide an exhaustive * list of incompatible combinations, so we recommend trying out combinations that you are interested in on a dummy * command line, to rapidly ascertain whether it will work or not.</p> * */ @CommandLineProgramProperties( summary = "Given a variant callset, it is common to calculate various quality control metrics. These metrics include the number of " + "raw or filtered SNP counts; ratio of transition mutations to transversions; concordance of a particular sample's calls " + "to a genotyping chip; number of singletons per sample; etc. Furthermore, it is often useful to stratify these metrics " + "by various criteria like functional class (missense, nonsense, silent), whether the site is CpG site, the amino acid " + "degeneracy of the site, etc. VariantEval facilitates these calculations in two ways: by providing several built-in " + "evaluation and stratification modules, and by providing a framework that permits the easy development of new evaluation " + "and stratification modules.", oneLineSummary = "General-purpose tool for variant evaluation (% in dbSNP, genotype concordance, Ti/Tv ratios, and a lot more)", programGroup = VariantEvaluationProgramGroup.class ) @DocumentedFeature @BetaFeature public class VariantEval extends MultiVariantWalker { public static final String IS_SINGLETON_KEY = "ISSINGLETON"; @Argument(fullName = StandardArgumentDefinitions.OUTPUT_LONG_NAME, shortName = StandardArgumentDefinitions.OUTPUT_SHORT_NAME, doc="File to which variants should be written") protected File outFile; /** * The variant file(s) to evaluate. */ @Argument(fullName="eval", shortName = "eval", doc="Input evaluation file(s)", optional=false) public List<FeatureInput<VariantContext>> evals; /** * The variant file(s) to compare against. */ @Argument(fullName = StandardArgumentDefinitions.COMPARISON_LONG_NAME, shortName = StandardArgumentDefinitions.COMPARISON_SHORT_NAME, doc="Input comparison file(s)", optional=true) public List<FeatureInput<VariantContext>> compsProvided = new ArrayList<>(); private List<FeatureInput<VariantContext>> comps = new ArrayList<>(); /** * dbSNP comparison VCF. By default, the dbSNP file is used to specify the set of "known" variants. * Other sets can be specified with the -known-name (--known_names) argument. */ @ArgumentCollection protected DbsnpArgumentCollection dbsnp = new DbsnpArgumentCollection(); /** * Some analyses want to count overlap not with dbSNP (which is in general very open) but * actually want to itemize their overlap specifically with a set of gold standard sites * such as HapMap, OMNI, or the gold standard indels. This argument provides a mechanism * for communicating which file to use */ @Argument(fullName="gold-standard", shortName = "gold", doc="Evaluations that count calls at sites of true variation (e.g., indel calls) will use this argument as their gold standard for comparison", optional=true) public FeatureInput<VariantContext> goldStandard = null; /** * Note that the --list argument requires a fully resolved and correct command-line to work. */ @Argument(fullName="list", shortName="ls", doc="List the available eval modules and exit", optional=true) protected Boolean LIST = false; // Partitioning the data arguments @Argument(shortName="select", doc="One or more stratifications to use when evaluating the data", optional=true) protected ArrayList<String> SELECT_EXPS = new ArrayList<String>(); @Argument(shortName="select-name", doc="Names to use for the list of stratifications (must be a 1-to-1 mapping)", optional=true) protected ArrayList<String> SELECT_NAMES = new ArrayList<String>(); @Argument(fullName="sample", shortName="sn", doc="Derive eval and comp contexts using only these sample genotypes, when genotypes are available in the original context", optional=true) protected Set<String> SAMPLE_EXPRESSIONS = new TreeSet<>(); @Argument(fullName = StandardArgumentDefinitions.PEDIGREE_FILE_LONG_NAME, shortName = StandardArgumentDefinitions.PEDIGREE_FILE_SHORT_NAME, doc="Pedigree file for determining the population \"founders\"", optional=true) private File pedigreeFile; /** * List of feature tracks to be used for specifying "known" variants other than dbSNP. */ @Argument(shortName="known-name", doc="Name of feature bindings containing variant sites that should be treated as known when splitting eval features into known and novel subsets", optional=true) protected Set<String> KNOWN_NAMES = new HashSet<String>(); List<FeatureInput<VariantContext>> knowns = new ArrayList<>(); // Stratification arguments @Argument(fullName="stratification-module", shortName="ST", doc="One or more specific stratification modules to apply to the eval track(s) (in addition to the standard stratifications, unless -noS is specified)", optional=true) protected List<String> STRATIFICATIONS_TO_USE = new ArrayList<>(); @Argument(fullName="do-not-use-all-standard-stratifications", shortName="no-st", doc="Do not use the standard stratification modules by default (instead, only those that are specified with the -S option)", optional=true) protected Boolean NO_STANDARD_STRATIFICATIONS = false; /** * See the -list argument to view available modules. */ @Argument(fullName="eval-module", shortName="EV", doc="One or more specific eval modules to apply to the eval track(s) (in addition to the standard modules, unless -no-ev is specified)", optional=true) protected List<String> MODULES_TO_USE = new ArrayList<>(); @Argument(fullName="do-not-use-all-standard-modules", shortName="no-ev", doc="Do not use the standard modules by default (instead, only those that are specified with the -EV option)", optional=true) protected Boolean NO_STANDARD_MODULES = false; @Argument(fullName="min-phase-quality", shortName="mpq", doc="Minimum phasing quality", optional=true) protected double MIN_PHASE_QUALITY = 10.0; @Argument(shortName="mvq", fullName="mendelian-violation-qual-threshold", doc="Minimum genotype QUAL score for each trio member required to accept a site as a violation. Default is 50.", optional=true) protected double MENDELIAN_VIOLATION_QUAL_THRESHOLD = 50; @Argument(shortName="ploidy", fullName="sample-ploidy", doc="Per-sample ploidy (number of chromosomes per sample)", optional=true) protected int ploidy = GATKVariantContextUtils.DEFAULT_PLOIDY; @Argument(fullName="ancestral-alignments", shortName="aa", doc="Fasta file with ancestral alleles", optional=true) private File ancestralAlignmentsFile = null; @Argument(fullName="require-strict-allele-match", shortName="strict", doc="If provided only comp and eval tracks with exactly matching reference and alternate alleles will be counted as overlapping", optional=true) private boolean requireStrictAlleleMatch = false; @Argument(fullName="keep-ac0", shortName="keep-ac0", doc="If provided, modules that track polymorphic sites will not require that a site have AC > 0 when the input eval has genotypes", optional=true) protected boolean keepSitesWithAC0 = false; @Hidden @Argument(fullName="num-samples", doc="If provided, modules that track polymorphic sites will not require that a site have AC > 0 when the input eval has genotypes", optional=true) private int numSamplesFromArgument = 0; /** * If true, VariantEval will treat -eval 1 -eval 2 as separate tracks from the same underlying * variant set, and evaluate the union of the results. Useful when you want to do -eval chr1.vcf -eval chr2.vcf etc. */ @Argument(fullName="merge-evals", shortName="merge-evals", doc="If provided, all -eval tracks will be merged into a single eval track", optional=true) public boolean mergeEvals = false; /** * File containing tribble-readable features for the IntervalStratificiation */ @Argument(fullName="strat-intervals", shortName="strat-intervals", doc="File containing tribble-readable features for the IntervalStratificiation", optional=true) public FeatureInput<Feature> intervalsFile = null; /** * File containing tribble-readable features containing known CNVs. For use with VariantSummary table. */ @Argument(fullName="known-cnvs", shortName="known-cnvs", doc="File containing tribble-readable features describing a known list of copy number variants", optional=true) public FeatureInput<Feature> knownCNVsFile = null; protected StratifyingScale AFScale = StratifyingScale.LINEAR; protected boolean useCompAFStratifier = false; @Override protected MultiVariantInputArgumentCollection getMultiVariantInputArgumentCollection() { return new MultiVariantInputArgumentCollection() { private static final long serialVersionUID = 1L; @Override public List<String> getDrivingVariantPaths() { //driving variants will be determined by initializeDrivingVariants() return Collections.emptyList(); } }; } @Override protected void initializeDrivingVariants() { getDrivingVariantsFeatureInputs().addAll(evals); if (dbsnp.dbsnp != null) { getDrivingVariantsFeatureInputs().add(dbsnp.dbsnp); } getDrivingVariantsFeatureInputs().addAll(compsProvided); super.initializeDrivingVariants(); } // Variables private Set<SortableJexlVCMatchExp> jexlExpressions = new TreeSet<SortableJexlVCMatchExp>(); private boolean isSubsettingSamples; private Set<String> sampleNamesForEvaluation = new LinkedHashSet<String>(); private Set<String> familyNamesForEvaluation = new LinkedHashSet<String>(); private Set<String> sampleNamesForStratification = new LinkedHashSet<String>(); private Set<String> familyNamesForStratification = new LinkedHashSet<String>(); // important stratifications private boolean byFilterIsEnabled = false; private boolean perSampleIsEnabled = false; private boolean perFamilyIsEnabled = false; // Public constants final private static String ALL_SAMPLE_NAME = "all"; final private static String ALL_FAMILY_NAME = "all"; // Utility class private final VariantEvalUtils variantEvalUtils = new VariantEvalUtils(this); // Ancestral alignments private ReferenceSequenceFile ancestralAlignments = null; // The set of all possible evaluation contexts StratificationManager<VariantStratifier, EvaluationContext> stratManager; private SampleDB sampleDB = null; // maintain the mapping of FeatureInput to name used in output file Map<FeatureInput<VariantContext>, String> inputToNameMap = new HashMap<>(); /** * Initialize the stratifications, evaluations, evaluation contexts, and reporting object */ @Override public void onTraversalStart() { Utils.nonNull(outFile); // Just list the modules, and exit quickly. if (LIST) { variantEvalUtils.listModulesAndExit(); } sampleDB = initializeSampleDB(); comps.addAll(compsProvided); compsProvided.forEach(x -> inputToNameMap.put(x, x.hasUserSuppliedName() ? x.getName() : StandardArgumentDefinitions.COMPARISON_SHORT_NAME)); if ( dbsnp.dbsnp != null ) { comps.add(dbsnp.dbsnp); inputToNameMap.put(dbsnp.dbsnp, "dbsnp"); knowns.add(dbsnp.dbsnp); } evals.forEach(x -> inputToNameMap.put(x, x.hasUserSuppliedName() ? x.getName() : "eval")); // Set up set of additional knowns for ( FeatureInput<VariantContext> compInput : comps ) { if ( KNOWN_NAMES.contains(getNameForInput(compInput))) knowns.add(compInput); } // Now that we have all the inputs categorized, determine the sample list from the eval inputs. Map<String, VCFHeader> vcfInputs = new HashMap<>(); evals.forEach(x -> vcfInputs.put(x.getName(), (VCFHeader)getHeaderForFeatures(x))); Set<String> vcfSamples = new HashSet<>(); vcfInputs.forEach((k,v) -> vcfSamples.addAll(v.getSampleNamesInOrder())); // Load the sample list, using an intermediate tree set to sort the samples final Set<String> allSampleNames = new HashSet<>(vcfSamples); sampleNamesForEvaluation.addAll(new TreeSet<>(SAMPLE_EXPRESSIONS.isEmpty() ? vcfSamples : Utils.filterCollectionByExpressions(vcfSamples, SAMPLE_EXPRESSIONS, false))); isSubsettingSamples = ! sampleNamesForEvaluation.containsAll(allSampleNames); familyNamesForEvaluation.addAll(sampleDB.getFamilyIDs()); //If stratifying by sample name, assign a stratification for each sample we're evaluating (based on commandline args)... if (STRATIFICATIONS_TO_USE.contains("Sample") ) { sampleNamesForStratification.addAll(sampleNamesForEvaluation); } //...and also a stratification for the sum over all samples sampleNamesForStratification.add(ALL_SAMPLE_NAME); //If stratifying by sample name, assign a stratification for each family... if ( STRATIFICATIONS_TO_USE.contains("Family") ) { familyNamesForStratification.addAll(familyNamesForEvaluation); } //...and also a stratification for the sum over all families familyNamesForStratification.add(ALL_FAMILY_NAME); // Initialize select expressions for (VariantContextUtils.JexlVCMatchExp jexl : VariantContextUtils.initializeMatchExps(SELECT_NAMES, SELECT_EXPS)) { SortableJexlVCMatchExp sjexl = new SortableJexlVCMatchExp(jexl.name, jexl.exp); jexlExpressions.add(sjexl); } // Initialize the set of stratifications and evaluations to use // The list of stratifiers and evaluators to use final List<VariantStratifier> stratificationObjects = variantEvalUtils.initializeStratificationObjects(NO_STANDARD_STRATIFICATIONS, STRATIFICATIONS_TO_USE); final Set<Class<? extends VariantEvaluator>> evaluationClasses = variantEvalUtils.initializeEvaluationObjects(NO_STANDARD_MODULES, MODULES_TO_USE); checkForIncompatibleEvaluatorsAndStratifiers(stratificationObjects, evaluationClasses); for ( VariantStratifier vs : stratificationObjects ) { if ( vs.getName().equals("Filter") ) byFilterIsEnabled = true; else if ( vs.getName().equals("Sample") ) perSampleIsEnabled = true; else if ( vs.getName().equals("Family")) perFamilyIsEnabled = true; } if (perSampleIsEnabled && perFamilyIsEnabled) throw new CommandLineException.BadArgumentValue("ST", "Variants cannot be stratified by sample and family at the same time"); if (perFamilyIsEnabled && sampleDB.getTrios().isEmpty()) throw new CommandLineException.BadArgumentValue("ST", "Cannot stratify by family without *.ped file"); if ( intervalsFile != null ) { boolean fail = true; for ( final VariantStratifier vs : stratificationObjects ) { if ( vs.getClass().equals(IntervalStratification.class) ) fail = false; } if ( fail ) throw new CommandLineException.BadArgumentValue("ST", "stratIntervals argument provided but -ST IntervalStratification not provided"); } // Initialize the evaluation contexts createStratificationStates(stratificationObjects, evaluationClasses); // Load ancestral alignments if (ancestralAlignmentsFile != null) { try { ancestralAlignments = new IndexedFastaSequenceFile(ancestralAlignmentsFile); } catch (FileNotFoundException e) { throw new GATKException(String.format("The ancestral alignments file, '%s', could not be found", ancestralAlignmentsFile.getAbsolutePath())); } } assertThatTerritoryIsSpecifiedIfNecessary(); } private void assertThatTerritoryIsSpecifiedIfNecessary() { final Set<String> evaluatorsWhichRequireTerritory = stratManager.values() .stream() .flatMap(ctx -> ctx.getVariantEvaluators().stream()) .filter(Objects::nonNull) .filter(VariantEvaluator::requiresTerritoryToBeSpecified) .map(VariantEvaluator::getSimpleName) .collect(Collectors.toSet()); if(!evaluatorsWhichRequireTerritory.isEmpty() && getTraversalIntervals() == null){ throw new UserException("You specified evaluators which require a covered territory to be specified. " + "\nPlease specify intervals or a reference file or disable all of the following evaluators:" + evaluatorsWhichRequireTerritory.stream() .collect(Collectors.joining(", "))); } } private void checkForIncompatibleEvaluatorsAndStratifiers( final List<VariantStratifier> stratificationObjects, Set<Class<? extends VariantEvaluator>> evaluationClasses) { for ( final VariantStratifier vs : stratificationObjects ) { for ( Class<? extends VariantEvaluator> ec : evaluationClasses ) if ( vs.getIncompatibleEvaluators().contains(ec) ) throw new CommandLineException.BadArgumentValue("ST and ET", "The selected stratification " + vs.getName() + " and evaluator " + ec.getSimpleName() + " are incompatible due to combinatorial memory requirements." + " Please disable one"); } } final void createStratificationStates(final List<VariantStratifier> stratificationObjects, final Set<Class<? extends VariantEvaluator>> evaluationObjects) { final List<VariantStratifier> strats = new ArrayList<VariantStratifier>(stratificationObjects); stratManager = new StratificationManager<>(strats); logger.info("Creating " + stratManager.size() + " combinatorial stratification states"); for ( int i = 0; i < stratManager.size(); i++ ) { EvaluationContext ec = createEvaluationContext(evaluationObjects); stratManager.set(i, ec); } } /** * Create the EvaluationContext (new instance) for the provided set of VariantEvaluators. * * @param evaluationObjects The list of VariantEvaluator classes * @return The EvaluationContext for this set of VariantEvaluator classes */ protected EvaluationContext createEvaluationContext(final Set<Class<? extends VariantEvaluator>> evaluationObjects) { return new EvaluationContext(this, evaluationObjects); } private class PositionAggregator { private SimpleInterval i = null; private ReadsContext readsContext; private ReferenceContext referenceContext; private FeatureContext featureContext; private void addVariant(VariantContext vc, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext) { if (i == null || !vc.getContig().equals(i.getContig()) || vc.getStart() != i.getStart()) { callDoApply(); i = new SimpleInterval(vc.getContig(), vc.getStart(), vc.getEnd()); this.readsContext = readsContext; this.referenceContext = referenceContext; this.featureContext = featureContext; } else if (vc.getEnd() > i.getEnd()) { //expand region i = new SimpleInterval(i.getContig(), i.getStart(), vc.getEnd()); this.readsContext = new ReadsContext(this.readsContext, i); this.referenceContext = new ReferenceContext(this.referenceContext, i); this.featureContext = new FeatureContext(this.featureContext, i); } } public void callDoApply(){ if (i != null) { doApply(this.readsContext, this.referenceContext, this.featureContext); i = null; } } public void onComplete() { callDoApply(); } } final PositionAggregator aggr = new PositionAggregator(); @Override public void apply(VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext) { aggr.addVariant(variant, readsContext, referenceContext, featureContext); } public String getNameForInput(FeatureInput<VariantContext> input) { return inputToNameMap.get(input); } /** * This will get called once per site where a variant is present in any input */ public void doApply(ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext) { HashMap<FeatureInput<VariantContext>, HashMap<String, Collection<VariantContext>>> evalVCs = variantEvalUtils.bindVariantContexts(referenceContext, featureContext, evals, byFilterIsEnabled, true, perSampleIsEnabled, perFamilyIsEnabled, mergeEvals); HashMap<FeatureInput<VariantContext>, HashMap<String, Collection<VariantContext>>> compVCs = variantEvalUtils.bindVariantContexts(referenceContext, featureContext, comps, byFilterIsEnabled, false, false, false, false); // for each eval track for ( final FeatureInput<VariantContext> evalInput : evals ) { final Map<String, Collection<VariantContext>> emptyEvalMap = Collections.emptyMap(); final Map<String, Collection<VariantContext>> evalSet = evalVCs.containsKey(evalInput) ? evalVCs.get(evalInput) : emptyEvalMap; Set<String> statificationLevels; // for each sample stratifier if (perFamilyIsEnabled) statificationLevels = familyNamesForStratification; else statificationLevels = sampleNamesForStratification; for ( final String stratLevelName : statificationLevels ) { Collection<VariantContext> evalSetBySample = evalSet.get(stratLevelName); if ( evalSetBySample == null ) { evalSetBySample = new HashSet<>(1); evalSetBySample.add(null); } // for each eval in the track for ( VariantContext eval : evalSetBySample ) { String aastr = (ancestralAlignments == null) ? null : new String(ancestralAlignments.getSubsequenceAt(eval.getContig(), eval.getStart(), eval.getEnd()).getBases()); // deal with ancestral alleles if requested if ( eval != null && aastr != null ) { eval = new VariantContextBuilder(eval).attribute("ANCESTRALALLELE", aastr).make(); } String evalName = getNameForInput(evalInput); // for each comp track for ( final FeatureInput<VariantContext> compInput : comps ) { processComp(referenceContext, readsContext, featureContext, eval, evalName, compInput, stratLevelName, compVCs, evalSetBySample); } if (comps.isEmpty()) { processComp(referenceContext, readsContext, featureContext, eval, evalName, null, stratLevelName, compVCs, evalSetBySample); } } } if ( mergeEvals ) break; // stop processing the eval tracks } } private void processComp(ReferenceContext referenceContext, ReadsContext readsContext, FeatureContext featureContext, VariantContext eval, String evalName, FeatureInput<VariantContext> compInput, String stratLevelName, HashMap<FeatureInput<VariantContext>, HashMap<String, Collection<VariantContext>>> compVCs, Collection<VariantContext> evalSetBySample) { String compName = getNameForInput(compInput); // no sample stratification for comps final HashMap<String, Collection<VariantContext>> compSetHash = compInput == null ? null : compVCs.get(compInput); final Collection<VariantContext> compSet = (compSetHash == null || compSetHash.isEmpty()) ? Collections.<VariantContext>emptyList() : compVCs.get(compInput).values().iterator().next(); // find the comp final VariantContext comp = findMatchingComp(eval, compSet); Collection<EvaluationContext> contextsForStratification; if (perFamilyIsEnabled) contextsForStratification = getEvaluationContexts(referenceContext, readsContext, featureContext, eval, evalName, comp, compName, null, stratLevelName); else { String familyID; if (stratLevelName.equals("all")) familyID = "all"; else familyID = sampleDB.getSample(stratLevelName).getFamilyID(); contextsForStratification = getEvaluationContexts(referenceContext, readsContext, featureContext, eval, evalName, comp, compName, stratLevelName, familyID); } for ( EvaluationContext nec : contextsForStratification ) { // eval against the comp synchronized (nec) { nec.apply(referenceContext, readsContext, featureContext, comp, eval); } // eval=null against all comps of different type that aren't bound to another eval for ( VariantContext otherComp : compSet ) { if ( otherComp != comp && ! compHasMatchingEval(otherComp, evalSetBySample) ) { synchronized (nec) { nec.apply(referenceContext, readsContext, featureContext, otherComp, null); } } } } } /** * Given specific eval and comp VCs and the sample name, return an iterable * over all of the applicable state keys. * * this code isn't structured yet for efficiency. Here we currently are * doing the following inefficient algorithm: * * for each strat: * get list of relevant states that eval and comp according to strat * add this list of states to a list of list states * * then * * ask the strat manager to look up all of the keys associated with the combinations * of these states. For example, suppose we have a single variant S. We have active * strats EvalFeatureInput, CompFeatureInput, and Novelty. We produce a list that looks like: * * L = [[Eval], [Comp], [All, Novel]] * * We then go through the strat manager tree to produce the keys associated with these states: * * K = [0, 1] where EVAL x COMP x ALL = 0 and EVAL x COMP x NOVEL = 1 * * It's clear that a better * * * @param referenceContext * @param readsContext * @param featureContext * @param eval * @param evalName * @param comp * @param compName * @param sampleName * @return */ protected Collection<EvaluationContext> getEvaluationContexts(final ReferenceContext referenceContext, final ReadsContext readsContext, final FeatureContext featureContext, final VariantContext eval, final String evalName, final VariantContext comp, final String compName, final String sampleName, final String familyName) { final List<List<Object>> states = new LinkedList<List<Object>>(); for ( final VariantStratifier vs : stratManager.getStratifiers() ) { states.add(vs.getRelevantStates(referenceContext, readsContext, featureContext, comp, compName, eval, evalName, sampleName, familyName)); } return stratManager.values(states); } private boolean compHasMatchingEval(final VariantContext comp, final Collection<VariantContext> evals) { // find all of the matching comps for ( final VariantContext eval : evals ) { if ( eval != null && doEvalAndCompMatch(comp, eval, requireStrictAlleleMatch) != EvalCompMatchType.NO_MATCH ) return true; } // nothing matched return false; } private enum EvalCompMatchType { NO_MATCH, STRICT, LENIENT } private EvalCompMatchType doEvalAndCompMatch(final VariantContext eval, final VariantContext comp, boolean requireStrictAlleleMatch) { if ( comp.getType() == VariantContext.Type.NO_VARIATION || eval.getType() == VariantContext.Type.NO_VARIATION ) // if either of these are NO_VARIATION they are LENIENT matches return EvalCompMatchType.LENIENT; if ( comp.getType() != eval.getType() ) return EvalCompMatchType.NO_MATCH; // find the comp which matches both the reference allele and alternate allele from eval final Allele altEval = eval.getAlternateAlleles().size() == 0 ? null : eval.getAlternateAllele(0); final Allele altComp = comp.getAlternateAlleles().size() == 0 ? null : comp.getAlternateAllele(0); if ((altEval == null && altComp == null) || (altEval != null && altEval.equals(altComp) && eval.getReference().equals(comp.getReference()))) return EvalCompMatchType.STRICT; else return requireStrictAlleleMatch ? EvalCompMatchType.NO_MATCH : EvalCompMatchType.LENIENT; } private VariantContext findMatchingComp(final VariantContext eval, final Collection<VariantContext> comps) { // if no comps, return null if ( comps == null || comps.isEmpty() ) return null; // if no eval, return any comp if ( eval == null ) return comps.iterator().next(); // find all of the matching comps VariantContext lenientMatch = null; for ( final VariantContext comp : comps ) { switch ( doEvalAndCompMatch(comp, eval, requireStrictAlleleMatch) ) { case STRICT: return comp; case LENIENT: if ( lenientMatch == null ) lenientMatch = comp; break; case NO_MATCH: // do nothing } } // nothing matched, just return lenientMatch, which might be null return lenientMatch; } @Override public Object onTraversalSuccess() { aggr.onComplete(); logger.info("Finalizing variant report"); // go through the evaluations and finalize them for ( final EvaluationContext nec : stratManager.values() ) for ( final VariantEvaluator ve : nec.getVariantEvaluators() ) ve.finalizeEvaluation(); //send data to MetricsCollection CompOverlap compOverlap = null; IndelSummary indelSummary = null; CountVariants countVariants = null; MultiallelicSummary multiallelicSummary = null; TiTvVariantEvaluator tiTvVariantEvaluator = null; MetricsCollection metricsCollection = null; for(final EvaluationContext nec: stratManager.values()) { for(final VariantEvaluator ve : nec.getVariantEvaluators()) { if (ve instanceof CompOverlap) compOverlap = (CompOverlap) ve; else if (ve instanceof IndelSummary) indelSummary = (IndelSummary) ve; else if (ve instanceof CountVariants) countVariants = (CountVariants) ve; else if (ve instanceof MultiallelicSummary) multiallelicSummary = (MultiallelicSummary) ve; else if (ve instanceof TiTvVariantEvaluator) tiTvVariantEvaluator = (TiTvVariantEvaluator) ve; else if (ve instanceof MetricsCollection) metricsCollection = (MetricsCollection) ve; } if(metricsCollection != null) metricsCollection.setData(compOverlap.concordantRate, indelSummary.n_SNPs, countVariants.nSNPs, indelSummary.n_indels, multiallelicSummary.nIndels, indelSummary.insertion_to_deletion_ratio, countVariants.insertionDeletionRatio, tiTvVariantEvaluator.tiTvRatio); } try (PrintStream out = IOUtils.makePrintStreamMaybeGzipped(outFile)){ VariantEvalReportWriter.writeReport(out, stratManager, stratManager.getStratifiers(), stratManager.get(0).getVariantEvaluators()); } catch(IOException e) { throw new UserException.CouldNotCreateOutputFile(e.getMessage(), e); } return null; } // Accessors public Logger getLogger() { return logger; } public double getMinPhaseQuality() { return MIN_PHASE_QUALITY; } public int getSamplePloidy() { return ploidy; } public double getMendelianViolationQualThreshold() { return MENDELIAN_VIOLATION_QUAL_THRESHOLD; } public static String getAllSampleName() { return ALL_SAMPLE_NAME; } public static String getAllFamilyName() { return ALL_FAMILY_NAME; } public List<FeatureInput<VariantContext>> getKnowns() { return knowns; } public List<FeatureInput<VariantContext>> getEvals() { return evals; } public boolean isSubsettingToSpecificSamples() { return isSubsettingSamples; } public Set<String> getSampleNamesForEvaluation() { return sampleNamesForEvaluation; } public Set<String> getFamilyNamesForEvaluation() { return familyNamesForEvaluation; } public int getNumberOfSamplesForEvaluation() { if (sampleNamesForEvaluation!= null && !sampleNamesForEvaluation.isEmpty()) return sampleNamesForEvaluation.size(); else { return numSamplesFromArgument; } } public Set<String> getSampleNamesForStratification() { return sampleNamesForStratification; } public Set<String> getFamilyNamesForStratification() { return familyNamesForStratification; } public List<FeatureInput<VariantContext>> getComps() { return comps; } public Set<SortableJexlVCMatchExp> getJexlExpressions() { return jexlExpressions; } public StratifyingScale getAFScale() { return AFScale; } public boolean getCompAFStratifier() { return useCompAFStratifier; } public Set<String> getContigNames() { final TreeSet<String> contigs = new TreeSet<>(); for( final SAMSequenceRecord r : getSequenceDictionaryForDrivingVariants().getSequences()) { contigs.add(r.getSequenceName()); } return contigs; } public boolean ignoreAC0Sites() { return ! keepSitesWithAC0; } /** * Entry-point function to initialize the samples database from input data */ private SampleDB initializeSampleDB() { final SampleDBBuilder sampleDBBuilder = new SampleDBBuilder(PedigreeValidationType.STRICT); if (pedigreeFile != null) sampleDBBuilder.addSamplesFromPedigreeFiles(Collections.singletonList(pedigreeFile)); Collection<String> samples = getSamplesForVariants(); if (samples != null) { sampleDBBuilder.addSamplesFromSampleNames(samples); } return sampleDBBuilder.getFinalSampleDB(); } public SampleDB getSampleDB() { return sampleDB; } /** * If an evaluator calls this method it must override {@link VariantEvaluator#requiresTerritoryToBeSpecified()} to return true. * @return either the size of the interval list given to the tool or the size of the reference given to the tool */ public long getnProcessedLoci() { if(getTraversalIntervals() == null){ throw new GATKException("BUG: One of the evaluators used should have overriden requiresTerritoryToBeSpecified, please report this to the developers." + "\nEvaluators: " + stratManager.values() .stream() .flatMap(evaluator -> evaluator.getVariantEvaluators().stream()) .map(VariantEvaluator::getSimpleName) .sorted() .distinct() .collect(Collectors.joining(", "))); } return getTraversalIntervals().stream().mapToLong(SimpleInterval::size).sum(); } public FeatureInput<Feature> getKnownCNVsFile() { return knownCNVsFile; } @Override public List<? extends CommandLinePluginDescriptor<?>> getPluginDescriptors() { // Reason this override is needed: // Because getDefaultReadFilters() is nearly always included (see GATKTool), this pulls in SampleReadFilter, // which has an argument named "sample", which conflicts with the local argument. we get an exception like: // org.broadinstitute.barclay.argparser.CommandLineException$CommandLineParserInternalException: [sample, sample] has already been used. // at org.broadinstitute.barclay.argparser.CommandLineArgumentParser.handleArgumentAnnotation(CommandLineArgumentParser.java:1002) // therefore override the method and return an empty list. return Collections.emptyList(); } }
{'repo_name': 'broadinstitute/gatk', 'stars': '843', 'repo_language': 'Java', 'file_name': 'testAFQCIntegration.expected.txt', 'mime_type': 'text/plain', 'hash': -3430645225376245461, 'source_dataset': 'data'}
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Most of the code in this file comes from the default Roslyn Analyzer project template using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using Xunit; namespace TestHelper { /// <summary> /// Superclass of all Unit Tests for DiagnosticAnalyzers /// </summary> public abstract partial class DiagnosticVerifier { #region To be implemented by Test classes /// <summary> /// Get the CSharp analyzer being tested - to be implemented in non-abstract class /// </summary> protected virtual DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() { return null; } /// <summary> /// Get the Visual Basic analyzer being tested (C#) - to be implemented in non-abstract class /// </summary> protected virtual DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() { return null; } #endregion #region Verifier wrappers /// <summary> /// Called to test a C# DiagnosticAnalyzer when applied on the single inputted string as a source /// Note: input a DiagnosticResult for each Diagnostic expected /// </summary> /// <param name="source">A class in the form of a string to run the analyzer on</param> /// <param name="expected"> DiagnosticResults that should appear after the analyzer is run on the source</param> protected void VerifyCSharpDiagnostic(string source, params DiagnosticResult[] expected) { VerifyDiagnostics(new[] { source }, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected); } /// <summary> /// Called to test a VB DiagnosticAnalyzer when applied on the single inputted string as a source /// Note: input a DiagnosticResult for each Diagnostic expected /// </summary> /// <param name="source">A class in the form of a string to run the analyzer on</param> /// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the source</param> protected void VerifyBasicDiagnostic(string source, params DiagnosticResult[] expected) { VerifyDiagnostics(new[] { source }, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected); } /// <summary> /// Called to test a C# DiagnosticAnalyzer when applied on the inputted strings as a source /// Note: input a DiagnosticResult for each Diagnostic expected /// </summary> /// <param name="sources">An array of strings to create source documents from to run the analyzers on</param> /// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param> protected void VerifyCSharpDiagnostic(string[] sources, params DiagnosticResult[] expected) { VerifyDiagnostics(sources, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected); } /// <summary> /// Called to test a VB DiagnosticAnalyzer when applied on the inputted strings as a source /// Note: input a DiagnosticResult for each Diagnostic expected /// </summary> /// <param name="sources">An array of strings to create source documents from to run the analyzers on</param> /// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param> protected void VerifyBasicDiagnostic(string[] sources, params DiagnosticResult[] expected) { VerifyDiagnostics(sources, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected); } /// <summary> /// General method that gets a collection of actual diagnostics found in the source after the analyzer is run, /// then verifies each of them. /// </summary> /// <param name="sources">An array of strings to create source documents from to run the analyzers on</param> /// <param name="language">The language of the classes represented by the source strings</param> /// <param name="analyzer">The analyzer to be run on the source code</param> /// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param> private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) { var diagnostics = GetSortedDiagnostics(sources, language, analyzer); VerifyDiagnosticResults(diagnostics, analyzer, expected); } #endregion #region Actual comparisons and verifications /// <summary> /// Checks each of the actual Diagnostics found and compares them with the corresponding DiagnosticResult in the array of expected results. /// Diagnostics are considered equal only if the DiagnosticResultLocation, Id, Severity, and Message of the DiagnosticResult match the actual diagnostic. /// </summary> /// <param name="actualResults">The Diagnostics found by the compiler after running the analyzer on the source code</param> /// <param name="analyzer">The analyzer that was being run on the sources</param> /// <param name="expectedResults">Diagnostic Results that should have appeared in the code</param> private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) { int expectedCount = expectedResults.Count(); int actualCount = actualResults.Count(); if (expectedCount != actualCount) { string diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzer, actualResults.ToArray()) : " NONE."; Assert.True(false, string.Format("Mismatch between number of diagnostics returned, expected \"{0}\" actual \"{1}\"\r\n\r\nDiagnostics:\r\n{2}\r\n", expectedCount, actualCount, diagnosticsOutput)); } for (int i = 0; i < expectedResults.Length; i++) { var actual = actualResults.ElementAt(i); var expected = expectedResults[i]; if (expected.Line == -1 && expected.Column == -1) { if (actual.Location != Location.None) { Assert.True(false, string.Format("Expected:\nA project diagnostic with No location\nActual:\n{0}", FormatDiagnostics(analyzer, actual))); } } else { VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First()); var additionalLocations = actual.AdditionalLocations.ToArray(); if (additionalLocations.Length != expected.Locations.Length - 1) { Assert.True(false, string.Format("Expected {0} additional locations but got {1} for Diagnostic:\r\n {2}\r\n", expected.Locations.Length - 1, additionalLocations.Length, FormatDiagnostics(analyzer, actual))); } for (int j = 0; j < additionalLocations.Length; ++j) { VerifyDiagnosticLocation(analyzer, actual, additionalLocations[j], expected.Locations[j + 1]); } } if (actual.Id != expected.Id) { Assert.True(false, string.Format("Expected diagnostic id to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Id, actual.Id, FormatDiagnostics(analyzer, actual))); } if (actual.Severity != expected.Severity) { Assert.True(false, string.Format("Expected diagnostic severity to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Severity, actual.Severity, FormatDiagnostics(analyzer, actual))); } if (actual.GetMessage() != expected.Message) { Assert.True(false, string.Format("Expected diagnostic message to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Message, actual.GetMessage(), FormatDiagnostics(analyzer, actual))); } } } /// <summary> /// Helper method to VerifyDiagnosticResult that checks the location of a diagnostic and compares it with the location in the expected DiagnosticResult. /// </summary> /// <param name="analyzer">The analyzer that was being run on the sources</param> /// <param name="diagnostic">The diagnostic that was found in the code</param> /// <param name="actual">The Location of the Diagnostic found in the code</param> /// <param name="expected">The DiagnosticResultLocation that should have been found</param> private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) { var actualSpan = actual.GetLineSpan(); Assert.True(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.") && expected.Path.Contains("Test.")), string.Format("Expected diagnostic to be in file \"{0}\" was actually in file \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Path, actualSpan.Path, FormatDiagnostics(analyzer, diagnostic))); var actualLinePosition = actualSpan.StartLinePosition; // Only check line position if there is an actual line in the real diagnostic if (actualLinePosition.Line > 0) { if (actualLinePosition.Line + 1 != expected.Line) { Assert.True(false, string.Format("Expected diagnostic to be on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Line, actualLinePosition.Line + 1, FormatDiagnostics(analyzer, diagnostic))); } } // Only check column position if there is an actual column position in the real diagnostic if (actualLinePosition.Character > 0) { if (actualLinePosition.Character + 1 != expected.Column) { Assert.True(false, string.Format("Expected diagnostic to start at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n", expected.Column, actualLinePosition.Character + 1, FormatDiagnostics(analyzer, diagnostic))); } } } #endregion #region Formatting Diagnostics /// <summary> /// Helper method to format a Diagnostic into an easily readable string /// </summary> /// <param name="analyzer">The analyzer that this verifier tests</param> /// <param name="diagnostics">The Diagnostics to be formatted</param> /// <returns>The Diagnostics formatted as a string</returns> private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics) { var builder = new StringBuilder(); for (int i = 0; i < diagnostics.Length; ++i) { builder.AppendLine("// " + diagnostics[i].ToString()); var analyzerType = analyzer.GetType(); var rules = analyzer.SupportedDiagnostics; foreach (var rule in rules) { if (rule != null && rule.Id == diagnostics[i].Id) { var location = diagnostics[i].Location; if (location == Location.None) { builder.AppendFormat("GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); } else { Assert.True(location.IsInSource, $"Test base does not currently handle diagnostics in metadata locations. Diagnostic in metadata: {diagnostics[i]}\r\n"); string resultMethodName = diagnostics[i].Location.SourceTree.FilePath.EndsWith(".cs") ? "GetCSharpResultAt" : "GetBasicResultAt"; var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition; builder.AppendFormat("{0}({1}, {2}, {3}.{4})", resultMethodName, linePosition.Line + 1, linePosition.Character + 1, analyzerType.Name, rule.Id); } if (i != diagnostics.Length - 1) { builder.Append(','); } builder.AppendLine(); break; } } } return builder.ToString(); } #endregion } }
{'repo_name': 'dotnet/aspnetcore', 'stars': '18362', 'repo_language': 'C#', 'file_name': 'Cpp.Common.targets', 'mime_type': 'text/plain', 'hash': -9136020910368254049, 'source_dataset': 'data'}
/* * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP #include "gc_implementation/shared/mutableSpace.hpp" // // A PSMarkSweepDecorator is used to add "ParallelScavenge" style mark sweep operations // to a MutableSpace. // class ObjectStartArray; class PSMarkSweepDecorator: public CHeapObj<mtGC> { private: static PSMarkSweepDecorator* _destination_decorator; protected: MutableSpace* _space; ObjectStartArray* _start_array; HeapWord* _first_dead; HeapWord* _end_of_live; HeapWord* _compaction_top; size_t _allowed_dead_ratio; bool insert_deadspace(size_t& allowed_deadspace_words, HeapWord* q, size_t word_len); public: PSMarkSweepDecorator(MutableSpace* space, ObjectStartArray* start_array, size_t allowed_dead_ratio) : _space(space), _start_array(start_array), _allowed_dead_ratio(allowed_dead_ratio) { } // During a compacting collection, we need to collapse objects into // spaces in a given order. We want to fill space A, space B, and so // on. The code that controls that order is in the following methods. static void set_destination_decorator_tenured(); static void set_destination_decorator_perm_gen(); static void advance_destination_decorator(); static PSMarkSweepDecorator* destination_decorator(); // Accessors MutableSpace* space() { return _space; } ObjectStartArray* start_array() { return _start_array; } HeapWord* compaction_top() { return _compaction_top; } void set_compaction_top(HeapWord* value) { _compaction_top = value; } size_t allowed_dead_ratio() { return _allowed_dead_ratio; } void set_allowed_dead_ratio(size_t value) { _allowed_dead_ratio = value; } // Work methods void adjust_pointers(); void precompact(); void compact(bool mangle_free_space); }; #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP
{'repo_name': 'codefollower/Open-Source-Research', 'stars': '197', 'repo_language': 'C++', 'file_name': 'SimpleExample.java', 'mime_type': 'text/x-java', 'hash': -7999416238364700114, 'source_dataset': 'data'}
package hashtag import ( "testing" "github.com/go-redis/redis/v8/internal/rand" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) func TestGinkgoSuite(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "hashtag") } var _ = Describe("CRC16", func() { // http://redis.io/topics/cluster-spec#keys-distribution-model It("should calculate CRC16", func() { tests := []struct { s string n uint16 }{ {"123456789", 0x31C3}, {string([]byte{83, 153, 134, 118, 229, 214, 244, 75, 140, 37, 215, 215}), 21847}, } for _, test := range tests { Expect(crc16sum(test.s)).To(Equal(test.n), "for %s", test.s) } }) }) var _ = Describe("HashSlot", func() { It("should calculate hash slots", func() { tests := []struct { key string slot int }{ {"123456789", 12739}, {"{}foo", 9500}, {"foo{}", 5542}, {"foo{}{bar}", 8363}, {"", 10503}, {"", 5176}, {string([]byte{83, 153, 134, 118, 229, 214, 244, 75, 140, 37, 215, 215}), 5463}, } // Empty keys receive random slot. rand.Seed(100) for _, test := range tests { Expect(Slot(test.key)).To(Equal(test.slot), "for %s", test.key) } }) It("should extract keys from tags", func() { tests := []struct { one, two string }{ {"foo{bar}", "bar"}, {"{foo}bar", "foo"}, {"{user1000}.following", "{user1000}.followers"}, {"foo{{bar}}zap", "{bar"}, {"foo{bar}{zap}", "bar"}, } for _, test := range tests { Expect(Slot(test.one)).To(Equal(Slot(test.two)), "for %s <-> %s", test.one, test.two) } }) })
{'repo_name': 'go-redis/redis', 'stars': '9241', 'repo_language': 'Go', 'file_name': 'redis.conf', 'mime_type': 'text/plain', 'hash': -7321893273651831520, 'source_dataset': 'data'}
glabel func_80B006B0 /* 02400 80B006B0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 /* 02404 80B006B4 AFBF0014 */ sw $ra, 0x0014($sp) /* 02408 80B006B8 AFA40018 */ sw $a0, 0x0018($sp) /* 0240C 80B006BC 0C2C0184 */ jal func_80B00610 /* 02410 80B006C0 AFA5001C */ sw $a1, 0x001C($sp) /* 02414 80B006C4 0C2C0164 */ jal func_80B00590 /* 02418 80B006C8 8FA40018 */ lw $a0, 0x0018($sp) /* 0241C 80B006CC 14400006 */ bne $v0, $zero, .L80B006E8 /* 02420 80B006D0 8FA40018 */ lw $a0, 0x0018($sp) /* 02424 80B006D4 908E02D8 */ lbu $t6, 0x02D8($a0) ## 000002D8 /* 02428 80B006D8 55C00004 */ bnel $t6, $zero, .L80B006EC /* 0242C 80B006DC 8FBF0014 */ lw $ra, 0x0014($sp) /* 02430 80B006E0 0C2C0178 */ jal func_80B005E0 /* 02434 80B006E4 00000000 */ nop .L80B006E8: /* 02438 80B006E8 8FBF0014 */ lw $ra, 0x0014($sp) .L80B006EC: /* 0243C 80B006EC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 /* 02440 80B006F0 03E00008 */ jr $ra /* 02444 80B006F4 00000000 */ nop
{'repo_name': 'n64decomp/oot', 'stars': '265', 'repo_language': 'Assembly', 'file_name': 'func_808AAD04.s', 'mime_type': 'text/plain', 'hash': -3220898322871162609, 'source_dataset': 'data'}
#include <GuiMenu.au3> _Main() Func _Main() Local $hWnd, $hMain, $hFile ; Open Notepad Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") $hWnd = WinGetHandle("[CLASS:Notepad]") $hMain = _GUICtrlMenu_GetMenu($hWnd) $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) ; Get/Set File menu data Writeln("File data: " & _GUICtrlMenu_GetMenuData($hFile)) _GUICtrlMenu_SetMenuData($hFile, 1234) Writeln("File data: " & _GUICtrlMenu_GetMenuData($hFile)) EndFunc ;==>_Main ; Write a line of text to Notepad Func Writeln($sText) ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR) EndFunc ;==>Writeln
{'repo_name': 'forcedotcom/dataloader', 'stars': '269', 'repo_language': 'AutoIt', 'file_name': 'core.commands-3.6.1.v20120521-2329.pom', 'mime_type': 'text/xml', 'hash': 7049728112752923135, 'source_dataset': 'data'}
{ "action": { "hacking": { "result": [ "Exfiltrate" ], "variety": [ "Use of stolen creds" ], "vector": [ "Unknown" ] }, "social": { "result": [ "Infiltrate" ], "target": [ "Unknown" ], "variety": [ "Phishing" ], "vector": [ "Email" ] } }, "actor": { "external": { "country": [ "Unknown" ], "motive": [ "Financial" ], "region": [ "000000" ], "variety": [ "Unaffiliated" ] } }, "asset": { "assets": [ { "amount": 1, "variety": "U - Laptop" }, { "amount": 1, "variety": "P - Unknown" }, { "variety": "U - Desktop or laptop" } ], "cloud": [ "Unknown" ], "country": [ "US" ] }, "attribute": { "confidentiality": { "data": [ { "amount": 880, "variety": "Medical" }, { "amount": 1, "variety": "Credentials" } ], "data_disclosure": "Yes", "data_total": 881 }, "integrity": { "variety": [ "Alter behavior" ] } }, "confidence": "High", "discovery_method": { "internal": { "variety": [ "Unknown" ] } }, "incident_id": "00a2d140-e1da-11e7-8553-197c24c367d2", "plus": { "analysis_status": "Validated", "analyst": "swidup", "created": "2017-12-16T05:05:36.800Z", "dbir_year": 2018, "github": "10609", "master_id": "5944b651-cea7-4964-9a7d-ff5bba0454e8", "modified": "2017-12-16T05:05:36.800Z", "sub_source": "phidbr" }, "reference": "https://www.databreaches.net/baptist-health-louisville-notifies-880-patients-after-phishing-incident/; https://www.hipaajournal.com/880-patients-baptist-health-louisville-phishing-attack/", "schema_version": "1.3.4", "security_incident": "Confirmed", "source_id": "vcdb", "summary": "Baptist Health in Louisville, KY has notified 880 patients that some of their protected health information has potentially been accessed and stolen by hackers. The security breach was discovered on October 3, 2017, when irregular activity was detected on the email account of an employee. Baptist Health was able to determine that a third party sent a phishing email to the employee, who responded and disclosed login credentials allowing the email account to be accessed. Those login credentials were subsequently used by an unknown individual to gain access the email account. The email account contained the protected health information of 880 patients, although it is unclear whether any of the emails were viewed. The motive behind the attack may not have been to gain access to sensitive information.", "targeted": "Targeted", "timeline": { "incident": { "month": 10, "year": 2017 } }, "victim": { "country": [ "US" ], "employee_count": "1001 to 10000", "industry": "621511", "region": [ "019021" ], "state": "TX", "victim_id": "Baptist Health" } }
{'repo_name': 'vz-risk/VCDB', 'stars': '346', 'repo_language': 'Jupyter Notebook', 'file_name': 'NOTE.txt', 'mime_type': 'text/plain', 'hash': 7064844509126182633, 'source_dataset': 'data'}
//===--- CapturePropagation.cpp - Propagate closure capture constants -----===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #define DEBUG_TYPE "capture-prop" #include "polarphp/ast/GenericEnvironment.h" #include "polarphp/demangling/Demangler.h" #include "polarphp/pil/lang/PILCloner.h" #include "polarphp/pil/lang/PILInstruction.h" #include "polarphp/pil/lang/TypeSubstCloner.h" #include "polarphp/pil/optimizer/analysis/ColdBlockInfo.h" #include "polarphp/pil/optimizer/analysis/DominanceAnalysis.h" #include "polarphp/pil/optimizer/passmgr/Transforms.h" #include "polarphp/pil/optimizer/utils/Generics.h" #include "polarphp/pil/optimizer/utils/InstOptUtils.h" #include "polarphp/pil/optimizer/utils/PILOptFunctionBuilder.h" #include "polarphp/pil/optimizer/utils/SpecializationMangler.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" using namespace polar; STATISTIC(NumCapturesPropagated, "Number of constant captures propagated"); namespace { /// Propagate constants through closure captures by specializing the partially /// applied function. /// Also optimize away partial_apply instructions where all partially applied /// arguments are dead. class CapturePropagation : public PILFunctionTransform { public: void run() override; protected: bool optimizePartialApply(PartialApplyInst *PAI); PILFunction *specializeConstClosure(PartialApplyInst *PAI, PILFunction *SubstF); void rewritePartialApply(PartialApplyInst *PAI, PILFunction *SpecialF); }; } // end anonymous namespace static LiteralInst *getConstant(PILValue V) { if (auto I = dyn_cast<ThinToThickFunctionInst>(V)) return getConstant(I->getOperand()); if (auto I = dyn_cast<ConvertFunctionInst>(V)) return getConstant(I->getOperand()); return dyn_cast<LiteralInst>(V); } static bool isOptimizableConstant(PILValue V) { // We do not optimize string literals of length > 32 since we would need to // encode them into the symbol name for uniqueness. if (auto *SLI = dyn_cast<StringLiteralInst>(V)) return SLI->getValue().size() <= 32; return true; } static bool isConstant(PILValue V) { V = getConstant(V); return V && isOptimizableConstant(V); } static std::string getClonedName(PartialApplyInst *PAI, IsSerialized_t Serialized, PILFunction *F) { auto P = demangling::SpecializationPass::CapturePropagation; mangle::FunctionSignatureSpecializationMangler Mangler(P, Serialized, F); // We know that all arguments are literal insts. unsigned argIdx = ApplySite(PAI).getCalleeArgIndexOfFirstAppliedArg(); for (auto arg : PAI->getArguments()) { Mangler.setArgumentConstantProp(argIdx, getConstant(arg)); ++argIdx; } return Mangler.mangle(); } namespace { /// Clone the partially applied function, replacing incoming arguments with /// literal constants. /// /// The cloned literals will retain the PILLocation from the partial apply's /// caller, so the cloned function will have a mix of locations from different /// functions. class CapturePropagationCloner : public TypeSubstCloner<CapturePropagationCloner, PILOptFunctionBuilder> { using SuperTy = TypeSubstCloner<CapturePropagationCloner, PILOptFunctionBuilder>; friend class PILInstructionVisitor<CapturePropagationCloner>; friend class PILCloner<CapturePropagationCloner>; PILFunction *OrigF; bool IsCloningConstant; public: CapturePropagationCloner(PILFunction *OrigF, PILFunction *NewF, SubstitutionMap Subs) : SuperTy(*NewF, *OrigF, Subs), OrigF(OrigF), IsCloningConstant(false) {} void cloneClosure(OperandValueArrayRef Args); protected: /// Literals cloned from the caller drop their location so the debug line /// tables don't senselessly jump around. As a placeholder give them the /// location of the newly cloned function. PILLocation remapLocation(PILLocation InLoc) { if (IsCloningConstant) return getBuilder().getFunction().getLocation(); return InLoc; } /// Literals cloned from the caller take on the new function's debug scope. void postProcess(PILInstruction *Orig, PILInstruction *Cloned) { assert(IsCloningConstant == (Orig->getFunction() != OrigF) && "Expect only cloned constants from the caller function."); PILClonerWithScopes<CapturePropagationCloner>::postProcess(Orig, Cloned); } const PILDebugScope *remapScope(const PILDebugScope *DS) { if (IsCloningConstant) return getBuilder().getFunction().getDebugScope(); else return PILClonerWithScopes<CapturePropagationCloner>::remapScope(DS); } void cloneConstValue(PILValue Const); }; } // end anonymous namespace /// Clone a constant value. Recursively walk the operand chain through cast /// instructions to ensure that all dependents are cloned. Note that the /// original value may not belong to the same function as the one being cloned /// by cloneClosure() (they may be from the partial apply caller). void CapturePropagationCloner::cloneConstValue(PILValue Val) { assert(IsCloningConstant && "incorrect mode"); if (isValueCloned(Val)) return; // TODO: MultiValueInstruction? auto Inst = dyn_cast<SingleValueInstruction>(Val); if (!Inst) return; if (Inst->getNumOperands() > 0) { // Only handle single operands for simple recursion without a worklist. assert(Inst->getNumOperands() == 1 && "expected single-operand cast"); cloneConstValue(Inst->getOperand(0)); } visit(Inst); } /// Clone the original partially applied function into the new specialized /// function, replacing some arguments with literals. void CapturePropagationCloner::cloneClosure( OperandValueArrayRef PartialApplyArgs) { PILFunction &CloneF = getBuilder().getFunction(); // Create the entry basic block with the function arguments. PILBasicBlock *OrigEntryBB = &*OrigF->begin(); PILBasicBlock *ClonedEntryBB = CloneF.createBasicBlock(); auto cloneConv = CloneF.getConventions(); // Only clone the arguments that remain in the new function type. The trailing // arguments are now propagated through the partial apply. assert(!IsCloningConstant && "incorrect mode"); SmallVector<PILValue, 4> entryArgs; entryArgs.reserve(OrigEntryBB->getArguments().size()); unsigned ArgIdx = 0; for (unsigned NewArgEnd = cloneConv.getNumPILArguments(); ArgIdx != NewArgEnd; ++ArgIdx) { PILArgument *Arg = OrigEntryBB->getArgument(ArgIdx); PILValue MappedValue = ClonedEntryBB->createFunctionArgument( remapType(Arg->getType()), Arg->getDecl()); entryArgs.push_back(MappedValue); } assert(OrigEntryBB->args_size() - ArgIdx == PartialApplyArgs.size() && "unexpected number of partial apply arguments"); // Replace the rest of the old arguments with constants. getBuilder().setInsertionPoint(ClonedEntryBB); IsCloningConstant = true; for (PILValue PartialApplyArg : PartialApplyArgs) { assert(isConstant(PartialApplyArg) && "expected a constant arg to partial apply"); cloneConstValue(PartialApplyArg); // The PartialApplyArg from the caller is now mapped to its cloned // instruction. Also map the original argument to the cloned instruction. entryArgs.push_back(getMappedValue(PartialApplyArg)); ++ArgIdx; } IsCloningConstant = false; // Clear information about cloned values from the caller function. clearClonerState(); // Visit original BBs in depth-first preorder, starting with the // entry block, cloning all instructions and terminators. cloneFunctionBody(OrigF, ClonedEntryBB, entryArgs); } CanPILFunctionType getPartialApplyInterfaceResultType(PartialApplyInst *PAI) { // The new partial_apply will no longer take any arguments--they are all // expressed as literals. So its callee signature will be the same as its // return signature. auto FTy = PAI->getType().castTo<PILFunctionType>(); assert(!PAI->hasSubstitutions() || !PAI->getSubstitutionMap().hasArchetypes()); FTy = cast<PILFunctionType>( FTy->mapTypeOutOfContext()->getCanonicalType()); auto NewFTy = FTy; return NewFTy; } /// Given a partial_apply instruction, create a specialized callee by removing /// all constant arguments and adding constant literals to the specialized /// function body. PILFunction *CapturePropagation::specializeConstClosure(PartialApplyInst *PAI, PILFunction *OrigF) { IsSerialized_t Serialized = IsNotSerialized; if (PAI->getFunction()->isSerialized() && OrigF->isSerialized()) Serialized = IsSerializable; std::string Name = getClonedName(PAI, Serialized, OrigF); // See if we already have a version of this function in the module. If so, // just return it. if (auto *NewF = OrigF->getModule().lookUpFunction(Name)) { assert(NewF->isSerialized() == Serialized); LLVM_DEBUG(llvm::dbgs() << " Found an already specialized version of the callee: "; NewF->printName(llvm::dbgs()); llvm::dbgs() << "\n"); return NewF; } // The new partial_apply will no longer take any arguments--they are all // expressed as literals. So its callee signature will be the same as its // return signature. auto NewFTy = getPartialApplyInterfaceResultType(PAI); NewFTy = NewFTy->getWithRepresentation(PILFunctionType::Representation::Thin); GenericEnvironment *GenericEnv = nullptr; if (NewFTy->getInvocationGenericSignature()) GenericEnv = OrigF->getGenericEnvironment(); PILOptFunctionBuilder FuncBuilder(*this); PILFunction *NewF = FuncBuilder.createFunction( PILLinkage::Shared, Name, NewFTy, GenericEnv, OrigF->getLocation(), OrigF->isBare(), OrigF->isTransparent(), Serialized, IsNotDynamic, OrigF->getEntryCount(), OrigF->isThunk(), OrigF->getClassSubclassScope(), OrigF->getInlineStrategy(), OrigF->getEffectsKind(), /*InsertBefore*/ OrigF, OrigF->getDebugScope()); if (!OrigF->hasOwnership()) { NewF->setOwnershipEliminated(); } LLVM_DEBUG(llvm::dbgs() << " Specialize callee as "; NewF->printName(llvm::dbgs()); llvm::dbgs() << " " << NewFTy << "\n"); LLVM_DEBUG(if (PAI->hasSubstitutions()) { llvm::dbgs() << "CapturePropagation of generic partial_apply:\n"; PAI->dumpInContext(); }); CapturePropagationCloner cloner(OrigF, NewF, PAI->getSubstitutionMap()); cloner.cloneClosure(PAI->getArguments()); assert(OrigF->getDebugScope()->Parent != NewF->getDebugScope()->Parent); return NewF; } void CapturePropagation::rewritePartialApply(PartialApplyInst *OrigPAI, PILFunction *SpecialF) { LLVM_DEBUG(llvm::dbgs() << "\n Rewriting a partial apply:\n"; OrigPAI->dumpInContext(); llvm::dbgs() << " with special function: " << SpecialF->getName() << "\n"; llvm::dbgs() << "\nThe function being rewritten is:\n"; OrigPAI->getFunction()->dump()); PILBuilderWithScope Builder(OrigPAI); auto FuncRef = Builder.createFunctionRef(OrigPAI->getLoc(), SpecialF); auto *T2TF = Builder.createThinToThickFunction(OrigPAI->getLoc(), FuncRef, OrigPAI->getType()); OrigPAI->replaceAllUsesWith(T2TF); // Remove any dealloc_stack users. SmallVector<Operand*, 16> Uses(T2TF->getUses()); for (auto *Use : Uses) if (auto *DS = dyn_cast<DeallocStackInst>(Use->getUser())) DS->eraseFromParent(); recursivelyDeleteTriviallyDeadInstructions(OrigPAI, true); LLVM_DEBUG(llvm::dbgs() << " Rewrote caller:\n" << *T2TF); } /// For now, we conservative only specialize if doing so can eliminate dynamic /// dispatch. /// /// TODO: Check for other profitable constant propagation, like builtin compare. static bool isProfitable(PILFunction *Callee) { PILBasicBlock *EntryBB = &*Callee->begin(); for (auto *Arg : EntryBB->getArguments()) { for (auto *Operand : Arg->getUses()) { if (FullApplySite FAS = FullApplySite::isa(Operand->getUser())) { if (FAS.getCallee() == Operand->get()) return true; } } } return false; } /// Returns true if block \p BB only contains a return or throw of the first /// block argument and side-effect-free instructions. static bool onlyContainsReturnOrThrowOfArg(PILBasicBlock *BB) { for (PILInstruction &I : *BB) { if (isa<ReturnInst>(&I) || isa<ThrowInst>(&I)) { PILValue RetVal = I.getOperand(0); return BB->getNumArguments() == 1 && RetVal == BB->getArgument(0); } if (I.mayHaveSideEffects() || isa<TermInst>(&I)) return false; } llvm_unreachable("should have seen a terminator instruction"); } /// Checks if \p Orig is a thunk which calls another function but without /// passing the trailing \p numDeadParams dead parameters. /// If a generic specialization was performed for a generic capture, /// GenericSpecialized contains a tuple: /// (new specialized function, old function) static PILFunction *getSpecializedWithDeadParams( PILOptFunctionBuilder &FuncBuilder, PartialApplyInst *PAI, PILFunction *Orig, int numDeadParams, std::pair<PILFunction *, PILFunction *> &GenericSpecialized) { PILBasicBlock &EntryBB = *Orig->begin(); unsigned NumArgs = EntryBB.getNumArguments(); // Check if all dead parameters have trivial types. We don't support non- // trivial types because it's very hard to find places where we can release // those parameters (as a replacement for the removed partial_apply). // TODO: maybe we can skip this restriction when we have semantic ARC. for (unsigned Idx = NumArgs - numDeadParams; Idx < NumArgs; ++Idx) { PILType ArgTy = EntryBB.getArgument(Idx)->getType(); if (!ArgTy.isTrivial(*Orig)) return nullptr; } PILFunction *Specialized = nullptr; PILValue RetValue; // Check all instruction of the entry block. for (PILInstruction &I : EntryBB) { if (auto FAS = FullApplySite::isa(&I)) { // Check if this is the call of the specialized function. // If the original partial_apply didn't have substitutions, // also the specialized function must be not generic. if (!PAI->hasSubstitutions() && FAS.hasSubstitutions()) return nullptr; // Is it the only call? if (Specialized) return nullptr; Specialized = FAS.getReferencedFunctionOrNull(); if (!Specialized) return nullptr; // Check if parameters are passes 1-to-1 unsigned NumArgs = FAS.getNumArguments(); if (EntryBB.getNumArguments() - numDeadParams != NumArgs) return nullptr; for (unsigned Idx = 0; Idx < NumArgs; ++Idx) { if (FAS.getArgument(Idx) != (ValueBase *)EntryBB.getArgument(Idx)) return nullptr; } if (auto *TAI = dyn_cast<TryApplyInst>(&I)) { // Check the normal and throw blocks of the try_apply. if (onlyContainsReturnOrThrowOfArg(TAI->getNormalBB()) && onlyContainsReturnOrThrowOfArg(TAI->getErrorBB())) return Specialized; return nullptr; } assert(isa<ApplyInst>(&I) && "unknown FullApplySite instruction"); RetValue = cast<ApplyInst>(&I); continue; } if (auto *RI = dyn_cast<ReturnInst>(&I)) { // Check if we return the result of the apply. if (RI->getOperand() != RetValue) return nullptr; continue; } if (I.mayHaveSideEffects() || isa<TermInst>(&I)) return nullptr; } auto Rep = Specialized->getLoweredFunctionType()->getRepresentation(); if (getPILFunctionLanguage(Rep) != PILFunctionLanguage::Swift) return nullptr; GenericSpecialized = std::make_pair(nullptr, nullptr); if (PAI->hasSubstitutions()) { if (Specialized->isExternalDeclaration()) return nullptr; if (!Orig->shouldOptimize()) return nullptr; // Perform a generic specialization of the Specialized function. ReabstractionInfo ReInfo( FuncBuilder.getModule().getTypePHPModule(), FuncBuilder.getModule().isWholeModule(), ApplySite(), Specialized, PAI->getSubstitutionMap(), Specialized->isSerialized(), /* ConvertIndirectToDirect */ false); GenericFuncSpecializer FuncSpecializer(FuncBuilder, Specialized, ReInfo.getClonerParamSubstitutionMap(), ReInfo); PILFunction *GenericSpecializedFunc = FuncSpecializer.trySpecialization(); if (!GenericSpecializedFunc) return nullptr; GenericSpecialized = std::make_pair(GenericSpecializedFunc, Specialized); return GenericSpecializedFunc; } return Specialized; } bool CapturePropagation::optimizePartialApply(PartialApplyInst *PAI) { PILFunction *SubstF = PAI->getReferencedFunctionOrNull(); if (!SubstF) return false; if (SubstF->isExternalDeclaration()) return false; if (PAI->hasSubstitutions() && PAI->getSubstitutionMap().hasArchetypes()) { LLVM_DEBUG(llvm::dbgs() << "CapturePropagation: cannot handle partial specialization " "of partial_apply:\n"; PAI->dumpInContext()); return false; } // First possibility: Is it a partial_apply where all partially applied // arguments are dead? std::pair<PILFunction *, PILFunction *> GenericSpecialized; PILOptFunctionBuilder FuncBuilder(*this); if (auto *NewFunc = getSpecializedWithDeadParams(FuncBuilder, PAI, SubstF, PAI->getNumArguments(), GenericSpecialized)) { rewritePartialApply(PAI, NewFunc); if (GenericSpecialized.first) { // Notify the pass manager about the new function. addFunctionToPassManagerWorklist(GenericSpecialized.first, GenericSpecialized.second); } return true; } // Second possibility: Are all partially applied arguments constant? for (auto Arg : PAI->getArguments()) { if (!isConstant(Arg)) return false; } if (!isProfitable(SubstF)) return false; LLVM_DEBUG(llvm::dbgs() << "Specializing closure for constant arguments:\n" << " " << SubstF->getName() << "\n" << *PAI); ++NumCapturesPropagated; PILFunction *NewF = specializeConstClosure(PAI, SubstF); rewritePartialApply(PAI, NewF); addFunctionToPassManagerWorklist(NewF, SubstF); return true; } void CapturePropagation::run() { DominanceAnalysis *DA = PM->getAnalysis<DominanceAnalysis>(); auto *F = getFunction(); bool HasChanged = false; // Don't optimize functions that are marked with the opt.never attribute. if (!F->shouldOptimize()) return; // Cache cold blocks per function. ColdBlockInfo ColdBlocks(DA); for (auto &BB : *F) { if (ColdBlocks.isCold(&BB)) continue; auto I = BB.begin(); while (I != BB.end()) { PILInstruction *Inst = &*I; ++I; if (auto *PAI = dyn_cast<PartialApplyInst>(Inst)) HasChanged |= optimizePartialApply(PAI); } } if (HasChanged) { invalidateAnalysis(PILAnalysis::InvalidationKind::Everything); } } PILTransform *polar::createCapturePropagation() { return new CapturePropagation(); }
{'repo_name': 'polarphp/polarphp', 'stars': '1040', 'repo_language': 'C++', 'file_name': 'Commands.cpp', 'mime_type': 'text/x-c++', 'hash': 2042897897912194677, 'source_dataset': 'data'}
<?xml version="1.0" encoding="UTF-8"?> <options> <configurable id="preferences.keymap" configurable_name="Keymap"> <option name="" path="ActionManager" hit="" /> <option name="bottom" path="ActionManager" hit="Bottom" /> <option name="breadcrumbs" path="ActionManager" hit="Breadcrumbs" /> <option name="creates" path="ActionManager" hit="Creates new HTML file" /> <option name="file" path="ActionManager" hit="Creates new HTML file" /> <option name="html" path="ActionManager" hit="Creates new HTML file" /> <option name="new" path="ActionManager" hit="Creates new HTML file" /> <option name="don" path="ActionManager" hit="Don't Show" /> <option name="show" path="ActionManager" hit="Don't Show" /> <option name="t" path="ActionManager" hit="Don't Show" /> <option name="emmet" path="ActionManager" hit="Emmet" /> <option name="emmet" path="ActionManager" hit="Emmet Preview" /> <option name="preview" path="ActionManager" hit="Emmet Preview" /> <option name="characters" path="ActionManager" hit="Encode XML/HTML Special Characters" /> <option name="encode" path="ActionManager" hit="Encode XML/HTML Special Characters" /> <option name="html" path="ActionManager" hit="Encode XML/HTML Special Characters" /> <option name="special" path="ActionManager" hit="Encode XML/HTML Special Characters" /> <option name="xml" path="ActionManager" hit="Encode XML/HTML Special Characters" /> <option name="characters" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="entities" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="escape" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="html" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="special" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="with" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="xml" path="ActionManager" hit="Escape XML/HTML special characters with entities" /> <option name="dtd" path="ActionManager" hit="Generate DTD from XML File" /> <option name="file" path="ActionManager" hit="Generate DTD from XML File" /> <option name="from" path="ActionManager" hit="Generate DTD from XML File" /> <option name="generate" path="ActionManager" hit="Generate DTD from XML File" /> <option name="xml" path="ActionManager" hit="Generate DTD from XML File" /> <option name="document" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="from" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="generate" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="schema" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="xml" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="xsd" path="ActionManager" hit="Generate XML Document from XSD Schema..." /> <option name="file" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="from" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="generate" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="schema" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="xml" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="xsd" path="ActionManager" hit="Generate XSD Schema from XML File..." /> <option name="a" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="according" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="generate" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="information" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="new" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="schema" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="tag" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="to" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="xml" path="ActionManager" hit="Generate a new XML tag according to schema information" /> <option name="edit" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="emmet" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="go" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="next" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="point" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="to" path="ActionManager" hit="Go to next Emmet edit point" /> <option name="edit" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="emmet" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="go" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="point" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="previous" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="to" path="ActionManager" hit="Go to previous Emmet edit point" /> <option name="file" path="ActionManager" hit="HTML File" /> <option name="html" path="ActionManager" hit="HTML File" /> <option name="bar" path="ActionManager" hit="Hide the breadcrumbs bar" /> <option name="breadcrumbs" path="ActionManager" hit="Hide the breadcrumbs bar" /> <option name="hide" path="ActionManager" hit="Hide the breadcrumbs bar" /> <option name="the" path="ActionManager" hit="Hide the breadcrumbs bar" /> <option name="edit" path="ActionManager" hit="Next Emmet Edit Point" /> <option name="emmet" path="ActionManager" hit="Next Emmet Edit Point" /> <option name="next" path="ActionManager" hit="Next Emmet Edit Point" /> <option name="point" path="ActionManager" hit="Next Emmet Edit Point" /> <option name="in" path="ActionManager" hit="Open In..." /> <option name="open" path="ActionManager" hit="Open In..." /> <option name="browser" path="ActionManager" hit="Open in Browser" /> <option name="in" path="ActionManager" hit="Open in Browser" /> <option name="open" path="ActionManager" hit="Open in Browser" /> <option name="browser" path="ActionManager" hit="Open in default browser" /> <option name="default" path="ActionManager" hit="Open in default browser" /> <option name="in" path="ActionManager" hit="Open in default browser" /> <option name="open" path="ActionManager" hit="Open in default browser" /> <option name="browser" path="ActionManager" hit="Open selected file in browser" /> <option name="file" path="ActionManager" hit="Open selected file in browser" /> <option name="in" path="ActionManager" hit="Open selected file in browser" /> <option name="open" path="ActionManager" hit="Open selected file in browser" /> <option name="selected" path="ActionManager" hit="Open selected file in browser" /> <option name="browser" path="ActionManager" hit="Open selected file in default browser" /> <option name="default" path="ActionManager" hit="Open selected file in default browser" /> <option name="file" path="ActionManager" hit="Open selected file in default browser" /> <option name="in" path="ActionManager" hit="Open selected file in default browser" /> <option name="open" path="ActionManager" hit="Open selected file in default browser" /> <option name="selected" path="ActionManager" hit="Open selected file in default browser" /> <option name="edit" path="ActionManager" hit="Previous Emmet Edit Point" /> <option name="emmet" path="ActionManager" hit="Previous Emmet Edit Point" /> <option name="point" path="ActionManager" hit="Previous Emmet Edit Point" /> <option name="previous" path="ActionManager" hit="Previous Emmet Edit Point" /> <option name="configurations" path="ActionManager" hit="Run Configurations" /> <option name="run" path="ActionManager" hit="Run Configurations" /> <option name="breadcrumbs" path="ActionManager" hit="Show Breadcrumbs" /> <option name="show" path="ActionManager" hit="Show Breadcrumbs" /> <option name="abbreviation" path="ActionManager" hit="Show preview for emmet abbreviation" /> <option name="emmet" path="ActionManager" hit="Show preview for emmet abbreviation" /> <option name="for" path="ActionManager" hit="Show preview for emmet abbreviation" /> <option name="preview" path="ActionManager" hit="Show preview for emmet abbreviation" /> <option name="show" path="ActionManager" hit="Show preview for emmet abbreviation" /> <option name="above" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="bar" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="breadcrumbs" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="editor" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="show" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="text" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="the" path="ActionManager" hit="Show the breadcrumbs bar above the text editor" /> <option name="bar" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="below" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="breadcrumbs" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="editor" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="show" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="text" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="the" path="ActionManager" hit="Show the breadcrumbs bar below the text editor" /> <option name="abbreviation" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="code" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="emmet" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="selected" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="surround" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="with" path="ActionManager" hit="Surround selected code with Emmet abbreviation" /> <option name="emmet" path="ActionManager" hit="Surround with Emmet" /> <option name="surround" path="ActionManager" hit="Surround with Emmet" /> <option name="with" path="ActionManager" hit="Surround with Emmet" /> <option name="bar" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="breadcrumbs" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="current" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="display" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="editor" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="in" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="the" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="toggle" path="ActionManager" hit="Toggle display the breadcrumbs bar in current editor" /> <option name="bar" path="ActionManager" hit="Toggle the breadcrumbs bar settings" /> <option name="breadcrumbs" path="ActionManager" hit="Toggle the breadcrumbs bar settings" /> <option name="settings" path="ActionManager" hit="Toggle the breadcrumbs bar settings" /> <option name="the" path="ActionManager" hit="Toggle the breadcrumbs bar settings" /> <option name="toggle" path="ActionManager" hit="Toggle the breadcrumbs bar settings" /> <option name="top" path="ActionManager" hit="Top" /> <option name="abbreviation" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="emmet" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="existing" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="html" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="tag" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="update" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="with" path="ActionManager" hit="Update existing HTML tag with Emmet abbreviation" /> <option name="emmet" path="ActionManager" hit="Update tag with Emmet" /> <option name="tag" path="ActionManager" hit="Update tag with Emmet" /> <option name="update" path="ActionManager" hit="Update tag with Emmet" /> <option name="with" path="ActionManager" hit="Update tag with Emmet" /> <option name="xml" path="ActionManager" hit="XML" /> <option name="actions" path="ActionManager" hit="XML Actions" /> <option name="xml" path="ActionManager" hit="XML Actions" /> <option name="actions" path="ActionManager" hit="XML Generate Actions" /> <option name="generate" path="ActionManager" hit="XML Generate Actions" /> <option name="xml" path="ActionManager" hit="XML Generate Actions" /> <option name="tag" path="ActionManager" hit="XML Tag..." /> <option name="xml" path="ActionManager" hit="XML Tag..." /> </configurable> <configurable id="editor.preferences.import" configurable_name="Auto Import"> <option name="import" hit="Show import popup" /> <option name="popup" hit="Show import popup" /> <option name="show" hit="Show import popup" /> <option name="xml" hit="XML" /> </configurable> <configurable id="editor.preferences.appearance" configurable_name="Appearance"> <option name="as" hit="Show CSS color preview as background" /> <option name="background" hit="Show CSS color preview as background" /> <option name="color" hit="Show CSS color preview as background" /> <option name="css" hit="Show CSS color preview as background" /> <option name="preview" hit="Show CSS color preview as background" /> <option name="show" hit="Show CSS color preview as background" /> </configurable> <configurable id="editor.preferences.appearance" configurable_name="Appearance"> <option name="enable" hit="Enable HTML/XML tag tree highlighting" /> <option name="highlighting" hit="Enable HTML/XML tag tree highlighting" /> <option name="html" hit="Enable HTML/XML tag tree highlighting" /> <option name="tag" hit="Enable HTML/XML tag tree highlighting" /> <option name="tree" hit="Enable HTML/XML tag tree highlighting" /> <option name="xml" hit="Enable HTML/XML tag tree highlighting" /> <option name="highlight" hit="Levels to highlight:" /> <option name="levels" hit="Levels to highlight:" /> <option name="to" hit="Levels to highlight:" /> <option name="opacity" hit="Opacity:" /> </configurable> <configurable id="editor.breadcrumbs" configurable_name="Breadcrumbs"> <option name="bottom" hit="Bottom" /> <option name="breadcrumbs" hit="Breadcrumbs" /> <option name="languages" hit="Languages:" /> <option name="colors" hit="Manage colors" /> <option name="manage" hit="Manage colors" /> <option name="placement" hit="Placement:" /> <option name="breadcrumbs" hit="Show breadcrumbs" /> <option name="show" hit="Show breadcrumbs" /> <option name="top" hit="Top" /> </configurable> <configurable id="editor.breadcrumbs" configurable_name="Breadcrumbs"> <option name="xml" hit="XML" /> </configurable> <configurable id="editor.breadcrumbs" configurable_name="Breadcrumbs"> <option name="xhtml" hit="XHTML" /> </configurable> <configurable id="editor.breadcrumbs" configurable_name="Breadcrumbs"> <option name="html" hit="HTML" /> </configurable> <configurable id="editor.preferences.folding" configurable_name="Code Folding"> <option name="data" hit="Data URIs" /> <option name="uris" hit="Data URIs" /> <option name="attribute" hit="HTML 'style' attribute" /> <option name="html" hit="HTML 'style' attribute" /> <option name="style" hit="HTML 'style' attribute" /> <option name="entities" hit="XML entities" /> <option name="xml" hit="XML entities" /> <option name="tags" hit="XML tags" /> <option name="xml" hit="XML tags" /> </configurable> <configurable id="editor.preferences.smartKeys" configurable_name="Smart Keys"> <option name="add" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="and" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="attribute" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="completion" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="for" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="on" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="quotes" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="typing" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="value" hit="Add quotes for attribute value on typing '=' and attribute completion" /> <option name="auto-close" hit="Auto-close tag on typing '&lt;/'" /> <option name="on" hit="Auto-close tag on typing '&lt;/'" /> <option name="tag" hit="Auto-close tag on typing '&lt;/'" /> <option name="typing" hit="Auto-close tag on typing '&lt;/'" /> <option name="css" hit="CSS" /> <option name="closing" hit="Insert closing tag on tag completion" /> <option name="completion" hit="Insert closing tag on tag completion" /> <option name="insert" hit="Insert closing tag on tag completion" /> <option name="on" hit="Insert closing tag on tag completion" /> <option name="tag" hit="Insert closing tag on tag completion" /> <option name="attributes" hit="Insert required attributes on tag completion" /> <option name="completion" hit="Insert required attributes on tag completion" /> <option name="insert" hit="Insert required attributes on tag completion" /> <option name="on" hit="Insert required attributes on tag completion" /> <option name="required" hit="Insert required attributes on tag completion" /> <option name="tag" hit="Insert required attributes on tag completion" /> <option name="completion" hit="Insert required subtags on tag completion" /> <option name="insert" hit="Insert required subtags on tag completion" /> <option name="on" hit="Insert required subtags on tag completion" /> <option name="required" hit="Insert required subtags on tag completion" /> <option name="subtags" hit="Insert required subtags on tag completion" /> <option name="tag" hit="Insert required subtags on tag completion" /> <option name="click" hit="Select whole CSS identifiers on double click" /> <option name="css" hit="Select whole CSS identifiers on double click" /> <option name="double" hit="Select whole CSS identifiers on double click" /> <option name="identifiers" hit="Select whole CSS identifiers on double click" /> <option name="on" hit="Select whole CSS identifiers on double click" /> <option name="select" hit="Select whole CSS identifiers on double click" /> <option name="whole" hit="Select whole CSS identifiers on double click" /> <option name="editing" hit="Simultaneous ' ' editing" /> <option name="simultaneous" hit="Simultaneous ' ' editing" /> <option name="attribute" hit="Start attribute on tag completion" /> <option name="completion" hit="Start attribute on tag completion" /> <option name="on" hit="Start attribute on tag completion" /> <option name="start" hit="Start attribute on tag completion" /> <option name="tag" hit="Start attribute on tag completion" /> <option name="web" hit="Web" /> <option name="html" hit="XML/HTML" /> <option name="xml" hit="XML/HTML" /> </configurable> <configurable id="reference.settingsdialog.IDE.editor.colors.HTML" configurable_name="HTML"> <option name="html" hit="HTML" /> <option name="attribute" hit="Attribute name" /> <option name="name" hit="Attribute name" /> <option name="attribute" hit="Attribute value" /> <option name="value" hit="Attribute value" /> <option name="comment" hit="Comment" /> <option name="entity" hit="Entity reference" /> <option name="reference" hit="Entity reference" /> <option name="code" hit="HTML code" /> <option name="html" hit="HTML code" /> <option name="tag" hit="Tag" /> <option name="name" hit="Tag name" /> <option name="tag" hit="Tag name" /> <option name="1" hit="Tag tree (level 1)" /> <option name="level" hit="Tag tree (level 1)" /> <option name="tag" hit="Tag tree (level 1)" /> <option name="tree" hit="Tag tree (level 1)" /> <option name="2" hit="Tag tree (level 2)" /> <option name="level" hit="Tag tree (level 2)" /> <option name="tag" hit="Tag tree (level 2)" /> <option name="tree" hit="Tag tree (level 2)" /> <option name="3" hit="Tag tree (level 3)" /> <option name="level" hit="Tag tree (level 3)" /> <option name="tag" hit="Tag tree (level 3)" /> <option name="tree" hit="Tag tree (level 3)" /> <option name="4" hit="Tag tree (level 4)" /> <option name="level" hit="Tag tree (level 4)" /> <option name="tag" hit="Tag tree (level 4)" /> <option name="tree" hit="Tag tree (level 4)" /> <option name="5" hit="Tag tree (level 5)" /> <option name="level" hit="Tag tree (level 5)" /> <option name="tag" hit="Tag tree (level 5)" /> <option name="tree" hit="Tag tree (level 5)" /> <option name="6" hit="Tag tree (level 6)" /> <option name="level" hit="Tag tree (level 6)" /> <option name="tag" hit="Tag tree (level 6)" /> <option name="tree" hit="Tag tree (level 6)" /> </configurable> <configurable id="reference.settingsdialog.IDE.editor.colors.XML" configurable_name="XML"> <option name="xml" hit="XML" /> <option name="attribute" hit="Attribute name" /> <option name="name" hit="Attribute name" /> <option name="attribute" hit="Attribute value" /> <option name="value" hit="Attribute value" /> <option name="comment" hit="Comment" /> <option name="entity" hit="Entity reference" /> <option name="reference" hit="Entity reference" /> <option name="namespace" hit="Namespace prefix" /> <option name="prefix" hit="Namespace prefix" /> <option name="prologue" hit="Prologue" /> <option name="tag" hit="Tag" /> <option name="data" hit="Tag data" /> <option name="tag" hit="Tag data" /> <option name="name" hit="Tag name" /> <option name="tag" hit="Tag name" /> </configurable> <configurable id="preferences.sourceCode.HTML" configurable_name="HTML"> <option name="a" path="Code Generation" hit="Add a space at comment start" /> <option name="add" path="Code Generation" hit="Add a space at comment start" /> <option name="at" path="Code Generation" hit="Add a space at comment start" /> <option name="comment" path="Code Generation" hit="Add a space at comment start" /> <option name="space" path="Code Generation" hit="Add a space at comment start" /> <option name="start" path="Code Generation" hit="Add a space at comment start" /> <option name="add" path="Other" hit="Add for JSX attributes:" /> <option name="attributes" path="Other" hit="Add for JSX attributes:" /> <option name="for" path="Other" hit="Add for JSX attributes:" /> <option name="jsx" path="Other" hit="Add for JSX attributes:" /> <option name="after" path="Other" hit="After tag name" /> <option name="name" path="Other" hit="After tag name" /> <option name="tag" path="Other" hit="After tag name" /> <option name="align" path="Other" hit="Align attributes" /> <option name="attributes" path="Other" hit="Align attributes" /> <option name="align" path="Other" hit="Align text" /> <option name="text" path="Other" hit="Align text" /> <option name="around" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="attribute" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="in" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="arrangement" path="Arrangement" hit="Arrangement" /> <option name="based" path="Other" hit="Based on type" /> <option name="on" path="Other" hit="Based on type" /> <option name="type" path="Other" hit="Based on type" /> <option name="at" path="Code Generation" hit="Block comment at first column" /> <option name="block" path="Code Generation" hit="Block comment at first column" /> <option name="column" path="Code Generation" hit="Block comment at first column" /> <option name="comment" path="Code Generation" hit="Block comment at first column" /> <option name="first" path="Code Generation" hit="Block comment at first column" /> <option name="braces" path="Other" hit="Braces" /> <option name="chop" path="Other" hit="Chop down if long" /> <option name="down" path="Other" hit="Chop down if long" /> <option name="if" path="Other" hit="Chop down if long" /> <option name="long" path="Other" hit="Chop down if long" /> <option name="code" path="Code Generation" hit="Code Generation" /> <option name="generation" path="Code Generation" hit="Code Generation" /> <option name="comments" path="Code Generation" hit="Comments" /> <option name="continuation" path="Tabs and Indents" hit="Continuation indent:" /> <option name="indent" path="Tabs and Indents" hit="Continuation indent:" /> <option name="default" path="Other" hit="Default: No" /> <option name="no" path="Other" hit="Default: No" /> <option name="children" path="Other" hit="Do not indent children of:" /> <option name="do" path="Other" hit="Do not indent children of:" /> <option name="indent" path="Other" hit="Do not indent children of:" /> <option name="not" path="Other" hit="Do not indent children of:" /> <option name="of" path="Other" hit="Do not indent children of:" /> <option name="do" path="Other" hit="Do not wrap" /> <option name="not" path="Other" hit="Do not wrap" /> <option name="wrap" path="Other" hit="Do not wrap" /> <option name="break" path="Other" hit="Don't break if inline content:" /> <option name="content" path="Other" hit="Don't break if inline content:" /> <option name="don" path="Other" hit="Don't break if inline content:" /> <option name="if" path="Other" hit="Don't break if inline content:" /> <option name="inline" path="Other" hit="Don't break if inline content:" /> <option name="t" path="Other" hit="Don't break if inline content:" /> <option name="double" path="Other" hit="Double" /> <option name="enforce" path="Other" hit="Enforce on format" /> <option name="format" path="Other" hit="Enforce on format" /> <option name="on" path="Other" hit="Enforce on format" /> <option name="generated" path="Other" hit="Generated quote marks:" /> <option name="marks" path="Other" hit="Generated quote marks:" /> <option name="quote" path="Other" hit="Generated quote marks:" /> <option name="html" hit="HTML" /> <option name="at" path="Other" hit="Hard wrap at" /> <option name="hard" path="Other" hit="Hard wrap at" /> <option name="wrap" path="Other" hit="Hard wrap at" /> <option name="empty" path="Other" hit="In empty tag" /> <option name="in" path="Other" hit="In empty tag" /> <option name="tag" path="Other" hit="In empty tag" /> <option name="indent" path="Tabs and Indents" hit="Indent:" /> <option name="elements" path="Other" hit="Inline elements:" /> <option name="inline" path="Other" hit="Inline elements:" /> <option name="before" path="Other" hit="Insert new line before:" /> <option name="insert" path="Other" hit="Insert new line before:" /> <option name="line" path="Other" hit="Insert new line before:" /> <option name="new" path="Other" hit="Insert new line before:" /> <option name="blank" path="Other" hit="Keep blank lines:" /> <option name="keep" path="Other" hit="Keep blank lines:" /> <option name="lines" path="Other" hit="Keep blank lines:" /> <option name="empty" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="indents" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="keep" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="lines" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="on" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="breaks" path="Other" hit="Keep line breaks" /> <option name="keep" path="Other" hit="Keep line breaks" /> <option name="line" path="Other" hit="Keep line breaks" /> <option name="breaks" path="Other" hit="Keep line breaks in text" /> <option name="in" path="Other" hit="Keep line breaks in text" /> <option name="keep" path="Other" hit="Keep line breaks in text" /> <option name="line" path="Other" hit="Keep line breaks in text" /> <option name="text" path="Other" hit="Keep line breaks in text" /> <option name="keep" path="Other" hit="Keep white spaces" /> <option name="spaces" path="Other" hit="Keep white spaces" /> <option name="white" path="Other" hit="Keep white spaces" /> <option name="inside" path="Other" hit="Keep white spaces inside:" /> <option name="keep" path="Other" hit="Keep white spaces inside:" /> <option name="spaces" path="Other" hit="Keep white spaces inside:" /> <option name="white" path="Other" hit="Keep white spaces inside:" /> <option name="at" path="Code Generation" hit="Line comment at first column" /> <option name="column" path="Code Generation" hit="Line comment at first column" /> <option name="comment" path="Code Generation" hit="Line comment at first column" /> <option name="first" path="Code Generation" hit="Line comment at first column" /> <option name="line" path="Code Generation" hit="Line comment at first column" /> <option name="loading" hit="Loading..." /> <option name="never" path="Other" hit="Never" /> <option name="after" path="Other" hit="New line after last attribute:" /> <option name="attribute" path="Other" hit="New line after last attribute:" /> <option name="last" path="Other" hit="New line after last attribute:" /> <option name="line" path="Other" hit="New line after last attribute:" /> <option name="new" path="Other" hit="New line after last attribute:" /> <option name="attribute" path="Other" hit="New line before first attribute:" /> <option name="before" path="Other" hit="New line before first attribute:" /> <option name="first" path="Other" hit="New line before first attribute:" /> <option name="line" path="Other" hit="New line before first attribute:" /> <option name="new" path="Other" hit="New line before first attribute:" /> <option name="no" path="Other" hit="No" /> <option name="none" path="Other" hit="None" /> <option name="other" path="Other" hit="Other" /> <option name="quotes" path="Other" hit="Quotes" /> <option name="before" path="Other" hit="Remove new line before:" /> <option name="line" path="Other" hit="Remove new line before:" /> <option name="new" path="Other" hit="Remove new line before:" /> <option name="remove" path="Other" hit="Remove new line before:" /> <option name="reset" path="Other" hit="Reset" /> <option name="scheme" hit="Scheme:" /> <option name="from" hit="Set from..." /> <option name="set" hit="Set from..." /> <option name="single" path="Other" hit="Single" /> <option name="smart" path="Tabs and Indents" hit="Smart tabs" /> <option name="tabs" path="Tabs and Indents" hit="Smart tabs" /> <option name="spaces" path="Other" hit="Spaces" /> <option name="120" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="80" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="guide" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="one" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="or" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="several" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="specify" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="size" path="Tabs and Indents" hit="Tab size:" /> <option name="tab" path="Tabs and Indents" hit="Tab size:" /> <option name="and" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="indents" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="tabs" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="character" path="Tabs and Indents" hit="Use tab character" /> <option name="tab" path="Tabs and Indents" hit="Use tab character" /> <option name="use" path="Tabs and Indents" hit="Use tab character" /> <option name="guides" path="Other" hit="Visual guides:" /> <option name="visual" path="Other" hit="Visual guides:" /> <option name="multiline" path="Other" hit="When multiline" /> <option name="when" path="Other" hit="When multiline" /> <option name="always" path="Other" hit="Wrap always" /> <option name="wrap" path="Other" hit="Wrap always" /> <option name="attributes" path="Other" hit="Wrap attributes:" /> <option name="wrap" path="Other" hit="Wrap attributes:" /> <option name="if" path="Other" hit="Wrap if long" /> <option name="long" path="Other" hit="Wrap if long" /> <option name="wrap" path="Other" hit="Wrap if long" /> <option name="on" path="Other" hit="Wrap on typing" /> <option name="typing" path="Other" hit="Wrap on typing" /> <option name="wrap" path="Other" hit="Wrap on typing" /> <option name="text" path="Other" hit="Wrap text" /> <option name="wrap" path="Other" hit="Wrap text" /> <option name="yes" path="Other" hit="Yes" /> <option name="columns" path="Other" hit="columns" /> <option name="lines" path="Other" hit="lines" /> <option name="if" path="Other" hit="or if tag size more than" /> <option name="more" path="Other" hit="or if tag size more than" /> <option name="or" path="Other" hit="or if tag size more than" /> <option name="size" path="Other" hit="or if tag size more than" /> <option name="tag" path="Other" hit="or if tag size more than" /> <option name="than" path="Other" hit="or if tag size more than" /> </configurable> <configurable id="preferences.sourceCode.XML" configurable_name="XML"> <option name="a" path="Code Generation" hit="Add a space at comment start" /> <option name="add" path="Code Generation" hit="Add a space at comment start" /> <option name="at" path="Code Generation" hit="Add a space at comment start" /> <option name="comment" path="Code Generation" hit="Add a space at comment start" /> <option name="space" path="Code Generation" hit="Add a space at comment start" /> <option name="start" path="Code Generation" hit="Add a space at comment start" /> <option name="add" path="Other" hit="Add new lines" /> <option name="lines" path="Other" hit="Add new lines" /> <option name="new" path="Other" hit="Add new lines" /> <option name="additional" path="Arrangement" hit="Additional settings" /> <option name="settings" path="Arrangement" hit="Additional settings" /> <option name="after" path="Other" hit="After tag name" /> <option name="name" path="Other" hit="After tag name" /> <option name="tag" path="Other" hit="After tag name" /> <option name="align" path="Other" hit="Align attributes" /> <option name="attributes" path="Other" hit="Align attributes" /> <option name="always" path="Arrangement" hit="Always" /> <option name="around" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="attribute" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="in" path="Other" hit="Around &quot;=&quot; in attribute" /> <option name="arrangement" path="Arrangement" hit="Arrangement" /> <option name="at" path="Code Generation" hit="Block comment at first column" /> <option name="block" path="Code Generation" hit="Block comment at first column" /> <option name="column" path="Code Generation" hit="Block comment at first column" /> <option name="comment" path="Code Generation" hit="Block comment at first column" /> <option name="first" path="Code Generation" hit="Block comment at first column" /> <option name="cdata" path="Other" hit="CDATA" /> <option name="chop" path="Other" hit="Chop down if long" /> <option name="down" path="Other" hit="Chop down if long" /> <option name="if" path="Other" hit="Chop down if long" /> <option name="long" path="Other" hit="Chop down if long" /> <option name="code" path="Code Generation" hit="Code Generation" /> <option name="generation" path="Code Generation" hit="Code Generation" /> <option name="comments" path="Code Generation" hit="Comments" /> <option name="continuation" path="Tabs and Indents" hit="Continuation indent:" /> <option name="indent" path="Tabs and Indents" hit="Continuation indent:" /> <option name="default" path="Other" hit="Default: No" /> <option name="no" path="Other" hit="Default: No" /> <option name="do" path="Other" hit="Do not wrap" /> <option name="not" path="Other" hit="Do not wrap" /> <option name="wrap" path="Other" hit="Do not wrap" /> <option name="force" path="Arrangement" hit="Force rearrange:" /> <option name="rearrange" path="Arrangement" hit="Force rearrange:" /> <option name="at" path="Other" hit="Hard wrap at" /> <option name="hard" path="Other" hit="Hard wrap at" /> <option name="wrap" path="Other" hit="Hard wrap at" /> <option name="empty" path="Other" hit="In empty tag" /> <option name="in" path="Other" hit="In empty tag" /> <option name="tag" path="Other" hit="In empty tag" /> <option name="indent" path="Tabs and Indents" hit="Indent:" /> <option name="blank" path="Other" hit="Keep blank lines:" /> <option name="keep" path="Other" hit="Keep blank lines:" /> <option name="lines" path="Other" hit="Keep blank lines:" /> <option name="empty" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="indents" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="keep" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="lines" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="on" path="Tabs and Indents" hit="Keep indents on empty lines" /> <option name="breaks" path="Other" hit="Keep line breaks" /> <option name="keep" path="Other" hit="Keep line breaks" /> <option name="line" path="Other" hit="Keep line breaks" /> <option name="breaks" path="Other" hit="Keep line breaks in text" /> <option name="in" path="Other" hit="Keep line breaks in text" /> <option name="keep" path="Other" hit="Keep line breaks in text" /> <option name="line" path="Other" hit="Keep line breaks in text" /> <option name="text" path="Other" hit="Keep line breaks in text" /> <option name="keep" path="Other" hit="Keep white spaces" /> <option name="spaces" path="Other" hit="Keep white spaces" /> <option name="white" path="Other" hit="Keep white spaces" /> <option name="inside" path="Other" hit="Keep whitespace inside" /> <option name="keep" path="Other" hit="Keep whitespace inside" /> <option name="whitespace" path="Other" hit="Keep whitespace inside" /> <option name="at" path="Code Generation" hit="Line comment at first column" /> <option name="column" path="Code Generation" hit="Line comment at first column" /> <option name="comment" path="Code Generation" hit="Line comment at first column" /> <option name="first" path="Code Generation" hit="Line comment at first column" /> <option name="line" path="Code Generation" hit="Line comment at first column" /> <option name="loading" hit="Loading..." /> <option name="never" path="Arrangement" hit="Never" /> <option name="no" path="Other" hit="No" /> <option name="other" path="Other" hit="Other" /> <option name="preserve" path="Other" hit="Preserve" /> <option name="keep" path="Other" hit="Remove (keep with tags)" /> <option name="remove" path="Other" hit="Remove (keep with tags)" /> <option name="tags" path="Other" hit="Remove (keep with tags)" /> <option name="with" path="Other" hit="Remove (keep with tags)" /> <option name="reset" path="Other" hit="Reset" /> <option name="scheme" hit="Scheme:" /> <option name="from" hit="Set from..." /> <option name="set" hit="Set from..." /> <option name="smart" path="Tabs and Indents" hit="Smart tabs" /> <option name="tabs" path="Tabs and Indents" hit="Smart tabs" /> <option name="spaces" path="Other" hit="Spaces" /> <option name="120" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="80" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="guide" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="one" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="or" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="several" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="specify" path="Other" hit="Specify one guide (80) or several (80, 120)" /> <option name="size" path="Tabs and Indents" hit="Tab size:" /> <option name="tab" path="Tabs and Indents" hit="Tab size:" /> <option name="and" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="indents" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="tabs" path="Tabs and Indents" hit="Tabs and Indents" /> <option name="code" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="current" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="dialog" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="in" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="mode" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="reformat" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="the" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="toggled" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="use" path="Arrangement" hit="Use current mode (toggled in the Reformat Code dialog)" /> <option name="character" path="Tabs and Indents" hit="Use tab character" /> <option name="tab" path="Tabs and Indents" hit="Use tab character" /> <option name="use" path="Tabs and Indents" hit="Use tab character" /> <option name="guides" path="Other" hit="Visual guides:" /> <option name="visual" path="Other" hit="Visual guides:" /> <option name="around" path="Other" hit="Whitespace around:" /> <option name="whitespace" path="Other" hit="Whitespace around:" /> <option name="always" path="Other" hit="Wrap always" /> <option name="wrap" path="Other" hit="Wrap always" /> <option name="attributes" path="Other" hit="Wrap attributes:" /> <option name="wrap" path="Other" hit="Wrap attributes:" /> <option name="if" path="Other" hit="Wrap if long" /> <option name="long" path="Other" hit="Wrap if long" /> <option name="wrap" path="Other" hit="Wrap if long" /> <option name="on" path="Other" hit="Wrap on typing" /> <option name="typing" path="Other" hit="Wrap on typing" /> <option name="wrap" path="Other" hit="Wrap on typing" /> <option name="text" path="Other" hit="Wrap text" /> <option name="wrap" path="Other" hit="Wrap text" /> <option name="xml" hit="XML" /> <option name="yes" path="Other" hit="Yes" /> <option name="columns" path="Other" hit="columns" /> </configurable> <configurable id="reference.idesettings.emmet" configurable_name="Emmet"> <option name="custom" hit="Custom..." /> <option name="emmet" hit="Emmet" /> <option name="enter" hit="Enter" /> <option name="abbreviation" hit="Expand abbreviation with" /> <option name="expand" hit="Expand abbreviation with" /> <option name="with" hit="Expand abbreviation with" /> <option name="space" hit="Space" /> <option name="tab" hit="Tab" /> </configurable> <configurable id="reference.idesettings.emmet.xml" configurable_name="HTML"> <option name="add" hit="Add edit point at the end of template" /> <option name="at" hit="Add edit point at the end of template" /> <option name="edit" hit="Add edit point at the end of template" /> <option name="end" hit="Add edit point at the end of template" /> <option name="of" hit="Add edit point at the end of template" /> <option name="point" hit="Add edit point at the end of template" /> <option name="template" hit="Add edit point at the end of template" /> <option name="the" hit="Add edit point at the end of template" /> <option name="bem" hit="BEM" /> <option name="class" hit="Class name's element separator:" /> <option name="element" hit="Class name's element separator:" /> <option name="name" hit="Class name's element separator:" /> <option name="s" hit="Class name's element separator:" /> <option name="separator" hit="Class name's element separator:" /> <option name="class" hit="Class name's modifier separator:" /> <option name="modifier" hit="Class name's modifier separator:" /> <option name="name" hit="Class name's modifier separator:" /> <option name="s" hit="Class name's modifier separator:" /> <option name="separator" hit="Class name's modifier separator:" /> <option name="comment" hit="Comment tags" /> <option name="tags" hit="Comment tags" /> <option name="emmet" hit="Enable XML/HTML Emmet" /> <option name="enable" hit="Enable XML/HTML Emmet" /> <option name="html" hit="Enable XML/HTML Emmet" /> <option name="xml" hit="Enable XML/HTML Emmet" /> <option name="abbreviation" hit="Enable abbreviation preview" /> <option name="enable" hit="Enable abbreviation preview" /> <option name="preview" hit="Enable abbreviation preview" /> <option name="automatic" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="enable" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="recognition" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="tag" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="text" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="url" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="while" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="with" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="wrapping" hit="Enable automatic URL recognition while wrapping text with tag" /> <option name="escape" hit="Escape" /> <option name="by" hit="Filters enabled by default" /> <option name="default" hit="Filters enabled by default" /> <option name="enabled" hit="Filters enabled by default" /> <option name="filters" hit="Filters enabled by default" /> <option name="html" hit="HTML" /> <option name="element" hit="Short element prefix:" /> <option name="prefix" hit="Short element prefix:" /> <option name="short" hit="Short element prefix:" /> <option name="line" hit="Single line" /> <option name="single" hit="Single line" /> <option name="line" hit="Trim line markers" /> <option name="markers" hit="Trim line markers" /> <option name="trim" hit="Trim line markers" /> <option name="tuning" hit="XSL tuning" /> <option name="xsl" hit="XSL tuning" /> </configurable> <configurable id="preferences.externalResources" configurable_name="Schemas and DTDs"> <option name="and" hit="Schemas and DTDs" /> <option name="dtds" hit="Schemas and DTDs" /> <option name="schemas" hit="Schemas and DTDs" /> </configurable> <configurable id="xml.defaultSchemas" configurable_name="Default XML Schemas"> <option name="default" hit="Default HTML language level" /> <option name="html" hit="Default HTML language level" /> <option name="language" hit="Default HTML language level" /> <option name="level" hit="Default HTML language level" /> <option name="default" hit="Default XML Schemas" /> <option name="schemas" hit="Default XML Schemas" /> <option name="xml" hit="Default XML Schemas" /> <option name="4" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="dtd" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="html" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="html4" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="http" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="loose" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="org" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="tr" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="w3" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="www" hit="HTML 4 (&quot;http://www.w3.org/TR/html4/loose.dtd&quot;)" /> <option name="5" hit="HTML 5" /> <option name="html" hit="HTML 5" /> <option name="doctype" hit="Other doctype:" /> <option name="other" hit="Other doctype:" /> <option name="0" hit="XML Schema 1.0" /> <option name="1" hit="XML Schema 1.0" /> <option name="schema" hit="XML Schema 1.0" /> <option name="xml" hit="XML Schema 1.0" /> <option name="1" hit="XML Schema 1.1" /> <option name="schema" hit="XML Schema 1.1" /> <option name="xml" hit="XML Schema 1.1" /> <option name="schema" hit="XML Schema version" /> <option name="version" hit="XML Schema version" /> <option name="xml" hit="XML Schema version" /> </configurable> <configurable id="xml.catalog" configurable_name="XML Catalog"> <option name="catalog" hit="Catalog property file:" /> <option name="file" hit="Catalog property file:" /> <option name="property" hit="Catalog property file:" /> <option name="catalog" hit="XML Catalog" /> <option name="xml" hit="XML Catalog" /> </configurable> <configurable id="reference.settings.ide.settings.web.browsers" configurable_name="Web Browsers"> <option name="custom" hit="Custom path" /> <option name="path" hit="Custom path" /> <option name="browser" hit="Default Browser:" /> <option name="default" hit="Default Browser:" /> <option name="first" hit="First listed" /> <option name="listed" hit="First listed" /> <option name="browser" hit="Show browser popup in the editor" /> <option name="editor" hit="Show browser popup in the editor" /> <option name="in" hit="Show browser popup in the editor" /> <option name="popup" hit="Show browser popup in the editor" /> <option name="show" hit="Show browser popup in the editor" /> <option name="the" hit="Show browser popup in the editor" /> <option name="browsers" hit="Web Browsers" /> <option name="web" hit="Web Browsers" /> </configurable> </options>
{'repo_name': 'ewen0930/PyCharm-Chinese', 'stars': '489', 'repo_language': 'HTML', 'file_name': 'MANIFEST.MF', 'mime_type': 'text/plain', 'hash': -1931053156141764207, 'source_dataset': 'data'}
/* OneToMany in Picat. "Constraint programming suitable for extracting OneToMany relationships from records" https://stackoverflow.com/questions/56843065/constraint-programming-suitable-for-extracting-onetomany-relationships-from-reco """ I don’t have much experience with constraint programming but I’m trying to figure whether it is suitable for a certain kind of problem I am currently facing. I will explain the problem type with an easy fictive example, maybe someone has an idea. Imagine a table of projects (e.g. school projects where kids do something). Each project has one or more children participating. For each child we store its name and the name of its mother. But for each project there is only one cell that contains all mothers and one cell that contains all children. Both cells are not necessarily ordered in the same way. Example: +-----------+-----------+------------+ | | | | | Project | Parents | Children | | | | | +-----------+-----------+------------+ | | | | | 1 | Jane; | Brian; | | | Claire | Stephen | | | | | +-----------+-----------+------------+ | | | | | 2 | Claire; | Emma; | | | Jane | William | | | | | +-----------+-----------+------------+ | | | | | 3 | Jane; | William; | | | Claire | James | | | | | +-----------+-----------+------------+ | | | | | 4 | Jane; | Brian; | | | Sophia; | James; | | | Claire | Isabella | | | | | +-----------+-----------+------------+ | | | | | 4 | Claire | Brian | | | | | +-----------+-----------+------------+ | | | | | 5 | Jane | Emma | | | | | +-----------+-----------+------------+ I hope this example visualizes the problem. As I said both cells only contain the names separated by a delimiter, but are not necessarily ordered in a similar way. So for technical applications you would transform the data into this: +-------------+-----------+----------+ | Project | Name | Role | +-------------+-----------+----------+ | 1 | Jane | Mother | +-------------+-----------+----------+ | 1 | Claire | Mother | +-------------+-----------+----------+ | 1 | Brian | Child | +-------------+-----------+----------+ | 1 | Stephen | Child | +-------------+-----------+----------+ | 2 | Jane | Mother | +-------------+-----------+----------+ | 2 | Claire | Mother | +-------------+-----------+----------+ | 2 | Emma | Child | +-------------+-----------+----------+ | 2 | William | Child | +-------------+-----------+----------+ | | | | | | | And so on | The number of parents and children is equal for each project, so it is given that within the context of a certain project each child belongs to exactly one mother. Knowing that it is possible to assign each mother to all of her children by logical inference starting with the projects that involve only one child (i.e. 4 and 5). Results: Jane has Emma, Stephen and James; Claire has Brian and William; Sophia has Isabella The real dataset I am working with is very large and traversing it with loops, that try to capture information about mother-child relations iteratively, is very cumbersome. I am wondering if it is possible to solve such a problem with constraint programming. Additionally, the real data set might be underdetermined and I am wondering if it is possible to isolate records that, when solved manually (i.e. when the mother-child assignments are done manually), would break the underdetermination. Can someone tell me if I am on the right path? """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import util. import cp. main => go. go ?=> Mothers = [Jane,Claire,Sophia], Mothers_S = [jane,claire,sophia], MLen = Mothers.len, Mothers = 1..MLen, Children = [Brian,Stephen,Emma,William,James,Isabella], Children_S = [brian,stephen,emma,william,james,isabella], CLen = Children.len, Children = 1..CLen, X = new_list(Children.len), X :: 1..MLen, % Project 1 check_project(X,[Jane,Claire], [Brian,Stephen]), % project 2 check_project(X,[Claire,Jane],[Emma,William]), % project 3 check_project(X,[Claire,Jane],[William,James]), % project 4 check_project(X,[Claire,Sophia,Jane],[Brian,James,Isabella]), % project 4(sic!) check_project(X,[Claire],[Brian]), % project 5 check_project(X,[Jane],[Emma]), solve(X), % println(X), foreach(I in 1..CLen) printf("%w: %w\n", Children_S[I], Mothers_S[X[I]]) end, fail, nl. go => true. % % Without loops or indexing, i.e. traditional Prolog style % go2 => Mothers = [Jane,Claire,Sophia], Mothers_S = [jane,claire,sophia], MLen = Mothers.len, Mothers = 1..MLen, Children = [Brian,Stephen,Emma,William,James,Isabella], Children_S = [brian,stephen,emma,william,james,isabella], CLen = Children.len, Children = 1..CLen, X = new_list(Children.len), X :: 1..MLen, % Project 1 check_project2(X,[Jane,Claire], [Brian,Stephen]), % project 2 check_project2(X,[Claire,Jane],[Emma,William]), % project 3 check_project2(X,[Claire,Jane],[William,James]), % project 4 check_project2(X,[Claire,Sophia,Jane],[Brian,James,Isabella]), % project 4(sic!) check_project2(X,[Claire],[Brian]), % project 5 check_project2(X,[Jane],[Emma]), solve(X), print_solution(X,Children_S, Mothers_S), fail, nl. go2 => true. % Ensure that exactly one mother pairs with one childen % in this project. check_project(X, Mothers,Children) => N = Mothers.len, Y = new_list(N), Y :: 1..N, all_different(Y), foreach(I in 1..N) % X[Children[I]] #= Mothers[Y[I]] element(Children[I], X, V), element(Y[I], Mothers, V) end. % Ensure that exactly one mother pairs with one childen % in this project. % Another approach, plain recursion and no indexing check_project2(_X, [], _,_) ?=> true. check_project2(X, Mothers,Children) ?=> N = Mothers.len, Y = new_list(N), Y :: 1..N, all_different(Y), check_mc(X, Y, Mothers, Children). check_mc(_X,[], _Mothers,_Children) ?=> true. check_mc(X,[Y|YRest], Mothers,CCRest) ?=> CCRest = [C|CRest], element(C,X,V), element(Y,Mothers,V), check_mc(X,YRest, Mothers,CRest). print_solution([], _Children, _Mothers) ?=> true. print_solution([H|T], CCRest, Mothers) => CCRest = [C|CRest], nth(H,Mothers,V), printf("%w: %w\n", C, V), print_solution(T,CRest,Mothers).
{'repo_name': 'hakank/hakank', 'stars': '211', 'repo_language': 'Prolog', 'file_name': 'Graduation.arff', 'mime_type': 'text/plain', 'hash': -2408740973515500367, 'source_dataset': 'data'}
import { ElementUIComponent } from './component' /** Footer Component */ export declare class ElFooter extends ElementUIComponent { /** Height of the footer */ height: string }
{'repo_name': 'TyCoding/spring-boot', 'stars': '300', 'repo_language': 'JavaScript', 'file_name': 'sys_schema.sql', 'mime_type': 'text/plain', 'hash': 4548758635138577371, 'source_dataset': 'data'}
/* Copyright 2013-2014. The Regents of the University of California. * Copyright 2016-2018. Martin Uecker. * All rights reserved. Use of this source code is governed by * a BSD-style license which can be found in the LICENSE file. * * Authors: * 2012-2018 Martin Uecker <martin.uecker@med.uni-goettingen.de> * 2014 Jonathan Tamir <jtamir@eecs.berkeley.edu> * * * Samsonov AA, Kholmovski EG, Parker DL, Johnson CR. POCSENSE: POCS-based * reconstruction for sensitivity encoded magnetic resonance imaging. * Magn Reson Med 2004; 52:1397–1406. * */ #include <complex.h> #include <stdbool.h> #include <assert.h> #include <math.h> #include "misc/misc.h" #include "misc/mri.h" #include "misc/debug.h" #include "misc/types.h" #include "num/multind.h" #include "num/flpmath.h" #include "num/fft.h" #include "num/ops_p.h" #include "num/ops.h" #include "linops/linop.h" #include "iter/iter.h" #include "iter/prox.h" #include "iter/monitor.h" #include "sense/model.h" #include "pocs.h" struct data { INTERFACE(operator_data_t); const struct linop_s* sense_op; complex float* tmp; float alpha; // l1 or l2 regularization float lambda; // robust consistency const struct operator_p_s* thresh; const complex float* kspace; const complex float* pattern; const complex float* fftmod_mat; long dims_ksp[DIMS]; long dims_pat[DIMS]; long strs_ksp[DIMS]; long strs_pat[DIMS]; }; static DEF_TYPEID(data); static void xupdate_apply(const operator_data_t* _data, float mu, complex float* dst, const complex float* src) { const auto data = CAST_DOWN(data, _data); UNUSED(mu); md_zsmul(DIMS, data->dims_ksp, dst, src, 1. / (data->alpha == 0 ? 2. : 3.)); } static complex float cthresh(float lambda, complex float x) { float norm = cabsf(x); float red = norm - lambda; return (red > 0.) ? ((red / norm) * x) : 0.; } static void robust_consistency(float lambda, const long dims[DIMS], complex float* dst, const complex float* pattern, const complex float* kspace) { assert(1 == dims[MAPS_DIM]); size_t size = md_calc_size(DIMS, dims); for (unsigned int i = 0; i < size; i++) if (1. == pattern[i % (size / dims[COIL_DIM])]) dst[i] = kspace[i] + cthresh(lambda, dst[i] - kspace[i]); } static void sparsity_proj_apply(const operator_data_t* _data, float mu, complex float* dst, const complex float* src) { const auto data = CAST_DOWN(data, _data); const long* dims = data->dims_ksp; ifft(DIMS, dims, FFT_FLAGS, dst, src); // FIXME fftmod is slow #if 0 fftscale(DIMS, dims, FFT_FLAGS, dst, dst); ifftmod(DIMS, dims, FFT_FLAGS, dst, dst); #else md_zmulc2(DIMS, dims, data->strs_ksp, dst, data->strs_ksp, dst, data->strs_pat, data->fftmod_mat); #endif operator_p_apply(data->thresh, mu, DIMS, dims, dst, DIMS, dims, dst); #if 0 fftmod(DIMS, dims, FFT_FLAGS, dst, dst); fftscale(DIMS, dims, FFT_FLAGS, dst, dst); #else md_zmul2(DIMS, dims, data->strs_ksp, dst, data->strs_ksp, dst, data->strs_pat, data->fftmod_mat); #endif fft(DIMS, dims, FFT_FLAGS, dst, dst); } static void data_consistency_proj_apply(const operator_data_t* _data, float mu, complex float* dst, const complex float* src) { UNUSED(mu); const auto data = CAST_DOWN(data, _data); if (-1. != data->lambda) robust_consistency(data->lambda, data->dims_ksp, dst, data->pattern, data->kspace); else data_consistency(data->dims_ksp, dst, data->pattern, data->kspace, src); } static void sense_proj_apply(const operator_data_t* _data, float mu, complex float* dst, const complex float* src) { UNUSED(mu); const auto data = CAST_DOWN(data, _data); // assumes normalized sensitivities linop_adjoint_unchecked(data->sense_op, data->tmp, src); linop_forward_unchecked(data->sense_op, dst, data->tmp); } static void proj_del(const operator_data_t* _data) { UNUSED(_data); } static float compute_norm(const void* _data, const float* ksp) { const struct data* data = _data; // FIXME: CAST? float norm = md_znorm(DIMS, data->dims_ksp, (complex float*)ksp); //assert(isnormal(norm)); return norm; } void pocs_recon(const long dims[DIMS], const struct operator_p_s* thresh, int maxiter, float alpha, float lambda, complex float* result, const complex float* maps, const complex float* pattern, const complex float* kspace) { struct iter_pocs_conf pconf = iter_pocs_defaults; pconf.maxiter = maxiter; pocs_recon2(iter2_pocs, &pconf, NULL, dims, thresh, alpha, lambda, result, maps, pattern, kspace); } void pocs_recon2(italgo_fun2_t italgo, void* iconf, const struct linop_s* ops[3], const long dims[DIMS], const struct operator_p_s* thresh_op, float alpha, float lambda, complex float* result, const complex float* maps, const complex float* pattern, const complex float* kspace) { long dims_pat[DIMS]; long dims_img[DIMS]; long dims_ksp[DIMS]; md_select_dims(DIMS, ~(COIL_FLAG | MAPS_FLAG), dims_pat, dims); md_select_dims(DIMS, ~(MAPS_FLAG), dims_ksp, dims); md_select_dims(DIMS, ~(COIL_FLAG), dims_img, dims); long strs_pat[DIMS]; long strs_ksp[DIMS]; md_calc_strides(DIMS, strs_pat, dims_pat, CFL_SIZE); md_calc_strides(DIMS, strs_ksp, dims_ksp, CFL_SIZE); struct data data; SET_TYPEID(data, &data); data.pattern = pattern; data.kspace = kspace; data.lambda = lambda; data.alpha = alpha; md_copy_dims(DIMS, data.dims_ksp, dims_ksp); md_copy_dims(DIMS, data.dims_pat, dims_pat); md_copy_strides(DIMS, data.strs_ksp, strs_ksp); md_copy_strides(DIMS, data.strs_pat, strs_pat); data.sense_op = sense_init(dims, FFT_FLAGS|MAPS_FLAG|COIL_FLAG, maps); data.thresh = thresh_op; data.tmp = md_alloc_sameplace(DIMS, dims_img, CFL_SIZE, kspace); complex float* fftmod_mat = md_alloc_sameplace(DIMS, dims_pat, CFL_SIZE, kspace); complex float one[1] = { 1. }; md_fill(DIMS, dims_pat, fftmod_mat, one, CFL_SIZE ); fftscale(DIMS, dims_pat, FFT_FLAGS, fftmod_mat, fftmod_mat); fftmod(DIMS, dims_pat, FFT_FLAGS, fftmod_mat, fftmod_mat); data.fftmod_mat = fftmod_mat; const struct operator_p_s* sense_proj = operator_p_create(DIMS, dims_ksp, DIMS, dims_ksp, CAST_UP(&data), sense_proj_apply, proj_del); const struct operator_p_s* data_consistency_proj = operator_p_create(DIMS, dims_ksp, DIMS, dims_ksp, CAST_UP(&data), data_consistency_proj_apply, proj_del); const struct operator_p_s* sparsity_proj = NULL; if (NULL != thresh_op) sparsity_proj = operator_p_create(DIMS, dims_ksp, DIMS, dims_ksp, CAST_UP(&data), sparsity_proj_apply, proj_del); else sparsity_proj = prox_leastsquares_create(DIMS, dims_ksp, alpha, NULL); const struct operator_p_s* prox_ops[3] = { data_consistency_proj, sense_proj, sparsity_proj }; //const struct operator_p_s* prox_ops[3] = { data_consistency_proj, sense_proj, thresh_op }; const struct operator_p_s* xupdate_op = operator_p_create(DIMS, dims_ksp, DIMS, dims_ksp, CAST_UP(&data), xupdate_apply, proj_del); long size = 2 * md_calc_size(DIMS, dims_ksp); md_clear(DIMS, dims_ksp, result, CFL_SIZE); struct iter_monitor_s* mon = create_monitor(size, NULL, (void*)&data, compute_norm); italgo(iconf, NULL, (alpha == 0.) ? 2 : 3, prox_ops, ops, NULL, xupdate_op, size, (float*)result, NULL, mon); free(mon); // FIXME debug_printf(DP_INFO, "Done\n"); md_free(data.tmp); md_free(fftmod_mat); linop_free(data.sense_op); operator_p_free(sense_proj); operator_p_free(data_consistency_proj); operator_p_free(sparsity_proj); operator_p_free(xupdate_op); } #ifdef USE_CUDA void pocs_recon_gpu(const long dims[DIMS], const struct operator_p_s* thresh, int maxiter, float alpha, float lambda, complex float* result, const complex float* maps, const complex float* pattern, const complex float* kspace) { struct iter_pocs_conf pconf = iter_pocs_defaults; pconf.maxiter = maxiter; pocs_recon_gpu2(iter2_pocs, &pconf, NULL, dims, thresh, alpha, lambda, result, maps, pattern, kspace); } void pocs_recon_gpu2(italgo_fun2_t italgo, void* iconf, const struct linop_s** ops, const long dims[DIMS], const struct operator_p_s* thresh, float alpha, float lambda, complex float* result, const complex float* maps, const complex float* pattern, const complex float* kspace) { long dims_pat[DIMS]; long dims_ksp[DIMS]; md_select_dims(DIMS, ~(COIL_FLAG | MAPS_FLAG), dims_pat, dims); md_select_dims(DIMS, ~MAPS_FLAG, dims_ksp, dims); complex float* gpu_maps = md_gpu_move(DIMS, dims, maps, CFL_SIZE); complex float* gpu_pat = md_gpu_move(DIMS, dims_pat, pattern, CFL_SIZE); complex float* gpu_ksp = md_gpu_move(DIMS, dims_ksp, kspace, CFL_SIZE); complex float* gpu_result = md_gpu_move(DIMS, dims_ksp, result, CFL_SIZE); pocs_recon2(italgo, iconf, ops, dims, thresh, alpha, lambda, gpu_result, gpu_maps, gpu_pat, gpu_ksp); md_copy(DIMS, dims_ksp, result, gpu_result, CFL_SIZE); md_free(gpu_result); md_free(gpu_pat); md_free(gpu_ksp); md_free(gpu_maps); } #endif
{'repo_name': 'mrirecon/bart', 'stars': '132', 'repo_language': 'C', 'file_name': 'building.txt', 'mime_type': 'text/plain', 'hash': -6140043824335570481, 'source_dataset': 'data'}
<?php class RequestsTest_IDNAEncoder extends PHPUnit_Framework_TestCase { public static function specExamples() { return array( array( "\xe4\xbb\x96\xe4\xbb\xac\xe4\xb8\xba\xe4\xbb\x80\xe4\xb9\x88\xe4\xb8\x8d\xe8\xaf\xb4\xe4\xb8\xad\xe6\x96\x87", "xn--ihqwcrb4cv8a8dqg056pqjye" ), array( "\x33\xe5\xb9\xb4\x42\xe7\xb5\x84\xe9\x87\x91\xe5\x85\xab\xe5\x85\x88\xe7\x94\x9f", "xn--3B-ww4c5e180e575a65lsy2b", ) ); } /** * @dataProvider specExamples */ public function testEncoding($data, $expected) { $result = Requests_IDNAEncoder::encode($data); $this->assertEquals($expected, $result); } /** * @expectedException Requests_Exception */ public function testASCIITooLong() { $data = str_repeat("abcd", 20); $result = Requests_IDNAEncoder::encode($data); } /** * @expectedException Requests_Exception */ public function testEncodedTooLong() { $data = str_repeat("\xe4\xbb\x96", 60); $result = Requests_IDNAEncoder::encode($data); } /** * @expectedException Requests_Exception */ public function testAlreadyPrefixed() { $result = Requests_IDNAEncoder::encode("xn--\xe4\xbb\x96"); } public function testASCIICharacter() { $result = Requests_IDNAEncoder::encode("a"); $this->assertEquals('a', $result); } public function testTwoByteCharacter() { $result = Requests_IDNAEncoder::encode("\xc2\xb6"); // Pilcrow character $this->assertEquals('xn--tba', $result); } public function testThreeByteCharacter() { $result = Requests_IDNAEncoder::encode("\xe2\x82\xac"); // Euro symbol $this->assertEquals('xn--lzg', $result); } public function testFourByteCharacter() { $result = Requests_IDNAEncoder::encode("\xf0\xa4\xad\xa2"); // Chinese symbol? $this->assertEquals('xn--ww6j', $result); } /** * @expectedException Requests_Exception */ public function testFiveByteCharacter() { $result = Requests_IDNAEncoder::encode("\xfb\xb6\xb6\xb6\xb6"); } /** * @expectedException Requests_Exception */ public function testSixByteCharacter() { $result = Requests_IDNAEncoder::encode("\xfd\xb6\xb6\xb6\xb6\xb6"); } /** * @expectedException Requests_Exception */ public function testInvalidASCIICharacterWithMultibyte() { $result = Requests_IDNAEncoder::encode("\0\xc2\xb6"); } /** * @expectedException Requests_Exception */ public function testUnfinishedMultibyte() { $result = Requests_IDNAEncoder::encode("\xc2"); } /** * @expectedException Requests_Exception */ public function testPartialMultibyte() { $result = Requests_IDNAEncoder::encode("\xc2\xc2\xb6"); } }
{'repo_name': 'sayakb/sticky-notes', 'stars': '291', 'repo_language': 'PHP', 'file_name': 'stickynotes-setup.js', 'mime_type': 'text/plain', 'hash': -2623651948221916006, 'source_dataset': 'data'}
<?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkflowRealTimeStatisticsOptions Options builder */ public static function fetch(string $taskChannel = Values::NONE): FetchWorkflowRealTimeStatisticsOptions { return new FetchWorkflowRealTimeStatisticsOptions($taskChannel); } } class FetchWorkflowRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct(string $taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkflowRealTimeStatisticsOptions ' . $options . ']'; } }
{'repo_name': 'twilio/twilio-php', 'stars': '1210', 'repo_language': 'PHP', 'file_name': 'ClientTest.php', 'mime_type': 'text/x-php', 'hash': 3945195208564339969, 'source_dataset': 'data'}
// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2019 DENX Software Engineering * Lukasz Majewski, DENX Software Engineering, lukma@denx.de * * Copyright 2012 Freescale Semiconductor, Inc. * Copyright 2012 Linaro Ltd. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ #include <common.h> #include <asm/io.h> #include <malloc.h> #include <clk-uclass.h> #include <dm/device.h> #include <dm/devres.h> #include <linux/clk-provider.h> #include <div64.h> #include <clk.h> #include "clk.h" #include <linux/err.h> #define UBOOT_DM_CLK_IMX_PFD "imx_clk_pfd" struct clk_pfd { struct clk clk; void __iomem *reg; u8 idx; }; #define to_clk_pfd(_clk) container_of(_clk, struct clk_pfd, clk) #define SET 0x4 #define CLR 0x8 #define OTG 0xc static unsigned long clk_pfd_recalc_rate(struct clk *clk) { struct clk_pfd *pfd = to_clk_pfd(dev_get_clk_ptr(clk->dev)); unsigned long parent_rate = clk_get_parent_rate(clk); u64 tmp = parent_rate; u8 frac = (readl(pfd->reg) >> (pfd->idx * 8)) & 0x3f; tmp *= 18; do_div(tmp, frac); return tmp; } static unsigned long clk_pfd_set_rate(struct clk *clk, unsigned long rate) { struct clk_pfd *pfd = to_clk_pfd(clk); unsigned long parent_rate = clk_get_parent_rate(clk); u64 tmp = parent_rate; u8 frac; tmp = tmp * 18 + rate / 2; do_div(tmp, rate); frac = tmp; if (frac < 12) frac = 12; else if (frac > 35) frac = 35; writel(0x3f << (pfd->idx * 8), pfd->reg + CLR); writel(frac << (pfd->idx * 8), pfd->reg + SET); return 0; } static const struct clk_ops clk_pfd_ops = { .get_rate = clk_pfd_recalc_rate, .set_rate = clk_pfd_set_rate, }; struct clk *imx_clk_pfd(const char *name, const char *parent_name, void __iomem *reg, u8 idx) { struct clk_pfd *pfd; struct clk *clk; int ret; pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); if (!pfd) return ERR_PTR(-ENOMEM); pfd->reg = reg; pfd->idx = idx; /* register the clock */ clk = &pfd->clk; ret = clk_register(clk, UBOOT_DM_CLK_IMX_PFD, name, parent_name); if (ret) { kfree(pfd); return ERR_PTR(ret); } return clk; } U_BOOT_DRIVER(clk_pfd) = { .name = UBOOT_DM_CLK_IMX_PFD, .id = UCLASS_CLK, .ops = &clk_pfd_ops, .flags = DM_FLAG_PRE_RELOC, };
{'repo_name': 'u-boot/u-boot', 'stars': '1164', 'repo_language': 'C', 'file_name': 'Makefile', 'mime_type': 'text/plain', 'hash': 2468607310076668153, 'source_dataset': 'data'}
package com.zhuinden.examplegithubclient.util; import android.content.Context; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Created by Owner on 2016.12.10. */ @Inherited @Retention(RetentionPolicy.RUNTIME) public @interface ComponentFactory { Class<? extends FactoryMethod<?>> value(); interface FactoryMethod<T> { T createComponent(Context context); } }
{'repo_name': 'Zhuinden/flowless', 'stars': '147', 'repo_language': 'Java', 'file_name': 'ExampleUnitTest.java', 'mime_type': 'text/x-java', 'hash': 4748638222934832513, 'source_dataset': 'data'}
import path from 'path'; import fs from 'fs-extra'; import resolvePkg from 'resolve-pkg'; import * as git from './git'; export async function bootstrap(fixture: string, directory?: string) { const cwd = await git.bootstrap(fixture, directory); const manifestPath = path.join(cwd, 'package.json'); const targetModulesPath = path.join(cwd, 'node_modules'); if (await fs.pathExists(manifestPath)) { const {dependencies = {}, devDependencies = {}} = await fs.readJson( manifestPath ); const deps = Object.keys({...dependencies, ...devDependencies}); await Promise.all( deps.map(async (dependency: any) => { const sourcePath = resolvePkg(dependency); if (!sourcePath) { throw new Error(`Could not resolve dependency ${dependency}`); } const sourceModulesPath = findParentPath(sourcePath, 'node_modules'); if (!sourceModulesPath) { throw new Error(`Could not determine node_modules for ${sourcePath}`); } const relativePath = path.relative(sourceModulesPath, sourcePath); const targetPath = path.join(targetModulesPath, relativePath); await fs.mkdirp(path.join(targetPath, '..')); await fs.symlink(sourcePath, targetPath); }) ); } return cwd; } function findParentPath( parentPath: string, dirname: string ): string | undefined { const rawFragments = parentPath.split(path.sep); const {matched, fragments} = rawFragments.reduceRight( ({fragments, matched}, item) => { if (item === dirname && !matched) { return {fragments, matched: true}; } if (!matched && fragments.length > 0) { fragments.pop(); } return {fragments, matched}; }, {fragments: rawFragments, matched: false} ); return matched ? fragments.join(path.sep) : undefined; }
{'repo_name': 'conventional-changelog/commitlint', 'stars': '6014', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 6291210917914390020, 'source_dataset': 'data'}
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::mappedFixedValueFvPatchField Description This boundary condition maps the value at a set of cells or patch faces back to *this. The sample mode is set by the underlying mapping engine, provided by the mappedPatchBase class. Usage \table Property | Description | Required | Default value fieldName | name of field to be mapped | no | this field name setAverage | flag to activate setting of average value | yes | average | average value to apply if \c setAverage = yes | yes | interpolationScheme | type of interpolation scheme | no | \endtable Example of the boundary condition specification: \verbatim <patchName> { type mapped; fieldName T; setAverage no; average 0; interpolationScheme cell; value uniform 0; } \endverbatim When employing the \c nearestCell sample mode, the user must also specify the interpolation scheme using the \c interpolationScheme entry. In case of interpolation (where scheme != cell) the limitation is that there is only one value per cell. For example, if you have a cell with two boundary faces and both faces sample into the cell, both faces will get the same value. Note It is not possible to sample internal faces since volume fields are not defined on faces. See also Foam::mappedPatchBase Foam::interpolation Foam::fixedValueFvPatchField SourceFiles mappedFixedValueFvPatchField.C \*---------------------------------------------------------------------------*/ #ifndef mappedFixedValueFvPatchField_H #define mappedFixedValueFvPatchField_H #include "fixedValueFvPatchFields.H" //#include "interpolation.H" #include "mappedPatchFieldBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class mappedFixedValueFvPatchField Declaration \*---------------------------------------------------------------------------*/ template<class Type> class mappedFixedValueFvPatchField : public fixedValueFvPatchField<Type>, public mappedPatchFieldBase<Type> { protected: // Protected Member Functions const mappedPatchBase& mapper ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF ); public: //- Runtime type information TypeName("mapped"); // Constructors //- Construct from patch and internal field mappedFixedValueFvPatchField ( const fvPatch&, const DimensionedField<Type, volMesh>& ); //- Construct from patch, internal field and dictionary mappedFixedValueFvPatchField ( const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary& ); //- Construct by mapping given mappedFixedValueFvPatchField // onto a new patch mappedFixedValueFvPatchField ( const mappedFixedValueFvPatchField<Type>&, const fvPatch&, const DimensionedField<Type, volMesh>&, const fvPatchFieldMapper& ); //- Copy constructor mappedFixedValueFvPatchField ( const mappedFixedValueFvPatchField<Type>& ); //- Construct and return a clone virtual tmp<fvPatchField<Type>> clone() const { return tmp<fvPatchField<Type>> ( new mappedFixedValueFvPatchField<Type>(*this) ); } //- Copy constructor setting internal field reference mappedFixedValueFvPatchField ( const mappedFixedValueFvPatchField<Type>&, const DimensionedField<Type, volMesh>& ); //- Construct and return a clone setting internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { return tmp<fvPatchField<Type>> ( new mappedFixedValueFvPatchField<Type>(*this, iF) ); } // Member Functions // Evaluation functions //- Update the coefficients associated with the patch field virtual void updateCoeffs(); //- Write virtual void write(Ostream&) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository #include "mappedFixedValueFvPatchField.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
{'repo_name': 'OpenFOAM/OpenFOAM-dev', 'stars': '633', 'repo_language': 'C++', 'file_name': 'tensorOperator.sty', 'mime_type': 'text/plain', 'hash': -5779586923821971914, 'source_dataset': 'data'}
# Makefile for Optware packages # # Copyright (C) 2004 by Rod Whitby <unslung@gmail.com> # Copyright (C) 2004 by Oleg I. Vdovikin <oleg@cs.msu.su> # Copyright (C) 2001-2004 Erik Andersen <andersen@codepoet.org> # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # shell used by make: should be bash SHELL=/bin/bash # one of `ls platforms/toolchain-*.mk | sed 's|^platforms/toolchain-\(.*\)\.mk$$|\1|'` OPTWARE_TARGET ?= buildroot-armeabi-ng # Add new packages here # When they have been tested, they will be promoted and uploaded. # PACKAGES_READY_FOR_TESTING = qt-embedded \ py-btpd-webui \ cryptsetup \ unbound \ ldns \ dnssec-trigger \ # iozone - fileop_linux-arm.o: No such file or directory # lumikki - does not install to $(TARGET_PREFIX) # doxygen - host binary, not stripped # bpalogin - for some reason it can't find 'sed' on the build machine # btg - needs old boost and libtorrent-rasterbar # clinkcc - fails to build with GCC 7: # ../../src/cybergarage/upnp/Service.cpp: In member function ‘bool CyberLink::Service::loadSCPD(CyberIO::File*)’: # ../../src/cybergarage/upnp/Service.cpp:349:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] # PACKAGES_THAT_NEED_TO_BE_FIXED = lumikki \ doxygen \ xchat \ iozone \ bpalogin \ nemesis \ appweb libextractor sandbox \ btg \ clinkcc \ PERL_PACKAGES = \ intltool \ perl \ perl-algorithm-diff \ perl-appconfig perl-assp \ perl-archive-tar perl-archive-zip \ perl-b-keywords \ perl-berkeleydb \ perl-bit-vector \ perl-bsd-resource \ perl-business-isbn-data perl-business-isbn \ perl-carp-clan \ perl-cgi perl-cgi-application \ perl-class-accessor perl-class-data-inheritable perl-class-inspector perl-class-dbi perl-class-trigger \ perl-clone \ perl-compress-zlib \ perl-convert-binhex perl-convert-tnef perl-convert-uulib \ perl-crypt-openssl-random perl-crypt-openssl-rsa perl-crypt-ssleay \ perl-danga-socket \ perl-date-calc perl-date-manip \ perl-db-file \ perl-dbd-mysql perl-dbd-sqlite perl-dbi \ perl-dbix-contextualfetch \ perl-devel-caller perl-devel-lexalias \ perl-devel-modlist \ perl-device-serialport \ perl-digest-hmac perl-digest-perl-md5 perl-digest-sha1 perl-digest-sha \ perl-email-address perl-email-messageid \ perl-email-mime-contenttype \ perl-email-mime-encodings \ perl-email-mime-modifier perl-email-mime \ perl-email-simple perl-email-send \ perl-encode-detect \ perl-encode-locale \ perl-extutils-cbuilder perl-extutils-parsexs \ perl-file-next perl-file-pid perl-file-rename \ perl-gd perl-gd-barcode \ perl-html-form \ perl-html-parser perl-html-tagparser perl-html-tagset perl-html-template perl-hottproxy \ perl-http-cookies perl-http-date perl-http-message \ perl-http-response-encoding \ perl-ima-dbi \ perl-io-interface perl-io-socket-multicast \ perl-io-multiplex perl-io-socket-ssl perl-io-string perl-io-stringy perl-io-zlib \ perl-ip-country \ perl-json-xs \ perl-lexical-persistence \ perl-libnet perl-libwww \ perl-libxml perl-libxml-libxml perl-libxml-namespacesupport perl-libxml-sax-base perl-libxml-sax perl-libxml-simple \ perl-lwp-protocol-https \ perl-mail-spf-query perl-mailtools \ perl-mime-tools \ perl-module-build perl-module-pluggable perl-module-refresh perl-module-signature perl-mozilla-ca \ perl-net-cidr-lite perl-net-dns perl-net-http perl-net-ident perl-net-server perl-net-ssleay \ perl-padwalker \ perl-par-dist \ perl-pod-readme perl-poe-xs-queue-array \ perl-return-value \ perl-scgi perl-soap-lite \ perl-storable \ perl-sys-hostname-long \ perl-sys-syscall \ perl-template-toolkit \ perl-term-readkey perl-term-readline-gnu \ perl-text-diff \ perl-timedate \ perl-time-hires \ perl-unicode-map perl-unicode-string \ perl-universal-moniker \ perl-unix-syslog \ perl-uri \ perl-version \ perl-wakeonlan \ perl-www-mechanize \ perl-xml-dom perl-xml-parser perl-xml-parser-lite perl-xml-regexp \ perl-yaml-syck \ ack \ amavisd-new \ colordiff \ cowsay \ ddclient \ ipcalc \ perlbal \ perlconsole \ postgrey \ rsnapshot \ slimrat \ slimserver squeezecenter \ spamassassin \ stow \ PYTHON_PACKAGES = \ bzr bzr-rewrite bzr-svn bzrtools \ cherokee-pyscgi \ deluge deluge-develop \ dir2ogg \ dstat \ getmail \ gitosis \ hellanzb \ hplip \ iotop \ ipython \ mailman \ mod-python mod-wsgi \ offlineimap \ pyload \ pssh putmail \ pygments pyrex \ sabnzbd sabnzbdplus \ scons \ stgit \ subvertpy \ py-4suite py-amara py-apsw \ py-asn1-modules py-asn1 py-cairo py-cffi py-characteristic py-cparser \ py-cryptography py-cython py-enum34 py-hgdistver py-ordereddict py-service-identity py-six \ py-beaker py-bittorrent py-bluez py-boto py-buildutils \ py-celementtree py-chardet py-cheetah py-cherrypy py-cherrytemplate py-cjson \ py-clips py-configobj py-constraint py-crypto py-cups py-curl \ py-decorator py-decoratortools py-dispatcher py-django py-docutils py-duplicity \ py-elementtree py-feedparser py-flup py-formencode \ py-gdchart2 py-gd py-genshi py-geoip py-gnosis-utils py-gobject2 py-gtk \ py-idna py-imaplib2 py-ipaddress py-jinja2 \ py-hgsubversion py-hgsvn py-jsmin py-kid py-lepl py-lxml \ py-mako py-markdown py-mercurial \ py-moin py-mssql py-mutagen py-mx-base py-mysql \ py-myghty \ py-nose \ py-openssl py-openzwave py-paramiko \ py-paste py-pastedeploy py-pastescript py-pastewebkit \ py-pexpect py-pil py-pip py-ply py-protocols \ py-pgsql py-psycopg py-psycopg2 py-pygresql \ py-pudge py-pylons py-pyro py-quixote \ py-rdiff-backup py-redis py-requests py-tornado \ py-reportlab py-routes py-roundup py-ruledispatch \ py-scgi py-selector py-serial py-setuptools \ py-silvercity py-simplejson py-simpy py-slimit py-soappy \ py-sqlalchemy py-sqlite py-sqlobject py-statlib \ py-tailor py-tgfastdata py-trac py-urllib3 \ py-turbocheetah py-turbogears py-turbojson py-turbokid \ py-urwid py-usb py-weatherget py-webpy py-wsgiref py-webhelpers \ py-xdg py-xml py-yaml py-yenc py-zope-interface \ py-twisted py-axiom py-epsilon py-mantissa py-nevow \ ERLANG_PACKAGES = \ erlang erl-yaws erl-ejabberd \ # removed asterisk-chan-capi, doesn't build because of asterisk-stage problems ASTERISK_PACKAGES = \ asterisk10 \ asterisk11 \ asterisk11-chan-dongle \ asterisk13 \ asterisk14-core-sounds-en-alaw \ asterisk14-core-sounds-en-g729 \ asterisk14-core-sounds-en-gsm \ asterisk14-core-sounds-en-ulaw \ asterisk14-extra-sounds-en-alaw \ asterisk14-extra-sounds-en-g729 \ asterisk14-extra-sounds-en-gsm \ asterisk14-extra-sounds-en-ulaw \ asterisk14-moh-freeplay-alaw \ asterisk14-moh-freeplay-g729 \ asterisk14-moh-freeplay-gsm \ asterisk14-moh-freeplay-ulaw \ asterisk14-moh-opsound-alaw \ asterisk14-moh-opsound-g729 \ asterisk14-moh-opsound-gsm \ asterisk14-moh-opsound-ulaw \ asterisk-gui \ asterisk18 \ PACKAGES_REQUIRE_LINUX26 = \ inotail \ lm-sensors \ module-init-tools \ sysfsutils \ varnish \ PACKAGES_ONLY_WORK_ON_LINUX24 = \ modutils \ spindown \ BOOST_PACKAGES = \ libtorrent-rasterbar \ mkvtoolnix \ player \ OPENJDK_PACKAGES = \ openjdk7 openjdk8 \ bubbleupnpserver-installer GCCGO_PACKAGES = \ gotty \ shell2http \ GOLANG_PACKAGES = \ rclone \ syncthing \ # libao - has runtime trouble? COMMON_PACKAGES = \ $(PACKAGES_REQUIRE_LINUX26) \ 6relayd 9base \ abook adduser adns aget aiccu alac-decoder \ alsa-lib alsa-oss alsa-utils \ amule analog antinat apcupsd \ apache apr apr-util \ arc aria2 arping arpwatch aspell \ $(ASTERISK_PACKAGES) \ at at-spi2-core atftp atk atk-bridge atop attr audiofile autoconf \ automake automake1.4 automake1.9 automake1.10 automake1.14 autossh avahi \ bacula bash bash-completion bc bftpd \ bind bip bison bitchx bitlbee \ bogofilter boost $(BOOST_PACKAGES) bridge-utils \ bsdgames bsdmainutils \ btpd busybox byrequest bzflag bzip2 \ bluez-libs bluez-utils bluez-hcidump \ bluez2-libs bluez2-utils bvi \ c-ares cabextract cacerts jre-cacerts cadaver cairo calc calcurse castget \ catdoc ccollect ccrypt ccxstream cdargs \ cdrtools centerim cuetools \ cherokee chicken chillispot chromaprint chrpath cksfv \ classpath clamav clearsilver climm clips cmake cmdftp collectd \ confuse connect coreutils corkscrew cpio cppunit cpufrequtils cron cryptcat \ cscope csync2 ctags ctcs ctorrent ctrlproxy \ cups cups-filters cups-pdf cvs \ cyrus-imapd cyrus-sasl \ daemonize dansguardian dash davtools \ dbus dbus-glib dbus-python \ dcled dcraw delegate denyhosts dev-pts devio devmem2 dfu-util \ dhcp dialog dict digitemp dircproxy distcc \ diffstat diffutils discount \ dmsetup dnscrypt-proxy dnsmasq dnstracer dokuwiki dos2unix dosfstools dovecot \ dropbear dropbear-android drraw dspam dtach duktape dump \ e2fsprogs e2tools eaccelerator easy-rsa ed ecl electric-fence elinks \ elementary-xfce-icon-theme \ emacs22 encfs endian enhanced-ctorrent enscript esmtp esniper \ ettercap ettercap-ng \ $(ERLANG_PACKAGES) \ esound eggdrop eventlog exif exo expat extract-xiso ez-ipupdate \ faad2 fake-hwclock fann fatresize fatsort fbcat fcgi fconfig \ fdupes fetchmail ffmpeg ffmpegthumbnailer \ ficy file finch findutils firedrill-httptunnel \ fis fish fixesext flac flex flip \ fontconfig \ fossil-scm \ freecell freeradius freetds freetype freeze \ fribidi ftpcopy fslint ftpd-topfield fuppes fuse fuse-exfat \ gambit-c gawk gcal gconv-modules gdb gdbm gdchart \ ged gedit geoip gerbera gettext gdk-pixbuf \ ggrab ghostscript ghostscript-fonts git gkrellmd glib glib-networking gnet gnokii gnome-icon-theme \ gnome-icon-theme-symbolic \ gnu-httptunnel gnu-smalltalk gnugo \ gnupg1 gnupg gnuplot gnutls gpgme \ gloox gobject-introspection golang $(GCCGO_PACKAGES) $(GOLANG_PACKAGES) gpsd \ grep groff gsasl gsnmp gtmess gtypist gutenprint gzip \ gphoto2 libgphoto2 \ gift giftcurs gift-ares gift-fasttrack gift-gnutella \ gift-openft gift-opennap gtk gtk2 gtksourceview gtksourceview2 gsettings-desktop-schemas \ haproxy harfbuzz haserl hd2u hdparm hello hexcurse heyu \ hiawatha hicolor-icon-theme hnb hping htop httping \ ice icecast ices0 icu \ id3lib ifstat iftop ii iksemel imagemagick imap \ inadyn indent inetutils \ inferno \ ink inputproto \ ipac-ng iperf ipkg-web iptables iptraf iputils-arping \ ircd-hybrid irssi ivorbis-tools \ jabberd jamvm jed jfsutils jikes jove joe \ kamailio kbproto keychain kismet kissdx knock \ lame launchtool lcd4linux ldconfig ldd lddtree leafnode less lftp lha \ liba52 libacl libao libart libass libassuan libatomic-ops libbt libcap \ libcapi20 libcdio libconfig libcroco libcurl \ libdaemon libdb libdb52 libdlna \ libdvb libdvbpsi libdvdnav libdvdread libdrm \ libebml libexosip2 \ libepoxy libevent \ libesmtp libexif libexplain libfdk-aac libffi libftdi \ libgc libgcrypt libgd libghttp libgmp libgpg-error libgssapi \ libglade libhid \ libical \ libid3tag libidn libieee1284 libijs libinklevel libjansson libjbigkit libjpeg libjson-c \ libksba liblcms liblcms2 libmaa libmad libmatroska libmediainfo libmemcache libmemcached libmicrohttpd \ libmcrypt libmm $(strip $(if $(filter true, $(NO_LIBNSL)), , libnsl)) \ libmms libmnl libmpc libmpcdec libmpdclient libmpeg2 libmpfr libmrss libmtp \ libnetfilter-acct libnetfilter-conntrack libnetfilter-log libnetfilter-queue libnfnetlink libnettle libnl libnxml \ libol libogg libosip2 libopensync libopenzwave libopus libotr libpam \ libpar2 libpcap libpeas libpng libpth librsync librsvg \ libsamplerate libserf libshout libsigc++ libsoup libsndfile libsodium libsoxr libstdc++ libgo \ libtasn1 libtheora libtiff libtirpc libtool libtorrent \ libubox libunistring libupnp libupnp6 libusb libusb1 libuv libvncserver \ libvorbis libvorbisidec libwebsockets libxfce4ui libxfce4util libxkbcommon libxml2 libxslt libzen libzip \ lighttpd lirc links2 linksys-tftp linphone littlesmalltalk llink \ logrotate lookat loudmouth lrzsz lsof ltrace \ lua luarocks lxappearance lxde-icon-theme \ lynx lzo \ m4 mac madplay make man man-pages mc mcabber md5deep mdadm \ mediainfo mediatomb mediawiki meganz-sdk megatools memcached mesalib metalog memtester \ mg miau microcom microdc2 microperl mimms \ minicom minidlna minidlna-rescan minihttpd miniupnpd \ mini-sendmail mini-snmpd \ miscfiles mktemp mktorrent mlocate moblock \ moc modutils monit most motif motion motor mousepad \ mod-fastcgi moe moreutils mp3blaster mp3info mpack mpage \ mpc mpd mpdscribble \ mpg123 mplayer mpop mrtg msmtp \ msort msynctool mt-daapd mt-daapd-svn mtools \ mtr multitail mussh mutt mxml \ myrapbook \ mysql mysql5 mysql-connector-odbc \ nagg nagios-plugins nail nano nanoblogger nbench-byte \ ncdu ncftp ncmpc ncurses ncursesw nd ne \ neon net-snmp net-tools netatalk netcat nethack netio netrik \ newsbeuter newt \ nfs-server nfs-utils \ nget nginx ngrep nickle ninvaders nload \ nmap nmon node node010 noip nostromo nrpe \ ntfs-3g ntfsprogs \ ntop ntp ntpclient nttcp nut nvi nylon nzbget nzbget-testing \ ocaml oleo open2300 $(OPENJDK_PACKAGES) \ openobex obexftp \ opendchub openjpeg openldap opensips \ openssl openssh sshfs sshguard openvpn oscam \ optware-devel ossp-js oww owwlog \ p7zip p910nd pal palantir pango parted \ par2cmdline patch patchutils \ pcal pcapsipdump pciutils pcre pcsc-lite pen perltgd $(PERL_PACKAGES) pinentry pixman \ phoneme-advanced \ php php-apache php-geoip php-imagick php-opcache php-thttpd php-memcached phpmyadmin \ picocom picolisp pkgconfig plowshare poco polipo pop3proxy poppler \ popt poptop portmap postgresql postfix pound powertop \ ppower ppp printproto privoxy procmail \ procps proftpd proxytunnel psmisc psutils pthread-stubs puppy pure-ftpd pv pwgen \ python python24 python25 python26 python27 python3 $(PYTHON_PACKAGES) \ qemacs qemu qemu-libc-i386 qpdf qpopper quagga quickie quilt \ radiusclient-ng rc rc5pipe rcs rdate \ readline re2c recode recordext recordprotos \ redir renderext renderproto rhtvision rkhunter \ rlfe rlwrap rox-filer rpcbind rrdcollect rrdtool \ rssh rsstail rsync rtmpdump rtorrent rtpproxy ruby rubygems rxtx \ sablevm samba samba2 samba34 samba35 samba36 sane-backends \ scli scponly screen scrobby scsi-idle sd-idle sdl sdparm \ sed sendmail ser ser2net setserial setpwc sg3-utils shared-mime-info \ sharutils shellinabox shntool silc-client simh sipcalc siproxd sispmctl \ slang slrn slsc \ sm smartmontools smstools3 snort snownews \ socat softethervpn softflowd sox spandsp spawn-fcgi speex speexdsp spindown splix \ sqlite sqlite2 \ sqsh squeak squid squid3 squeezelite \ srelay srecord srtp ssam sslh sslwrap start-stop-daemon \ strace strongswan stunnel streamripper \ stupid-ftpd sudo surfraw swi-prolog svn \ swig syslog-ng sysstat syx \ taged taglib talloc tar tcl tcpwrappers tftp-hpa \ tcpdump tcpflow tcsh telldus-core termcap tesseract-ocr \ texinfo textutils thttpd thunar \ tig tin tinyproxy tinyscheme tmsnc tmux tnef tnftp tnftpd \ toppyweb tor torsocks torrent torrentflux transcode \ transmission \ transmissiond transmissiondcfp tre tree trickle \ tshark tsocks ttf-bitstream-vera tz tzwatch \ ucl udev udns udpxy uemacs ulogd unarj uncia unfs3 unionfs-fuse units unixodbc \ unrar unrtf \ unzip up-imapproxy updatedd upslug2 \ upx usb-modeswitch usbutils ushare utelnetd utf8proc util-linux \ vblade vdr-mediamvp vim vitetris vlc \ vnstat vorbis-tools vorbisgain vpnc vsftpd vte vtun \ w3cam w3m wayland wakelan wavpack webalizer weechat werc wget \ which whois wizd wpa-supplicant wput wxbase \ xerces-c xmlrpc-c xmlstarlet \ x11 xau xauth xaw xbitmaps compositeproto libxcomposite xcursor xdg-utils xdmcp xdpyinfo xext xdamage xinerama xineramaproto xshmfence \ xextensions xfixes xfixesproto xft xi xinetd pciaccess \ xmu xp xpdf xpm xcb-proto xcb xextproto xfconf xorg-macros xproto xrender xt xterm xtrans xtst \ damageproto dri2proto dri3proto glproto presentproto \ x264 xmail xupnpd xvid xz-utils \ yafc yasm yawk yougrabber \ zile zip zlib znc zoo zsh zsync \ glibc-opt glibc-locale binutils libc-dev gcc ipkg-static \ # php-fcgi ipk is now built from php.mk # libiconv - has been made obsolete by gconv-modules # Metalog - has been made obsolete by syslog-ng PACKAGES_OBSOLETED = cogito erl-escript libiconv metalog monotone \ perl-spamassassin perl-mime-base64 jabber tzcode \ ############## HOST_MACHINE:=$(shell \ if test x86_64 = `uname -m` -a 32-bit = `file /sbin/init | awk '{print $$3}'`; then echo i386 ; else uname -m; fi \ | sed -e 's/i[3-9]86/i386/' ) HOST_OS:=$(shell uname) # extract number of jobs passed through the command line MAKE_JOBS:=$(shell \ ps T | grep "^\s*$(shell echo $$PPID).*$(MAKE)" | \ sed -e 's/--jobs=/--jobs /g' -e 's/--jobs/-j/g' -e 's/[ \t][\t ]*/ /g' -e 's/-j /-j/g' -n -e 's/.* -j\([^ ]*\).*/\1/p') # Directory location definitions OPTWARE_TOP=$(shell if ! grep -q ^OPTWARE_TOP= ./Makefile; then cd ..; fi; pwd) BASE_DIR:=$(shell pwd) SOURCE_DIR=$(BASE_DIR)/sources DL_DIR=$(BASE_DIR)/downloads TOOL_BUILD_DIR=$(BASE_DIR)/toolchain PACKAGE_DIR=$(BASE_DIR)/packages BUILD_DIR=$(BASE_DIR)/builds STAGING_DIR=$(BASE_DIR)/staging STAGING_PREFIX=$(STAGING_DIR)$(TARGET_PREFIX) STAGING_INCLUDE_DIR=$(STAGING_PREFIX)/include STAGING_LIB_DIR=$(STAGING_PREFIX)/lib STAGING_CPPFLAGS=$(TARGET_CFLAGS) -I$(STAGING_INCLUDE_DIR) STAGING_LDFLAGS=$(TARGET_LDFLAGS) -L$(STAGING_LIB_DIR) -Wl,-rpath,$(TARGET_PREFIX)/lib -Wl,-rpath-link,$(STAGING_LIB_DIR) HOST_BUILD_DIR=$(BASE_DIR)/host/builds HOST_STAGING_DIR=$(BASE_DIR)/host/staging HOST_STAGING_PREFIX=$(HOST_STAGING_DIR)/opt HOST_STAGING_INCLUDE_DIR=$(HOST_STAGING_PREFIX)/include HOST_STAGING_LIB_DIR=$(HOST_STAGING_PREFIX)/lib HOST_STAGING_CPPFLAGS=-I$(HOST_STAGING_INCLUDE_DIR) HOST_STAGING_LDFLAGS=-L$(HOST_STAGING_LIB_DIR) -Wl,-rpath,$(HOST_STAGING_LIB_DIR) -Wl,-rpath-link,$(HOST_STAGING_LIB_DIR) WHAT_TO_DO_WITH_IPK_DIR=rm -rf # WHAT_TO_DO_WITH_IPK_DIR=: keep export TMPDIR=$(BASE_DIR)/tmp ############## all: directories toolchain packages TARGET_OPTIMIZATION=-O2 #-mtune=xscale -march=armv4 -Wa,-mcpu=xscale TARGET_DEBUGGING= #-g include $(OPTWARE_TOP)/platforms/toolchain-$(OPTWARE_TARGET).mk DEFAULT_TARGET_PREFIX ?= /opt TARGET_PREFIX ?= /opt INSTALL = TARGET_PREFIX=$(TARGET_PREFIX) $(SHELL) $(BASE_DIR)/scripts/install.sh PATCH = TARGET_PREFIX=$(TARGET_PREFIX) $(SHELL) $(BASE_DIR)/scripts/patch.sh ifndef TARGET_USRLIBDIR TARGET_USRLIBDIR = $(TARGET_LIBDIR) endif ifeq (darwin,$(TARGET_OS)) SHLIB_EXT=dylib SO= DYLIB=.dylib else # default linux SHLIB_EXT=so SO=.so DYLIB= endif include $(OPTWARE_TOP)/platforms/packages-$(OPTWARE_TARGET).mk ifeq ($(LIBC_STYLE), uclibc) include $(OPTWARE_TOP)/platforms/packages-uclibc.mk else LIBC_STYLE=glibc endif PACKAGES = $(filter-out \ $(BROKEN_PACKAGES) \ , $(COMMON_PACKAGES) $(SPECIFIC_PACKAGES)) ifneq (, $(filter ipkg-static ipkg-opt $(OPTWARE_TARGET)-bootstrap $(OPTWARE_TARGET)-optware-bootstrap, $(PACKAGES))) UPD-ALT_PREFIX ?= $(TARGET_PREFIX) endif testing: $(MAKE) PACKAGES="$(PACKAGES_READY_FOR_TESTING)" all $(PERL) -w scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) --objdump-path=$(TARGET_CROSS)objdump --base-dir=$(BASE_DIR) $(patsubst %,$(BUILD_DIR)/%*.ipk,$(PACKAGES_READY_FOR_TESTING)) # Common tools which may need overriding CVS=cvs SUDO=sudo WGET_BINARY=wget CREATE_CHECKSUM=0 ifeq ($(CREATE_CHECKSUM), 1) WGET = TOP=$(BASE_DIR)/scripts WGET=$(WGET_BINARY) CREATE_CHECKSUM=1 $(SHELL) $(BASE_DIR)/scripts/wget.sh --passive-ftp --tries=2 --no-check-certificate else WGET = TOP=$(BASE_DIR)/scripts WGET=$(WGET_BINARY) $(SHELL) $(BASE_DIR)/scripts/wget.sh --passive-ftp --tries=2 --no-check-certificate endif PERL=perl # Required host-tools, which will build if they missing HOST_TOOL_GCC33 = $(MAKE) gcc-host-stage GCC_VERSION=3.3.6 HOST_TOOL_ACLOCAL = \ $(MAKE) directories automake-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_AUTOMAKE = \ $(MAKE) directories automake-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_ACLOCAL1.14 = \ $(MAKE) directories automake1.14-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_AUTOMAKE1.14 = \ $(MAKE) directories automake1.14-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_ACLOCAL1.10 = \ $(MAKE) directories automake1.10-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_AUTOMAKE1.10 = \ $(MAKE) directories automake1.10-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_ACLOCAL1.9 = \ $(MAKE) directories automake1.9-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_AUTOMAKE1.9 = \ $(MAKE) directories automake1.9-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_ACLOCAL1.4 = \ $(MAKE) directories automake1.4-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage HOST_TOOL_AUTOMAKE1.4 = \ $(MAKE) directories automake1.4-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage # These are aclocal wrappers used to automatically fix # libtool versions mismatch issue that can occur with # some software in most cases ACLOCAL1.15_SH= TOP=$(BASE_DIR) ACLOCAL=$(HOST_STAGING_PREFIX)/bin/aclocal-1.15 \ $(SHELL) $(BASE_DIR)/scripts/aclocal.sh ACLOCAL1.14_SH= TOP=$(BASE_DIR) ACLOCAL=$(HOST_STAGING_PREFIX)/bin/aclocal-1.14 \ $(SHELL) $(BASE_DIR)/scripts/aclocal.sh ACLOCAL1.10_SH= TOP=$(BASE_DIR) ACLOCAL=$(HOST_STAGING_PREFIX)/bin/aclocal-1.10 \ $(SHELL) $(BASE_DIR)/scripts/aclocal.sh ACLOCAL1.9_SH= TOP=$(BASE_DIR) ACLOCAL=$(HOST_STAGING_PREFIX)/bin/aclocal-1.9 \ $(SHELL) $(BASE_DIR)/scripts/aclocal.sh ACLOCAL1.4_SH= TOP=$(BASE_DIR) ACLOCAL=$(HOST_STAGING_PREFIX)/bin/aclocal-1.4 \ $(SHELL) $(BASE_DIR)/scripts/aclocal.sh # These should be called instead of `autoreconf` AUTORECONF1.15 = (cd $(BASE_DIR) && $(HOST_TOOL_AUTOMAKE)) && \ mkdir -p $(STAGING_PREFIX)/share/aclocal && \ $(subst %,$(HOST_STAGING_PREFIX)/bin/, \ AUTOCONF=%autoconf \ AUTOHEADER=%autoheader \ AUTOMAKE=%automake-1.15 \ AUTOPOINT=%autopoint \ LIBTOOLIZE=%libtoolize \ M4=%m4 \ ACLOCAL='$(ACLOCAL1.15_SH) -I $(STAGING_PREFIX)/share/aclocal' \ %autoreconf) AUTORECONF1.14 = (cd $(BASE_DIR) && $(HOST_TOOL_AUTOMAKE1.14)) && \ mkdir -p $(STAGING_PREFIX)/share/aclocal && \ $(subst %,$(HOST_STAGING_PREFIX)/bin/, \ AUTOCONF=%autoconf \ AUTOHEADER=%autoheader \ AUTOMAKE=%automake-1.14 \ AUTOPOINT=%autopoint \ LIBTOOLIZE=%libtoolize \ M4=%m4 \ ACLOCAL='$(ACLOCAL1.14_SH) -I $(STAGING_PREFIX)/share/aclocal' \ %autoreconf) AUTORECONF1.10 =(cd $(BASE_DIR) && $(HOST_TOOL_AUTOMAKE1.10)) && \ mkdir -p $(STAGING_PREFIX)/share/aclocal && \ $(subst %,$(HOST_STAGING_PREFIX)/bin/, \ AUTOCONF=%autoconf \ AUTOHEADER=%autoheader \ AUTOMAKE=%automake-1.10 \ AUTOPOINT=%autopoint \ LIBTOOLIZE=%libtoolize \ M4=%m4 \ ACLOCAL='$(ACLOCAL1.10_SH) -I $(STAGING_PREFIX)/share/aclocal' \ %autoreconf) AUTORECONF1.9 = (cd $(BASE_DIR) && $(HOST_TOOL_AUTOMAKE1.9)) && \ mkdir -p $(STAGING_PREFIX)/share/aclocal && \ $(subst %,$(HOST_STAGING_PREFIX)/bin/, \ AUTOCONF=%autoconf \ AUTOHEADER=%autoheader \ AUTOMAKE=%automake-1.9 \ AUTOPOINT=%autopoint \ LIBTOOLIZE=%libtoolize \ M4=%m4 \ ACLOCAL='$(ACLOCAL1.9_SH) -I $(STAGING_PREFIX)/share/aclocal' \ %autoreconf) AUTORECONF1.4 = (cd $(BASE_DIR) && $(HOST_TOOL_AUTOMAKE1.4)) && \ mkdir -p $(STAGING_PREFIX)/share/aclocal && \ $(subst %,$(HOST_STAGING_PREFIX)/bin/, \ AUTOCONF=%autoconf \ AUTOHEADER=%autoheader \ AUTOMAKE=%automake-1.4 \ AUTOPOINT=%autopoint \ LIBTOOLIZE=%libtoolize \ M4=%m4 \ ACLOCAL='$(ACLOCAL1.4_SH) -I $(STAGING_PREFIX)/share/aclocal' \ %autoreconf) host-automake-tools: directories automake1.4-host-stage automake1.9-host-stage automake1.10-host-stage automake1.14-host-stage automake-host-stage autoconf-host-stage pkgconfig-host-stage m4-host-stage libtool-host-stage # The hostname or IP number of our local dl.sf.net mirror SOURCEFORGE_MIRROR=downloads.sourceforge.net #SOURCES_NLO_SITE=http://sources.nslu2-linux.org/sources #SOURCES_NLO_SITE=http://ftp.osuosl.org/pub/nslu2/sources SOURCES_NLO_SITE=http://ipkg.nslu2-linux.org/sources # FreeBSD distfiles site FREEBSD_DISTFILES=ftp://ftp.fi.freebsd.org/pub/FreeBSD/ports/distfiles # Perl CPAN mirror: # use this instead of search.cpan.org, since search.cpan.org # contains only recent versions PERL_CPAN_SITE=ftp.auckland.ac.nz TARGET_CXX=$(TARGET_CROSS)g++ TARGET_CC=$(TARGET_CROSS)gcc TARGET_GCCGO=$(TARGET_CROSS)gccgo TARGET_CPP="$(TARGET_CC) -E" TARGET_LD=$(TARGET_CROSS)ld TARGET_AR=$(TARGET_CROSS)ar TARGET_AS=$(TARGET_CROSS)as TARGET_NM=$(TARGET_CROSS)nm TARGET_OBJDUMP=$(TARGET_CROSS)objdump TARGET_RANLIB=$(TARGET_CROSS)ranlib TARGET_READELF=$(TARGET_CROSS)readelf TARGET_STRIP?=$(TARGET_CROSS)strip TARGET_CONFIGURE_OPTS= \ AR=$(TARGET_AR) \ AS=$(TARGET_AS) \ LD=$(TARGET_LD) \ NM=$(TARGET_NM) \ OBJDUMP=$(TARGET_OBJDUMP) \ CC=$(TARGET_CC) \ CPP=$(TARGET_CPP) \ GCC=$(TARGET_CC) \ CXX=$(TARGET_CXX) \ RANLIB=$(TARGET_RANLIB) \ STRIP=$(TARGET_STRIP) \ PKG_CONFIG=$(OPTWARE_TOP)/scripts/pkg-config.sh CMAKE_CONFIGURE_OPTS= \ -DCMAKE_VERBOSE_MAKEFILE=TRUE \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_VERSION=1 \ -DCMAKE_CROSSCOMPILING=1 \ -DCMAKE_SYSTEM_PROCESSOR=$(TARGET_ARCH) \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \ -DCMAKE_C_COMPILER="$(TARGET_CC)" \ -DCMAKE_C_COMPILER_ARG1="" \ -DCMAKE_CXX_COMPILER="$(TARGET_CXX)" \ -DCMAKE_CXX_COMPILER_ARG1="" \ -DCMAKE_ASM_COMPILER="$(TARGET_CC)" \ -DCMAKE_ASM_COMPILER_ARG1="" \ -DCMAKE_AR=$(TARGET_AR) \ -DCMAKE_NM=$(TARGET_NM) \ -DCMAKE_RANLIB=$(TARGET_RUNLIB) \ -DPKG_CONFIG_EXECUTABLE=$(OPTWARE_TOP)/scripts/pkg-config.sh \ -DCMAKE_FIND_ROOT_PATH="$(STAGING_PREFIX);$(TARGET_CROSS_TOP)" \ -DCMAKE_LIBRARY_PATH=$(STAGING_LIB_DIR) \ -DCMAKE_INCLUDE_PATH=$(STAGING_INCLUDE_DIR) \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_STRIP=: \ -DCMAKE_INSTALL_PREFIX=$(TARGET_PREFIX) \ -DDL_LIBRARY=$(STAGING_DIR) \ -DCMAKE_PREFIX_PATH=$(STAGING_DIR) \ -DCMAKE_SKIP_RPATH=TRUE TARGET_GOARCH=$(strip \ $(if $(filter buildroot-armeabi-ng buildroot-armeabihf buildroot-armv5eabi-ng buildroot-armv5eabi-ng-legacy, $(OPTWARE_TARGET)), arm, \ $(if $(filter buildroot-i686, $(OPTWARE_TARGET)), 386, \ $(if $(filter buildroot-mipsel-ng, $(OPTWARE_TARGET)), mipsle, \ $(if $(filter buildroot-ppc-603e ct-ng-ppc-e500v2, $(OPTWARE_TARGET)), ppc, \ $(if $(filter buildroot-x86_64, $(OPTWARE_TARGET)), amd64, \ $(TARGET_ARCH))))))) CROSS_GCCGO_GOROOT ?= $(TARGET_CROSS_TOP)/$(EXACT_TARGET_NAME) TARGET_GCCGO_GO_ENV= \ GCCGO=$(TARGET_GCCGO) \ GOROOT=$(CROSS_GCCGO_GOROOT) \ GOARCH=$(TARGET_GOARCH) \ CC=$(TARGET_CC) \ CXX=$(TARGET_CXX) TARGET_PATH=$(STAGING_PREFIX)/bin:$(STAGING_DIR)/bin:$(TARGET_PREFIX)/bin:$(TARGET_PREFIX)/sbin:/bin:/sbin:/usr/bin:/usr/sbin STRIP_COMMAND ?= $(TARGET_STRIP) --remove-section=.comment --remove-section=.note --strip-unneeded PATCH_LIBTOOL=$(SHELL) $(OPTWARE_TOP)/scripts/patch_libtool.sh -i \ -e 's|^sys_lib_search_path_spec=.*"$$|sys_lib_search_path_spec="$(TARGET_LIBDIR) $(STAGING_LIB_DIR)"|' \ -e 's|^sys_lib_dlsearch_path_spec=.*"$$|sys_lib_dlsearch_path_spec=""|' \ -e 's|^hardcode_libdir_flag_spec=.*"$$|hardcode_libdir_flag_spec=""|' \ -e 's|nmedit |$(TARGET_CROSS)nmedit |' \ # Clear these variables to remove assumptions AR= AS= LD= NM= CC= GCC= CXX= RANLIB= STRIP= LD_LIBRARY_PATH= PACKAGES_CLEAN:=$(patsubst %,%-clean,$(PACKAGES)) PACKAGES_SOURCE:=$(patsubst %,%-source,$(PACKAGES)) PACKAGES_DIRCLEAN:=$(patsubst %,%-dirclean,$(PACKAGES)) PACKAGES_STAGE:=$(patsubst %,%-stage,$(PACKAGES)) PACKAGES_IPKG:=$(patsubst %,%-ipk,$(PACKAGES)) $(PACKAGES) : directories toolchain $(PACKAGES_STAGE) : directories toolchain %-stage : directories toolchain $(PACKAGES_IPKG) : directories toolchain ipkg-utils %-ipk : directories toolchain ipkg-utils .PHONY: index index: $(HOST_STAGING_DIR)/bin/ipk_indexer_html_sorted.sh $(PACKAGE_DIR)/Packages $(PACKAGE_DIR)/Packages.html boost-packages: $(BOOST_PACKAGES) boost-packages-ipk: $(patsubst %, %-ipk, $(BOOST_PACKAGES)) boost-packages-dirclean: $(patsubst %, %-dirclean, $(BOOST_PACKAGES)) boost-packages-check: $(patsubst %, %-check, $(BOOST_PACKAGES)) test-build: rm -f builds/failed.log ifneq ($(MAKE_JOBS), ) for package in $(PACKAGES); do \ $(MAKE) $${package}-ipk -j$(MAKE_JOBS) || (echo "$${package}" >> builds/failed.log); \ done else for package in $(PACKAGES); do \ $(MAKE) $${package}-ipk || (echo "$${package}" >> builds/failed.log); \ done endif ifeq ($(PACKAGE_DIR),$(BASE_DIR)/packages) ifeq (,$(findstring -bootstrap,$(SPECIFIC_PACKAGES))) $(PACKAGE_DIR)/Packages $(PACKAGE_DIR)/Packages.html: $(BUILD_DIR)/*.ipk else $(PACKAGE_DIR)/Packages $(PACKAGE_DIR)/Packages.html: $(BUILD_DIR)/*.ipk $(BUILD_DIR)/*.xsh endif if ls $(BUILD_DIR)/*_$(TARGET_ARCH).xsh > /dev/null 2>&1; then \ rm -f $(@D)/*_$(TARGET_ARCH).xsh ; \ cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).xsh $(@D)/ ; \ fi rm -f $(@D)/*_$(TARGET_ARCH).ipk cp -fal $(BUILD_DIR)/*_$(TARGET_ARCH).ipk $(@D)/ else $(PACKAGE_DIR)/Packages $(PACKAGE_DIR)/Packages.html: endif { \ cd $(PACKAGE_DIR); \ $(IPKG_MAKE_INDEX) . > Packages; \ gzip -c Packages > Packages.gz; \ $(IPK_INDEXER_MAKE_HTML_INDEX); \ } @echo "ALL DONE." packages: $(PACKAGES_IPKG) ifneq ($(MAKE_JOBS), ) $(MAKE) index -j$(MAKE_JOBS) else $(MAKE) index endif package-only: $(PACKAGES_IPKG) .PHONY: all clean dirclean distclean directories packages source toolchain \ buildroot-toolchain libuclibc++-toolchain \ autoclean \ check-dependencies \ $(PACKAGES) $(PACKAGES_SOURCE) $(PACKAGES_DIRCLEAN) \ $(PACKAGES_STAGE) $(PACKAGES_IPKG) \ query-% query-%: @echo $($(*)) TARGET_CC_VER = $(shell test -x "$(TARGET_CC)" && $(TARGET_CC) -dumpversion) include $(shell ls make/*.mk) .NOTPARALLEL: %/.configured %/.built %/.staged %.ipk %/.packaged directories: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(STAGING_PREFIX) \ $(STAGING_LIB_DIR) $(STAGING_INCLUDE_DIR) $(TOOL_BUILD_DIR) \ $(PACKAGE_DIR) $(TMPDIR) $(STAGING_PREFIX)/lib64 $(DL_DIR): mkdir $(DL_DIR) $(BUILD_DIR): mkdir $(BUILD_DIR) $(STAGING_DIR): mkdir $(STAGING_DIR) $(STAGING_PREFIX): mkdir -p $(STAGING_PREFIX) $(STAGING_LIB_DIR): mkdir $(STAGING_LIB_DIR) $(STAGING_INCLUDE_DIR): mkdir $(STAGING_INCLUDE_DIR) $(TOOL_BUILD_DIR): mkdir $(TOOL_BUILD_DIR) $(PACKAGE_DIR): mkdir $(PACKAGE_DIR) $(TMPDIR): mkdir $(TMPDIR) $(STAGING_PREFIX)/lib64: ln -sf lib $(STAGING_PREFIX)/lib64 source: $(PACKAGES_SOURCE) check-packages: @$(PERL) -w scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) --objdump-path=$(TARGET_CROSS)objdump --base-dir=$(BASE_DIR) $(filter-out $(BUILD_DIR)/crosstool-native-%,$(wildcard $(BUILD_DIR)/*.ipk)) check-dependencies: @rm -rf test @mkdir test @READELF=$(TARGET_READELF) PACKAGESDIR=packages TEST=test scripts/dependencies_check.sh autoclean: $(PERL) -w scripts/optware-autoclean.pl -v -C $(BASE_DIR) clean: $(TARGETS_CLEAN) $(PACKAGES_CLEAN) find . -name '*~' -print | xargs /bin/rm -f find . -name '.*~' -print | xargs /bin/rm -f find . -name '.#*' -print | xargs /bin/rm -f dirclean: $(PACKAGES_DIRCLEAN) distclean: cd $(OPTWARE_TOP) rm -rf $(BUILD_DIR) $(STAGING_DIR) $(PACKAGE_DIR) rm -rf host rm -rf `ls platforms/toolchain-*.mk | sed 's|^platforms/toolchain-\(.*\)\.mk$$|\1|'` toolclean: rm -rf $(TOOL_BUILD_DIR) %-savespace: scripts/clean-workdir.sh $* host/.configured: [ -d $(HOST_BUILD_DIR) ] || ( \ if [ "$(OPTWARE_TARGET)" = $(shell basename $(BASE_DIR)) ]; \ then mkdir -p ../host; ln -s ../host .; \ else mkdir -p host; \ fi; \ mkdir -p $(HOST_BUILD_DIR) $(HOST_STAGING_PREFIX); \ ) [ -e $@ ] || touch $@ ifeq ($(DEFAULT_TARGET_PREFIX), $(TARGET_PREFIX)) DIRNAME_SUFFIX= else DIRNAME_SUFFIX=$(shell echo $(TARGET_PREFIX) | sed 's/[^a-zA-Z]/-/g') endif ifneq ($(DEFAULT_TARGET_PREFIX), $(TARGET_PREFIX)) %-target %$(DIRNAME_SUFFIX)/.configured: [ -e ${DL_DIR} ] || mkdir -p ${DL_DIR} [ -e $*$(DIRNAME_SUFFIX)/Makefile ] || ( \ mkdir -p $*$(DIRNAME_SUFFIX) ; \ cd $*$(DIRNAME_SUFFIX) ; \ echo "OPTWARE_TARGET=$*" > Makefile ; \ echo "TARGET_PREFIX=$(TARGET_PREFIX)" >> Makefile ; \ echo "include ../Makefile" >> Makefile ; \ ln -s ../downloads downloads ; \ ln -s ../make make ; \ ln -s ../scripts scripts ; \ ln -s ../sources sources ; \ ) touch $*$(DIRNAME_SUFFIX)/.configured else %-target %/.configured: [ -e ${DL_DIR} ] || mkdir -p ${DL_DIR} [ -e $*/Makefile ] || ( \ mkdir -p $* ; \ cd $* ; \ echo "OPTWARE_TARGET=$*" > Makefile ; \ echo "include ../Makefile" >> Makefile ; \ ln -s ../downloads downloads ; \ ln -s ../make make ; \ ln -s ../scripts scripts ; \ ln -s ../sources sources ; \ ) touch $*/.configured endif make/%.mk: PKG_UP=$$(echo $* | tr [a-z\-] [A-Z_]); \ sed -e "s/<foo>/$*/g" -e "s/<FOO>/$${PKG_UP}/g" \ -e '6,11d' make/template.mk > $@ ifeq ($(OPTWARE_TOP), $(BASE_DIR)) # Use this to build *all* feeds (all targets from `cat Optware_targets_list`) OPTWARE_BUILD_TARGETS:=$(shell echo `cat Optware_targets_list`) ifneq ($(DEFAULT_TARGET_PREFIX), $(TARGET_PREFIX)) %/.configured: [ -e ${DL_DIR} ] || mkdir -p ${DL_DIR} [ -e $*/Makefile ] || ( \ mkdir -p $* ; \ cd $* ; \ echo "OPTWARE_TARGET=$*" > Makefile ; \ echo "include ../Makefile" >> Makefile ; \ ln -s ../downloads downloads ; \ ln -s ../make make ; \ ln -s ../scripts scripts ; \ ln -s ../sources sources ; \ ) touch $*/.configured endif %-feed: %/.configured ifneq ($(MAKE_JOBS), ) $(MAKE) -C $* directories -j$(MAKE_JOBS) $(MAKE) -C $* host/.configured -j$(MAKE_JOBS) $(MAKE) -C $* ipkg-utils -j$(MAKE_JOBS) $(MAKE) -C $* toolchain -j$(MAKE_JOBS) $(MAKE) -C $* packages -j$(MAKE_JOBS) else $(MAKE) -C $* directories $(MAKE) -C $* host/.configured $(MAKE) -C $* ipkg-utils $(MAKE) -C $* toolchain $(MAKE) -C $* packages endif %-feed-build: %/.configured ifneq ($(MAKE_JOBS), ) $(MAKE) -C $* directories -j$(MAKE_JOBS) $(MAKE) -C $* host/.configured -j$(MAKE_JOBS) $(MAKE) -C $* ipkg-utils -j$(MAKE_JOBS) $(MAKE) -C $* toolchain -j$(MAKE_JOBS) $(MAKE) -C $* package-only -j$(MAKE_JOBS) else $(MAKE) -C $* directories $(MAKE) -C $* host/.configured $(MAKE) -C $* ipkg-utils $(MAKE) -C $* toolchain $(MAKE) -C $* package-only endif %-feed-test-build: %/.configured ifneq ($(MAKE_JOBS), ) $(MAKE) -C $* directories -j$(MAKE_JOBS) $(MAKE) -C $* host/.configured -j$(MAKE_JOBS) $(MAKE) -C $* ipkg-utils -j$(MAKE_JOBS) $(MAKE) -C $* toolchain -j$(MAKE_JOBS) $(MAKE) -C $* test-build -j$(MAKE_JOBS) else $(MAKE) -C $* directories $(MAKE) -C $* host/.configured $(MAKE) -C $* ipkg-utils $(MAKE) -C $* toolchain $(MAKE) -C $* test-build endif allfeeds: $(patsubst %,%-feed,$(OPTWARE_BUILD_TARGETS)) endif
{'repo_name': 'Optware/Optware-ng', 'stars': '238', 'repo_language': 'Makefile', 'file_name': 'createinstance.sh', 'mime_type': 'text/x-shellscript', 'hash': 6413286331060122876, 'source_dataset': 'data'}
/* @author Tony Beltramelli www.tonybeltramelli.com - created 05/09/15 */ $(document).ready(function(){main();}); var LOCAL_SERVER_ADDRESS = "swat:serverAddress"; var LOCAL_SERVER_PORT = "swat:serverPort"; var serverAddress; var serverPort; function main () { $("main").hide(); serverAddress = localStorage.getItem(LOCAL_SERVER_ADDRESS); serverPort = localStorage.getItem(LOCAL_SERVER_PORT); if(serverAddress) $("#serverAddress").val(serverAddress); if(serverPort) $("#serverPort").val(serverPort); $("#saveButton").click(function(e){ serverAddress = $("#serverAddress").val(); serverPort = $("#serverPort").val(); localStorage.setItem(LOCAL_SERVER_ADDRESS, serverAddress); localStorage.setItem(LOCAL_SERVER_PORT, serverPort); $(this).parent().hide(); $("main").show(); }); $(".keypad li").on("touchstart", function(e){ timestamp = Date.now(); e.stopPropagation(); e.preventDefault(); $(this).css({ background: "#1caaff", color: "#fcfcfc" }); var label = $(this).find("span").text().charCodeAt(0); send(timestamp, label); }); $(".keypad li").on("touchend", function(e){ $(this).css({ background: "#fcfcfc", color: "#1caaff" }); }); } function send(timestamp, label) { var data = { sensor_name: "labels", data_points:[{ timestamp: timestamp, label: label }] }; $.ajax({ url: serverAddress+":"+serverPort, type: "POST", data: JSON.stringify(data), contentType: "text/plain" }); }
{'repo_name': 'tonybeltramelli/Deep-Spying', 'stars': '172', 'repo_language': 'Python', 'file_name': 'FeatureExtractor.py', 'mime_type': 'text/x-python', 'hash': -877517969601131695, 'source_dataset': 'data'}
 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qztest", "qztest.vcproj", "{7632B767-D089-4F15-8B1E-C4B3F9EBF592}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "..\quazip\quazip.vcproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.ActiveCfg = Debug|Win32 {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.Build.0 = Debug|Win32 {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.ActiveCfg = Release|Win32 {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.Build.0 = Release|Win32 {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
{'repo_name': 'yiminyangguang520/qt', 'stars': '464', 'repo_language': 'C++', 'file_name': 'QSpinBoxDemo.pro', 'mime_type': 'text/plain', 'hash': 6485214060889665375, 'source_dataset': 'data'}
/* * Copyright (c) 1998, 2017, 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 com.sun.tools.jdi; import com.sun.jdi.ByteType; import com.sun.jdi.InvalidTypeException; import com.sun.jdi.PrimitiveValue; import com.sun.jdi.VirtualMachine; public class ByteTypeImpl extends PrimitiveTypeImpl implements ByteType { ByteTypeImpl(VirtualMachine vm) { super(vm); } public String signature() { return String.valueOf((char)JDWP.Tag.BYTE); } PrimitiveValue convert(PrimitiveValue value) throws InvalidTypeException { return vm.mirrorOf(((PrimitiveValueImpl)value).checkedByteValue()); } }
{'repo_name': 'openjdk/jdk', 'stars': '2204', 'repo_language': 'Java', 'file_name': 'fttype1.c', 'mime_type': 'text/x-c', 'hash': -4679544142480291781, 'source_dataset': 'data'}
<?php $_PLUGIN_CONFIG['LANG'] = array( 'NAME'=>'Quick Links', 'DESCRIPTION'=>'Quick access to the administration panel.', 'HOME'=>'Home', 'DASHBOARD'=>'Dashboard', 'NEW_SIMPLE_POST'=>'New Simple post', 'NEW_VIDEO_POST'=>'New Video post', 'NEW_QUOTE_POST'=>'New Quote post' ); ?>
{'repo_name': 'dignajar/nibbleblog', 'stars': '220', 'repo_language': 'PHP', 'file_name': 'da_DK.bit', 'mime_type': 'text/x-php', 'hash': 7022101256700028900, 'source_dataset': 'data'}
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kendra/types" smithy "github.com/awslabs/smithy-go" "github.com/awslabs/smithy-go/middleware" smithyhttp "github.com/awslabs/smithy-go/transport/http" ) // Searches an active index. Use this API to search your documents using query. The // Query operation enables to do faceted search and to filter results based on // document attributes. It also enables you to provide user context that Amazon // Kendra uses to enforce document access control in the search results. Amazon // Kendra searches your index for text content and question and answer (FAQ) // content. By default the response contains three types of results. // // * // Relevant passages // // * Matching FAQs // // * Relevant documents // // You can // specify that the query return only one type of result using the // QueryResultTypeConfig parameter. func (c *Client) Query(ctx context.Context, params *QueryInput, optFns ...func(*Options)) (*QueryOutput, error) { stack := middleware.NewStack("Query", smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } addawsAwsjson11_serdeOpQueryMiddlewares(stack) awsmiddleware.AddRequestInvocationIDMiddleware(stack) smithyhttp.AddContentLengthMiddleware(stack) AddResolveEndpointMiddleware(stack, options) v4.AddComputePayloadSHA256Middleware(stack) retry.AddRetryMiddlewares(stack, options) addHTTPSignerV4Middleware(stack, options) awsmiddleware.AddAttemptClockSkewMiddleware(stack) addClientUserAgent(stack) smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) smithyhttp.AddCloseResponseBodyMiddleware(stack) addOpQueryValidationMiddleware(stack) stack.Initialize.Add(newServiceMetadataMiddleware_opQuery(options.Region), middleware.Before) addRequestIDRetrieverMiddleware(stack) addResponseErrorMiddleware(stack) for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err := handler.Handle(ctx, params) if err != nil { return nil, &smithy.OperationError{ ServiceID: ServiceID, OperationName: "Query", Err: err, } } out := result.(*QueryOutput) out.ResultMetadata = metadata return out, nil } type QueryInput struct { // Provides information that determines how the results of the query are sorted. // You can set the field that Amazon Kendra should sort the results on, and specify // whether the results should be sorted in ascending or descending order. In the // case of ties in sorting the results, the results are sorted by relevance. If you // don't provide sorting configuration, the results are sorted by the relevance // that Amazon Kendra determines for the result. SortingConfiguration *types.SortingConfiguration // The unique identifier of the index to search. The identifier is returned in the // response from the operation. IndexId *string // The text to search for. QueryText *string // Enables filtered searches based on document attributes. You can only provide one // attribute filter; however, the AndAllFilters, NotFilter, and OrAllFilters // parameters contain a list of other filters. The AttributeFilter parameter // enables you to create a set of filtering rules that a document must satisfy to // be included in the query results. AttributeFilter *types.AttributeFilter // Query results are returned in pages the size of the PageSize parameter. By // default, Amazon Kendra returns the first page of results. Use this parameter to // get result pages after the first one. PageNumber *int32 // Sets the number of results that are returned in each page of results. The // default page size is 10. The maximum number of results returned is 100. If you // ask for more than 100 results, only 100 are returned. PageSize *int32 // An array of documents attributes. Amazon Kendra returns a count for each // attribute key specified. You can use this information to help narrow the search // for your user. Facets []*types.Facet // Sets the type of query. Only results for the specified query type are returned. QueryResultTypeFilter types.QueryResultType // An array of document attributes to include in the response. No other document // attributes are included in the response. By default all document attributes are // included in the response. RequestedDocumentAttributes []*string } type QueryOutput struct { // The results of the search. ResultItems []*types.QueryResultItem // Contains the facet results. A FacetResult contains the counts for each attribute // key that was specified in the Facets input parameter. FacetResults []*types.FacetResult // The number of items returned by the search. Use this to determine when you have // requested the last set of results. TotalNumberOfResults *int32 // The unique identifier for the search. You use QueryId to identify the search // when using the feedback API. QueryId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata } func addawsAwsjson11_serdeOpQueryMiddlewares(stack *middleware.Stack) { stack.Serialize.Add(&awsAwsjson11_serializeOpQuery{}, middleware.After) stack.Deserialize.Add(&awsAwsjson11_deserializeOpQuery{}, middleware.After) } func newServiceMetadataMiddleware_opQuery(region string) awsmiddleware.RegisterServiceMetadata { return awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "Query", } }
{'repo_name': 'aws/aws-sdk-go-v2', 'stars': '606', 'repo_language': 'Go', 'file_name': 'endpoints.go', 'mime_type': 'text/plain', 'hash': -487197765045750301, 'source_dataset': 'data'}
# logging for XMLTV importer # # One can simply use # import log # print>>log, "Some text" # because the log unit looks enough like a file! import sys from cStringIO import StringIO import threading logfile = None # Need to make our operations thread-safe. mutex = None size = None def open(buffersize = 16384): global logfile, mutex, size if logfile is None: logfile = StringIO() mutex = threading.Lock() size = buffersize def write(data): global logfile, mutex mutex.acquire() try: if logfile.tell() > size: # Do a sort of 16k round robin logfile.reset() logfile.write(data) finally: mutex.release() sys.stdout.write(data) def getvalue(): global logfile, mutex mutex.acquire() try: pos = logfile.tell() head = logfile.read() logfile.reset() tail = logfile.read(pos) finally: mutex.release() return head + tail def close(): global logfile if logfile: logfile.close() logfile = None
{'repo_name': 'openatv/enigma2', 'stars': '123', 'repo_language': 'Python', 'file_name': 'Makefile.am', 'mime_type': 'text/x-makefile', 'hash': -3771811874328461270, 'source_dataset': 'data'}
/* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* @(#) $Id$ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H #include "zlib.h" #ifdef STDC # include <stddef.h> # include <string.h> # include <stdlib.h> #endif #ifdef NO_ERRNO_H extern int errno; #else # include <errno.h> #endif #ifndef local # define local static #endif /* compile with -Dlocal if your debugger can't find static symbols */ typedef unsigned char uch; typedef uch FAR uchf; typedef unsigned short ush; typedef ush FAR ushf; typedef unsigned long ulg; #define ERR_RETURN(strm,err) \ return (strm->msg = (char*)ERR_MSG(err), (err)) /* To be used only when the state is known to be valid */ /* common constants */ #ifndef DEF_WBITS # define DEF_WBITS MAX_WBITS #endif /* default windowBits for decompression. MAX_WBITS is for compression only */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default memLevel */ #define STORED_BLOCK 0 #define STATIC_TREES 1 #define DYN_TREES 2 /* The three kinds of block type */ #define MIN_MATCH 3 #define MAX_MATCH 258 /* The minimum and maximum match lengths */ #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ /* target dependencies */ #ifdef MSDOS # define OS_CODE 0x00 # if defined(__TURBOC__) || defined(__BORLANDC__) # if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) /* Allow compilation with ANSI keywords only enabled */ void _Cdecl farfree( void *block ); void *_Cdecl farmalloc( unsigned long nbytes ); # else # include <alloc.h> # endif # else /* MSC or DJGPP */ # endif #endif #ifdef OS2 # define OS_CODE 0x06 #endif #ifdef WIN32 /* Window 95 & Windows NT */ # define OS_CODE 0x0b #endif #if defined(VAXC) || defined(VMS) # define OS_CODE 0x02 # define F_OPEN(name, mode) \ ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") #endif #ifdef AMIGA # define OS_CODE 0x01 #endif #if defined(ATARI) || defined(atarist) # define OS_CODE 0x05 #endif #if defined(MACOS) || defined(TARGET_OS_MAC) # define OS_CODE 0x07 # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include <unix.h> /* for fdopen */ # else # ifndef fdopen # define fdopen(fd,mode) NULL /* No fdopen() */ # endif # endif #endif #ifdef __50SERIES /* Prime/PRIMOS */ # define OS_CODE 0x0F #endif #ifdef TOPS20 # define OS_CODE 0x0a #endif #if defined(_BEOS_) || defined(RISCOS) # define fdopen(fd,mode) NULL /* No fdopen() */ #endif #if (defined(_MSC_VER) && (_MSC_VER > 600)) # define fdopen(fd,type) _fdopen(fd,type) #endif /* Common defaults */ #ifndef OS_CODE # define OS_CODE 0x03 /* assume Unix */ #endif #ifndef F_OPEN # define F_OPEN(name, mode) ft_fopen((name), (mode)) #endif /* functions */ #ifdef HAVE_STRERROR extern char *strerror OF((int)); # define zstrerror(errnum) strerror(errnum) #else # define zstrerror(errnum) "" #endif #if defined(pyr) # define NO_MEMCPY #endif #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) /* Use our own functions for small and medium model with MSC <= 5.0. * You may have to use the same strategy for Borland C (untested). * The __SC__ check is for Symantec. */ # define NO_MEMCPY #endif #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) # define HAVE_MEMCPY #endif #ifdef HAVE_MEMCPY # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ # define zmemcpy _fmemcpy # define zmemcmp _fmemcmp # define zmemzero(dest, len) _fmemset(dest, 0, len) # else # define zmemcpy ft_memcpy # define zmemcmp ft_memcmp # define zmemzero(dest, len) ft_memset(dest, 0, len) # endif #else extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); extern void zmemzero OF((Bytef* dest, uInt len)); #endif /* Diagnostic functions */ #ifdef DEBUG # include <stdio.h> extern int z_verbose; extern void z_error OF((char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} # define Tracevv(x) {if (z_verbose>1) fprintf x ;} # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} #else # define Assert(cond,msg) # define Trace(x) # define Tracev(x) # define Tracevv(x) # define Tracec(c,x) # define Tracecv(c,x) #endif typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len)); local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); local void zcfree OF((voidpf opaque, voidpf ptr)); #define ZALLOC(strm, items, size) \ (*((strm)->zalloc))((strm)->opaque, (items), (size)) #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} #endif /* _Z_UTIL_H */
{'repo_name': 'musescore/MuseScore', 'stars': '4930', 'repo_language': 'C++', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': 8331715330205794949, 'source_dataset': 'data'}
/* * This file is part of Player Analytics (Plan). * * Plan is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License v3 as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Plan 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 Plan. If not, see <https://www.gnu.org/licenses/>. */ package com.djrapitops.plan.gathering.listeners.bukkit; import com.djrapitops.plan.delivery.domain.Nickname; import com.djrapitops.plan.gathering.cache.NicknameCache; import com.djrapitops.plan.identification.ServerInfo; import com.djrapitops.plan.storage.database.DBSystem; import com.djrapitops.plan.storage.database.transactions.events.NicknameStoreTransaction; import com.djrapitops.plan.utilities.logging.ErrorContext; import com.djrapitops.plan.utilities.logging.ErrorLogger; import com.djrapitops.plugin.logging.L; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; import javax.inject.Inject; import java.util.UUID; /** * Event Listener for AsyncPlayerChatEvents. * * @author Rsl1122 */ public class ChatListener implements Listener { private final ServerInfo serverInfo; private final DBSystem dbSystem; private final NicknameCache nicknameCache; private final ErrorLogger errorLogger; @Inject public ChatListener( ServerInfo serverInfo, DBSystem dbSystem, NicknameCache nicknameCache, ErrorLogger errorLogger ) { this.serverInfo = serverInfo; this.dbSystem = dbSystem; this.nicknameCache = nicknameCache; this.errorLogger = errorLogger; } @EventHandler(priority = EventPriority.MONITOR) public void onChat(AsyncPlayerChatEvent event) { if (event.isCancelled()) { return; } try { actOnChatEvent(event); } catch (Exception e) { errorLogger.log(L.ERROR, e, ErrorContext.builder().related(event).build()); } } private void actOnChatEvent(AsyncPlayerChatEvent event) { long time = System.currentTimeMillis(); Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); String displayName = player.getDisplayName(); dbSystem.getDatabase().executeTransaction(new NicknameStoreTransaction( uuid, new Nickname(displayName, time, serverInfo.getServerUUID()), (playerUUID, name) -> nicknameCache.getDisplayName(playerUUID).map(name::equals).orElse(false) )); } }
{'repo_name': 'plan-player-analytics/Plan', 'stars': '252', 'repo_language': 'Java', 'file_name': 'BungeeSystemTest.java', 'mime_type': 'text/x-java', 'hash': 8589519079060256299, 'source_dataset': 'data'}
#!/usr/bin/env python # # Public Domain 2014-2019 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # In jurisdictions that recognize copyright laws, the author or authors # of this software dedicate any and all copyright interest in the # software to the public domain. We make this dedication for the benefit # of the public at large and to the detriment of our heirs and # successors. We intend this dedication to be an overt act of # relinquishment in perpetuity of all present and future rights to this # software under copyright law. # # 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 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. import wiredtiger, wttest from wtdataset import SimpleDataSet from helper import copy_wiredtiger_home # test_bug014.py # JIRA WT-2115: fast-delete pages can be incorrectly lost due to a crash. class test_bug014(wttest.WiredTigerTestCase): def test_bug014(self): # Populate a table with 1000 keys on small pages. uri = 'table:test_bug014' ds = SimpleDataSet(self, uri, 1000, config='allocation_size=512,leaf_page_max=512') ds.populate() # Reopen it so we can fast-delete pages. self.reopen_conn() # Truncate a chunk of the key/value pairs inside a transaction. self.session.begin_transaction(None) start = self.session.open_cursor(uri, None) start.set_key(ds.key(250)) end = self.session.open_cursor(uri, None) end.set_key(ds.key(500)) self.session.truncate(None, start, end, None) start.close() end.close() # With the truncation uncommitted, checkpoint the database. ckpt_session = self.conn.open_session() ckpt_session.checkpoint(None) ckpt_session.close() # Simulate a crash by copying to a new directory. copy_wiredtiger_home(".", "RESTART") # Open the new directory. conn = self.setUpConnectionOpen("RESTART") session = self.setUpSessionOpen(conn) cursor = session.open_cursor(uri) # Confirm all of the records are there. for i in range(1, 1001): cursor.set_key(ds.key(i)) self.assertEqual(cursor.search(), 0) conn.close() if __name__ == '__main__': wttest.run()
{'repo_name': 'wiredtiger/wiredtiger', 'stars': '1562', 'repo_language': 'C', 'file_name': '__init__.py', 'mime_type': 'text/x-python', 'hash': -2473140215707633304, 'source_dataset': 'data'}
{ "type": "minecraft:crafting_shaped", "group": "carpet", "pattern": [ "###", "#$#", "###" ], "key": { "#": { "item": "minecraft:white_carpet" }, "$": { "item": "minecraft:green_dye" } }, "result": { "item": "minecraft:green_carpet", "count": 8 } }
{'repo_name': 'dotnetGame/MineCase', 'stars': '466', 'repo_language': 'C#', 'file_name': 'cyan.json', 'mime_type': 'text/plain', 'hash': -8505639403623078809, 'source_dataset': 'data'}
/*! @file Forward declares `boost::hana::remove_range` and `boost::hana::remove_range_c`. @copyright Louis Dionne 2013-2016 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_FWD_REMOVE_RANGE_HPP #define BOOST_HANA_FWD_REMOVE_RANGE_HPP #include <boost/hana/config.hpp> #include <boost/hana/core/when.hpp> #include <cstddef> BOOST_HANA_NAMESPACE_BEGIN //! Remove the elements inside a given range of indices from a sequence. //! @ingroup group-Sequence //! //! `remove_range` returns a new sequence identical to the original, //! except that elements at indices in the provided range are removed. //! Specifically, `remove_range([x0, ..., xn], from, to)` is a new //! sequence equivalent to `[x0, ..., x_from-1, x_to, ..., xn]`. //! //! //! @note //! The behavior is undefined if the range contains any index out of the //! bounds of the sequence. //! //! //! @param xs //! A sequence from which elements are removed. //! //! @param [from, to) //! An half-open interval of `IntegralConstant`s representing the indices //! of the elements to be removed from the sequence. The `IntegralConstant`s //! in the half-open interval must be non-negative and in the bounds of //! the sequence. The half-open interval must also be valid, meaning that //! `from <= to`. //! //! //! Example //! ------- //! @include example/remove_range.cpp #ifdef BOOST_HANA_DOXYGEN_INVOKED constexpr auto remove_range = [](auto&& xs, auto const& from, auto const& to) { return tag-dispatched; }; #else template <typename S, typename = void> struct remove_range_impl : remove_range_impl<S, when<true>> { }; struct remove_range_t { template <typename Xs, typename From, typename To> constexpr auto operator()(Xs&& xs, From const& from, To const& to) const; }; constexpr remove_range_t remove_range{}; #endif //! Equivalent to `remove_range`; provided for convenience. //! @ingroup group-Sequence //! //! //! Example //! ------- //! @include example/remove_range_c.cpp #ifdef BOOST_HANA_DOXYGEN_INVOKED template <std::size_t from, std::size_t to> constexpr auto remove_range_c = [](auto&& xs) { return hana::remove_range(forwarded(xs), hana::size_c<from>, hana::size_c<to>); }; #else template <std::size_t from, std::size_t to> struct remove_range_c_t; template <std::size_t from, std::size_t to> constexpr remove_range_c_t<from, to> remove_range_c{}; #endif BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_FWD_REMOVE_RANGE_HPP
{'repo_name': 'textileio/photos', 'stars': '236', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -2561474514802215682, 'source_dataset': 'data'}
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.apis.graphics; import android.os.Bundle; import android.app.Dialog; import android.content.Context; import android.graphics.*; import android.view.MotionEvent; import android.view.View; public class ColorPickerDialog extends Dialog { public interface OnColorChangedListener { void colorChanged(int color); } private OnColorChangedListener mListener; private int mInitialColor; private static class ColorPickerView extends View { private Paint mPaint; private Paint mCenterPaint; private final int[] mColors; private OnColorChangedListener mListener; ColorPickerView(Context c, OnColorChangedListener l, int color) { super(c); mListener = l; mColors = new int[] { 0xFFFF0000, 0xFFFF00FF, 0xFF0000FF, 0xFF00FFFF, 0xFF00FF00, 0xFFFFFF00, 0xFFFF0000 }; Shader s = new SweepGradient(0, 0, mColors, null); mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setShader(s); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(32); mCenterPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mCenterPaint.setColor(color); mCenterPaint.setStrokeWidth(5); } private boolean mTrackingCenter; private boolean mHighlightCenter; @Override protected void onDraw(Canvas canvas) { float r = CENTER_X - mPaint.getStrokeWidth()*0.5f; canvas.translate(CENTER_X, CENTER_X); canvas.drawOval(new RectF(-r, -r, r, r), mPaint); canvas.drawCircle(0, 0, CENTER_RADIUS, mCenterPaint); if (mTrackingCenter) { int c = mCenterPaint.getColor(); mCenterPaint.setStyle(Paint.Style.STROKE); if (mHighlightCenter) { mCenterPaint.setAlpha(0xFF); } else { mCenterPaint.setAlpha(0x80); } canvas.drawCircle(0, 0, CENTER_RADIUS + mCenterPaint.getStrokeWidth(), mCenterPaint); mCenterPaint.setStyle(Paint.Style.FILL); mCenterPaint.setColor(c); } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(CENTER_X*2, CENTER_Y*2); } private static final int CENTER_X = 100; private static final int CENTER_Y = 100; private static final int CENTER_RADIUS = 32; private int floatToByte(float x) { int n = java.lang.Math.round(x); return n; } private int pinToByte(int n) { if (n < 0) { n = 0; } else if (n > 255) { n = 255; } return n; } private int ave(int s, int d, float p) { return s + java.lang.Math.round(p * (d - s)); } private int interpColor(int colors[], float unit) { if (unit <= 0) { return colors[0]; } if (unit >= 1) { return colors[colors.length - 1]; } float p = unit * (colors.length - 1); int i = (int)p; p -= i; // now p is just the fractional part [0...1) and i is the index int c0 = colors[i]; int c1 = colors[i+1]; int a = ave(Color.alpha(c0), Color.alpha(c1), p); int r = ave(Color.red(c0), Color.red(c1), p); int g = ave(Color.green(c0), Color.green(c1), p); int b = ave(Color.blue(c0), Color.blue(c1), p); return Color.argb(a, r, g, b); } private int rotateColor(int color, float rad) { float deg = rad * 180 / 3.1415927f; int r = Color.red(color); int g = Color.green(color); int b = Color.blue(color); ColorMatrix cm = new ColorMatrix(); ColorMatrix tmp = new ColorMatrix(); cm.setRGB2YUV(); tmp.setRotate(0, deg); cm.postConcat(tmp); tmp.setYUV2RGB(); cm.postConcat(tmp); final float[] a = cm.getArray(); int ir = floatToByte(a[0] * r + a[1] * g + a[2] * b); int ig = floatToByte(a[5] * r + a[6] * g + a[7] * b); int ib = floatToByte(a[10] * r + a[11] * g + a[12] * b); return Color.argb(Color.alpha(color), pinToByte(ir), pinToByte(ig), pinToByte(ib)); } private static final float PI = 3.1415926f; @Override public boolean onTouchEvent(MotionEvent event) { float x = event.getX() - CENTER_X; float y = event.getY() - CENTER_Y; boolean inCenter = java.lang.Math.sqrt(x*x + y*y) <= CENTER_RADIUS; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mTrackingCenter = inCenter; if (inCenter) { mHighlightCenter = true; invalidate(); break; } case MotionEvent.ACTION_MOVE: if (mTrackingCenter) { if (mHighlightCenter != inCenter) { mHighlightCenter = inCenter; invalidate(); } } else { float angle = (float)java.lang.Math.atan2(y, x); // need to turn angle [-PI ... PI] into unit [0....1] float unit = angle/(2*PI); if (unit < 0) { unit += 1; } mCenterPaint.setColor(interpColor(mColors, unit)); invalidate(); } break; case MotionEvent.ACTION_UP: if (mTrackingCenter) { if (inCenter) { mListener.colorChanged(mCenterPaint.getColor()); } mTrackingCenter = false; // so we draw w/o halo invalidate(); } break; } return true; } } public ColorPickerDialog(Context context, OnColorChangedListener listener, int initialColor) { super(context); mListener = listener; mInitialColor = initialColor; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); OnColorChangedListener l = new OnColorChangedListener() { public void colorChanged(int color) { mListener.colorChanged(color); dismiss(); } }; setContentView(new ColorPickerView(getContext(), l, mInitialColor)); setTitle("Pick a Color"); } }
{'repo_name': 'Miserlou/Android-SDK-Samples', 'stars': '265', 'repo_language': 'Java', 'file_name': 'strings.xml', 'mime_type': 'text/xml', 'hash': -5361893934576945004, 'source_dataset': 'data'}
// // QuantumUI Variables // You must import bootstrap variabled // -------------------------------------------------- //== Import Bootstap variables // //## Import Bootstap variables @import "../../wwwroot/lib/bootstrap/scss/variables.scss"; //** Load fonts from this directory. $icon-font-path: "../../wwwroot/lib/bootstrap/fonts/"; //== Colors // //## Skin and brand colors for use across QuantumUI Bootstrap Skin. $skin-base-color: $gray-light; $skin-base-accent: lighten($brand-info, 10%); $skin-base-active: darken($brand-warning, 10%); $skin-base-50: tint(shade($skin-base-color, -48.5%), 97%); $skin-base-100: tint(shade($skin-base-color, -40%), 88%); $skin-base-200: tint(shade($skin-base-color, -30%), 60%); $skin-base-300: tint(shade($skin-base-color, -20%), 40%); $skin-base-400: tint(shade($skin-base-color, -10%), 20%); $skin-base-500: $skin-base-color; $skin-base-600: shade(tint($skin-base-color, -7.5%), 15%); $skin-base-700: shade(tint($skin-base-color, -15%), 30%); $skin-base-800: shade(tint($skin-base-color, -22.5%), 45%); $skin-base-900: shade(tint($skin-base-color, -33.5%), 67%); $skin-base-1000: shade(tint($skin-base-color, -40%), 80%); $skin-accent-50: tint(shade($skin-base-accent, -41.5%), 92%); $skin-accent-100: tint(shade($skin-base-accent, -35%), 74%); $skin-accent-200: tint(shade($skin-base-accent, -27%), 54%); $skin-accent-300: tint(shade($skin-base-accent, -14%), 28%); $skin-accent-400: $skin-base-accent; $skin-accent-700: shade(tint($skin-base-accent, -15%), 30%); $skin-active-50: tint(shade($skin-base-active, -47.5%), 95%); $skin-active-100: tint(shade($skin-base-active, -40%), 80%); $skin-active-200: tint(shade($skin-base-active, -27%), 54%); $skin-active-300: tint(shade($skin-base-active, -14%), 28%); $skin-active-400: $skin-base-active; $skin-active-700: shade(tint($skin-base-active, -15%), 30%); $white: #fff; $white-lighter: darken($white, 0.6%); $white-light: darken($white, 1.8%); $white-dark: darken($white, 3.3%); $white-darker: darken($white, 5.8%); //==Brand Shades // //## Brand colors for use across QuantumUI. $brand-primary-darker: shade(tint($brand-primary, -19%), 38%); $brand-primary-dark: shade(tint($brand-primary, -9%), 18%); $brand-primary-light: tint(shade($brand-primary, -9%), 18%); $brand-primary-lighter: tint(shade($brand-primary, -19%), 38%); $brand-info-darker: shade(tint($brand-info, -7.5%), 15%); $brand-info-dark: shade(tint($brand-info, -3.75%), 7.5%); $brand-info-light: tint(shade($brand-info, -9%), 18%); $brand-info-lighter: tint(shade($brand-info, -19%), 38%); $brand-success-darker: shade(tint($brand-success, -7.5%), 15%); $brand-success-dark: shade(tint($brand-success, -3.75%), 7.5%); $brand-success-light: tint(shade($brand-success, -9%), 18%); $brand-success-lighter: tint(shade($brand-success, -18%), 38%); $brand-warning-darker: shade(tint($brand-warning, -7.5%), 15%); $brand-warning-dark: shade(tint($brand-warning, -3.75%), 7.5%); $brand-warning-light: tint(shade($brand-warning, -9%), 18%); $brand-warning-lighter: tint(shade($brand-warning, -19%), 38%); $brand-danger-darker: shade(tint($brand-danger, -7.5%), 15%); $brand-danger-dark: shade(tint($brand-danger, -3.75%), 7.5%); $brand-danger-light: tint(shade($brand-danger, -9%), 18%); $brand-danger-lighter: tint(shade($brand-danger, -19%), 38%); //== Scaffolding // //## Settings for some of the most global styles. $font-size-largest: 21px; $font-size-smallest: ceil(($font-size-base * 0.7)); // ~10px //== Components // //## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). $line-height-largest: 1.18; $border-radius-largest: 8px; //** component font family. $component-font-family: 'Glyphicons Halflings'; $angle-icon: '\e259'; $angle-up-icon: '\e260'; $tick-icon: '\e013'; $info-icon: '\e086'; $danger-icon: '\e107'; $warning-icon: '\e101'; $caret-width-large: 5px; //== Dropdowns // //## Dropdown menu container and contents. $dropdown-min-width: 160px; $dropdown-box-shadow: 0 6px 12px rgba($skin-base-700, 2%/100.0%); $dropdown-caret-color: $skin-base-800; //** Background for the dropdown container. $dropdown-container-bg: $skin-base-100; $dropdown-container-box-shadow: 0 5px 10px rgba($skin-base-700, 2%/100.0%); $dropdown-container-box-shadow-top: 0 -5px 10px rgba($skin-base-700, 2%/100.0%); //** Dropdown container `border-color`. $dropdown-container-border: shade($dropdown-container-bg, 5.5%); $dropdown-container-fallback-border: shade($dropdown-container-bg, 5.5%); $dropdown-container-min-width: 170px; //** Dropdown container `max-width`. $dropdown-container-max-width: 360px; $dropdown-container-header-padding: 5px 7px; $dropdown-container-footer-padding: 5px 7px; $dropdown-container-header-color: $skin-base-800; $dropdown-container-footer-color: $skin-base-800; //-- Z-index master list // // Warning: Avoid customizing these values. They're used for a bird's eye view // of components dependent on the z-axis and are designed to all work together. // // Note: These variables are not generated into the Customizer. $zindex-dropdown: 1040; $zindex-aside: 1040; $zindex-modal: 1050; $zindex-titip: 9999; //== Tabs $nav-tabs-font-size: ($font-size-base - 1px); //== Modalbox // //## $modal-box-lg: 600px; $modal-box-md: 450px; $modal-box-sm: 250px; //== Carousel // //## $carousel-indicator-thumb-color: $skin-base-800; $carousel-indicator-thumb-bg: $skin-base-200; $carousel-indicator-thumb-border-color: $skin-base-300; $carousel-caption-color: #fff; $carousel-caption-bg: $skin-base-700; //== Scrollbar // //## //** general scrollbar size. $scrollbar-image-path: "../../images/scrollbar"; $scrollbar-size: 8px; //** page scrollbar size. $scrollbar-page-size: 12px; $scrollbar-offset: 5px; $scrollbar-color: #fff; $scrollbar-bg-color: rgba($skin-base-300, 30%/100.0%); $scrollbar-button-bg-color: rgba($skin-base-300, 50%/100.0%); $scrollbar-hover-bg-color: rgba($skin-base-300, 65%/100.0%); $scrollbar-border-color: lighten($skin-base-300, 35%); $scrollbar-track-border-radius: 6px; $scrollbar-track-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); $scrollbar-thumb-opacity: 0.9; $scrollbar-thumb-bg-color: $skin-base-600; $scrollbar-thumb-border-radius: 6px; $scrollbar-thumb-box-shadow: inset 3px 3px 9px rgba(255, 255, 255, 0.3), inset -3px -3px 9px rgba(255, 255, 255, 0.3); $scrollbar-thumb-box-shadow-hover: inset 3px 3px 9px rgba(0, 0, 0, 0.2), inset -3px -3px 9px rgba(0, 0, 0, 0.2); $scrollbar-thumb-filter-image: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 40%, rgba(0,0,0,0.1) 100%); $scrollbar-corner-bg-color: $skin-base-100; $scrollbar-corner-border-color: $scrollbar-corner-bg-color; //** quantum scrollbar settings $scrollbar-z-index: 9; $scrollbar-button-bg-color: $scrollbar-thumb-bg-color; $scrollbar-button-box-shadow: 1px 1px 2px 0px rgba(50, 50, 50, 0.3); $scrollbar-button-size: $scrollbar-size; $scrollbar-button-border-width: 4px; $scrollbar-button-border-color: rgba(255, 255, 255, 0.8); $scrollbar-info-bg : $brand-info-lighter; $scrollbar-info-color : $brand-info-lighter; $scrollbar-info-thumb-bg : $brand-info; $scrollbar-warning-bg : $brand-warning-lighter; $scrollbar-warning-color : $brand-warning-lighter; $scrollbar-warning-thumb-bg : $brand-warning-dark; $scrollbar-danger-bg : $brand-danger-lighter; $scrollbar-danger-color : $brand-danger-lighter; $scrollbar-danger-thumb-bg : $brand-danger; $scrollbar-success-bg : $brand-success-lighter; $scrollbar-success-color : $brand-success-lighter; $scrollbar-success-thumb-bg : $brand-success; //== with-arrow Utils // //## $with-arrow-border-width: 10px; $with-arrow-margin: $with-arrow-border-width; $with-arrow-offset: $with-arrow-border-width; $with-arrow-top-box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.175); $with-arrow-border-inner-color: #fff; $with-arrow-border-outer-color: #fff; //== titip pure CSS tooltip // //## $titip-tringle-width: 8px; $titip-bg: $skin-base-600; $titip-border-color: $skin-base-700; $titip-color: $skin-base-100; $titip-padding: 6px 9px 7px; $titip-font-size: 13px; $titip-line-height: 13px; $titip-radius: $border-radius-base; $titip-box-shadow: 1px 1px 7px 0px rgba(50, 50, 50, 0.09); //== input[type="range"] IE10+ and nq-range-slider // //## $range-height: 6px; $range-bg: $skin-base-50; $range-selection-bg: $skin-base-400; $range-thumb-border: $skin-base-500; $range-ticks-color: $skin-base-800; $range-ticks-border-color: $skin-base-100; $range-values-font-size: 11px; $range-thumb-width: 10px; $range-thumb-height: 20px; $range-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); $range-box-shadow-horizontal: inset 0 -1px 2px rgba(0, 0, 0, 0.1); $range-thumb-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); $range-height-xs: 4px; $range-thumb-width-xs: 8px; $range-thumb-height-xs: 16px; $range-height-md: 10px; $range-thumb-width-md: 14px; $range-thumb-height-md: 24px; $range-height-lg: 14px; $range-thumb-width-lg: 18px; $range-thumb-height-lg: 28px; $range-slider-size: 210px; $range-ticks-size: 12px; $range-primary-bg: $brand-primary-lighter; $range-primary-selection-bg: $brand-primary; $range-primary-border: $brand-primary-dark; $range-success-bg: $state-success-bg; $range-success-selection-bg: $brand-success; $range-success-border: $brand-success-dark; $range-info-bg: $state-info-bg; $range-info-selection-bg: $brand-info; $range-info-border: $brand-info-dark; $range-warning-bg: $state-warning-bg; $range-warning-selection-bg: $brand-warning; $range-warning-border: $brand-warning-dark; $range-danger-bg: $state-danger-bg; $range-danger-selection-bg: $brand-danger; $range-danger-border: $brand-danger-dark; //== calendars, datepicker, datetimepicker // //## $cal-panel-bg: #fff; $cal-panel-z-index: $listbox-z-index; $cal-panel-border-color: $skin-base-100; $cal-panel-color: $skin-base-900; $cal-active-bg: $skin-base-active; $cal-active-color: #fff; $cal-hover-bg: $skin-base-700; $cal-hover-color: #fff; $cal-panel-padding: 3px; $cal-panel-radius: $border-radius-base; $cal-panel-max-width: 270px; $cal-panel-font: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Sans", Arial, Helvetica, sans-serif; //cal-table $cal-table-bg: $skin-base-50; $cal-table-color: $cal-panel-color; $cal-table-border-color: $cal-panel-border-color; $cal-table-header-size: 25px; $cal-table-cell-size: 30px; $cal-table-cell-color: lighten($cal-panel-color, 12%); $cal-table-cell-hover-color: #fff; $cal-table-cell-hover-bg: $cal-hover-bg; //== aside // //## $aside-bg: $skin-base-700; $aside-overlay-bg: #fff; $aside-color: $skin-base-400; $aside-width: 220px; $aside-collapsed-width: 60px; $aside-font: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Sans", Arial, Helvetica, sans-serif; $aside-header-height: 35px; $aside-footer-height: 35px; $aside-transition-duration: 0.2s; /*aside menu*/ $aside-menu-color: $skin-base-400; $aside-menu-link-height: 40px; $aside-default-bg: $skin-base-100; $aside-default-overlay-bg: $skin-base-600; $aside-default-color: $skin-base-1000; $aside-default-menu-color: $skin-base-1000; //== listbox(select) // //## $listbox-max-height: 180px; $listbox-max-width: 350px; $listbox-color: $skin-base-800; $listbox-bg: #fff; $listbox-border-color: $skin-base-100; $listbox-font-size: ($font-size-base - 1px); $listbox-border-radius: $border-radius-base; $listbox-z-index: $zindex-dropdown; $listbox-option-hover-bg: $skin-accent-100; $listbox-option-hover-color: $skin-accent-700; $listbox-option-active-bg: $skin-base-active; $listbox-option-active-color: #fff; $listbox-highlight-color: $skin-base-active;
{'repo_name': 'quantumui/quantumui', 'stars': '205', 'repo_language': 'JavaScript', 'file_name': 'app.js', 'mime_type': 'text/plain', 'hash': 8583279639803710210, 'source_dataset': 'data'}
{ "type":"Program", "loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "range":[0,19], "body":[ { "type":"TypeAlias", "loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "range":[0,19], "id":{ "type":"Identifier", "loc":{"source":null,"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, "range":[5,6], "name":"A", "typeAnnotation":null, "optional":false }, "typeParameters":null, "right":{ "type":"FunctionTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "range":[9,19], "params":[ { "type":"FunctionTypeParam", "loc":{"source":null,"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, "range":[10,11], "name":null, "typeAnnotation":{ "type":"GenericTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, "range":[10,11], "id":{ "type":"Identifier", "loc":{"source":null,"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, "range":[10,11], "name":"B", "typeAnnotation":null, "optional":false }, "typeParameters":null }, "optional":false } ], "returnType":{ "type":"GenericTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "range":[17,18], "id":{ "type":"Identifier", "loc":{"source":null,"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "range":[17,18], "name":"C", "typeAnnotation":null, "optional":false }, "typeParameters":null }, "rest":null, "typeParameters":null } } ], "comments":[] }
{'repo_name': 'facebook/flow', 'stars': '20773', 'repo_language': 'OCaml', 'file_name': 'Dockerfile', 'mime_type': 'text/plain', 'hash': -6757080461151524024, 'source_dataset': 'data'}
// modify from // https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/blob/mmdetection/mmdet/ops/dcn/src/deform_conv_cuda.c #include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <THC/THC.h> #include <THC/THCDeviceUtils.cuh> #include <vector> #include <iostream> #include <cmath> void deformable_im2col(const at::Tensor data_im, const at::Tensor data_offset, const int channels, const int height, const int width, const int ksize_h, const int ksize_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int parallel_imgs, const int deformable_group, at::Tensor data_col); void deformable_col2im(const at::Tensor data_col, const at::Tensor data_offset, const int channels, const int height, const int width, const int ksize_h, const int ksize_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int parallel_imgs, const int deformable_group, at::Tensor grad_im); void deformable_col2im_coord( const at::Tensor data_col, const at::Tensor data_im, const at::Tensor data_offset, const int channels, const int height, const int width, const int ksize_h, const int ksize_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int parallel_imgs, const int deformable_group, at::Tensor grad_offset); void modulated_deformable_im2col_cuda( const at::Tensor data_im, const at::Tensor data_offset, const at::Tensor data_mask, const int batch_size, const int channels, const int height_im, const int width_im, const int height_col, const int width_col, const int kernel_h, const int kenerl_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int deformable_group, at::Tensor data_col); void modulated_deformable_col2im_cuda( const at::Tensor data_col, const at::Tensor data_offset, const at::Tensor data_mask, const int batch_size, const int channels, const int height_im, const int width_im, const int height_col, const int width_col, const int kernel_h, const int kenerl_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int deformable_group, at::Tensor grad_im); void modulated_deformable_col2im_coord_cuda( const at::Tensor data_col, const at::Tensor data_im, const at::Tensor data_offset, const at::Tensor data_mask, const int batch_size, const int channels, const int height_im, const int width_im, const int height_col, const int width_col, const int kernel_h, const int kenerl_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, const int deformable_group, at::Tensor grad_offset, at::Tensor grad_mask); void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput, at::Tensor weight, int kH, int kW, int dH, int dW, int padH, int padW, int dilationH, int dilationW, int group, int deformable_group) { AT_CHECK(weight.ndimension() == 4, "4D weight tensor (nOutputPlane,nInputPlane,kH,kW) expected, " "but got: %s", weight.ndimension()); AT_CHECK(weight.is_contiguous(), "weight tensor has to be contiguous"); AT_CHECK(kW > 0 && kH > 0, "kernel size should be greater than zero, but got kH: %d kW: %d", kH, kW); AT_CHECK((weight.size(2) == kH && weight.size(3) == kW), "kernel size should be consistent with weight, ", "but got kH: %d kW: %d weight.size(2): %d, weight.size(3): %d", kH, kW, weight.size(2), weight.size(3)); AT_CHECK(dW > 0 && dH > 0, "stride should be greater than zero, but got dH: %d dW: %d", dH, dW); AT_CHECK( dilationW > 0 && dilationH > 0, "dilation should be greater than 0, but got dilationH: %d dilationW: %d", dilationH, dilationW); int ndim = input.ndimension(); int dimf = 0; int dimh = 1; int dimw = 2; if (ndim == 4) { dimf++; dimh++; dimw++; } AT_CHECK(ndim == 3 || ndim == 4, "3D or 4D input tensor expected but got: %s", ndim); long nInputPlane = weight.size(1) * group; long inputHeight = input.size(dimh); long inputWidth = input.size(dimw); long nOutputPlane = weight.size(0); long outputHeight = (inputHeight + 2 * padH - (dilationH * (kH - 1) + 1)) / dH + 1; long outputWidth = (inputWidth + 2 * padW - (dilationW * (kW - 1) + 1)) / dW + 1; AT_CHECK(nInputPlane % deformable_group == 0, "input channels must divide deformable group size"); if (outputWidth < 1 || outputHeight < 1) AT_ERROR( "Given input size: (%ld x %ld x %ld). " "Calculated output size: (%ld x %ld x %ld). Output size is too small", nInputPlane, inputHeight, inputWidth, nOutputPlane, outputHeight, outputWidth); AT_CHECK(input.size(1) == nInputPlane, "invalid number of input planes, expected: %d, but got: %d", nInputPlane, input.size(1)); AT_CHECK((inputHeight >= kH && inputWidth >= kW), "input image is smaller than kernel"); AT_CHECK((offset.size(2) == outputHeight && offset.size(3) == outputWidth), "invalid spatial size of offset, expected height: %d width: %d, but " "got height: %d width: %d", outputHeight, outputWidth, offset.size(2), offset.size(3)); AT_CHECK((offset.size(1) == deformable_group * 2 * kH * kW), "invalid number of channels of offset"); if (gradOutput != NULL) { AT_CHECK(gradOutput->size(dimf) == nOutputPlane, "invalid number of gradOutput planes, expected: %d, but got: %d", nOutputPlane, gradOutput->size(dimf)); AT_CHECK((gradOutput->size(dimh) == outputHeight && gradOutput->size(dimw) == outputWidth), "invalid size of gradOutput, expected height: %d width: %d , but " "got height: %d width: %d", outputHeight, outputWidth, gradOutput->size(dimh), gradOutput->size(dimw)); } } int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight, at::Tensor offset, at::Tensor output, at::Tensor columns, at::Tensor ones, int kW, int kH, int dW, int dH, int padW, int padH, int dilationW, int dilationH, int group, int deformable_group, int im2col_step) { // todo: resize columns to include im2col: done // todo: add im2col_step as input // todo: add new output buffer and transpose it to output (or directly // transpose output) todo: possibly change data indexing because of // parallel_imgs shape_check(input, offset, NULL, weight, kH, kW, dH, dW, padH, padW, dilationH, dilationW, group, deformable_group); input = input.contiguous(); offset = offset.contiguous(); weight = weight.contiguous(); int batch = 1; if (input.ndimension() == 3) { // Force batch batch = 0; input.unsqueeze_(0); offset.unsqueeze_(0); } // todo: assert batchsize dividable by im2col_step long batchSize = input.size(0); long nInputPlane = input.size(1); long inputHeight = input.size(2); long inputWidth = input.size(3); long nOutputPlane = weight.size(0); long outputWidth = (inputWidth + 2 * padW - (dilationW * (kW - 1) + 1)) / dW + 1; long outputHeight = (inputHeight + 2 * padH - (dilationH * (kH - 1) + 1)) / dH + 1; AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); output = output.view({batchSize / im2col_step, im2col_step, nOutputPlane, outputHeight, outputWidth}); columns = at::zeros( {nInputPlane * kW * kH, im2col_step * outputHeight * outputWidth}, input.options()); if (ones.ndimension() != 2 || ones.size(0) * ones.size(1) < outputHeight * outputWidth) { ones = at::ones({outputHeight, outputWidth}, input.options()); } input = input.view({batchSize / im2col_step, im2col_step, nInputPlane, inputHeight, inputWidth}); offset = offset.view({batchSize / im2col_step, im2col_step, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); at::Tensor output_buffer = at::zeros({batchSize / im2col_step, nOutputPlane, im2col_step * outputHeight, outputWidth}, output.options()); output_buffer = output_buffer.view( {output_buffer.size(0), group, output_buffer.size(1) / group, output_buffer.size(2), output_buffer.size(3)}); for (int elt = 0; elt < batchSize / im2col_step; elt++) { deformable_im2col(input[elt], offset[elt], nInputPlane, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, im2col_step, deformable_group, columns); columns = columns.view({group, columns.size(0) / group, columns.size(1)}); weight = weight.view({group, weight.size(0) / group, weight.size(1), weight.size(2), weight.size(3)}); for (int g = 0; g < group; g++) { output_buffer[elt][g] = output_buffer[elt][g] .flatten(1) .addmm_(weight[g].flatten(1), columns[g]) .view_as(output_buffer[elt][g]); } } output_buffer = output_buffer.view( {output_buffer.size(0), output_buffer.size(1) * output_buffer.size(2), output_buffer.size(3), output_buffer.size(4)}); output_buffer = output_buffer.view({batchSize / im2col_step, nOutputPlane, im2col_step, outputHeight, outputWidth}); output_buffer.transpose_(1, 2); output.copy_(output_buffer); output = output.view({batchSize, nOutputPlane, outputHeight, outputWidth}); input = input.view({batchSize, nInputPlane, inputHeight, inputWidth}); offset = offset.view( {batchSize, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); if (batch == 0) { output = output.view({nOutputPlane, outputHeight, outputWidth}); input = input.view({nInputPlane, inputHeight, inputWidth}); offset = offset.view({offset.size(1), offset.size(2), offset.size(3)}); } return 1; } int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset, at::Tensor gradOutput, at::Tensor gradInput, at::Tensor gradOffset, at::Tensor weight, at::Tensor columns, int kW, int kH, int dW, int dH, int padW, int padH, int dilationW, int dilationH, int group, int deformable_group, int im2col_step) { shape_check(input, offset, &gradOutput, weight, kH, kW, dH, dW, padH, padW, dilationH, dilationW, group, deformable_group); input = input.contiguous(); offset = offset.contiguous(); gradOutput = gradOutput.contiguous(); weight = weight.contiguous(); int batch = 1; if (input.ndimension() == 3) { // Force batch batch = 0; input = input.view({1, input.size(0), input.size(1), input.size(2)}); offset = offset.view({1, offset.size(0), offset.size(1), offset.size(2)}); gradOutput = gradOutput.view( {1, gradOutput.size(0), gradOutput.size(1), gradOutput.size(2)}); } long batchSize = input.size(0); long nInputPlane = input.size(1); long inputHeight = input.size(2); long inputWidth = input.size(3); long nOutputPlane = weight.size(0); long outputWidth = (inputWidth + 2 * padW - (dilationW * (kW - 1) + 1)) / dW + 1; long outputHeight = (inputHeight + 2 * padH - (dilationH * (kH - 1) + 1)) / dH + 1; AT_CHECK((offset.size(0) == batchSize), 3, "invalid batch size of offset"); gradInput = gradInput.view({batchSize, nInputPlane, inputHeight, inputWidth}); columns = at::zeros( {nInputPlane * kW * kH, im2col_step * outputHeight * outputWidth}, input.options()); // change order of grad output gradOutput = gradOutput.view({batchSize / im2col_step, im2col_step, nOutputPlane, outputHeight, outputWidth}); gradOutput.transpose_(1, 2); gradInput = gradInput.view({batchSize / im2col_step, im2col_step, nInputPlane, inputHeight, inputWidth}); input = input.view({batchSize / im2col_step, im2col_step, nInputPlane, inputHeight, inputWidth}); gradOffset = gradOffset.view({batchSize / im2col_step, im2col_step, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); offset = offset.view({batchSize / im2col_step, im2col_step, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); for (int elt = 0; elt < batchSize / im2col_step; elt++) { // divide into groups columns = columns.view({group, columns.size(0) / group, columns.size(1)}); weight = weight.view({group, weight.size(0) / group, weight.size(1), weight.size(2), weight.size(3)}); gradOutput = gradOutput.view( {gradOutput.size(0), group, gradOutput.size(1) / group, gradOutput.size(2), gradOutput.size(3), gradOutput.size(4)}); for (int g = 0; g < group; g++) { columns[g] = columns[g].addmm_(weight[g].flatten(1).transpose(0, 1), gradOutput[elt][g].flatten(1), 0.0f, 1.0f); } columns = columns.view({columns.size(0) * columns.size(1), columns.size(2)}); gradOutput = gradOutput.view( {gradOutput.size(0), gradOutput.size(1) * gradOutput.size(2), gradOutput.size(3), gradOutput.size(4), gradOutput.size(5)}); deformable_col2im_coord(columns, input[elt], offset[elt], nInputPlane, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, im2col_step, deformable_group, gradOffset[elt]); deformable_col2im(columns, offset[elt], nInputPlane, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, im2col_step, deformable_group, gradInput[elt]); } gradOutput.transpose_(1, 2); gradOutput = gradOutput.view({batchSize, nOutputPlane, outputHeight, outputWidth}); gradInput = gradInput.view({batchSize, nInputPlane, inputHeight, inputWidth}); input = input.view({batchSize, nInputPlane, inputHeight, inputWidth}); gradOffset = gradOffset.view( {batchSize, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); offset = offset.view( {batchSize, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); if (batch == 0) { gradOutput = gradOutput.view({nOutputPlane, outputHeight, outputWidth}); input = input.view({nInputPlane, inputHeight, inputWidth}); gradInput = gradInput.view({nInputPlane, inputHeight, inputWidth}); offset = offset.view({offset.size(1), offset.size(2), offset.size(3)}); gradOffset = gradOffset.view({offset.size(1), offset.size(2), offset.size(3)}); } return 1; } int deform_conv_backward_parameters_cuda( at::Tensor input, at::Tensor offset, at::Tensor gradOutput, at::Tensor gradWeight, // at::Tensor gradBias, at::Tensor columns, at::Tensor ones, int kW, int kH, int dW, int dH, int padW, int padH, int dilationW, int dilationH, int group, int deformable_group, float scale, int im2col_step) { // todo: transpose and reshape outGrad // todo: reshape columns // todo: add im2col_step as input shape_check(input, offset, &gradOutput, gradWeight, kH, kW, dH, dW, padH, padW, dilationH, dilationW, group, deformable_group); input = input.contiguous(); offset = offset.contiguous(); gradOutput = gradOutput.contiguous(); int batch = 1; if (input.ndimension() == 3) { // Force batch batch = 0; input = input.view( at::IntList({1, input.size(0), input.size(1), input.size(2)})); gradOutput = gradOutput.view( {1, gradOutput.size(0), gradOutput.size(1), gradOutput.size(2)}); } long batchSize = input.size(0); long nInputPlane = input.size(1); long inputHeight = input.size(2); long inputWidth = input.size(3); long nOutputPlane = gradWeight.size(0); long outputWidth = (inputWidth + 2 * padW - (dilationW * (kW - 1) + 1)) / dW + 1; long outputHeight = (inputHeight + 2 * padH - (dilationH * (kH - 1) + 1)) / dH + 1; AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); columns = at::zeros( {nInputPlane * kW * kH, im2col_step * outputHeight * outputWidth}, input.options()); gradOutput = gradOutput.view({batchSize / im2col_step, im2col_step, nOutputPlane, outputHeight, outputWidth}); gradOutput.transpose_(1, 2); at::Tensor gradOutputBuffer = at::zeros_like(gradOutput); gradOutputBuffer = gradOutputBuffer.view({batchSize / im2col_step, nOutputPlane, im2col_step, outputHeight, outputWidth}); gradOutputBuffer.copy_(gradOutput); gradOutputBuffer = gradOutputBuffer.view({batchSize / im2col_step, nOutputPlane, im2col_step * outputHeight, outputWidth}); gradOutput.transpose_(1, 2); gradOutput = gradOutput.view({batchSize, nOutputPlane, outputHeight, outputWidth}); input = input.view({batchSize / im2col_step, im2col_step, nInputPlane, inputHeight, inputWidth}); offset = offset.view({batchSize / im2col_step, im2col_step, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); for (int elt = 0; elt < batchSize / im2col_step; elt++) { deformable_im2col(input[elt], offset[elt], nInputPlane, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, im2col_step, deformable_group, columns); // divide into group gradOutputBuffer = gradOutputBuffer.view( {gradOutputBuffer.size(0), group, gradOutputBuffer.size(1) / group, gradOutputBuffer.size(2), gradOutputBuffer.size(3)}); columns = columns.view({group, columns.size(0) / group, columns.size(1)}); gradWeight = gradWeight.view({group, gradWeight.size(0) / group, gradWeight.size(1), gradWeight.size(2), gradWeight.size(3)}); for (int g = 0; g < group; g++) { gradWeight[g] = gradWeight[g] .flatten(1) .addmm_(gradOutputBuffer[elt][g].flatten(1), columns[g].transpose(1, 0), 1.0, scale) .view_as(gradWeight[g]); } gradOutputBuffer = gradOutputBuffer.view( {gradOutputBuffer.size(0), gradOutputBuffer.size(1) * gradOutputBuffer.size(2), gradOutputBuffer.size(3), gradOutputBuffer.size(4)}); columns = columns.view({columns.size(0) * columns.size(1), columns.size(2)}); gradWeight = gradWeight.view({gradWeight.size(0) * gradWeight.size(1), gradWeight.size(2), gradWeight.size(3), gradWeight.size(4)}); } input = input.view({batchSize, nInputPlane, inputHeight, inputWidth}); offset = offset.view( {batchSize, deformable_group * 2 * kH * kW, outputHeight, outputWidth}); if (batch == 0) { gradOutput = gradOutput.view({nOutputPlane, outputHeight, outputWidth}); input = input.view({nInputPlane, inputHeight, inputWidth}); } return 1; } void modulated_deform_conv_cuda_forward( at::Tensor input, at::Tensor weight, at::Tensor bias, at::Tensor ones, at::Tensor offset, at::Tensor mask, at::Tensor output, at::Tensor columns, int kernel_h, int kernel_w, const int stride_h, const int stride_w, const int pad_h, const int pad_w, const int dilation_h, const int dilation_w, const int group, const int deformable_group, const bool with_bias) { AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); AT_CHECK(weight.is_contiguous(), "weight tensor has to be contiguous"); const int batch = input.size(0); const int channels = input.size(1); const int height = input.size(2); const int width = input.size(3); const int channels_out = weight.size(0); const int channels_kernel = weight.size(1); const int kernel_h_ = weight.size(2); const int kernel_w_ = weight.size(3); if (kernel_h_ != kernel_h || kernel_w_ != kernel_w) AT_ERROR("Input shape and kernel shape wont match: (%d x %d vs %d x %d).", kernel_h_, kernel_w, kernel_h_, kernel_w_); if (channels != channels_kernel * group) AT_ERROR("Input shape and kernel channels wont match: (%d vs %d).", channels, channels_kernel * group); const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1; const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1; if (ones.ndimension() != 2 || ones.size(0) * ones.size(1) < height_out * width_out) { // Resize plane and fill with ones... ones = at::ones({height_out, width_out}, input.options()); } // resize output output = output.view({batch, channels_out, height_out, width_out}).zero_(); // resize temporary columns columns = at::zeros({channels * kernel_h * kernel_w, 1 * height_out * width_out}, input.options()); output = output.view({output.size(0), group, output.size(1) / group, output.size(2), output.size(3)}); for (int b = 0; b < batch; b++) { modulated_deformable_im2col_cuda( input[b], offset[b], mask[b], 1, channels, height, width, height_out, width_out, kernel_h, kernel_w, pad_h, pad_w, stride_h, stride_w, dilation_h, dilation_w, deformable_group, columns); // divide into group weight = weight.view({group, weight.size(0) / group, weight.size(1), weight.size(2), weight.size(3)}); columns = columns.view({group, columns.size(0) / group, columns.size(1)}); for (int g = 0; g < group; g++) { output[b][g] = output[b][g] .flatten(1) .addmm_(weight[g].flatten(1), columns[g]) .view_as(output[b][g]); } weight = weight.view({weight.size(0) * weight.size(1), weight.size(2), weight.size(3), weight.size(4)}); columns = columns.view({columns.size(0) * columns.size(1), columns.size(2)}); } output = output.view({output.size(0), output.size(1) * output.size(2), output.size(3), output.size(4)}); if (with_bias) { output += bias.view({1, bias.size(0), 1, 1}); } } void modulated_deform_conv_cuda_backward( at::Tensor input, at::Tensor weight, at::Tensor bias, at::Tensor ones, at::Tensor offset, at::Tensor mask, at::Tensor columns, at::Tensor grad_input, at::Tensor grad_weight, at::Tensor grad_bias, at::Tensor grad_offset, at::Tensor grad_mask, at::Tensor grad_output, int kernel_h, int kernel_w, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int group, int deformable_group, const bool with_bias) { AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); AT_CHECK(weight.is_contiguous(), "weight tensor has to be contiguous"); const int batch = input.size(0); const int channels = input.size(1); const int height = input.size(2); const int width = input.size(3); const int channels_kernel = weight.size(1); const int kernel_h_ = weight.size(2); const int kernel_w_ = weight.size(3); if (kernel_h_ != kernel_h || kernel_w_ != kernel_w) AT_ERROR("Input shape and kernel shape wont match: (%d x %d vs %d x %d).", kernel_h_, kernel_w, kernel_h_, kernel_w_); if (channels != channels_kernel * group) AT_ERROR("Input shape and kernel channels wont match: (%d vs %d).", channels, channels_kernel * group); const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1; const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1; if (ones.ndimension() != 2 || ones.size(0) * ones.size(1) < height_out * width_out) { // Resize plane and fill with ones... ones = at::ones({height_out, width_out}, input.options()); } grad_input = grad_input.view({batch, channels, height, width}); columns = at::zeros({channels * kernel_h * kernel_w, height_out * width_out}, input.options()); grad_output = grad_output.view({grad_output.size(0), group, grad_output.size(1) / group, grad_output.size(2), grad_output.size(3)}); for (int b = 0; b < batch; b++) { // divide int group columns = columns.view({group, columns.size(0) / group, columns.size(1)}); weight = weight.view({group, weight.size(0) / group, weight.size(1), weight.size(2), weight.size(3)}); for (int g = 0; g < group; g++) { columns[g].addmm_(weight[g].flatten(1).transpose(0, 1), grad_output[b][g].flatten(1), 0.0f, 1.0f); } columns = columns.view({columns.size(0) * columns.size(1), columns.size(2)}); weight = weight.view({weight.size(0) * weight.size(1), weight.size(2), weight.size(3), weight.size(4)}); // gradient w.r.t. input coordinate data modulated_deformable_col2im_coord_cuda( columns, input[b], offset[b], mask[b], 1, channels, height, width, height_out, width_out, kernel_h, kernel_w, pad_h, pad_w, stride_h, stride_w, dilation_h, dilation_w, deformable_group, grad_offset[b], grad_mask[b]); // gradient w.r.t. input data modulated_deformable_col2im_cuda( columns, offset[b], mask[b], 1, channels, height, width, height_out, width_out, kernel_h, kernel_w, pad_h, pad_w, stride_h, stride_w, dilation_h, dilation_w, deformable_group, grad_input[b]); // gradient w.r.t. weight, dWeight should accumulate across the batch and // group modulated_deformable_im2col_cuda( input[b], offset[b], mask[b], 1, channels, height, width, height_out, width_out, kernel_h, kernel_w, pad_h, pad_w, stride_h, stride_w, dilation_h, dilation_w, deformable_group, columns); columns = columns.view({group, columns.size(0) / group, columns.size(1)}); grad_weight = grad_weight.view({group, grad_weight.size(0) / group, grad_weight.size(1), grad_weight.size(2), grad_weight.size(3)}); if (with_bias) grad_bias = grad_bias.view({group, grad_bias.size(0) / group}); for (int g = 0; g < group; g++) { grad_weight[g] = grad_weight[g] .flatten(1) .addmm_(grad_output[b][g].flatten(1), columns[g].transpose(0, 1)) .view_as(grad_weight[g]); if (with_bias) { grad_bias[g] = grad_bias[g] .view({-1, 1}) .addmm_(grad_output[b][g].flatten(1), ones.view({-1, 1})) .view(-1); } } columns = columns.view({columns.size(0) * columns.size(1), columns.size(2)}); grad_weight = grad_weight.view({grad_weight.size(0) * grad_weight.size(1), grad_weight.size(2), grad_weight.size(3), grad_weight.size(4)}); if (with_bias) grad_bias = grad_bias.view({grad_bias.size(0) * grad_bias.size(1)}); } grad_output = grad_output.view({grad_output.size(0) * grad_output.size(1), grad_output.size(2), grad_output.size(3), grad_output.size(4)}); }
{'repo_name': 'Wangt-CN/VC-R-CNN', 'stars': '131', 'repo_language': 'Python', 'file_name': 'small_model.yml', 'mime_type': 'text/plain', 'hash': 7368927247602763734, 'source_dataset': 'data'}
<launch> <include file="$(find learning_launch)/launch/simple.launch" /> <node pkg="turtlesim" type="turtlesim_node" name="turtlesim_node"> <remap from="/turtle1/cmd_vel" to="/cmd_vel"/> </node> </launch>
{'repo_name': 'huchunxu/ros_21_tutorials', 'stars': '335', 'repo_language': 'CMake', 'file_name': 'c++_for.cpp', 'mime_type': 'text/x-c++', 'hash': -9147637476947738523, 'source_dataset': 'data'}
/*! * Bootstrap Table of Contents v1.0.1 (http://afeld.github.io/bootstrap-toc/) * Copyright 2015 Aidan Feldman * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ /* All levels of nav */ nav[data-toggle="toc"] .nav > li > a { display: block; padding: 4px 20px; font-size: 13px; font-weight: 500; color: #aaaaaa; } nav[data-toggle="toc"] .nav > li > a:hover, nav[data-toggle="toc"] .nav > li > a:focus { padding-left: 19px; color: #666666; text-decoration: none; background-color: transparent; border-left: 1px solid #666666; } nav[data-toggle="toc"] .nav-link.active, nav[data-toggle="toc"] .nav-link.active:hover, nav[data-toggle="toc"] .nav-link.active:focus { padding-left: 18px; font-weight: bold; color: #666666; background-color: transparent; border-left: 2px solid #666666; } /* Nav: second level (shown on .active) */ nav[data-toggle="toc"] .nav-link + ul { display: none; /* Hide by default, but at >768px, show it */ padding-bottom: 10px; } nav[data-toggle="toc"] .nav .nav > li > a { padding-top: 1px; padding-bottom: 1px; padding-left: 30px; font-size: 12px; font-weight: normal; } nav[data-toggle="toc"] .nav .nav > li > a:hover, nav[data-toggle="toc"] .nav .nav > li > a:focus { padding-left: 29px; } nav[data-toggle="toc"] .nav .nav > li > .active, nav[data-toggle="toc"] .nav .nav > li > .active:hover, nav[data-toggle="toc"] .nav .nav > li > .active:focus { padding-left: 28px; font-weight: 500; } nav[data-toggle="toc"] .nav-link.active + ul { display: block; }
{'repo_name': 'Shuttle/shuttle-esb', 'stars': '118', 'repo_language': 'HTML', 'file_name': 'api.html', 'mime_type': 'text/html', 'hash': -4517995817050994995, 'source_dataset': 'data'}
# -*- coding: utf-8 -*- # # Copyright DataStax, 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. import six from cassandra.auth import PlainTextAuthenticator try: import unittest2 as unittest except ImportError: import unittest # noqa class TestPlainTextAuthenticator(unittest.TestCase): def test_evaluate_challenge_with_unicode_data(self): authenticator = PlainTextAuthenticator("johnӁ", "doeӁ") self.assertEqual( authenticator.evaluate_challenge(six.ensure_binary('PLAIN-START')), six.ensure_binary("\x00johnӁ\x00doeӁ") )
{'repo_name': 'datastax/python-driver', 'stars': '1156', 'repo_language': 'Python', 'file_name': 'statements.py', 'mime_type': 'text/x-python', 'hash': -1487255389776558149, 'source_dataset': 'data'}
package com.openrsc.server.plugins.authentic.npcs.varrock; import com.openrsc.server.constants.ItemId; import com.openrsc.server.constants.NpcId; import com.openrsc.server.model.Shop; import com.openrsc.server.model.container.Item; import com.openrsc.server.model.entity.npc.Npc; import com.openrsc.server.model.entity.player.Player; import com.openrsc.server.model.world.World; import com.openrsc.server.net.rsc.ActionSender; import com.openrsc.server.plugins.AbstractShop; import static com.openrsc.server.plugins.Functions.*; public final class LowesArchery extends AbstractShop { private final Shop shop = new Shop(false, 3000, 100, 55, 1, new Item(ItemId.BRONZE_ARROWS.id(), 200), new Item(ItemId.CROSSBOW_BOLTS.id(), 150), new Item(ItemId.SHORTBOW.id(), 4), new Item( ItemId.LONGBOW.id(), 2), new Item(ItemId.CROSSBOW.id(), 2)); @Override public boolean blockTalkNpc(final Player player, final Npc n) { return n.getID() == NpcId.LOWE.id(); } @Override public Shop[] getShops(World world) { return new Shop[]{shop}; } @Override public boolean isMembers() { return false; } @Override public Shop getShop() { return shop; } @Override public void onTalkNpc(final Player player, final Npc n) { npcsay(player, n, "Welcome to Lowe's Archery Store", "Do you want to see my wares?"); int option = multi(player, n, false, //do not send over "Yes please", "No, I prefer to bash things close up"); if (option == 0) { say(player, n, "Yes Please"); player.setAccessingShop(shop); ActionSender.showShop(player, shop); } else if (option == 1) { say(player, n, "No, I prefer to bash things close up"); } } }
{'repo_name': 'Open-RSC/Core-Framework', 'stars': '118', 'repo_language': 'Java', 'file_name': 'TeleportStone.java', 'mime_type': 'text/x-java', 'hash': 456362672011390627, 'source_dataset': 'data'}
import hail as hl def densify(sparse_mt): """Convert sparse matrix table to a dense VCF-like representation by expanding reference blocks. Parameters ---------- sparse_mt : :class:`.MatrixTable` Sparse MatrixTable to densify. The first row key field must be named ``locus`` and have type ``locus``. Must have an ``END`` entry field of type ``int32``. Returns ------- :class:`.MatrixTable` The densified MatrixTable. The ``END`` entry field is dropped. While computationally expensive, this operation is necessary for many downstream analyses, and should be thought of as roughly costing as much as reading a matrix table created by importing a dense project VCF. """ if list(sparse_mt.row_key)[0] != 'locus' or not isinstance(sparse_mt.locus.dtype, hl.tlocus): raise ValueError("first row key field must be named 'locus' and have type 'locus'") if 'END' not in sparse_mt.entry or sparse_mt.END.dtype != hl.tint32: raise ValueError("'densify' requires 'END' entry field of type 'int32'") col_key_fields = list(sparse_mt.col_key) contigs = sparse_mt.locus.dtype.reference_genome.contigs contig_idx_map = hl.literal({contigs[i]: i for i in range(len(contigs))}, 'dict<str, int32>') mt = sparse_mt.annotate_rows(__contig_idx=contig_idx_map[sparse_mt.locus.contig]) mt = mt.annotate_entries(__contig=mt.__contig_idx) t = mt._localize_entries('__entries', '__cols') t = t.annotate( __entries=hl.rbind( hl.scan.array_agg( lambda entry: hl.scan._prev_nonnull(hl.or_missing(hl.is_defined(entry.END), entry)), t.__entries), lambda prev_entries: hl.map( lambda i: hl.rbind( prev_entries[i], t.__entries[i], lambda prev_entry, entry: hl.cond( (~hl.is_defined(entry) & (prev_entry.END >= t.locus.position) & (prev_entry.__contig == t.__contig_idx)), prev_entry, entry)), hl.range(0, hl.len(t.__entries))))) mt = t._unlocalize_entries('__entries', '__cols', col_key_fields) mt = mt.drop('__contig_idx', '__contig', 'END') return mt
{'repo_name': 'hail-is/hail', 'stars': '640', 'repo_language': 'Scala', 'file_name': 'billing.html', 'mime_type': 'text/html', 'hash': 4413394323566083470, 'source_dataset': 'data'}
import random class GoodChip: def good(self): return True def check(self, other): return other.good() class BadChip: def good(self): return False def check(self, other): return [True, False][random.randint(0, 1)] def jig(a, b): return [a.check(b), b.check(a)] def diogenes(chips, verbose = False): def find_single(chips): if len(chips) <= 2: return chips[0] else: halfpoint = len(chips) // 2 pairs = zip(chips[0:halfpoint], chips[halfpoint:halfpoint * 2]) kept = [a for (a, b) in pairs if jig(a, b) == [True, True]] if len(chips) % 2 == 1: kept.append(chips[-1]) return find_single(kept) good = find_single(chips) return [chip for chip in chips if jig(good, chip) == [True, True]]
{'repo_name': 'skanev/playground', 'stars': '157', 'repo_language': 'Scheme', 'file_name': '03.c', 'mime_type': 'text/x-c', 'hash': -3845646575785828833, 'source_dataset': 'data'}